commit e72db0e3508b2bba116d9802b32968c3db00b52d
parent 87b2df6dea5f8c547a7273a3d57d77335c318034
Author: Benno Schulenberg <bensberg@justemail.net>
Date: Mon, 26 Dec 2016 12:35:50 +0100
files: show newlines in filenames as ^J also in error messages
When a given file is, for example, unreadable or unwritable, the
error message should use ^J instead of ^@ in its name.
Diffstat:
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/src/files.c b/src/files.c
@@ -433,6 +433,9 @@ bool open_buffer(const char *filename, bool undoable)
assert(filename != NULL);
+ /* Display newlines in filenames as ^J. */
+ as_an_at = FALSE;
+
#ifndef DISABLE_OPERATINGDIR
if (check_operating_dir(filename, FALSE)) {
statusline(ALERT, _("Can't insert file from outside of %s"),
@@ -1058,7 +1061,7 @@ void do_insertfile(void)
bool execute = FALSE, right_side_up = FALSE, single_line = FALSE;
#endif
- /* Display embedded newlines as ^J. */
+ /* Display newlines in filenames as ^J. */
as_an_at = FALSE;
while (TRUE) {
@@ -2181,7 +2184,7 @@ int do_writeout(bool exiting)
static bool did_credits = FALSE;
#endif
- /* Display embedded newlines as ^J. */
+ /* Display newlines in filenames as ^J. */
as_an_at = FALSE;
if (exiting && ISSET(TEMP_FILE) && openfile->filename[0] != '\0') {