aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorEliseo Martínez <eliseomarmol@gmail.com>2015-01-23 14:18:36 +0100
committerEliseo Martínez <eliseomarmol@gmail.com>2015-01-27 01:33:31 +0100
commit8d6778a4d150e31659c93e61e441a6209572b534 (patch)
tree9e89de1c444f6f5ae3e8996d5fc3f776ba7f4f98 /src
parentd4d569d5614f4cbca2d816c60fde1a435ae6463a (diff)
downloadrneovim-8d6778a4d150e31659c93e61e441a6209572b534.tar.gz
rneovim-8d6778a4d150e31659c93e61e441a6209572b534.tar.bz2
rneovim-8d6778a4d150e31659c93e61e441a6209572b534.zip
Remove nonnullret deadcode: home_replace_save.
Diffstat (limited to 'src')
-rw-r--r--src/nvim/ex_docmd.c2
-rw-r--r--src/nvim/ex_getln.c6
-rw-r--r--src/nvim/fileio.c87
-rw-r--r--src/nvim/mark.c20
-rw-r--r--src/nvim/message.c3
5 files changed, 53 insertions, 65 deletions
diff --git a/src/nvim/ex_docmd.c b/src/nvim/ex_docmd.c
index 065c27013e..f6527db69b 100644
--- a/src/nvim/ex_docmd.c
+++ b/src/nvim/ex_docmd.c
@@ -8589,8 +8589,6 @@ static char_u *get_view_file(int c)
return NULL;
}
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
diff --git a/src/nvim/ex_getln.c b/src/nvim/ex_getln.c
index f1e53952e8..a4e8fccc23 100644
--- a/src/nvim/ex_getln.c
+++ b/src/nvim/ex_getln.c
@@ -3033,10 +3033,8 @@ void tilde_replace(char_u *orig_pat, int num_files, char_u **files)
if (orig_pat[0] == '~' && vim_ispathsep(orig_pat[1])) {
for (i = 0; i < num_files; ++i) {
p = home_replace_save(NULL, files[i]);
- if (p != NULL) {
- free(files[i]);
- files[i] = p;
- }
+ free(files[i]);
+ files[i] = p;
}
}
}
diff --git a/src/nvim/fileio.c b/src/nvim/fileio.c
index 98eeeeab05..863e44ed9c 100644
--- a/src/nvim/fileio.c
+++ b/src/nvim/fileio.c
@@ -4921,54 +4921,51 @@ buf_check_timestamp (
if (mesg != NULL) {
path = home_replace_save(buf, buf->b_fname);
- if (path != NULL) {
- if (!helpmesg)
- mesg2 = "";
- tbuf = xmalloc(STRLEN(path) + STRLEN(mesg) + STRLEN(mesg2) + 2);
- sprintf((char *)tbuf, mesg, path);
- /* Set warningmsg here, before the unimportant and output-specific
- * mesg2 has been appended. */
- set_vim_var_string(VV_WARNINGMSG, tbuf, -1);
- if (can_reload) {
- if (*mesg2 != NUL) {
- STRCAT(tbuf, "\n");
- STRCAT(tbuf, mesg2);
- }
- if (do_dialog(VIM_WARNING, (char_u *)_("Warning"), tbuf,
- (char_u *)_("&OK\n&Load File"), 1, NULL, TRUE) == 2)
- reload = TRUE;
- } else if (State > NORMAL_BUSY || (State & CMDLINE) ||
- already_warned) {
- if (*mesg2 != NUL) {
- STRCAT(tbuf, "; ");
- STRCAT(tbuf, mesg2);
- }
- EMSG(tbuf);
- retval = 2;
- } else {
- if (!autocmd_busy) {
- msg_start();
- msg_puts_attr(tbuf, hl_attr(HLF_E) + MSG_HIST);
- if (*mesg2 != NUL)
- msg_puts_attr((char_u *)mesg2,
- hl_attr(HLF_W) + MSG_HIST);
- msg_clr_eos();
- (void)msg_end();
- if (emsg_silent == 0) {
- out_flush();
- /* give the user some time to think about it */
- os_delay(1000L, true);
-
- /* don't redraw and erase the message */
- redraw_cmdline = FALSE;
- }
- }
- already_warned = TRUE;
+ if (!helpmesg)
+ mesg2 = "";
+ tbuf = xmalloc(STRLEN(path) + STRLEN(mesg) + STRLEN(mesg2) + 2);
+ sprintf((char *)tbuf, mesg, path);
+ /* Set warningmsg here, before the unimportant and output-specific
+ * mesg2 has been appended. */
+ set_vim_var_string(VV_WARNINGMSG, tbuf, -1);
+ if (can_reload) {
+ if (*mesg2 != NUL) {
+ STRCAT(tbuf, "\n");
+ STRCAT(tbuf, mesg2);
}
+ if (do_dialog(VIM_WARNING, (char_u *)_("Warning"), tbuf,
+ (char_u *)_("&OK\n&Load File"), 1, NULL, TRUE) == 2)
+ reload = TRUE;
+ } else if (State > NORMAL_BUSY || (State & CMDLINE) || already_warned) {
+ if (*mesg2 != NUL) {
+ STRCAT(tbuf, "; ");
+ STRCAT(tbuf, mesg2);
+ }
+ EMSG(tbuf);
+ retval = 2;
+ } else {
+ if (!autocmd_busy) {
+ msg_start();
+ msg_puts_attr(tbuf, hl_attr(HLF_E) + MSG_HIST);
+ if (*mesg2 != NUL)
+ msg_puts_attr((char_u *)mesg2,
+ hl_attr(HLF_W) + MSG_HIST);
+ msg_clr_eos();
+ (void)msg_end();
+ if (emsg_silent == 0) {
+ out_flush();
+ /* give the user some time to think about it */
+ os_delay(1000L, true);
- free(path);
- free(tbuf);
+ /* don't redraw and erase the message */
+ redraw_cmdline = FALSE;
+ }
+ }
+ already_warned = TRUE;
}
+
+ free(path);
+ free(tbuf);
}
if (reload) {
diff --git a/src/nvim/mark.c b/src/nvim/mark.c
index cfc702f189..74f3f8bdbf 100644
--- a/src/nvim/mark.c
+++ b/src/nvim/mark.c
@@ -506,8 +506,6 @@ void fmarks_check_names(buf_T *buf)
return;
name = home_replace_save(buf, buf->b_ffname);
- if (name == NULL)
- return;
for (i = 0; i < NMARKS + EXTRA_MARKS; ++i)
fmarks_check_one(&namedfm[i], name, buf);
@@ -1327,19 +1325,17 @@ int removable(char_u *name)
size_t n;
name = home_replace_save(NULL, name);
- if (name != NULL) {
- for (p = p_viminfo; *p; ) {
- copy_option_part(&p, part, 51, ", ");
- if (part[0] == 'r') {
- n = STRLEN(part + 1);
- if (MB_STRNICMP(part + 1, name, n) == 0) {
- retval = TRUE;
- break;
- }
+ for (p = p_viminfo; *p; ) {
+ copy_option_part(&p, part, 51, ", ");
+ if (part[0] == 'r') {
+ n = STRLEN(part + 1);
+ if (MB_STRNICMP(part + 1, name, n) == 0) {
+ retval = TRUE;
+ break;
}
}
- free(name);
}
+ free(name);
return retval;
}
diff --git a/src/nvim/message.c b/src/nvim/message.c
index 9cd3814826..87b0253d70 100644
--- a/src/nvim/message.c
+++ b/src/nvim/message.c
@@ -1083,8 +1083,7 @@ static void msg_home_replace_attr(char_u *fname, int attr)
char_u *name;
name = home_replace_save(NULL, fname);
- if (name != NULL)
- msg_outtrans_attr(name, attr);
+ msg_outtrans_attr(name, attr);
free(name);
}