diff options
author | Sergei Golubchik <serg@mysql.com> | 2009-02-11 19:57:38 +0100 |
---|---|---|
committer | Sergei Golubchik <serg@mysql.com> | 2009-02-11 19:57:38 +0100 |
commit | b4d0bf108461386dc42b0fff7222fc68592d046d (patch) | |
tree | e41936d718a258636de07e50c42606f677fad6bd /dbug/dbug.c | |
parent | 2637dda66845868fe996e60e54996acf03f6c537 (diff) | |
download | mariadb-git-b4d0bf108461386dc42b0fff7222fc68592d046d.tar.gz |
support for glob(7) patterns in dbug
Diffstat (limited to 'dbug/dbug.c')
-rw-r--r-- | dbug/dbug.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/dbug/dbug.c b/dbug/dbug.c index 1e18fb3eab0..33971d5523a 100644 --- a/dbug/dbug.c +++ b/dbug/dbug.c @@ -75,7 +75,7 @@ * (the logic is - think of a call stack as of a path. * "function" means only this function, "function/" means the hierarchy. * in the future, filters like function1/function2 could be supported. - * wildcards are a natural extension too: * and ?) + * following this logic glob(7) wildcards are supported.) * */ @@ -88,6 +88,13 @@ #include <my_global.h> #include <m_string.h> #include <errno.h> + +#ifdef HAVE_FNMATCH_H +#include <fnmatch.h> +#else +#define fnmatch(A,B,C) strcmp(A,B) +#endif + #if defined(MSDOS) || defined(__WIN__) #include <process.h> #endif @@ -1547,7 +1554,7 @@ static int InList(struct link *linkp, const char *cp) for (result=MATCHED; linkp != NULL; linkp= linkp->next_link) { - if (!strcmp(linkp->str, cp)) + if (!fnmatch(linkp->str, cp, 0)) return linkp->flags; if (!(linkp->flags & EXCLUDE)) result=NOT_MATCHED; |