diff options
author | vda <vda@69ca8d6d-28ef-0310-b511-8ec308f3f277> | 2006-10-03 21:00:06 +0000 |
---|---|---|
committer | vda <vda@69ca8d6d-28ef-0310-b511-8ec308f3f277> | 2006-10-03 21:00:06 +0000 |
commit | 63adc7384791548741e3a2afbee1be40d99fe9d2 (patch) | |
tree | edb58560b444979051b42ab7f0c0c718f7459754 /findutils/grep.c | |
parent | 1fa12c6ebcb25e2924778bcbaae4bea1af7b7e6a (diff) | |
download | busybox-w32-63adc7384791548741e3a2afbee1be40d99fe9d2.tar.gz busybox-w32-63adc7384791548741e3a2afbee1be40d99fe9d2.tar.bz2 busybox-w32-63adc7384791548741e3a2afbee1be40d99fe9d2.zip |
getopt_ulflags -> getopt32.
It is impossible to formulate sane ABI based on
size of ulong because it can be 32-bit or 64-bit.
Basically it means that you cannot portably use
more that 32 option chars in one call anyway...
Make it explicit.
git-svn-id: svn://busybox.net/trunk/busybox@16305 69ca8d6d-28ef-0310-b511-8ec308f3f277
Diffstat (limited to 'findutils/grep.c')
-rw-r--r-- | findutils/grep.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/findutils/grep.c b/findutils/grep.c index 5659a7d2b..35e6aff2d 100644 --- a/findutils/grep.c +++ b/findutils/grep.c | |||
@@ -24,7 +24,7 @@ | |||
24 | 24 | ||
25 | 25 | ||
26 | /* options */ | 26 | /* options */ |
27 | static unsigned long opt; | 27 | static unsigned opt; |
28 | #define GREP_OPTS "lnqvscFiHhe:f:Lo" | 28 | #define GREP_OPTS "lnqvscFiHhe:f:Lo" |
29 | #define GREP_OPT_l (1<<0) | 29 | #define GREP_OPT_l (1<<0) |
30 | #define PRINT_FILES_WITH_MATCHES (opt & GREP_OPT_l) | 30 | #define PRINT_FILES_WITH_MATCHES (opt & GREP_OPT_l) |
@@ -302,8 +302,8 @@ int grep_main(int argc, char **argv) | |||
302 | char *slines_before; | 302 | char *slines_before; |
303 | char *Copt; | 303 | char *Copt; |
304 | 304 | ||
305 | bb_opt_complementally = "H-h:e::f::C-AB"; | 305 | opt_complementary = "H-h:e::f::C-AB"; |
306 | opt = bb_getopt_ulflags(argc, argv, | 306 | opt = getopt32(argc, argv, |
307 | GREP_OPTS GREP_OPT_CONTEXT OPT_EGREP, | 307 | GREP_OPTS GREP_OPT_CONTEXT OPT_EGREP, |
308 | &pattern_head, &fopt, | 308 | &pattern_head, &fopt, |
309 | &slines_after, &slines_before, &Copt); | 309 | &slines_after, &slines_before, &Copt); |
@@ -336,8 +336,8 @@ int grep_main(int argc, char **argv) | |||
336 | before_buf = (char **)xzalloc(lines_before * sizeof(char *)); | 336 | before_buf = (char **)xzalloc(lines_before * sizeof(char *)); |
337 | #else | 337 | #else |
338 | /* with auto sanity checks */ | 338 | /* with auto sanity checks */ |
339 | bb_opt_complementally = "H-h:e::f::c-n:q-n:l-n"; | 339 | opt_complementary = "H-h:e::f::c-n:q-n:l-n"; |
340 | opt = bb_getopt_ulflags(argc, argv, GREP_OPTS OPT_EGREP, | 340 | opt = getopt32(argc, argv, GREP_OPTS OPT_EGREP, |
341 | &pattern_head, &fopt); | 341 | &pattern_head, &fopt); |
342 | #endif | 342 | #endif |
343 | invert_search = (opt & GREP_OPT_v) != 0; /* 0 | 1 */ | 343 | invert_search = (opt & GREP_OPT_v) != 0; /* 0 | 1 */ |