mirror of
https://github.com/openwrt/openwrt.git
synced 2024-12-23 23:42:43 +00:00
fix awk segfault
SVN-Revision: 7640
This commit is contained in:
parent
90d54c0faa
commit
0386ee90ed
@ -1,7 +1,7 @@
|
|||||||
Index: busybox-1.4.2/editors/awk.c
|
Index: busybox-1.4.2/editors/awk.c
|
||||||
===================================================================
|
===================================================================
|
||||||
--- busybox-1.4.2.orig/editors/awk.c 2007-06-04 13:21:32.083099296 +0200
|
--- busybox-1.4.2.orig/editors/awk.c 2007-06-15 23:43:26.460690280 +0200
|
||||||
+++ busybox-1.4.2/editors/awk.c 2007-06-04 13:21:35.202625056 +0200
|
+++ busybox-1.4.2/editors/awk.c 2007-06-15 23:45:26.283474448 +0200
|
||||||
@@ -2639,14 +2639,13 @@
|
@@ -2639,14 +2639,13 @@
|
||||||
|
|
||||||
int awk_main(int argc, char **argv)
|
int awk_main(int argc, char **argv)
|
||||||
@ -18,7 +18,7 @@ Index: busybox-1.4.2/editors/awk.c
|
|||||||
|
|
||||||
/* Undo busybox.c, or else strtod may eat ','! This breaks parsing:
|
/* Undo busybox.c, or else strtod may eat ','! This breaks parsing:
|
||||||
* $1,$2 == '$1,' '$2', NOT '$1' ',' '$2' */
|
* $1,$2 == '$1,' '$2', NOT '$1' ',' '$2' */
|
||||||
@@ -2694,40 +2693,54 @@
|
@@ -2694,40 +2693,56 @@
|
||||||
free(s);
|
free(s);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -83,13 +83,13 @@ Index: busybox-1.4.2/editors/awk.c
|
|||||||
- parse_program(s + 1);
|
- parse_program(s + 1);
|
||||||
- free(s);
|
- free(s);
|
||||||
- } else { // no -f: take program from 1st parameter
|
- } else { // no -f: take program from 1st parameter
|
||||||
- if (!argc)
|
|
||||||
- bb_show_usage();
|
|
||||||
+ }
|
+ }
|
||||||
+ argc -= optind;
|
+ argc -= optind;
|
||||||
+ argv += optind;
|
+ argv += optind;
|
||||||
+
|
+
|
||||||
+ if (!programname) {
|
+ if (!programname) {
|
||||||
|
if (!argc)
|
||||||
|
bb_show_usage();
|
||||||
programname = "cmd. line";
|
programname = "cmd. line";
|
||||||
parse_program(*argv++);
|
parse_program(*argv++);
|
||||||
argc--;
|
argc--;
|
||||||
|
Loading…
Reference in New Issue
Block a user