Skip to content

Commit e02e812

Browse files
committed
Make sure we spawn the best matching executable and not the first match
Fixes: #1632
1 parent 41a326b commit e02e812

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎src/spawn.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ find_exec ( const char *name, char *out, size_t len )
211211
if (!S_ISREG(st.st_mode) || !(st.st_mode & S_IEXEC)) continue;
212212
strlcpy(out, bin, len);
213213
ret = 1;
214-
break;
214+
if(strcmp(de->d_name, name) == 0) break; // Exact match, it won't get any better
215215
}
216216
closedir(dir);
217217
}

0 commit comments

Comments
 (0)