From: Flole998 Date: Tue, 20 Feb 2024 19:53:52 +0000 (+0000) Subject: Make sure we spawn the best matching executable and not the first match X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e02e812ee550e93cd0aacaa9677036d977c1d94b;p=thirdparty%2Ftvheadend.git Make sure we spawn the best matching executable and not the first match Fixes: #1632 --- diff --git a/src/spawn.c b/src/spawn.c index a491c0690..89b65402c 100644 --- a/src/spawn.c +++ b/src/spawn.c @@ -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); }