diff options
author | Mark Whitley <markw@lineo.com> | 2000-08-10 00:09:47 +0000 |
---|---|---|
committer | Mark Whitley <markw@lineo.com> | 2000-08-10 00:09:47 +0000 |
commit | 40406e6bad9abcd58977ed92194c9061d85c9e47 (patch) | |
tree | 305a296c9ea3827ed2a9a42e21c9dc67d4abae2e | |
parent | adbf018dc469d808fc0ca77f91bf37a871219d97 (diff) | |
download | busybox-w32-40406e6bad9abcd58977ed92194c9061d85c9e47.tar.gz busybox-w32-40406e6bad9abcd58977ed92194c9061d85c9e47.tar.bz2 busybox-w32-40406e6bad9abcd58977ed92194c9061d85c9e47.zip |
Applied patch from Mark Ferrell <mferrell@mvista.com> to fix sed '1,$p' where
sed was only printing the first line and then exiting.
-rw-r--r-- | editors/sed.c | 4 | ||||
-rw-r--r-- | sed.c | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/editors/sed.c b/editors/sed.c index 665471913..60b1e8d2e 100644 --- a/editors/sed.c +++ b/editors/sed.c | |||
@@ -639,8 +639,8 @@ static void process_file(FILE *file) | |||
639 | } | 639 | } |
640 | 640 | ||
641 | /* are we acting on a range of line numbers? */ | 641 | /* are we acting on a range of line numbers? */ |
642 | else if (sed_cmds[i].beg_line > 0 && sed_cmds[i].end_line > 0) { | 642 | else if (sed_cmds[i].beg_line > 0 && sed_cmds[i].end_line != 0) { |
643 | if (linenum >= sed_cmds[i].beg_line && linenum <= sed_cmds[i].end_line) | 643 | if (linenum >= sed_cmds[i].beg_line && (sed_cmds[i].end_line == -1 || linenum <= sed_cmds[i].end_line)) |
644 | line_altered += do_sed_command(&sed_cmds[i], line); | 644 | line_altered += do_sed_command(&sed_cmds[i], line); |
645 | } | 645 | } |
646 | 646 | ||
@@ -639,8 +639,8 @@ static void process_file(FILE *file) | |||
639 | } | 639 | } |
640 | 640 | ||
641 | /* are we acting on a range of line numbers? */ | 641 | /* are we acting on a range of line numbers? */ |
642 | else if (sed_cmds[i].beg_line > 0 && sed_cmds[i].end_line > 0) { | 642 | else if (sed_cmds[i].beg_line > 0 && sed_cmds[i].end_line != 0) { |
643 | if (linenum >= sed_cmds[i].beg_line && linenum <= sed_cmds[i].end_line) | 643 | if (linenum >= sed_cmds[i].beg_line && (sed_cmds[i].end_line == -1 || linenum <= sed_cmds[i].end_line)) |
644 | line_altered += do_sed_command(&sed_cmds[i], line); | 644 | line_altered += do_sed_command(&sed_cmds[i], line); |
645 | } | 645 | } |
646 | 646 | ||