From 023e832d409abeed4819807fc219fa532bcbdb03 Mon Sep 17 00:00:00 2001 From: Marco Hinz Date: Sun, 17 Feb 2019 05:00:14 +0100 Subject: vim-patch:8.1.0803: session restore: handle single quotes #9620 Problem: Session file has problem with single quote in file name. (Jon Crowe) Solution: Use a double quoted string. Add a test. https://github.com/vim/vim/commit/ad36a3588d32985ee27bd11aa97e5195ef623158 Fixes https://github.com/neovim/neovim/issues/9618 --- src/nvim/ex_docmd.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/nvim/ex_docmd.c') diff --git a/src/nvim/ex_docmd.c b/src/nvim/ex_docmd.c index 02d96603b7..cda80dad39 100644 --- a/src/nvim/ex_docmd.c +++ b/src/nvim/ex_docmd.c @@ -9391,9 +9391,9 @@ put_view( // Note, if a buffer for that file already exists, use :badd to // edit that buffer, to not lose folding information (:edit resets // folds in other buffers) - if (fputs("if bufexists('", fd) < 0 + if (fputs("if bufexists(\"", fd) < 0 || ses_fname(fd, wp->w_buffer, flagp, false) == FAIL - || fputs("') | buffer ", fd) < 0 + || fputs("\") | buffer ", fd) < 0 || ses_fname(fd, wp->w_buffer, flagp, false) == FAIL || fputs(" | else | edit ", fd) < 0 || ses_fname(fd, wp->w_buffer, flagp, false) == FAIL -- cgit