From: David Griffith Date: Tue, 12 Feb 2019 13:18:46 +0000 (-0800) Subject: Move path_separator stuff out in the open in os_read_file_name() for curses. X-Git-Url: https://scope-eye.net/git/?a=commitdiff_plain;h=b54a048fae0e0c87f4a55f056ba9b21b0c7d7bd9;p=liskon_frotz.git Move path_separator stuff out in the open in os_read_file_name() for curses. --- diff --git a/src/curses/ux_input.c b/src/curses/ux_input.c index afbccf7..11dae34 100644 --- a/src/curses/ux_input.c +++ b/src/curses/ux_input.c @@ -744,6 +744,9 @@ char *os_read_file_name (const char *default_name, int flag) char path_separator[2]; char file_name[FILENAME_MAX + 1]; + path_separator[0] = PATH_SEPARATOR; + path_separator[1] = 0; + /* Turn off playback and recording temporarily */ istream_replay = 0; ostream_record = 0; @@ -792,9 +795,6 @@ char *os_read_file_name (const char *default_name, int flag) * someone tries it. */ if (f_setup.restricted_path != NULL) { - path_separator[0] = PATH_SEPARATOR; - path_separator[1] = 0; - for (i = strlen(file_name); i > 0; i--) { if (file_name[i] == PATH_SEPARATOR) { i++;