summaryrefslogtreecommitdiffstats
path: root/cmd.c
diff options
context:
space:
mode:
authorNicholas Marriott <nicm@openbsd.org>2012-02-06 17:29:29 +0000
committerNicholas Marriott <nicm@openbsd.org>2012-02-06 17:29:29 +0000
commit67949de0a173901fc741674c31bb971172442ec9 (patch)
tree3df1b79c6cfd29f515458a99e1767ca3c2048c91 /cmd.c
parent3f49137f9027f0c2cf8b0318548a69505c4708ab (diff)
Don't die if fail to get root directory, from Ben Boeckel.
Diffstat (limited to 'cmd.c')
-rw-r--r--cmd.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/cmd.c b/cmd.c
index 5e2abfec..fbcde912 100644
--- a/cmd.c
+++ b/cmd.c
@@ -1309,7 +1309,8 @@ cmd_get_default_path(struct cmd_ctx *ctx, const char *cwd)
else
return (s->cwd);
skip = 0;
- goto complete_path;
+ if (root != NULL)
+ goto complete_path;
}
return (s->cwd);