diff options
author | Mike Frysinger | 2005-07-31 22:41:05 +0000 |
---|---|---|
committer | Mike Frysinger | 2005-07-31 22:41:05 +0000 |
commit | 25b8652b4f0122f23fbd1e59961935d9ea5e600e (patch) | |
tree | 08d399af0e8065973f944f2dba99d65bf7f7f151 /busybox | |
parent | 091a3e510e5f9c61c4d9f03bdbc8433847f645a8 (diff) | |
download | busybox-25b8652b4f0122f23fbd1e59961935d9ea5e600e.zip busybox-25b8652b4f0122f23fbd1e59961935d9ea5e600e.tar.gz |
patch by srowe in Bug 359 to fix fgrep aliasing
Diffstat (limited to 'busybox')
-rw-r--r-- | busybox/findutils/Config.in | 6 | ||||
-rw-r--r-- | busybox/findutils/grep.c | 5 |
2 files changed, 8 insertions, 3 deletions
diff --git a/busybox/findutils/Config.in b/busybox/findutils/Config.in index 3143bd4..10dc72e 100644 --- a/busybox/findutils/Config.in +++ b/busybox/findutils/Config.in @@ -73,13 +73,13 @@ config CONFIG_FEATURE_GREP_EGREP_ALIAS and various repetition operators. config CONFIG_FEATURE_GREP_FGREP_ALIAS - bool " Alias fgrep to grep -f" + bool " Alias fgrep to grep -F" default y depends on CONFIG_GREP help - fgrep sees the search pattern as a normal string rather than + fgrep sees the search pattern as a normal string rather than regular expressions. - grep -f is always builtin, this just creates the fgrep alias. + grep -F is always builtin, this just creates the fgrep alias. config CONFIG_FEATURE_GREP_CONTEXT bool " Enable before and after context flags (-A, -B and -C)" diff --git a/busybox/findutils/grep.c b/busybox/findutils/grep.c index 9b26add..a8fd2d4 100644 --- a/busybox/findutils/grep.c +++ b/busybox/findutils/grep.c @@ -326,6 +326,11 @@ extern int grep_main(int argc, char **argv) if(opt & GREP_OPT_f) load_regexes_from_file(fopt); +#ifdef CONFIG_FEATURE_GREP_FGREP_ALIAS + if(bb_applet_name[0] == 'f') + fgrep_flag = 1; +#endif + #ifdef CONFIG_FEATURE_GREP_EGREP_ALIAS if(bb_applet_name[0] == 'e' || (opt & GREP_OPT_E)) reflags = REG_EXTENDED | REG_NOSUB; |