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.
master
Benno Schulenberg 2016-12-26 12:35:50 +01:00
parent 87b2df6dea
commit e72db0e350
1 changed files with 5 additions and 2 deletions

View File

@ -433,6 +433,9 @@ bool open_buffer(const char *filename, bool undoable)
assert(filename != NULL); assert(filename != NULL);
/* Display newlines in filenames as ^J. */
as_an_at = FALSE;
#ifndef DISABLE_OPERATINGDIR #ifndef DISABLE_OPERATINGDIR
if (check_operating_dir(filename, FALSE)) { if (check_operating_dir(filename, FALSE)) {
statusline(ALERT, _("Can't insert file from outside of %s"), 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; bool execute = FALSE, right_side_up = FALSE, single_line = FALSE;
#endif #endif
/* Display embedded newlines as ^J. */ /* Display newlines in filenames as ^J. */
as_an_at = FALSE; as_an_at = FALSE;
while (TRUE) { while (TRUE) {
@ -2181,7 +2184,7 @@ int do_writeout(bool exiting)
static bool did_credits = FALSE; static bool did_credits = FALSE;
#endif #endif
/* Display embedded newlines as ^J. */ /* Display newlines in filenames as ^J. */
as_an_at = FALSE; as_an_at = FALSE;
if (exiting && ISSET(TEMP_FILE) && openfile->filename[0] != '\0') { if (exiting && ISSET(TEMP_FILE) && openfile->filename[0] != '\0') {