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