clang/API: copy "" if orig_save is NULL

orig_save can be NULL if ExpandOne() is misused
if ExpandOne() is first called with mode "WILD_CANCEL" or "WILD_APPLY"
before other modes.
This commit is contained in:
Jan Edmund Lazo 2021-04-02 08:27:53 -04:00
parent 5bfad093b2
commit 4d396271e1
No known key found for this signature in database
GPG Key ID: 64915E6E9F735B15

View File

@ -4093,9 +4093,10 @@ ExpandOne (
}
if (mode == WILD_CANCEL) {
ss = vim_strsave(orig_save);
ss = vim_strsave(orig_save ? orig_save : (char_u *)"");
} else if (mode == WILD_APPLY) {
ss = vim_strsave(findex == -1 ? orig_save : xp->xp_files[findex]);
ss = vim_strsave(findex == -1 ? (orig_save ? orig_save : (char_u *)"") :
xp->xp_files[findex]);
}
/* free old names */