forked from Imagelibrary/binutils-gdb
* source.c (openp): If the file does not exist don't necessarily
search the path.
This commit is contained in:
@@ -1,3 +1,8 @@
|
|||||||
|
2003-01-13 Daniel Jacobowitz <drow@mvista.com>
|
||||||
|
|
||||||
|
* source.c (openp): If the file does not exist don't necessarily
|
||||||
|
search the path.
|
||||||
|
|
||||||
2003-01-13 Daniel Jacobowitz <drow@mvista.com>
|
2003-01-13 Daniel Jacobowitz <drow@mvista.com>
|
||||||
|
|
||||||
Fix PR gdb/872.
|
Fix PR gdb/872.
|
||||||
|
|||||||
@@ -674,14 +674,21 @@ openp (const char *path, int try_cwd_first, const char *string,
|
|||||||
mode |= O_BINARY;
|
mode |= O_BINARY;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if ((try_cwd_first || IS_ABSOLUTE_PATH (string)) && is_regular_file (string))
|
if (try_cwd_first || IS_ABSOLUTE_PATH (string))
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
|
if (is_regular_file (string))
|
||||||
|
{
|
||||||
filename = alloca (strlen (string) + 1);
|
filename = alloca (strlen (string) + 1);
|
||||||
strcpy (filename, string);
|
strcpy (filename, string);
|
||||||
fd = open (filename, mode, prot);
|
fd = open (filename, mode, prot);
|
||||||
if (fd >= 0)
|
if (fd >= 0)
|
||||||
goto done;
|
goto done;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
fd = -1;
|
||||||
|
|
||||||
for (i = 0; string[i]; i++)
|
for (i = 0; string[i]; i++)
|
||||||
if (IS_DIR_SEPARATOR (string[i]))
|
if (IS_DIR_SEPARATOR (string[i]))
|
||||||
goto done;
|
goto done;
|
||||||
|
|||||||
Reference in New Issue
Block a user