From f987508891153c77f636e72696cc1c082c7edb6d Mon Sep 17 00:00:00 2001
From: Benno Schulenberg <bensberg@justemail.net>
Date: Thu, 23 Mar 2017 22:03:21 +0100
Subject: [PATCH] files: drop the pointless "[from ./]" from the insert-file
 prompt

Only use the "from" thing when an operating directory is in effect,
because /only/ then the indicated directory can be something other
than "./".

Also, make it so that there is no space before the colon.
---
 src/files.c | 21 +++++++++++++++------
 1 file changed, 15 insertions(+), 6 deletions(-)

diff --git a/src/files.c b/src/files.c
index c57c4363..50e4aa14 100644
--- a/src/files.c
+++ b/src/files.c
@@ -1069,7 +1069,7 @@ void do_insertfile(void)
 	if (execute) {
 #ifndef DISABLE_MULTIBUFFER
 	    if (ISSET(MULTIBUFFER))
-		/* TRANSLATORS: The next four messages are prompts. */
+		/* TRANSLATORS: The next six messages are prompts. */
 		msg = _("Command to execute in new buffer");
 	    else
 #endif
@@ -1077,12 +1077,22 @@ void do_insertfile(void)
 	} else
 #endif /* NANO_TINY */
 	{
+#ifndef DISABLE_OPERATINGDIR
+#ifndef DISABLE_MULTIBUFFER
+	    if (operating_dir != NULL && ISSET(MULTIBUFFER))
+		msg = _("File to insert into new buffer [from %s]");
+	    else
+#endif
+	    if (operating_dir != NULL)
+		msg = _("File to insert [from %s]");
+	    else
+#endif
 #ifndef DISABLE_MULTIBUFFER
 	    if (ISSET(MULTIBUFFER))
-		msg = _("File to insert into new buffer [from %s] ");
+		msg = _("File to insert into new buffer");
 	    else
 #endif
-		msg = _("File to insert [from %s] ");
+		msg = _("File to insert");
 	}
 
 	present_path = mallocstrcpy(present_path, "./");
@@ -1097,10 +1107,9 @@ void do_insertfile(void)
 #endif
 		edit_refresh, msg,
 #ifndef DISABLE_OPERATINGDIR
-		operating_dir != NULL && strcmp(operating_dir, ".") != 0 ?
-		operating_dir :
+		operating_dir != NULL ? operating_dir :
 #endif
-		"./");
+		"xxx");
 
 	/* If we're in multibuffer mode and the filename or command is
 	 * blank, open a new buffer instead of canceling. */
-- 
GitLab