refactor: Replace vim_strrchr() with strrchar() (#8718)

ref #1474
This commit is contained in:
ZviRackover
2018-08-11 17:14:10 +03:00
committed by Justin M. Keyes
parent 6aefae8c4e
commit 22311457ab
7 changed files with 28 additions and 36 deletions

View File

@@ -8607,11 +8607,14 @@ eval_vars (
break;
}
resultlen = STRLEN(result); /* length of new string */
if (src[*usedlen] == '<') { /* remove the file name extension */
++*usedlen;
if ((s = vim_strrchr(result, '.')) != NULL && s >= path_tail(result))
// Length of new string.
resultlen = STRLEN(result);
// Remove the file name extension.
if (src[*usedlen] == '<') {
(*usedlen)++;
if ((s = STRRCHR(result, '.')) != NULL && s >= path_tail(result)) {
resultlen = (size_t)(s - result);
}
} else if (!skip_mod) {
valid |= modify_fname(src, usedlen, &result, &resultbuf, &resultlen);
if (result == NULL) {