We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 964a5a1 commit ceee0e7Copy full SHA for ceee0e7
unixlauncher.c
@@ -31,8 +31,7 @@ static char *which(const char *const executable) {
31
dirs[dirs_length] = ':';
32
33
size_t dir_head = 0;
34
- size_t i = 0;
35
- do {
+ for (size_t i = 0; i <= dirs_length; i++) {
36
if (dirs[i] == ':') {
37
// Declare convenient path variables
38
char *const dir = dirs + dir_head;
@@ -59,7 +58,7 @@ static char *which(const char *const executable) {
59
58
60
dir_head = i + 1;
61
}
62
- } while (dirs[i++]);
+ };
63
64
// Lookup has failed, free if necessary and return NULL
65
if (exe_path != NULL) {
0 commit comments