From: Michael Schroeder Date: Mon, 14 Jul 2014 11:37:18 +0000 (+0200) Subject: always call selection_filelist if SELECTION_FILELIST is set X-Git-Tag: 0.6.5~12 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2a5c1c4f79ae4d8d414f4305660cd43af8079bd1;p=thirdparty%2Flibsolv.git always call selection_filelist if SELECTION_FILELIST is set Also checks for impossible matches in selection_filelist. --- diff --git a/src/selection.c b/src/selection.c index f0e61ea4..8856436f 100644 --- a/src/selection.c +++ b/src/selection.c @@ -551,6 +551,14 @@ selection_filelist(Pool *pool, Queue *selection, const char *name, int flags) Queue q; int type; + /* all files in the file list start with a '/' */ + if (*name != '/') + { + if (!(flags & SELECTION_GLOB)) + return 0; + if (*name != '*' && *name != '[' && *name != '?') + return 0; + } type = !(flags & SELECTION_GLOB) || strpbrk(name, "[*?") == 0 ? SEARCH_STRING : SEARCH_GLOB; if ((flags & SELECTION_NOCASE) != 0) type |= SEARCH_NOCASE; @@ -842,7 +850,7 @@ selection_make(Pool *pool, Queue *selection, const char *name, int flags) int ret = 0; queue_empty(selection); - if (*name == '/' && (flags & SELECTION_FILELIST)) + if ((flags & SELECTION_FILELIST) != 0) ret = selection_filelist(pool, selection, name, flags); if (!ret && (flags & SELECTION_REL) != 0 && strpbrk(name, "<=>") != 0) ret = selection_rel(pool, selection, name, flags);