This commit is contained in:
Jan Edmund Lazo 2019-05-25 20:42:22 -04:00
parent f60af8694b
commit 58d6e2d3cc
2 changed files with 4 additions and 3 deletions

View File

@ -8609,7 +8609,7 @@ eval_vars (
case SPEC_PERC: /* '%': current file */
if (curbuf->b_fname == NULL) {
result = (char_u *)"";
valid = 0; /* Must have ":p:h" to be valid */
valid = 0; // Must have ":p:h" to be valid
} else {
result = curbuf->b_fname;
tilde_file = STRCMP(result, "~") == 0;
@ -8662,7 +8662,7 @@ eval_vars (
*lnump = ECMD_LAST;
if (buf->b_fname == NULL) {
result = (char_u *)"";
valid = 0; /* Must have ":p:h" to be valid */
valid = 0; // Must have ":p:h" to be valid
} else {
result = buf->b_fname;
tilde_file = STRCMP(result, "~") == 0;

View File

@ -427,8 +427,9 @@ cs_add_common(
fbuf = (char_u *)fname;
(void)modify_fname((char_u *)":p", false, &usedlen,
(char_u **)&fname, &fbuf, &len);
if (fname == NULL)
if (fname == NULL) {
goto add_err;
}
fname = (char *)vim_strnsave((char_u *)fname, len);
xfree(fbuf);
FileInfo file_info;