summaryrefslogtreecommitdiff
path: root/gdb/main.c
diff options
context:
space:
mode:
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;