]> git.ipfire.org Git - thirdparty/libsolv.git/commitdiff
always call selection_filelist if SELECTION_FILELIST is set
authorMichael Schroeder <mls@suse.de>
Mon, 14 Jul 2014 11:37:18 +0000 (13:37 +0200)
committerMichael Schroeder <mls@suse.de>
Mon, 14 Jul 2014 11:37:18 +0000 (13:37 +0200)
Also checks for impossible matches in selection_filelist.

src/selection.c

index f0e61ea4bdd5f9268da0c62d473a8533a66ffc42..8856436f3d3a2c1d9c7acf02863457324cd086d8 100644 (file)
@@ -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);