From 5f5eacc48e57555e686559880ccc88202400dc9e Mon Sep 17 00:00:00 2001 From: Holger Vogt Date: Fri, 5 Jan 2018 17:36:40 +0100 Subject: [PATCH] move skipping white spaces to fcn create_circbyline() now ' .end' is acknowledged --- src/frontend/inp.c | 3 +++ src/frontend/inpcom.c | 4 ---- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/frontend/inp.c b/src/frontend/inp.c index 657633cf5..1ab981dc6 100644 --- a/src/frontend/inp.c +++ b/src/frontend/inp.c @@ -1483,6 +1483,9 @@ create_circbyline(char *line) FILE *fp = NULL; if (!circarray) circarray = TMALLOC(char*, memlen); + char *p = skip_ws(line); + if (line < p) + memmove(line, p, strlen(p) + 1); circarray[linec++] = line; if (linec < memlen) { if (ciprefix(".end", line) && (line[4] == '\0' || isspace_c(line[4]))) { diff --git a/src/frontend/inpcom.c b/src/frontend/inpcom.c index 27a4b0f93..06c0cb6ea 100644 --- a/src/frontend/inpcom.c +++ b/src/frontend/inpcom.c @@ -676,15 +676,11 @@ inp_read(FILE *fp, int call_depth, char *dir_name, bool comfile, bool intfile) for (;;) { /* derive lines from circarray */ if (intfile) { - char *p; buffer = circarray[cirlinecount++]; if (!buffer) { tfree(circarray); break; } - p = skip_ws(buffer); - if (buffer < p) - memmove(buffer, p, strlen(p) + 1); } /* read lines from file fp */ else {