Merge branch 'rexy712' into rexy712-color

This commit is contained in:
rexy712 2022-07-15 16:40:12 -07:00
commit f7fcc96a04

View File

@ -1380,8 +1380,9 @@ char *get_full_path(const char *origpath)
}
}
/* Ensure that a directory path ends with a slash. */
if (target && stat(target, &fileinfo) == 0 && S_ISDIR(fileinfo.st_mode)) {
/* Ensure that a non-apex directory path ends with a slash. */
if (target && target[1] && stat(target, &fileinfo) == 0 &&
S_ISDIR(fileinfo.st_mode)) {
target = nrealloc(target, strlen(target) + 2);
strcat(target, "/");
}