diff options
author | landley <landley@69ca8d6d-28ef-0310-b511-8ec308f3f277> | 2004-10-30 06:54:19 +0000 |
---|---|---|
committer | landley <landley@69ca8d6d-28ef-0310-b511-8ec308f3f277> | 2004-10-30 06:54:19 +0000 |
commit | e648ef106cc3d40bb47107d58b8939dbf04cf30f (patch) | |
tree | d7e680e89e0d6fb9843cb00552d8520de6fcf5e0 /scripts/split-include.c | |
parent | e08bbfa05c2a2670414d9d7f507bca0402483e16 (diff) | |
download | busybox-w32-e648ef106cc3d40bb47107d58b8939dbf04cf30f.tar.gz busybox-w32-e648ef106cc3d40bb47107d58b8939dbf04cf30f.tar.bz2 busybox-w32-e648ef106cc3d40bb47107d58b8939dbf04cf30f.zip |
Hiroshi Ito found some bugs. The 'c' command (cut and paste) was hardwired
to not put a newline at the end (which was backwards, it should have been
hardwired _to_ put a newline at the end, whether or not the input line
ended with a newline). Test case for that:
echo | sed -e '$ctest'
And then this would segfault:
echo | sed -e 'g'
Because pattern_space got freed but the dead pointer was only overwritten
in an if statement that didn't trigger if the hold space was empty. Oops.
While debugging it, I found out that the hold space is persistent between
multiple input files, so I promoted it to a global and added it to the
memory cleanup. The relevant test case (to compare with That Other Sed) is:
echo -n woo > woo
sed -e h -e g woo
echo "fish" | sed -e '/woo/h' -e "izap" -e 's/woo/thingy/' -e '/fish/g' woo -
And somebody gratuitously stuck in a c99 int8_t type for something that's just
a flag, so I grouped the darn ints.
git-svn-id: svn://busybox.net/trunk/busybox@9486 69ca8d6d-28ef-0310-b511-8ec308f3f277
Diffstat (limited to 'scripts/split-include.c')
0 files changed, 0 insertions, 0 deletions