memory: xstrchrnul and xmemscan.

This commit is contained in:
Scott Prager
2014-09-05 04:25:34 -04:00
parent afe7ba1e71
commit eff839b26d
4 changed files with 34 additions and 10 deletions

View File

@@ -134,10 +134,7 @@ static bool is_executable_in_path(const char_u *name, char_u **abspath)
// Walk through all entries in $PATH to check if "name" exists there and
// is an executable file.
for (;; ) {
const char *e = strchr(path, ':');
if (e == NULL) {
e = path + STRLEN(path);
}
const char *e = xstrchrnul(path, ':');
// Glue together the given directory from $PATH with name and save into
// buf.