Prevent a deadloop in PATH handling

Empty PATH segments should no longer cause
a deadloop.

Fixes #59
This commit is contained in:
Thomas Kerpe 2019-06-05 15:59:16 +02:00
parent 572470ef8c
commit 5d787629a5

View File

@ -66,6 +66,8 @@ get_paths(const char *env, const char *default_paths, struct paths *state)
if ((f = strcspn(state->path, ":")) > 0) {
state->path += f + (path[f] ? 1 : 0);
path[f] = 0;
} else {
state->path += 1;
}
if (!*path) {