--- file_not_specified_in_diff +++ file_not_specified_in_diff @@ -, +, @@ --- grep-2.6.1/lib/exclude.c.orig +++ grep-2.6.1/lib/exclude.c @@ -342,7 +342,7 @@ { char const *pattern = exclude[i].pattern; int options = exclude[i].options; - if (excluded != exclude_fnmatch (pattern, f, options)) + if (exclude_fnmatch (pattern, f, options)) return !excluded; } return excluded; --- grep-2.6.1/lib/savedir.c.orig +++ grep-2.6.1/lib/savedir.c @@ -48,7 +48,7 @@ size_t dirlen = strlen (dir); size_t filelen = strlen (file); - while (dirlen && path[dirlen - 1] == '/') + while (dirlen && dir[dirlen - 1] == '/') dirlen--; if ((dirlen + filelen + 2) > pathlen) @@ -112,7 +112,7 @@ && !isdir1 (dir, dp->d_name)) { if (included_patterns - && !excluded_file_name (included_patterns, dp->d_name)) + && excluded_file_name (included_patterns, dp->d_name)) continue; if (excluded_patterns && excluded_file_name (excluded_patterns, dp->d_name)) --- grep-2.6.1/src/main.c.orig +++ grep-2.6.1/src/main.c @@ -2066,7 +2066,7 @@ case INCLUDE_OPTION: if (!included_patterns) included_patterns = new_exclude (); - add_exclude (included_patterns, optarg, EXCLUDE_INCLUDE); + add_exclude (included_patterns, optarg, EXCLUDE_INCLUDE | EXCLUDE_WILDCARDS); break; case GROUP_SEPARATOR_OPTION: