browser: show a message when getcwd() fails, instead of just beeping

This commit is contained in:
Benno Schulenberg 2016-05-21 21:23:49 +02:00
parent f9fe9a7d57
commit 9576eb62e6

View File

@ -385,7 +385,12 @@ char *do_browse_from(const char *inpath)
path = charalloc(PATH_MAX + 1);
path = getcwd(path, PATH_MAX + 1);
if (path != NULL)
if (path == NULL) {
statusline(MILD, "The working directory has disappeared");
beep();
napms(1200);
return NULL;
} else
align(&path);
}
}