move skipping white spaces to fcn create_circbyline() now ' .end' is acknowledged

This commit is contained in:
Holger Vogt 2018-01-05 17:36:40 +01:00
parent 55b2a0218e
commit 5f5eacc48e
2 changed files with 3 additions and 4 deletions

View File

@ -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]))) {

View File

@ -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 {