]> git.ipfire.org Git - thirdparty/dracut.git/commitdiff
perf(dracut-install): multiple single-character strstr()s -> strpbrk()
authorнаб <nabijaczleweli@nabijaczleweli.xyz>
Tue, 26 Apr 2022 15:13:55 +0000 (17:13 +0200)
committerAntonio Álvarez Feijoo <antonio.feijoo@suse.com>
Wed, 28 Dec 2022 15:37:51 +0000 (16:37 +0100)
src/install/dracut-install.c

index 96b20e916d358103bab367c6a1e581ae9b163d0c..5423912da2712b8c90b737536cecbe5da57d4cef 100644 (file)
@@ -1420,7 +1420,7 @@ static int install_firmware(struct kmod_module *mod)
 
                         _asprintf(&fwpath, "%s/%s", *q, value);
 
-                        if ((strstr(value, "*") != 0 || strstr(value, "?") != 0 || strstr(value, "[") != 0)
+                        if (strpbrk(value, "*?[") != NULL
                             && stat(fwpath, &sb) != 0) {
                                 size_t i;
                                 _cleanup_globfree_ glob_t globbuf;