Deal with NULL or empty input for expand_path_tokens()

_krb5_expand_path_tokens() should return an empty string if the input
string is empty or NULL, instead of always returning a NULL for these
two cases.
This commit is contained in:
Asanka Herath
2010-08-26 16:23:42 -04:00
committed by Asanka C. Herath
parent e8e56defaf
commit ff9cb6572d

View File

@@ -407,6 +407,11 @@ _krb5_expand_path_tokens(krb5_context context,
const char *path_left;
size_t len = 0;
if (path_in == NULL || *path_in == '\0') {
*ppath_out = strdup("");
return 0;
}
*ppath_out = NULL;
for (path_left = path_in; path_left && *path_left; ) {