]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
Make sure we spawn the best matching executable and not the first match
authorFlole998 <Flole998@users.noreply.github.com>
Tue, 20 Feb 2024 19:53:52 +0000 (19:53 +0000)
committerFlole998 <Flole998@users.noreply.github.com>
Wed, 21 Feb 2024 13:41:02 +0000 (14:41 +0100)
Fixes: #1632
src/spawn.c

index a491c0690e566cd4fe84574d583f6ab1678ba9c7..89b65402c7526b90da40dfda1e1901ed73847b70 100644 (file)
@@ -211,7 +211,7 @@ find_exec ( const char *name, char *out, size_t len )
         if (!S_ISREG(st.st_mode) || !(st.st_mode & S_IEXEC)) continue;
         strlcpy(out, bin, len);
         ret = 1;
-        break;
+        if(strcmp(de->d_name, name) == 0) break; // Exact match, it won't get any better
       }
       closedir(dir);
     }