Commit e6350aab authored by Benno Schulenberg's avatar Benno Schulenberg
Browse files

prompt: do not treat a leading newline in a filename specially

This fixes https://savannah.gnu.org/bugs/?49884.
No related merge requests found
Showing with 4 additions and 10 deletions
+4 -10
...@@ -230,9 +230,7 @@ char *do_browser(char *path) ...@@ -230,9 +230,7 @@ char *do_browser(char *path)
/* TRANSLATORS: This is a prompt. */ /* TRANSLATORS: This is a prompt. */
browser_refresh, _("Go To Directory")); browser_refresh, _("Go To Directory"));
/* If the directory begins with a newline (i.e. an if (i < 0) {
* encoded null), treat it as though it's blank. */
if (i < 0 || *answer == '\n') {
statusbar(_("Cancelled")); statusbar(_("Cancelled"));
continue; continue;
} }
......
...@@ -1098,10 +1098,8 @@ void do_insertfile(void) ...@@ -1098,10 +1098,8 @@ void do_insertfile(void)
"./"); "./");
/* If we're in multibuffer mode and the filename or command is /* If we're in multibuffer mode and the filename or command is
* blank, open a new buffer instead of canceling. If the * blank, open a new buffer instead of canceling. */
* filename or command begins with a newline (i.e. an encoded if (i == -1 || (i == -2 && !ISSET(MULTIBUFFER))) {
* null), treat it as though it's blank. */
if (i == -1 || (!ISSET(MULTIBUFFER) && (i == -2 || *answer == '\n'))) {
statusbar(_("Cancelled")); statusbar(_("Cancelled"));
break; break;
} else { } else {
...@@ -2236,9 +2234,7 @@ int do_writeout(bool exiting) ...@@ -2236,9 +2234,7 @@ int do_writeout(bool exiting)
#endif #endif
); );
/* If the filename or command begins with a newline (i.e. an if (i < 0) {
* encoded null), treat it as though it's blank. */
if (i < 0 || *answer == '\n') {
statusbar(_("Cancelled")); statusbar(_("Cancelled"));
break; break;
} else { } else {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment