summaryrefslogtreecommitdiff
path: root/findutils/grep.c
diff options
context:
space:
mode:
authorDenis Vlasenko2006-10-03 21:00:06 +0000
committerDenis Vlasenko2006-10-03 21:00:06 +0000
commit67b23e6043d8e2b30b0bf3bc105b8583c2a26db5 (patch)
treeedb58560b444979051b42ab7f0c0c718f7459754 /findutils/grep.c
parent40920825d59874cf285390434486e88c8498d2d8 (diff)
downloadbusybox-67b23e6043d8e2b30b0bf3bc105b8583c2a26db5.zip
busybox-67b23e6043d8e2b30b0bf3bc105b8583c2a26db5.tar.gz
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.
Diffstat (limited to 'findutils/grep.c')
-rw-r--r--findutils/grep.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/findutils/grep.c b/findutils/grep.c
index 5659a7d..35e6aff 100644
--- a/findutils/grep.c
+++ b/findutils/grep.c
@@ -24,7 +24,7 @@
/* options */
-static unsigned long opt;
+static unsigned opt;
#define GREP_OPTS "lnqvscFiHhe:f:Lo"
#define GREP_OPT_l (1<<0)
#define PRINT_FILES_WITH_MATCHES (opt & GREP_OPT_l)
@@ -302,8 +302,8 @@ int grep_main(int argc, char **argv)
char *slines_before;
char *Copt;
- bb_opt_complementally = "H-h:e::f::C-AB";
- opt = bb_getopt_ulflags(argc, argv,
+ opt_complementary = "H-h:e::f::C-AB";
+ opt = getopt32(argc, argv,
GREP_OPTS GREP_OPT_CONTEXT OPT_EGREP,
&pattern_head, &fopt,
&slines_after, &slines_before, &Copt);
@@ -336,8 +336,8 @@ int grep_main(int argc, char **argv)
before_buf = (char **)xzalloc(lines_before * sizeof(char *));
#else
/* with auto sanity checks */
- bb_opt_complementally = "H-h:e::f::c-n:q-n:l-n";
- opt = bb_getopt_ulflags(argc, argv, GREP_OPTS OPT_EGREP,
+ opt_complementary = "H-h:e::f::c-n:q-n:l-n";
+ opt = getopt32(argc, argv, GREP_OPTS OPT_EGREP,
&pattern_head, &fopt);
#endif
invert_search = (opt & GREP_OPT_v) != 0; /* 0 | 1 */