aboutsummaryrefslogtreecommitdiff
path: root/toys/pending/sed.c
AgeCommit message (Collapse)Author
2014-12-21Promote sed to posix.Rob Landley
2014-12-20sed: implement 'l'Rob Landley
2014-12-19More sed bugs.Rob Landley
1) Newline in -e after s/// was eaten as "whitespace before flags" 2) \\ needs to be passed through to regex to avoid "trailing \" error and "\\n" is not a newline.
2014-12-15Fix yet another sed bug.Rob Landley
The s/// command would copy the \ of substitutions before deciding what to do with them (generally overwriting the \ with the new data). When the substitution was A) at the very end of the new string, B) resolved to nothing, it could leave a trailing \ that didn't belong there and didn't get overwritten because the "copy trailing data" part that copies the original string's null terminator already happened before the \ overwrote it. The ghostwheel() function restarts regexes after embedded NUL bytes, but if the string it's passed is _longer_ than the length it's told then it gets confused (and it means we're off the end of our allocation so segfaults are likely). Fix: test for \ first and move the "copy byte" logic into an else case.
2014-12-14Make sed a\ line continuations work properly for different pattern input modes.Rob Landley
2014-12-13Fix bug in sed y/// where bytes in target but not in source were replaced by ↵Rob Landley
zeroes (nul terminator overwritten).
2014-12-13Last sed bugfix broke 'b', fix it.Rob Landley
2014-12-10Make unescape_delimited_string() copy the string so error reporting isn't so ↵Rob Landley
messed up.
2014-12-10Fix some sed bugs and improve error reporting.Rob Landley
A newline after 'b' commands in -e command line patterns was being discarded as whitespace, a single element regex match on a {} was leaving stale state for the next line, and giant -e blobs of instructions were saying things like problem at character 432 (note: nulls inserted for regex processing aren't always cleaned up, screws up error reporting).
2014-11-27sed: c needs to trigger range logic like d, D works like d when there isn't ↵Rob Landley
anything left in the line, and more tests.
2014-11-18More sed bugfixes.Rob Landley
2014-11-17sed: fix 'q', and { }, and } after s/// with no semicolon.Rob Landley
2014-11-17More sed corner cases. (Empty regex repeats previous regex, implement -i, etc.)Rob Landley
2014-11-16Fix more sed bugs.Rob Landley
2014-11-16Fix sed 'b' with no label and 'N' in general.Rob Landley
2014-11-15More sed bugfixes. (Did you know s/[/]// is a valid sed expression?)Rob Landley
2014-11-15Debugging pass on sed: make the existing test suite pass.Rob Landley
2014-11-14sed: implement s & and \1 backrefs.Rob Landley
2014-11-12Implement more sed plumbing, including s/// (without \1 or & yet).Rob Landley
2014-11-10Implement another largeish chunk of sed. Untested, unfinished, do not use yet.Rob Landley
2014-11-08Implement a few sed commands. Not done, and not tested yet.Rob Landley
2014-11-04Next round of sed infrastructure, parses most commands now, doesn't ↵Rob Landley
implement them yet.
2014-10-29Next drop of sed infrastructure, mostly argument parsing, doesn't do ↵Rob Landley
anything interesting yet.
2014-10-28Fill out rest of help text for sed.Rob Landley
2014-10-24Basic sed range support, enough for "sed -n 9,11p README" to work.Rob Landley
2014-10-20Random in-progress snapshot of sed, not finished yet.Rob Landley
2014-10-13Started over on sed (by reading the posix spec).Rob Landley
2014-03-29Group headers by standard (POSIX or LSB) or function (internationalization, ↵Rob Landley
networking). Move headers standards ignore (but which have been there >15 years) to lib/portability.h. Fold xregcomp into lib since it's posix.
2013-02-24Sed's still just a stub, but clean it up enough so it at least compiles.Rob Landley
2013-02-22Move some unfinished commands to the "pending" directory.Rob Landley