From: Pierre Muller Date: Thu, 3 Jan 2013 22:18:35 +0000 (+0000) Subject: * main.c (relocate_gdb_directory): Avoid calling stat function X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=78a8b30e9dd47617db3002b3aebede4d619d00b1;p=binutils-gdb.git * main.c (relocate_gdb_directory): Avoid calling stat function if DIR is empty. --- diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 8363ed7a317..ac806e99ad3 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,8 @@ +2013-01-03 Pierre Muller + + * main.c (relocate_gdb_directory): Avoid calling stat function + if DIR is empty. + 2013-01-03 Yao Qi * psymtab.c (fixup_psymbol_section): Update declaration. diff --git a/gdb/main.c b/gdb/main.c index 14893bdffd0..7cd2d03d957 100644 --- a/gdb/main.c +++ b/gdb/main.c @@ -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;