]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
* main.c (relocate_gdb_directory): Avoid calling stat function
authorPierre Muller <muller@sourceware.org>
Thu, 3 Jan 2013 22:18:35 +0000 (22:18 +0000)
committerPierre Muller <muller@sourceware.org>
Thu, 3 Jan 2013 22:18:35 +0000 (22:18 +0000)
if DIR is empty.

gdb/ChangeLog
gdb/main.c

index 8363ed7a317b4646d89bbfccc6c90dbb48e870b9..ac806e99ad380ceb8e72fbfb41fd0869b8e88f65 100644 (file)
@@ -1,3 +1,8 @@
+2013-01-03  Pierre Muller  <muller@sourceware.org>
+
+       * main.c (relocate_gdb_directory): Avoid calling stat function
+       if DIR is empty.
+
 2013-01-03  Yao Qi  <yao@codesourcery.com>
 
        * psymtab.c (fixup_psymbol_section): Update declaration.
index 14893bdffd016d5d3b74e955a7fa0409c6e06cad..7cd2d03d95738f90bce2c0bb6783dd493d423f18 100644 (file)
@@ -126,7 +126,7 @@ relocate_gdb_directory (const char *initial, int flag)
     {
       struct stat s;
 
-      if (stat (dir, &s) != 0 || !S_ISDIR (s.st_mode))
+      if (*dir == '\0' || stat (dir, &s) != 0 || !S_ISDIR (s.st_mode))
        {
          xfree (dir);
          dir = NULL;