aboutsummaryrefslogtreecommitdiff
path: root/toys/pending/sed.c
diff options
context:
space:
mode:
authorRob Landley <rob@landley.net>2014-12-13 12:27:51 -0600
committerRob Landley <rob@landley.net>2014-12-13 12:27:51 -0600
commit76ea44a623ba186a3c4662d54b71b60b358ae0ad (patch)
tree371cdc55a0163c18e53dcf3bb84dd37f7b3c5e89 /toys/pending/sed.c
parent4e49a944da7a6816d126205c79700704708f4300 (diff)
downloadtoybox-76ea44a623ba186a3c4662d54b71b60b358ae0ad.tar.gz
Last sed bugfix broke 'b', fix it.
Diffstat (limited to 'toys/pending/sed.c')
-rw-r--r--toys/pending/sed.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/toys/pending/sed.c b/toys/pending/sed.c
index 623307cc..0b8c272a 100644
--- a/toys/pending/sed.c
+++ b/toys/pending/sed.c
@@ -588,7 +588,7 @@ writenow:
} 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 @@ writenow:
// 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");