From 077d0aee9860e87b85926e956095d83009039aa4 Mon Sep 17 00:00:00 2001 From: rlar Date: Sat, 8 Jun 2013 17:17:57 +0200 Subject: [PATCH] inpcom.c, rewrite `chk_for_line_continuation()' --- src/frontend/inpcom.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/src/frontend/inpcom.c b/src/frontend/inpcom.c index 3dc69d5e9..800a2b19e 100644 --- a/src/frontend/inpcom.c +++ b/src/frontend/inpcom.c @@ -1170,15 +1170,12 @@ inp_add_control_section(struct line *deck, int *line_number) static bool chk_for_line_continuation(char *line) { - char *ptr = line + strlen(line) - 1; - if (*line != '*' && *line != '$') { - while (ptr >= line && *ptr && isspace(*ptr)) - ptr--; + char *ptr = skip_back_ws_(line + strlen(line), line); - if ((ptr-1) >= line && *ptr == '\\' && *(ptr-1) && *(ptr-1) == '\\') { - *ptr = ' '; - *(ptr-1) = ' '; + if ((ptr - 2 >= line) && (ptr[-1] == '\\') && (ptr[-2] == '\\')) { + ptr[-1] = ' '; + ptr[-2] = ' '; return TRUE; } }