inpcom.c, rewrite `chk_for_line_continuation()'

This commit is contained in:
rlar 2013-06-08 17:17:57 +02:00
parent c8a94fb1d4
commit cbc2abdd13
1 changed files with 4 additions and 7 deletions

View File

@ -1174,15 +1174,12 @@ inp_add_control_section(struct line *deck, int *line_number)
static bool static bool
chk_for_line_continuation(char *line) chk_for_line_continuation(char *line)
{ {
char *ptr = line + strlen(line) - 1;
if (*line != '*' && *line != '$') { if (*line != '*' && *line != '$') {
while (ptr >= line && *ptr && isspace(*ptr)) char *ptr = skip_back_ws_(line + strlen(line), line);
ptr--;
if ((ptr-1) >= line && *ptr == '\\' && *(ptr-1) && *(ptr-1) == '\\') { if ((ptr - 2 >= line) && (ptr[-1] == '\\') && (ptr[-2] == '\\')) {
*ptr = ' '; ptr[-1] = ' ';
*(ptr-1) = ' '; ptr[-2] = ' ';
return TRUE; return TRUE;
} }
} }