Merge pull request #1867 from elmart/nonnull-deadcode

Remove deadcode due to nonnullret funcs.
This commit is contained in:
Justin M. Keyes 2015-01-26 21:08:52 -05:00
commit 6bc8c7be3a
18 changed files with 147 additions and 231 deletions

View File

@ -390,19 +390,13 @@ char_u *transstr(char_u *s) FUNC_ATTR_NONNULL_RET
return res; return res;
} }
/// Convert the string "str[orglen]" to do ignore-case comparing. Uses the /// Convert the string "str[orglen]" to do ignore-case comparing.
/// current locale. /// Use the current locale.
/// ///
/// When "buf" is NULL returns an allocated string (NULL for out-of-memory). /// When "buf" is NULL, return an allocated string.
/// Otherwise puts the result in "buf[buflen]". /// Otherwise, put the result in buf, limited by buflen, and return buf.
///
/// @param str
/// @param orglen
/// @param buf
/// @param buflen
///
/// @return converted string.
char_u* str_foldcase(char_u *str, int orglen, char_u *buf, int buflen) char_u* str_foldcase(char_u *str, int orglen, char_u *buf, int buflen)
FUNC_ATTR_NONNULL_RET
{ {
garray_T ga; garray_T ga;
int i; int i;

View File

@ -1633,11 +1633,6 @@ change_indent (
* put it back again the way we wanted it. * put it back again the way we wanted it.
*/ */
if (State & VREPLACE_FLAG) { if (State & VREPLACE_FLAG) {
/* If orig_line didn't allocate, just return. At least we did the job,
* even if you can't backspace. */
if (orig_line == NULL)
return;
/* Save new line */ /* Save new line */
new_line = vim_strsave(get_cursor_line_ptr()); new_line = vim_strsave(get_cursor_line_ptr());
@ -2437,14 +2432,12 @@ void ins_compl_show_pum(void)
} }
} }
if (compl_match_array != NULL) {
/* Compute the screen column of the start of the completed text. /* Compute the screen column of the start of the completed text.
* Use the cursor to get all wrapping and other settings right. */ * Use the cursor to get all wrapping and other settings right. */
col = curwin->w_cursor.col; col = curwin->w_cursor.col;
curwin->w_cursor.col = compl_col; curwin->w_cursor.col = compl_col;
pum_display(compl_match_array, compl_match_arraysize, cur); pum_display(compl_match_array, compl_match_arraysize, cur);
curwin->w_cursor.col = col; curwin->w_cursor.col = col;
}
} }
#define DICT_FIRST (1) /* use just first element in "dict" */ #define DICT_FIRST (1) /* use just first element in "dict" */
@ -4135,7 +4128,7 @@ static int ins_compl_use_match(int c)
/* /*
* Do Insert mode completion. * Do Insert mode completion.
* Called when character "c" was typed, which has a meaning for completion. * Called when character "c" was typed, which has a meaning for completion.
* Returns OK if completion was done, FAIL if something failed (out of mem). * Returns OK if completion was done, FAIL if something failed.
*/ */
static int ins_complete(int c) static int ins_complete(int c)
{ {
@ -4236,13 +4229,9 @@ static int ins_complete(int c)
compl_length = curs_col - startcol; compl_length = curs_col - startcol;
} }
if (p_ic) if (p_ic)
compl_pattern = str_foldcase(line + compl_col, compl_pattern = str_foldcase(line + compl_col, compl_length, NULL, 0);
compl_length, NULL, 0);
else else
compl_pattern = vim_strnsave(line + compl_col, compl_pattern = vim_strnsave(line + compl_col, compl_length);
compl_length);
if (compl_pattern == NULL)
return FAIL;
} else if (compl_cont_status & CONT_ADDING) { } else if (compl_cont_status & CONT_ADDING) {
char_u *prefix = (char_u *)"\\<"; char_u *prefix = (char_u *)"\\<";
@ -4309,12 +4298,9 @@ static int ins_complete(int c)
if (compl_length < 0) /* cursor in indent: empty pattern */ if (compl_length < 0) /* cursor in indent: empty pattern */
compl_length = 0; compl_length = 0;
if (p_ic) if (p_ic)
compl_pattern = str_foldcase(line + compl_col, compl_length, compl_pattern = str_foldcase(line + compl_col, compl_length, NULL, 0);
NULL, 0);
else else
compl_pattern = vim_strnsave(line + compl_col, compl_length); compl_pattern = vim_strnsave(line + compl_col, compl_length);
if (compl_pattern == NULL)
return FAIL;
} else if (ctrl_x_mode == CTRL_X_FILES) { } else if (ctrl_x_mode == CTRL_X_FILES) {
/* Go back to just before the first filename character. */ /* Go back to just before the first filename character. */
if (startcol > 0) { if (startcol > 0) {
@ -4331,10 +4317,7 @@ static int ins_complete(int c)
compl_col += startcol; compl_col += startcol;
compl_length = (int)curs_col - startcol; compl_length = (int)curs_col - startcol;
compl_pattern = addstar(line + compl_col, compl_length, compl_pattern = addstar(line + compl_col, compl_length, EXPAND_FILES);
EXPAND_FILES);
if (compl_pattern == NULL)
return FAIL;
} else if (ctrl_x_mode == CTRL_X_CMDLINE) { } else if (ctrl_x_mode == CTRL_X_CMDLINE) {
compl_pattern = vim_strnsave(line, curs_col); compl_pattern = vim_strnsave(line, curs_col);
set_cmd_context(&compl_xp, compl_pattern, set_cmd_context(&compl_xp, compl_pattern,

View File

@ -11628,18 +11628,12 @@ static void f_or(typval_T *argvars, typval_T *rettv)
*/ */
static void f_pathshorten(typval_T *argvars, typval_T *rettv) static void f_pathshorten(typval_T *argvars, typval_T *rettv)
{ {
char_u *p;
rettv->v_type = VAR_STRING; rettv->v_type = VAR_STRING;
p = get_tv_string_chk(&argvars[0]); rettv->vval.v_string = get_tv_string_chk(&argvars[0]);
if (p == NULL) if (!rettv->vval.v_string) {
rettv->vval.v_string = NULL; return;
else {
p = vim_strsave(p);
rettv->vval.v_string = p;
if (p != NULL)
shorten_dir(p);
} }
rettv->vval.v_string = shorten_dir(vim_strsave(rettv->vval.v_string));
} }
/* /*
@ -18168,7 +18162,6 @@ void func_dump_profile(FILE *fd)
--todo; --todo;
fp = HI2UF(hi); fp = HI2UF(hi);
if (fp->uf_profiling) { if (fp->uf_profiling) {
if (sorttab != NULL)
sorttab[st_len++] = fp; sorttab[st_len++] = fp;
if (fp->uf_name[0] == K_SPECIAL) if (fp->uf_name[0] == K_SPECIAL)
@ -18196,7 +18189,7 @@ void func_dump_profile(FILE *fd)
} }
} }
if (sorttab != NULL && st_len > 0) { if (st_len > 0) {
qsort((void *)sorttab, (size_t)st_len, sizeof(ufunc_T *), qsort((void *)sorttab, (size_t)st_len, sizeof(ufunc_T *),
prof_total_cmp); prof_total_cmp);
prof_sort_list(fd, sorttab, st_len, "TOTAL", FALSE); prof_sort_list(fd, sorttab, st_len, "TOTAL", FALSE);

View File

@ -4742,7 +4742,6 @@ void ex_help(exarg_T *eap)
tag = vim_strsave(matches[i]); tag = vim_strsave(matches[i]);
FreeWild(num_matches, matches); FreeWild(num_matches, matches);
/* /*
* Re-use an existing help window or open a new one. * Re-use an existing help window or open a new one.
* Always open a new one for ":tab help". * Always open a new one for ":tab help".
@ -4805,7 +4804,6 @@ void ex_help(exarg_T *eap)
* It is needed for do_tag top open folds under the cursor. */ * It is needed for do_tag top open folds under the cursor. */
KeyTyped = old_KeyTyped; KeyTyped = old_KeyTyped;
if (tag != NULL)
do_tag(tag, DT_HELP, 1, FALSE, TRUE); do_tag(tag, DT_HELP, 1, FALSE, TRUE);
/* Delete the empty buffer if we're not using it. Careful: autocommands /* Delete the empty buffer if we're not using it. Careful: autocommands

View File

@ -8589,8 +8589,6 @@ static char_u *get_view_file(int c)
return NULL; return NULL;
} }
sname = home_replace_save(NULL, curbuf->b_ffname); sname = home_replace_save(NULL, curbuf->b_ffname);
if (sname == NULL)
return NULL;
/* /*
* We want a file name without separators, because we're not going to make * We want a file name without separators, because we're not going to make

View File

@ -3033,12 +3033,10 @@ void tilde_replace(char_u *orig_pat, int num_files, char_u **files)
if (orig_pat[0] == '~' && vim_ispathsep(orig_pat[1])) { if (orig_pat[0] == '~' && vim_ispathsep(orig_pat[1])) {
for (i = 0; i < num_files; ++i) { for (i = 0; i < num_files; ++i) {
p = home_replace_save(NULL, files[i]); p = home_replace_save(NULL, files[i]);
if (p != NULL) {
free(files[i]); free(files[i]);
files[i] = p; files[i] = p;
} }
} }
}
} }
/* /*
@ -3265,6 +3263,7 @@ addstar (
int len, int len,
int context /* EXPAND_FILES etc. */ int context /* EXPAND_FILES etc. */
) )
FUNC_ATTR_NONNULL_RET
{ {
char_u *retval; char_u *retval;
int i, j; int i, j;
@ -3343,7 +3342,6 @@ addstar (
} }
} else { } else {
retval = xmalloc(len + 4); retval = xmalloc(len + 4);
if (retval != NULL) {
STRLCPY(retval, fname, len + 1); STRLCPY(retval, fname, len + 1);
/* /*
@ -3372,7 +3370,6 @@ addstar (
--len; --len;
retval[len] = NUL; retval[len] = NUL;
} }
}
return retval; return retval;
} }
@ -3506,8 +3503,6 @@ expand_cmdline (
/* add star to file name, or convert to regexp if not exp. files. */ /* add star to file name, or convert to regexp if not exp. files. */
xp->xp_pattern_len = (int)(str + col - xp->xp_pattern); xp->xp_pattern_len = (int)(str + col - xp->xp_pattern);
file_str = addstar(xp->xp_pattern, xp->xp_pattern_len, xp->xp_context); file_str = addstar(xp->xp_pattern, xp->xp_pattern_len, xp->xp_context);
if (file_str == NULL)
return EXPAND_UNSUCCESSFUL;
if (p_wic) if (p_wic)
options += WILD_ICASE; options += WILD_ICASE;

View File

@ -28,6 +28,7 @@
#include "nvim/ex_docmd.h" #include "nvim/ex_docmd.h"
#include "nvim/ex_eval.h" #include "nvim/ex_eval.h"
#include "nvim/fold.h" #include "nvim/fold.h"
#include "nvim/func_attr.h"
#include "nvim/getchar.h" #include "nvim/getchar.h"
#include "nvim/hashtab.h" #include "nvim/hashtab.h"
#include "nvim/iconv.h" #include "nvim/iconv.h"
@ -2106,6 +2107,7 @@ void set_forced_fenc(exarg_T *eap)
* When *pp is not set to NULL, the result is in allocated memory. * When *pp is not set to NULL, the result is in allocated memory.
*/ */
static char_u *next_fenc(char_u **pp) static char_u *next_fenc(char_u **pp)
FUNC_ATTR_NONNULL_ALL FUNC_ATTR_NONNULL_RET
{ {
char_u *p; char_u *p;
char_u *r; char_u *r;
@ -2125,10 +2127,6 @@ static char_u *next_fenc(char_u **pp)
free(r); free(r);
r = p; r = p;
} }
if (r == NULL) { /* out of memory */
r = (char_u *)"";
*pp = NULL;
}
return r; return r;
} }
@ -4923,7 +4921,6 @@ buf_check_timestamp (
if (mesg != NULL) { if (mesg != NULL) {
path = home_replace_save(buf, buf->b_fname); path = home_replace_save(buf, buf->b_fname);
if (path != NULL) {
if (!helpmesg) if (!helpmesg)
mesg2 = ""; mesg2 = "";
tbuf = xmalloc(STRLEN(path) + STRLEN(mesg) + STRLEN(mesg2) + 2); tbuf = xmalloc(STRLEN(path) + STRLEN(mesg) + STRLEN(mesg2) + 2);
@ -4939,8 +4936,7 @@ buf_check_timestamp (
if (do_dialog(VIM_WARNING, (char_u *)_("Warning"), tbuf, if (do_dialog(VIM_WARNING, (char_u *)_("Warning"), tbuf,
(char_u *)_("&OK\n&Load File"), 1, NULL, TRUE) == 2) (char_u *)_("&OK\n&Load File"), 1, NULL, TRUE) == 2)
reload = TRUE; reload = TRUE;
} else if (State > NORMAL_BUSY || (State & CMDLINE) || } else if (State > NORMAL_BUSY || (State & CMDLINE) || already_warned) {
already_warned) {
if (*mesg2 != NUL) { if (*mesg2 != NUL) {
STRCAT(tbuf, "; "); STRCAT(tbuf, "; ");
STRCAT(tbuf, mesg2); STRCAT(tbuf, mesg2);
@ -4971,7 +4967,6 @@ buf_check_timestamp (
free(path); free(path);
free(tbuf); free(tbuf);
} }
}
if (reload) { if (reload) {
/* Reload the buffer. */ /* Reload the buffer. */

View File

@ -1649,7 +1649,6 @@ static void cs_print_tags_priv(char **matches, char **cntxts, int num_matches)
char *cntxformat = " <<%s>>"; char *cntxformat = " <<%s>>";
char *context; char *context;
char *cstag_msg = _("Cscope tag: %s"); char *cstag_msg = _("Cscope tag: %s");
char *csfmt_str = "%4d %6s ";
assert (num_matches > 0); assert (num_matches > 0);
@ -1691,17 +1690,15 @@ static void cs_print_tags_priv(char **matches, char **cntxts, int num_matches)
lno[strlen(lno)-2] = '\0'; /* ignore ;" at the end */ lno[strlen(lno)-2] = '\0'; /* ignore ;" at the end */
const char *csfmt_str = "%4d %6s ";
/* hopefully 'num' (num of matches) will be less than 10^16 */ /* hopefully 'num' (num of matches) will be less than 10^16 */
newsize = strlen(csfmt_str) + 16 + strlen(lno); newsize = strlen(csfmt_str) + 16 + strlen(lno);
if (bufsize < newsize) { if (bufsize < newsize) {
buf = xrealloc(buf, newsize); buf = xrealloc(buf, newsize);
bufsize = newsize; bufsize = newsize;
} }
if (buf != NULL) {
/* csfmt_str = "%4d %6s "; */
(void)sprintf(buf, csfmt_str, num, lno); (void)sprintf(buf, csfmt_str, num, lno);
MSG_PUTS_ATTR(buf, hl_attr(HLF_CM)); MSG_PUTS_ATTR(buf, hl_attr(HLF_CM));
}
MSG_PUTS_LONG_ATTR(cs_pathcomponents(fname), hl_attr(HLF_CM)); MSG_PUTS_LONG_ATTR(cs_pathcomponents(fname), hl_attr(HLF_CM));
/* compute the required space for the context */ /* compute the required space for the context */
@ -1715,7 +1712,6 @@ static void cs_print_tags_priv(char **matches, char **cntxts, int num_matches)
buf = xrealloc(buf, newsize); buf = xrealloc(buf, newsize);
bufsize = newsize; bufsize = newsize;
} }
if (buf != NULL) {
(void)sprintf(buf, cntxformat, context); (void)sprintf(buf, cntxformat, context);
/* print the context only if it fits on the same line */ /* print the context only if it fits on the same line */
@ -1724,7 +1720,6 @@ static void cs_print_tags_priv(char **matches, char **cntxts, int num_matches)
msg_advance(12); msg_advance(12);
MSG_PUTS_LONG(buf); MSG_PUTS_LONG(buf);
msg_putchar('\n'); msg_putchar('\n');
}
if (extra != NULL) { if (extra != NULL) {
msg_advance(13); msg_advance(13);
MSG_PUTS_LONG(extra); MSG_PUTS_LONG(extra);

View File

@ -1593,8 +1593,6 @@ int get_c_indent(void)
* This is required, because only the most recent line obtained with * This is required, because only the most recent line obtained with
* ml_get is valid! */ * ml_get is valid! */
linecopy = vim_strsave(ml_get(cur_curpos.lnum)); linecopy = vim_strsave(ml_get(cur_curpos.lnum));
if (linecopy == NULL)
return 0;
/* /*
* In insert mode and the cursor is on a ')' truncate the line at the * In insert mode and the cursor is on a ')' truncate the line at the

View File

@ -506,8 +506,6 @@ void fmarks_check_names(buf_T *buf)
return; return;
name = home_replace_save(buf, buf->b_ffname); name = home_replace_save(buf, buf->b_ffname);
if (name == NULL)
return;
for (i = 0; i < NMARKS + EXTRA_MARKS; ++i) for (i = 0; i < NMARKS + EXTRA_MARKS; ++i)
fmarks_check_one(&namedfm[i], name, buf); fmarks_check_one(&namedfm[i], name, buf);
@ -1327,7 +1325,6 @@ int removable(char_u *name)
size_t n; size_t n;
name = home_replace_save(NULL, name); name = home_replace_save(NULL, name);
if (name != NULL) {
for (p = p_viminfo; *p; ) { for (p = p_viminfo; *p; ) {
copy_option_part(&p, part, 51, ", "); copy_option_part(&p, part, 51, ", ");
if (part[0] == 'r') { if (part[0] == 'r') {
@ -1339,7 +1336,6 @@ int removable(char_u *name)
} }
} }
free(name); free(name);
}
return retval; return retval;
} }
@ -1451,8 +1447,6 @@ void copy_viminfo_marks(vir_T *virp, FILE *fp_out, int count, int eof, int flags
*/ */
str = skipwhite(line + 1); str = skipwhite(line + 1);
str = viminfo_readstring(virp, (int)(str - virp->vir_line), FALSE); str = viminfo_readstring(virp, (int)(str - virp->vir_line), FALSE);
if (str == NULL)
continue;
p = str + STRLEN(str); p = str + STRLEN(str);
while (p != str && (*p == NUL || vim_isspace(*p))) while (p != str && (*p == NUL || vim_isspace(*p)))
p--; p--;

View File

@ -1240,10 +1240,8 @@ theend:
mf_put(mfp, hp, false, false); mf_put(mfp, hp, false, false);
mf_close(mfp, false); /* will also free(mfp->mf_fname) */ mf_close(mfp, false); /* will also free(mfp->mf_fname) */
} }
if (buf != NULL) {
free(buf->b_ml.ml_stack); free(buf->b_ml.ml_stack);
free(buf); free(buf);
}
if (serious_error && called_from_main) if (serious_error && called_from_main)
ml_close(curbuf, TRUE); ml_close(curbuf, TRUE);
else { else {
@ -3279,9 +3277,6 @@ findswapname (
/* /*
* we try different names until we find one that does not exist yet * we try different names until we find one that does not exist yet
*/ */
if (dir_name == NULL) /* out of memory */
fname = NULL;
else
fname = makeswapname(buf_fname, buf->b_ffname, buf, dir_name); fname = makeswapname(buf_fname, buf->b_ffname, buf, dir_name);
for (;; ) { for (;; ) {

View File

@ -1083,7 +1083,6 @@ static void msg_home_replace_attr(char_u *fname, int attr)
char_u *name; char_u *name;
name = home_replace_save(NULL, fname); name = home_replace_save(NULL, fname);
if (name != NULL)
msg_outtrans_attr(name, attr); msg_outtrans_attr(name, attr);
free(name); free(name);
} }

View File

@ -3466,8 +3466,6 @@ get_cmd_output (
i = (int)fread((char *)buffer, (size_t)1, (size_t)len, fd); i = (int)fread((char *)buffer, (size_t)1, (size_t)len, fd);
fclose(fd); fclose(fd);
os_remove((char *)tempname); os_remove((char *)tempname);
if (buffer == NULL)
goto done;
if (i != len) { if (i != len) {
EMSG2(_(e_notread), tempname); EMSG2(_(e_notread), tempname);
free(buffer); free(buffer);

View File

@ -239,33 +239,31 @@ int vim_ispathlistsep(int c)
* Shorten the path of a file from "~/foo/../.bar/fname" to "~/f/../.b/fname" * Shorten the path of a file from "~/foo/../.bar/fname" to "~/f/../.b/fname"
* It's done in-place. * It's done in-place.
*/ */
void shorten_dir(char_u *str) char_u *shorten_dir(char_u *str)
{ {
char_u *tail, *s, *d; char_u *tail = path_tail(str);
int skip = FALSE; char_u *d = str;
bool skip = false;
tail = path_tail(str); for (char_u *s = str;; ++s) {
d = str;
for (s = str;; ++s) {
if (s >= tail) { /* copy the whole tail */ if (s >= tail) { /* copy the whole tail */
*d++ = *s; *d++ = *s;
if (*s == NUL) if (*s == NUL)
break; break;
} else if (vim_ispathsep(*s)) { /* copy '/' and next char */ } else if (vim_ispathsep(*s)) { /* copy '/' and next char */
*d++ = *s; *d++ = *s;
skip = FALSE; skip = false;
} else if (!skip) { } else if (!skip) {
*d++ = *s; /* copy next char */ *d++ = *s; /* copy next char */
if (*s != '~' && *s != '.') /* and leading "~" and "." */ if (*s != '~' && *s != '.') /* and leading "~" and "." */
skip = TRUE; skip = true;
if (has_mbyte) { if (has_mbyte) {
int l = mb_ptr2len(s); int l = mb_ptr2len(s);
while (--l > 0) while (--l > 0)
*d++ = *++s; *d++ = *++s;
} }
} }
} }
return str;
} }
/* /*
@ -883,11 +881,9 @@ static void uniquefy_paths(garray_T *gap, char_u *pattern)
} }
free(curdir); free(curdir);
if (in_curdir != NULL) {
for (int i = 0; i < gap->ga_len; i++) for (int i = 0; i < gap->ga_len; i++)
free(in_curdir[i]); free(in_curdir[i]);
free(in_curdir); free(in_curdir);
}
ga_clear_strings(&path_ga); ga_clear_strings(&path_ga);
vim_regfree(regmatch.regprog); vim_regfree(regmatch.regprog);

View File

@ -370,17 +370,13 @@ void pum_redraw(void)
size++; size++;
} }
} }
screen_puts_len(rt, (int)STRLEN(rt), row, col - size + 1, screen_puts_len(rt, (int)STRLEN(rt), row, col - size + 1, attr);
attr);
free(rt_start); free(rt_start);
free(st); free(st);
col -= width; col -= width;
} else { } else {
if (st != NULL) {
screen_puts_len(st, (int)STRLEN(st), row, col, attr); screen_puts_len(st, (int)STRLEN(st), row, col, attr);
free(st); free(st);
}
col += width; col += width;
} }

View File

@ -7795,7 +7795,7 @@ static void draw_tabline(void)
if (room > 0) { if (room > 0) {
/* Get buffer name in NameBuff[] */ /* Get buffer name in NameBuff[] */
get_trans_bufname(cwp->w_buffer); get_trans_bufname(cwp->w_buffer);
shorten_dir(NameBuff); (void)shorten_dir(NameBuff);
len = vim_strsize(NameBuff); len = vim_strsize(NameBuff);
p = NameBuff; p = NameBuff;
if (has_mbyte) if (has_mbyte)

View File

@ -4025,8 +4025,6 @@ find_pattern_in_path (
def_regmatch.rm_ic = FALSE; /* don't ignore case in define pat. */ def_regmatch.rm_ic = FALSE; /* don't ignore case in define pat. */
} }
files = xcalloc(max_path_depth, sizeof(SearchedFile)); files = xcalloc(max_path_depth, sizeof(SearchedFile));
if (files == NULL)
goto fpip_end;
old_files = max_path_depth; old_files = max_path_depth;
depth = depth_displayed = -1; depth = depth_displayed = -1;
@ -4627,9 +4625,7 @@ int read_viminfo_search_pattern(vir_T *virp, int force)
hlsearch_on = TRUE; hlsearch_on = TRUE;
if (idx >= 0) { if (idx >= 0) {
if (force || spats[idx].pat == NULL) { if (force || spats[idx].pat == NULL) {
val = viminfo_readstring(virp, (int)(lp - virp->vir_line + 1), val = viminfo_readstring(virp, (int)(lp - virp->vir_line + 1), TRUE);
TRUE);
if (val != NULL) {
set_last_search_pat(val, idx, magic, setlast); set_last_search_pat(val, idx, magic, setlast);
free(val); free(val);
spats[idx].no_scs = no_scs; spats[idx].no_scs = no_scs;
@ -4641,7 +4637,6 @@ int read_viminfo_search_pattern(vir_T *virp, int force)
} }
} }
} }
}
return viminfo_readline(virp); return viminfo_readline(virp);
} }

View File

@ -4545,11 +4545,9 @@ static afffile_T *spell_read_aff(spellinfo_T *spin, char_u *fname)
// Turn flag "c" into COMPOUNDRULE compatible string "c+", // Turn flag "c" into COMPOUNDRULE compatible string "c+",
// "Na" into "Na+", "1234" into "1234+". // "Na" into "Na+", "1234" into "1234+".
p = getroom(spin, STRLEN(items[1]) + 2, false); p = getroom(spin, STRLEN(items[1]) + 2, false);
if (p != NULL) {
STRCPY(p, items[1]); STRCPY(p, items[1]);
STRCAT(p, "+"); STRCAT(p, "+");
compflags = p; compflags = p;
}
} else if (is_aff_rule(items, itemcnt, "COMPOUNDRULES", 2)) { } else if (is_aff_rule(items, itemcnt, "COMPOUNDRULES", 2)) {
// We don't use the count, but do check that it's a number and // We don't use the count, but do check that it's a number and
// not COMPOUNDRULE mistyped. // not COMPOUNDRULE mistyped.
@ -4565,7 +4563,6 @@ static afffile_T *spell_read_aff(spellinfo_T *spin, char_u *fname)
if (compflags != NULL) if (compflags != NULL)
l += (int)STRLEN(compflags) + 1; l += (int)STRLEN(compflags) + 1;
p = getroom(spin, l, false); p = getroom(spin, l, false);
if (p != NULL) {
if (compflags != NULL) { if (compflags != NULL) {
STRCPY(p, compflags); STRCPY(p, compflags);
STRCAT(p, "/"); STRCAT(p, "/");
@ -4573,7 +4570,6 @@ static afffile_T *spell_read_aff(spellinfo_T *spin, char_u *fname)
STRCAT(p, items[1]); STRCAT(p, items[1]);
compflags = p; compflags = p;
} }
}
} else if (is_aff_rule(items, itemcnt, "COMPOUNDWORDMAX", 2) } else if (is_aff_rule(items, itemcnt, "COMPOUNDWORDMAX", 2)
&& compmax == 0) { && compmax == 0) {
compmax = atoi((char *)items[1]); compmax = atoi((char *)items[1]);
@ -5199,8 +5195,6 @@ static void process_compflags(spellinfo_T *spin, afffile_T *aff, char_u *compfla
if (spin->si_compflags != NULL) if (spin->si_compflags != NULL)
len += (int)STRLEN(spin->si_compflags) + 1; len += (int)STRLEN(spin->si_compflags) + 1;
p = getroom(spin, len, false); p = getroom(spin, len, false);
if (p == NULL)
return;
if (spin->si_compflags != NULL) { if (spin->si_compflags != NULL) {
STRCPY(p, spin->si_compflags); STRCPY(p, spin->si_compflags);
STRCAT(p, "/"); STRCAT(p, "/");