diff --git a/src/files.c b/src/files.c index 6641de01..51bc1dce 100644 --- a/src/files.c +++ b/src/files.c @@ -351,6 +351,14 @@ bool has_valid_path(const char *filename) struct stat parentinfo; bool validity = FALSE; + if (strcmp(parentdir, ".") == 0) { + char *currentdir = realpath(".", NULL); + + if (currentdir == NULL) + statusline(ALERT, _("The working directory has disappeared")); + + free(currentdir); + } else if (stat(parentdir, &parentinfo) == -1) { if (errno == ENOENT) /* TRANSLATORS: Keep the next ten messages at most 76 characters. */