* solib.c (solib_open): Handle an empty solib_absolute_prefix like a
authorDaniel Jacobowitz <drow@false.org>
Mon, 9 Oct 2006 20:16:10 +0000 (20:16 +0000)
committerDaniel Jacobowitz <drow@false.org>
Mon, 9 Oct 2006 20:16:10 +0000 (20:16 +0000)
missing one.

gdb/ChangeLog
gdb/solib.c

index ad3ff0b9bc82b2655690eac75b39d8bec77201f5..274a328a842454e89289f283deef1aad19af1cc6 100644 (file)
@@ -1,3 +1,8 @@
+2006-10-09  Jan Kratochvil  <jan.kratochvil@redhat.com>
+
+       * solib.c (solib_open): Handle an empty solib_absolute_prefix like a
+       missing one.
+
 2006-10-09  Daniel Jacobowitz  <dan@codesourcery.com>
 
        * solib.c (solib_read_symbols): Stop if the file was not found.
index 8dbc8e35779b3d94fa8e1998d00d54120959b79b..c26a000e2b31890f4a1fbbbdcb5eb68fd97f79ba 100644 (file)
@@ -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);