Date: Tue, 13 Jun 2000 13:40:09 +0300 (IDT) From: Eli Zaretskii X-Sender: eliz AT is To: Prashant TR 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: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII 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 Precedence: bulk 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.