comparison src/os_unix.c @ 12343:72046661f6d0 v8.0.1051

patch 8.0.1051: cannot run terminal with spaces in argument commit https://github.com/vim/vim/commit/9d654a8d8cd3421307445f111785fb303a38c2a0 Author: Bram Moolenaar <Bram@vim.org> Date: Sun Sep 3 19:52:17 2017 +0200 patch 8.0.1051: cannot run terminal with spaces in argument Problem: Cannot run terminal with spaces in argument. Solution: Accept backslash to escape space and other characters. (closes #1999)
author Christian Brabandt <cb@256bit.org>
date Sun, 03 Sep 2017 20:00:04 +0200
parents 50b0b3aaa545
children d7f087d1b0e5
comparison
equal deleted inserted replaced
12342:0e49fefc0769 12343:72046661f6d0
4092 if (i == 1) 4092 if (i == 1)
4093 (*argv)[*argc] = (char *)p; 4093 (*argv)[*argc] = (char *)p;
4094 ++*argc; 4094 ++*argc;
4095 while (*p != NUL && (inquote || (*p != ' ' && *p != TAB))) 4095 while (*p != NUL && (inquote || (*p != ' ' && *p != TAB)))
4096 { 4096 {
4097 if (*p == '"') 4097 if (p[0] == '"')
4098 inquote = !inquote; 4098 inquote = !inquote;
4099 else if (p[0] == '\\' && p[1] != NUL)
4100 {
4101 /* First pass: skip over "\ " and "\"".
4102 * Second pass: Remove the backslash. */
4103 if (i == 1)
4104 mch_memmove(p, p + 1, STRLEN(p));
4105 else
4106 ++p;
4107 }
4099 ++p; 4108 ++p;
4100 } 4109 }
4101 if (*p == NUL) 4110 if (*p == NUL)
4102 break; 4111 break;
4103 if (i == 1) 4112 if (i == 1)