ed

simple ed
git clone git://git.2f30.org/ed.git
Log | Files | Refs

commit a53921fd16f367641afda0e4c4eca804f44453fe
parent 8c130c929d1f7ccb450b2d5da52b7a6456e7cc56
Author: Roberto E. Vargas Caballero <k0ga@shike2.com>
Date:   Tue Dec  8 20:08:30 +0100

Remove calls to skipblank in getlst()

We want to convert getlst() into a getchar() parser
alike function, and the first step is to remove
skipblank() calls because this function is also
used in another places, so it cannot be converted
directed a getchar() code.

Diffstat:
ed.c | 12++++++++----
1 file changed, 8 insertions(+), 4 deletions(-)
diff --git a/ed.c b/ed.c @@ -308,7 +308,8 @@ linenum(int *line) { int ln, c, sign = 1; - skipblank(); + while (isspace(*cmdp)) + ++cmdp; switch (*cmdp) { case '.': @@ -316,7 +317,8 @@ linenum(int *line) break; case '\'': ++cmdp; - skipblank(); + while (isspace(*cmdp)) + ++cmdp; if (!isalpha(c = *cmdp)) error("invalid mark character"); if (!(ln = marks[c])) @@ -363,7 +365,8 @@ address(int *line) return 0; for (;;) { - skipblank(); + while (isspace(*cmdp)) + ++cmdp; c = *cmdp++; if (c != '+' && c != '-') break; @@ -398,7 +401,8 @@ getlst() line1 = line2; line2 = ln; ++nlines; - skipblank(); + while (isspace(*cmdp)) + ++cmdp; if (*cmdp != ',' && *cmdp != ';') break; if (*cmdp++ == ';')