aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorkraai <kraai@69ca8d6d-28ef-0310-b511-8ec308f3f277>2001-10-29 15:49:03 +0000
committerkraai <kraai@69ca8d6d-28ef-0310-b511-8ec308f3f277>2001-10-29 15:49:03 +0000
commit99f25757d3ddfdbe764f04ee037b19b748b7caec (patch)
treef49f55887c6de8c9ced3458ac1a2d981a5e3f374
parent8e22fcef462de1311ae95ac92bf755e35aedf042 (diff)
downloadbusybox-w32-99f25757d3ddfdbe764f04ee037b19b748b7caec.tar.gz
busybox-w32-99f25757d3ddfdbe764f04ee037b19b748b7caec.tar.bz2
busybox-w32-99f25757d3ddfdbe764f04ee037b19b748b7caec.zip
Use extended regular expressions when invoked as egrep (noted and initial
patch by Charles Steinkuehler). git-svn-id: svn://busybox.net/trunk/busybox@3601 69ca8d6d-28ef-0310-b511-8ec308f3f277
-rw-r--r--findutils/config.in3
-rw-r--r--findutils/grep.c5
-rw-r--r--include/applets.h2
3 files changed, 9 insertions, 1 deletions
diff --git a/findutils/config.in b/findutils/config.in
index 8e41bd50c..21e368047 100644
--- a/findutils/config.in
+++ b/findutils/config.in
@@ -8,6 +8,9 @@ comment 'Finding Utilities'
8 8
9bool 'find' CONFIG_FIND 9bool 'find' CONFIG_FIND
10bool 'grep' CONFIG_GREP 10bool 'grep' CONFIG_GREP
11if [ "$CONFIG_GREP" = "y" ] ; then
12 bool ' egrep alias' CONFIG_FEATURE_GREP_EGREP_ALIAS
13fi
11bool 'which' CONFIG_WHICH 14bool 'which' CONFIG_WHICH
12bool 'xargs' CONFIG_XARGS 15bool 'xargs' CONFIG_XARGS
13endmenu 16endmenu
diff --git a/findutils/grep.c b/findutils/grep.c
index a97a8bbb7..7cd8196fd 100644
--- a/findutils/grep.c
+++ b/findutils/grep.c
@@ -243,6 +243,11 @@ extern int grep_main(int argc, char **argv)
243 perror_msg_and_die("atexit"); 243 perror_msg_and_die("atexit");
244#endif 244#endif
245 245
246#ifdef CONFIG_FEATURE_GREP_EGREP_ALIAS
247 if (strcmp (basename (argv[0]), "egrep") == 0)
248 reflags |= REG_ICASE;
249#endif
250
246 /* do normal option parsing */ 251 /* do normal option parsing */
247 while ((opt = getopt(argc, argv, "iHhlnqvsce:f:" 252 while ((opt = getopt(argc, argv, "iHhlnqvsce:f:"
248#ifdef CONFIG_FEATURE_GREP_CONTEXT 253#ifdef CONFIG_FEATURE_GREP_CONTEXT
diff --git a/include/applets.h b/include/applets.h
index 9a7e394b6..effbb5233 100644
--- a/include/applets.h
+++ b/include/applets.h
@@ -149,7 +149,7 @@
149#ifdef CONFIG_ECHO 149#ifdef CONFIG_ECHO
150 APPLET(echo, echo_main, _BB_DIR_BIN) 150 APPLET(echo, echo_main, _BB_DIR_BIN)
151#endif 151#endif
152#if defined(CONFIG_FEATURE_GREP_EGREP_ALIAS) && defined(CONFIG_GREP) 152#if defined(CONFIG_FEATURE_GREP_EGREP_ALIAS)
153 APPLET_NOUSAGE("egrep", grep_main, _BB_DIR_BIN) 153 APPLET_NOUSAGE("egrep", grep_main, _BB_DIR_BIN)
154#endif 154#endif
155#ifdef CONFIG_ENV 155#ifdef CONFIG_ENV