/* DO NOT EDIT! GENERATED AUTOMATICALLY! */
/* exclude.c -- exclude file names
- Copyright (C) 1992, 1993, 1994, 1997, 1999, 2000, 2001, 2002, 2003, 2004,
- 2005, 2006, 2007, 2009, 2010 Free Software Foundation, Inc.
+ Copyright (C) 1992-1994, 1997, 1999-2007, 2009-2011 Free Software
+ Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
return false;
}
+static void
+unescape_pattern (char *str)
+{
+ int inset = 0;
+ char *q = str;
+ do
+ {
+ if (inset)
+ {
+ if (*q == ']')
+ inset = 0;
+ }
+ else if (*q == '[')
+ inset = 1;
+ else if (*q == '\\')
+ q++;
+ }
+ while ((*str++ = *q++));
+}
+
/* Return a newly allocated and empty exclude list. */
struct exclude *
{
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;
seg = new_exclude_segment (ex, exclude_hash, options);
str = xstrdup (pattern);
+ if (options & EXCLUDE_WILDCARDS)
+ unescape_pattern (str);
p = hash_insert (seg->v.table, str);
if (p != str)
free (str);