version 1.74, 2021/03/25 12:46:11 |
version 1.75, 2021/05/06 14:16:12 |
|
|
return (FALSE); |
return (FALSE); |
llen = strlen(bufp); |
llen = strlen(bufp); |
|
|
return (excline(exbuf, llen)); |
return (excline(exbuf, llen, 1)); |
} |
} |
|
|
/* |
/* |
|
|
{ |
{ |
struct line *lp; |
struct line *lp; |
struct buffer *bp = curbp; |
struct buffer *bp = curbp; |
int s, llen; |
int s, llen, lnum = 0; |
static char excbuf[BUFSIZE]; |
static char excbuf[BUFSIZE]; |
|
|
for (lp = bfirstlp(bp); lp != bp->b_headp; lp = lforw(lp)) { |
for (lp = bfirstlp(bp); lp != bp->b_headp; lp = lforw(lp)) { |
|
lnum++; |
llen = llength(lp); |
llen = llength(lp); |
if (llen >= BUFSIZE) |
if (llen >= BUFSIZE) |
return (FALSE); |
return (FALSE); |
|
|
|
|
/* make sure the line is terminated */ |
/* make sure the line is terminated */ |
excbuf[llen] = '\0'; |
excbuf[llen] = '\0'; |
if ((s = excline(excbuf, llen)) != TRUE) { |
if ((s = excline(excbuf, llen, lnum)) != TRUE) { |
cleanup(); |
cleanup(); |
return (s); |
return (s); |
} |
} |
|
|
== FIOSUC) { |
== FIOSUC) { |
line++; |
line++; |
excbuf[nbytes] = '\0'; |
excbuf[nbytes] = '\0'; |
if (excline(excbuf, nbytes) != TRUE) { |
if (excline(excbuf, nbytes, line) != TRUE) { |
s = FIOERR; |
s = FIOERR; |
dobeep(); |
dobeep(); |
ewprintf("Error loading file %s at line %d", fncpy, line); |
ewprintf("Error loading file %s at line %d", fncpy, line); |
|
|
} |
} |
(void)ffclose(ffp, NULL); |
(void)ffclose(ffp, NULL); |
excbuf[nbytes] = '\0'; |
excbuf[nbytes] = '\0'; |
if (s != FIOEOF || (nbytes && excline(excbuf, nbytes) != TRUE)) |
if (s != FIOEOF || (nbytes && excline(excbuf, nbytes, ++line) != TRUE)) |
return (FALSE); |
return (FALSE); |
return (TRUE); |
return (TRUE); |
} |
} |
|
|
* excline - run a line from a load file or eval-expression. |
* excline - run a line from a load file or eval-expression. |
*/ |
*/ |
int |
int |
excline(char *line, int llen) |
excline(char *line, int llen, int lnum) |
{ |
{ |
PF fp; |
PF fp; |
struct line *lp, *np; |
struct line *lp, *np; |
|
|
if (*funcp == '\0') |
if (*funcp == '\0') |
return (TRUE); /* No error on blank lines */ |
return (TRUE); /* No error on blank lines */ |
if (*funcp == '(') |
if (*funcp == '(') |
return (foundparen(funcp, llen)); |
return (foundparen(funcp, llen, lnum)); |
line = parsetoken(funcp); |
line = parsetoken(funcp); |
if (*line != '\0') { |
if (*line != '\0') { |
*line++ = '\0'; |
*line++ = '\0'; |