From 722d8ce55e8fb722b9226e60212da631ae449e0a Mon Sep 17 00:00:00 2001 From: Stefan Ritt Date: Tue, 10 Apr 2012 08:07:34 +0000 Subject: [PATCH] Show error "File not found" on "Preset text" only if text is a file SVN revision: 2447 --- src/elogd.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/elogd.c b/src/elogd.c index 5026e6ce..aa1f7c34 100755 --- a/src/elogd.c +++ b/src/elogd.c @@ -11132,9 +11132,16 @@ void show_edit_form(LOGBOOK * lbs, int message_id, BOOL breply, BOOL bedit, BOOL strsubst_list(str, sizeof(str), slist, svalue, j); while (strstr(str, "\\n")) memcpy(strstr(str, "\\n"), "\r\n", 2); - rsputs("File "); - rsputs3(str); - rsputs(" cannot be found"); + + if (strchr(str, ' ')) { + /* name contains blanks -> must be text */ + rsputs3(str); + } else { + /* name is probably a file -> show error */ + rsputs("File "); + rsputs3(str); + rsputs(" cannot be found"); + } } }