diff --git a/src/files.c b/src/files.c index 471420c7c2ccd970cd69d6300360517764f4fe65..f8af4ec2992264ede43139eceac67b666e2f99f2 100644 --- a/src/files.c +++ b/src/files.c @@ -1591,6 +1591,7 @@ void init_operating_dir(void) /* If get_full_path() failed or the operating directory is * inaccessible, unset operating_dir. */ if (full_operating_dir == NULL || chdir(full_operating_dir) == -1) { + statusline(ALERT, _("Not a valid directory: %s"), operating_dir); free(full_operating_dir); full_operating_dir = NULL; free(operating_dir); diff --git a/src/nano.c b/src/nano.c index f3f3ee6e96adca33e86b54eed5594470bccc402e..68a135686d975c30ebf33154fee5499d812d9c08 100644 --- a/src/nano.c +++ b/src/nano.c @@ -2422,12 +2422,6 @@ int main(int argc, char **argv) init_backup_dir(); #endif -#ifndef DISABLE_OPERATINGDIR - /* Set up the operating directory. This entails chdir()ing there, - * so that file reads and writes will be based there. */ - init_operating_dir(); -#endif - #ifndef DISABLE_JUSTIFY /* If punct wasn't specified, set its default value. */ if (punct == NULL) @@ -2559,6 +2553,12 @@ int main(int argc, char **argv) controlright = key_defined(keyvalue); #endif +#ifndef DISABLE_OPERATINGDIR + /* Set up the operating directory. This entails chdir()ing there, + * so that file reads and writes will be based there. */ + init_operating_dir(); +#endif + #ifdef DEBUG fprintf(stderr, "Main: open file\n"); #endif