Mercurial > hg > toybox
changeset 1610:74e2642c35e8 draft
Last sed bugfix broke 'b', fix it.
author | Rob Landley <rob@landley.net> |
---|---|
date | Sat, 13 Dec 2014 12:27:51 -0600 |
parents | 1c152e2c5b27 |
children | 50dc30893f9d |
files | toys/pending/sed.c |
diffstat | 1 files changed, 5 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/toys/pending/sed.c Sat Dec 13 12:12:14 2014 -0600 +++ b/toys/pending/sed.c Sat Dec 13 12:27:51 2014 -0600 @@ -588,7 +588,7 @@ } else if (c=='=') { sprintf(toybuf, "%ld", TT.count); emit(toybuf, strlen(toybuf), 1); - } else if (!strchr(":{}", c)) error_exit("todo: %c", c); + } logrus = logrus->next; } @@ -895,7 +895,10 @@ // Trim whitespace from "b ;" and ": blah " but only first space in "w x " - while (isspace(*line) && !*line == '\n') line++; + while (isspace(*line)) { + if (!strchr("btT", c) || *line != '\n') line++; + else break; + } append: class = !strchr("btT:", c); end = strcspn(line, class ? "\n" : "; \t\r\n\v\f");