diff options
author | Pierre Muller <muller@sourceware.org> | 2013-01-03 22:18:35 +0000 |
---|---|---|
committer | Pierre Muller <muller@sourceware.org> | 2013-01-03 22:18:35 +0000 |
commit | 78a8b30e9dd47617db3002b3aebede4d619d00b1 (patch) | |
tree | fbb50be411cfdfd7082404f2f68428013a766192 /gdb | |
parent | 5b2ab15006f21ae2d10c18b5352fc195fff3db88 (diff) | |
download | gdb-78a8b30e9dd47617db3002b3aebede4d619d00b1.zip gdb-78a8b30e9dd47617db3002b3aebede4d619d00b1.tar.gz gdb-78a8b30e9dd47617db3002b3aebede4d619d00b1.tar.bz2 |
* main.c (relocate_gdb_directory): Avoid calling stat function
if DIR is empty.
Diffstat (limited to 'gdb')
-rw-r--r-- | gdb/ChangeLog | 5 | ||||
-rw-r--r-- | gdb/main.c | 2 |
2 files changed, 6 insertions, 1 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 8363ed7..ac806e9 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -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. @@ -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; |