> + notmuch_bool_t ret = FALSE; > + > + if (strchr(exename, '/')) { > + if (0 == access(exename, X_OK)) > + return TRUE; > + else > + return FALSE; > + } > + > + c = getenv("PATH"); > + if (c) > + c = talloc_strdup(NULL, c); Is there some advantage to using the talloc_ functions here? > + else { Is n needed outside this block? if not, it could be declared here (and then I don't care about the single letter name). > + n = confstr(_CS_PATH, NULL, 0); according to a glance at the man page, this might return 0 if there is no value for _CS_PATH set? > + > + tok = strtok_r(c, ":", &save); > + while (tok) { same comment about block local declaration of dfd > + dfd = open(tok, O_DIRECTORY | O_RDONLY); > + tok = strtok_r(NULL, ":", &save); not sure if it helps, but there is also strtok_len in libutil > +done: as a real nitpick, we have always (?) used DONE for a label.