summaryrefslogtreecommitdiff
path: root/gdb/main.c
diff options
context:
space:
mode:
authorPierre Muller <muller@ics.u-strasbg.fr>2013-01-03 22:18:32 +0000
committerPierre Muller <muller@ics.u-strasbg.fr>2013-01-03 22:18:32 +0000
commit797f8f366fa34dda9fc6d522987bcb1fd963c937 (patch)
tree2f65d0b691b2b5d2f903ca9cfa2b20c27db9715c /gdb/main.c
parente413a27b027cbfca083b18beb3a25f02613ca917 (diff)
downloadgdb-797f8f366fa34dda9fc6d522987bcb1fd963c937.tar.gz
* main.c (relocate_gdb_directory): Avoid calling stat function
if DIR is empty.
Diffstat (limited to 'gdb/main.c')
-rw-r--r--gdb/main.c2
1 files changed, 1 insertions, 1 deletions
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;