diff options
author | Felipe Oliveira Carvalho <felipekde@gmail.com> | 2014-05-08 21:34:46 -0300 |
---|---|---|
committer | Felipe Oliveira Carvalho <felipekde@gmail.com> | 2014-05-19 14:50:23 -0300 |
commit | a80d7e86c1f088c5b68d8e8929cc72a0d9680f76 (patch) | |
tree | cc9cc71ee35fe966779cf6764bd5faabd1186df3 /src/nvim/misc1.c | |
parent | b63d2626ed9e3e38a485b9990a8e65ba59d6906a (diff) | |
download | rneovim-a80d7e86c1f088c5b68d8e8929cc72a0d9680f76.tar.gz rneovim-a80d7e86c1f088c5b68d8e8929cc72a0d9680f76.tar.bz2 rneovim-a80d7e86c1f088c5b68d8e8929cc72a0d9680f76.zip |
Remove NULL/non-NULL tests after calls to vim_str(n)save()
Diffstat (limited to 'src/nvim/misc1.c')
-rw-r--r-- | src/nvim/misc1.c | 23 |
1 files changed, 6 insertions, 17 deletions
diff --git a/src/nvim/misc1.c b/src/nvim/misc1.c index 4f7a78e534..df286c3a07 100644 --- a/src/nvim/misc1.c +++ b/src/nvim/misc1.c @@ -120,8 +120,6 @@ open_line ( * make a copy of the current line so we can mess with it */ saved_line = vim_strsave(ml_get_curline()); - if (saved_line == NULL) /* out of memory! */ - return FALSE; if (State & VREPLACE_FLAG) { /* @@ -137,8 +135,6 @@ open_line ( next_line = vim_strsave(ml_get(curwin->w_cursor.lnum + 1)); else next_line = vim_strsave((char_u *)""); - if (next_line == NULL) /* out of memory! */ - goto theend; /* * In VREPLACE mode, a NL replaces the rest of the line, and starts @@ -918,8 +914,6 @@ open_line ( if (State & VREPLACE_FLAG) { /* Put new line in p_extra */ p_extra = vim_strsave(ml_get_curline()); - if (p_extra == NULL) - goto theend; /* Put back original line */ ml_replace(curwin->w_cursor.lnum, next_line, FALSE); @@ -1743,9 +1737,6 @@ truncate_line ( else newp = vim_strnsave(ml_get(lnum), col); - if (newp == NULL) - return FAIL; - ml_replace(lnum, newp, FALSE); /* mark the buffer as changed and prepare for displaying */ @@ -2874,13 +2865,11 @@ expand_env_esc ( if (p_ssl && var != NULL && vim_strchr(var, '\\') != NULL) { char_u *p = vim_strsave(var); - if (p != NULL) { - if (mustfree) - free(var); - var = p; - mustfree = TRUE; - forward_slash(var); - } + if (mustfree) + free(var); + var = p; + mustfree = TRUE; + forward_slash(var); } #endif @@ -3033,7 +3022,7 @@ char_u *vim_getenv(char_u *name, int *mustfree) /* check that the result is a directory name */ p = vim_strnsave(p, (int)(pend - p)); - if (p != NULL && !os_isdir(p)) { + if (!os_isdir(p)) { free(p); p = NULL; } else { |