aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJames McCoy <jamessan@jamessan.com>2017-04-07 16:38:06 -0400
committerJames McCoy <jamessan@jamessan.com>2017-04-07 16:38:06 -0400
commit123931e65e8f6ca3ac13fff8279720c8328a018e (patch)
tree1f83acdac4c61866ac59f22fabe0d8d77597ed7b
parent98dd9b801281bb6eb82817ba92c4f635bb5f45e0 (diff)
downloadrneovim-123931e65e8f6ca3ac13fff8279720c8328a018e.tar.gz
rneovim-123931e65e8f6ca3ac13fff8279720c8328a018e.tar.bz2
rneovim-123931e65e8f6ca3ac13fff8279720c8328a018e.zip
lint
-rw-r--r--src/nvim/eval.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/nvim/eval.c b/src/nvim/eval.c
index e15d6c0240..124d6acfe9 100644
--- a/src/nvim/eval.c
+++ b/src/nvim/eval.c
@@ -8729,8 +8729,9 @@ static void f_foldtextresult(typval_T *argvars, typval_T *rettv, FunPtr fptr)
fold_count = foldedCount(curwin, lnum, &foldinfo);
if (fold_count > 0) {
text = get_foldtext(curwin, lnum, lnum + fold_count - 1, &foldinfo, buf);
- if (text == buf)
+ if (text == buf) {
text = vim_strsave(text);
+ }
rettv->vval.v_string = text;
}
}