summaryrefslogtreecommitdiff
path: root/busybox/findutils
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2005-07-31 22:41:05 +0000
committerMike Frysinger <vapier@gentoo.org>2005-07-31 22:41:05 +0000
commit25b8652b4f0122f23fbd1e59961935d9ea5e600e (patch)
tree08d399af0e8065973f944f2dba99d65bf7f7f151 /busybox/findutils
parent091a3e510e5f9c61c4d9f03bdbc8433847f645a8 (diff)
downloadbusybox-w32-25b8652b4f0122f23fbd1e59961935d9ea5e600e.tar.gz
busybox-w32-25b8652b4f0122f23fbd1e59961935d9ea5e600e.tar.bz2
busybox-w32-25b8652b4f0122f23fbd1e59961935d9ea5e600e.zip
patch by srowe in Bug 359 to fix fgrep aliasing
Diffstat (limited to 'busybox/findutils')
-rw-r--r--busybox/findutils/Config.in6
-rw-r--r--busybox/findutils/grep.c5
2 files changed, 8 insertions, 3 deletions
diff --git a/busybox/findutils/Config.in b/busybox/findutils/Config.in
index 3143bd438..10dc72e29 100644
--- a/busybox/findutils/Config.in
+++ b/busybox/findutils/Config.in
@@ -73,13 +73,13 @@ config CONFIG_FEATURE_GREP_EGREP_ALIAS
73 and various repetition operators. 73 and various repetition operators.
74 74
75config CONFIG_FEATURE_GREP_FGREP_ALIAS 75config CONFIG_FEATURE_GREP_FGREP_ALIAS
76 bool " Alias fgrep to grep -f" 76 bool " Alias fgrep to grep -F"
77 default y 77 default y
78 depends on CONFIG_GREP 78 depends on CONFIG_GREP
79 help 79 help
80 fgrep sees the search pattern as a normal string rather than 80 fgrep sees the search pattern as a normal string rather than
81 regular expressions. 81 regular expressions.
82 grep -f is always builtin, this just creates the fgrep alias. 82 grep -F is always builtin, this just creates the fgrep alias.
83 83
84config CONFIG_FEATURE_GREP_CONTEXT 84config CONFIG_FEATURE_GREP_CONTEXT
85 bool " Enable before and after context flags (-A, -B and -C)" 85 bool " Enable before and after context flags (-A, -B and -C)"
diff --git a/busybox/findutils/grep.c b/busybox/findutils/grep.c
index 9b26add9a..a8fd2d41a 100644
--- a/busybox/findutils/grep.c
+++ b/busybox/findutils/grep.c
@@ -326,6 +326,11 @@ extern int grep_main(int argc, char **argv)
326 if(opt & GREP_OPT_f) 326 if(opt & GREP_OPT_f)
327 load_regexes_from_file(fopt); 327 load_regexes_from_file(fopt);
328 328
329#ifdef CONFIG_FEATURE_GREP_FGREP_ALIAS
330 if(bb_applet_name[0] == 'f')
331 fgrep_flag = 1;
332#endif
333
329#ifdef CONFIG_FEATURE_GREP_EGREP_ALIAS 334#ifdef CONFIG_FEATURE_GREP_EGREP_ALIAS
330 if(bb_applet_name[0] == 'e' || (opt & GREP_OPT_E)) 335 if(bb_applet_name[0] == 'e' || (opt & GREP_OPT_E))
331 reflags = REG_EXTENDED | REG_NOSUB; 336 reflags = REG_EXTENDED | REG_NOSUB;