delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/2000/06/13/07:59:38

Date: Tue, 13 Jun 2000 13:40:09 +0300 (IDT)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
X-Sender: eliz AT is
To: Prashant TR <tr AT midpec DOT com>
cc: djgpp-workers AT delorie DOT com
Subject: Re: Patches for FSDB to look for .exe files
In-Reply-To: <200006130355.JAA02699@midpec.com>
Message-ID: <Pine.SUN.3.91.1000613133947.16888a-100000@is>
MIME-Version: 1.0
Reply-To: djgpp-workers AT delorie DOT com
Errors-To: nobody AT delorie DOT com
X-Mailing-List: djgpp-workers AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

On Tue, 13 Jun 2000, Prashant TR wrote:

> Ok, here goes...
> 
> --- djgpp/src/debug/fsdb/ed.c~0	Tue Jun 13 09:14:45 2000
> +++ djgpp/src/debug/fsdb/ed.c	Tue Jun 13 09:10:31 2000

Thanks!

> +  /* Try adding the .exe extension to it and try again. */
> +  fname = alloca(strlen(argv[argno] + 5));
> +  strcpy(fname,argv[argno]);
> +
> +  if (!__file_exists(fname))
> +    {
> +      dotptr = rindex(fname,'.');
> +      if (_USE_LFN || dotptr == NULL)
> +	strcat(fname,".exe");
> +      else
> +	if (dotptr < rindex(fname,'/') || dotptr < rindex(fname,'\\'))
> +	  strcat(fname,".exe");
> +    }
> +  syms_init(fname);

This is IMHO not robust enough: the file could exist, but be a
directory, or something that is not a DJGPP program.  I suggest using
_check_v2_prog instead of __file_exists.

Please also provide a short entry for wc204.txi.

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019