diff options
author | Justin M. Keyes <justinkz@gmail.com> | 2020-01-26 14:26:01 -0800 |
---|---|---|
committer | Justin M. Keyes <justinkz@gmail.com> | 2020-01-26 17:30:47 -0800 |
commit | 1c3ca4f18fdc403813d8959b49626ac1c99e2c59 (patch) | |
tree | 4f2150ee9703be7ed7c7ea4bd56d21f3eca80eaf /src/nvim/ex_docmd.c | |
parent | c4f4719ced9101195a84b350249ab2a105de627c (diff) | |
download | rneovim-1c3ca4f18fdc403813d8959b49626ac1c99e2c59.tar.gz rneovim-1c3ca4f18fdc403813d8959b49626ac1c99e2c59.tar.bz2 rneovim-1c3ca4f18fdc403813d8959b49626ac1c99e2c59.zip |
mksession: always unix slashes "/" for filepaths
Diffstat (limited to 'src/nvim/ex_docmd.c')
-rw-r--r-- | src/nvim/ex_docmd.c | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/src/nvim/ex_docmd.c b/src/nvim/ex_docmd.c index 79cf1794b1..d87dd29f88 100644 --- a/src/nvim/ex_docmd.c +++ b/src/nvim/ex_docmd.c @@ -8089,6 +8089,10 @@ static void close_redir(void) do { if (FAIL == put_line(fd, (s))) { return FAIL; } } while (0) /// ":mkexrc", ":mkvimrc", ":mkview", ":mksession". +/// +/// Legacy 'sessionoptions' flags SSOP_UNIX, SSOP_SLASH are always enabled. +/// - SSOP_UNIX: line-endings are always LF +/// - SSOP_SLASH: filenames are always written with "/" slash static void ex_mkrc(exarg_T *eap) { FILE *fd; @@ -9112,6 +9116,8 @@ char_u *expand_sfile(char_u *arg) /// Writes commands for restoring the current buffers, for :mksession. /// +/// Legacy 'sessionoptions' flags SSOP_UNIX, SSOP_SLASH are always enabled. +/// /// @param dirnow Current directory name /// @param fd File descriptor to write to /// @@ -9840,12 +9846,10 @@ static char *ses_escape_fname(char *name, unsigned *flagp) char *p; char *sname = (char *)home_replace_save(NULL, (char_u *)name); - if (*flagp & SSOP_SLASH) { - // change all backslashes to forward slashes - for (p = sname; *p != NUL; MB_PTR_ADV(p)) { - if (*p == '\\') { - *p = '/'; - } + // Always SSOP_SLASH: change all backslashes to forward slashes. + for (p = sname; *p != NUL; MB_PTR_ADV(p)) { + if (*p == '\\') { + *p = '/'; } } |