1 diff -ur busybox.old/editors/awk.c busybox.dev/editors/awk.c
2 --- busybox.old/editors/awk.c 2006-12-27 05:56:50.000000000 +0100
3 +++ busybox.dev/editors/awk.c 2007-01-01 23:12:04.000000000 +0100
6 int awk_main(int argc, char **argv)
9 - char *opt_F, *opt_v, *opt_W;
13 @@ -2691,32 +2689,44 @@
17 - opt = getopt32(argc, argv, "F:v:f:W:", &opt_F, &opt_v, &programname, &opt_W);
18 - if (opt & 0x1) setvar_s(V[FS], opt_F); // -F
19 - if (opt & 0x2) if (!is_assignment(opt_v)) bb_show_usage(); // -v
20 - if (opt & 0x4) { // -f
22 - F = afopen(programname, "r");
24 - /* one byte is reserved for some trick in next_token */
25 - if (fseek(F, 0, SEEK_END) == 0) {
27 - s = (char *)xmalloc(flen+4);
28 - fseek(F, 0, SEEK_SET);
29 - i = 1 + fread(s+1, 1, flen, F);
31 - for (i=j=1; j>0; i+=j) {
32 - s = (char *)xrealloc(s, i+4096);
33 - j = fread(s+i, 1, 4094, F);
35 + while((c = getopt(argc, argv, "F:v:f:W:")) != EOF) {
38 + setvar_s(V[FS], optarg);
41 + if (! is_assignment(optarg))
46 + F = afopen(programname = optarg, "r");
48 + /* one byte is reserved for some trick in next_token */
49 + if (fseek(F, 0, SEEK_END) == 0) {
51 + s = (char *)xmalloc(flen+4);
52 + fseek(F, 0, SEEK_SET);
53 + i = 1 + fread(s+1, 1, flen, F);
55 + for (i=j=1; j>0; i+=j) {
56 + s = (char *)xrealloc(s, i+4096);
57 + j = fread(s+i, 1, 4094, F);
66 + bb_error_msg("Warning: unrecognized option '-W %s' ignored\n", optarg);
77 - if (opt & 0x8) // -W
78 - bb_error_msg("warning: unrecognized option '-W %s' ignored", opt_W);