This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
Re: PATCH: Fix openp() if the file doesn't exist
- From: Daniel Jacobowitz <drow at mvista dot com>
- To: gdb-patches at sources dot redhat dot com
- Date: Mon, 13 Jan 2003 15:27:40 -0500
- Subject: Re: PATCH: Fix openp() if the file doesn't exist
- References: <20030109224155.GA17364@nevyn.them.org>
On Thu, Jan 09, 2003 at 05:41:55PM -0500, Daniel Jacobowitz wrote:
> Sometime last April, when Joel committed a patch to not try to open
> directories as programs, we started always searching the given path in
> openp (). Try it:
> % gdb ./ls
> will open /bin/ls if there is no ls in the current directory.
>
> Anyone see a problem with this patch? If not I'll commit it in a day or
> two; also to 5.3 on the off chance we have another release. This is one of
> my two big annoyances at 5.3 (and HEAD). The other is that backtrace
Checked in, with the following patch to squelch a GCC warning. It's a
false positive for the uninitialized checking.
--
Daniel Jacobowitz
MontaVista Software Debian GNU/Linux Developer
2003-01-13 Daniel Jacobowitz <drow@mvista.com>
* source.c (openp): Squelch warning about "filename".
Index: source.c
===================================================================
RCS file: /cvs/src/src/gdb/source.c,v
retrieving revision 1.40
diff -u -p -r1.40 source.c
--- source.c 13 Jan 2003 20:12:57 -0000 1.40
+++ source.c 13 Jan 2003 20:24:53 -0000
@@ -687,7 +687,10 @@ openp (const char *path, int try_cwd_fir
goto done;
}
else
- fd = -1;
+ {
+ filename = NULL;
+ fd = -1;
+ }
for (i = 0; string[i]; i++)
if (IS_DIR_SEPARATOR (string[i]))