Fix http://bugs.busybox.net/view.php?id=826 in which "(echo; echo) | sed x"

crashes because the empty state of the hold space is NULL but the empty
state of the pattern space is "".
This commit is contained in:
Rob Landley 2006-06-28 13:50:59 +00:00
parent cc826d74e4
commit ea7c18514b

View File

@ -1054,7 +1054,7 @@ restart:
case 'x': /* Exchange hold and pattern space */
{
char *tmp = pattern_space;
pattern_space = bbg.hold_space;
pattern_space = bbg.hold_space ? : xzalloc(1);
no_newline=0;
bbg.hold_space = tmp;
break;