mirror of
https://github.com/sheumann/hush.git
synced 2024-12-26 10:32:02 +00:00
Applied patch from Mark Ferrell <mferrell@mvista.com> to fix sed '1,$p' where
sed was only printing the first line and then exiting.
This commit is contained in:
parent
adbf018dc4
commit
40406e6bad
@ -639,8 +639,8 @@ static void process_file(FILE *file)
|
||||
}
|
||||
|
||||
/* are we acting on a range of line numbers? */
|
||||
else if (sed_cmds[i].beg_line > 0 && sed_cmds[i].end_line > 0) {
|
||||
if (linenum >= sed_cmds[i].beg_line && linenum <= sed_cmds[i].end_line)
|
||||
else if (sed_cmds[i].beg_line > 0 && sed_cmds[i].end_line != 0) {
|
||||
if (linenum >= sed_cmds[i].beg_line && (sed_cmds[i].end_line == -1 || linenum <= sed_cmds[i].end_line))
|
||||
line_altered += do_sed_command(&sed_cmds[i], line);
|
||||
}
|
||||
|
||||
|
4
sed.c
4
sed.c
@ -639,8 +639,8 @@ static void process_file(FILE *file)
|
||||
}
|
||||
|
||||
/* are we acting on a range of line numbers? */
|
||||
else if (sed_cmds[i].beg_line > 0 && sed_cmds[i].end_line > 0) {
|
||||
if (linenum >= sed_cmds[i].beg_line && linenum <= sed_cmds[i].end_line)
|
||||
else if (sed_cmds[i].beg_line > 0 && sed_cmds[i].end_line != 0) {
|
||||
if (linenum >= sed_cmds[i].beg_line && (sed_cmds[i].end_line == -1 || linenum <= sed_cmds[i].end_line))
|
||||
line_altered += do_sed_command(&sed_cmds[i], line);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user