aboutsummaryrefslogtreecommitdiff
path: root/gdb/solib.c
diff options
context:
space:
mode:
authorDaniel Jacobowitz <drow@false.org>2006-10-09 20:16:10 +0000
committerDaniel Jacobowitz <drow@false.org>2006-10-09 20:16:10 +0000
commit58dc52c34de2f74463f3b92aa4b8883e078ffd82 (patch)
treedb03a460187f9129bd8e885c9d1a9abad0475b0f /gdb/solib.c
parent8bb752867cc0906c585051cbe0b0e766da0d910c (diff)
downloadgdb-58dc52c34de2f74463f3b92aa4b8883e078ffd82.zip
gdb-58dc52c34de2f74463f3b92aa4b8883e078ffd82.tar.gz
gdb-58dc52c34de2f74463f3b92aa4b8883e078ffd82.tar.bz2
* solib.c (solib_open): Handle an empty solib_absolute_prefix like a
missing one.
Diffstat (limited to 'gdb/solib.c')
-rw-r--r--gdb/solib.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/gdb/solib.c b/gdb/solib.c
index 8dbc8e3..c26a000 100644
--- a/gdb/solib.c
+++ b/gdb/solib.c
@@ -146,13 +146,17 @@ solib_open (char *in_pathname, char **found_pathname)
int found_file = -1;
char *temp_pathname = NULL;
char *p = in_pathname;
+ int solib_absolute_prefix_is_empty;
+
+ solib_absolute_prefix_is_empty = (solib_absolute_prefix == NULL
+ || *solib_absolute_prefix == 0);
while (*p && !IS_DIR_SEPARATOR (*p))
p++;
if (*p)
{
- if (! IS_ABSOLUTE_PATH (in_pathname) || solib_absolute_prefix == NULL)
+ if (! IS_ABSOLUTE_PATH (in_pathname) || solib_absolute_prefix_is_empty)
temp_pathname = in_pathname;
else
{
@@ -208,14 +212,14 @@ solib_open (char *in_pathname, char **found_pathname)
&temp_pathname);
/* If not found, next search the inferior's $PATH environment variable. */
- if (found_file < 0 && solib_absolute_prefix == NULL)
+ if (found_file < 0 && solib_absolute_prefix_is_empty)
found_file = openp (get_in_environ (inferior_environ, "PATH"),
OPF_TRY_CWD_FIRST, in_pathname, O_RDONLY | O_BINARY, 0,
&temp_pathname);
/* If not found, next search the inferior's $LD_LIBRARY_PATH
environment variable. */
- if (found_file < 0 && solib_absolute_prefix == NULL)
+ if (found_file < 0 && solib_absolute_prefix_is_empty)
found_file = openp (get_in_environ (inferior_environ, "LD_LIBRARY_PATH"),
OPF_TRY_CWD_FIRST, in_pathname, O_RDONLY | O_BINARY, 0,
&temp_pathname);