Fixed a bug where "sed 's/foo/bar/g'" (i.e. a script w/o a -e)
would go into an infinite loop. -Erik
This commit is contained in:
parent
9c5c29d442
commit
e916d24805
@ -35,6 +35,8 @@
|
||||
- Fixes to the makefile for handling "strip"
|
||||
* An initial telnet implementation was added by
|
||||
Randolph Chung <tausq@debian.org>.
|
||||
* Fixed a bug where "sed 's/foo/bar/g'" would go into an
|
||||
infinite loop.
|
||||
|
||||
|
||||
-Erik Andersen
|
||||
|
@ -184,7 +184,8 @@ extern int sed_main(int argc, char **argv)
|
||||
}
|
||||
|
||||
while (argc > 1) {
|
||||
if (**argv == '-') {
|
||||
if (**argv != '-')
|
||||
usage(sed_usage);
|
||||
argc--;
|
||||
cp = *argv++;
|
||||
stopNow = FALSE;
|
||||
@ -307,7 +308,6 @@ extern int sed_main(int argc, char **argv)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (argc == 0) {
|
||||
switch (sed_f) {
|
||||
|
4
sed.c
4
sed.c
@ -184,7 +184,8 @@ extern int sed_main(int argc, char **argv)
|
||||
}
|
||||
|
||||
while (argc > 1) {
|
||||
if (**argv == '-') {
|
||||
if (**argv != '-')
|
||||
usage(sed_usage);
|
||||
argc--;
|
||||
cp = *argv++;
|
||||
stopNow = FALSE;
|
||||
@ -307,7 +308,6 @@ extern int sed_main(int argc, char **argv)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (argc == 0) {
|
||||
switch (sed_f) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user