summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBram Moolenaar <bram@zimbu.org>2010-05-13 13:12:06 +0200
committerBram Moolenaar <bram@zimbu.org>2010-05-13 13:12:06 +0200
commit7ac614b73bcc3cba74726e33ec5ecb9c3c934c45 (patch)
tree79790cf44853514377f3ca4b7b1592166f173c30
parent79aae0e0fef58a2d49b2ad6ed70a929208880bf5 (diff)
downloadvim-7ac614b73bcc3cba74726e33ec5ecb9c3c934c45.tar.gz
updated for version 7.2.417v7.2.417v7-2-417
Problem: When 'shell' has an argument with a slash then 'shellpipe' is not set properly. (Britton Kerin) Solution: Assume there are no spaces in the path, arguments follow.
-rw-r--r--src/option.c23
-rw-r--r--src/version.c2
2 files changed, 25 insertions, 0 deletions
diff --git a/src/option.c b/src/option.c
index ba17c115..a59beed7 100644
--- a/src/option.c
+++ b/src/option.c
@@ -3696,9 +3696,32 @@ set_init_3()
* Isolate the name of the shell:
* - Skip beyond any path. E.g., "/usr/bin/csh -f" -> "csh -f".
* - Remove any argument. E.g., "csh -f" -> "csh".
+ * But don't allow a space in the path, so that this works:
+ * "/usr/bin/csh --rcfile ~/.cshrc"
+ * But don't do that for Windows, it's common to have a space in the path.
*/
+#ifdef WIN3264
p = gettail(p_sh);
p = vim_strnsave(p, (int)(skiptowhite(p) - p));
+#else
+ p = skiptowhite(p_sh);
+ if (*p == NUL)
+ {
+ /* No white space, use the tail. */
+ p = vim_strsave(gettail(p_sh));
+ }
+ else
+ {
+ char_u *p1, *p2;
+
+ /* Find the last path separator before the space. */
+ p1 = p_sh;
+ for (p2 = p_sh; p2 < p; mb_ptr_adv(p2))
+ if (vim_ispathsep(*p2))
+ p1 = p2 + 1;
+ p = vim_strnsave(p1, (int)(p - p1));
+ }
+#endif
if (p != NULL)
{
/*
diff --git a/src/version.c b/src/version.c
index a20d1023..1f1263b6 100644
--- a/src/version.c
+++ b/src/version.c
@@ -682,6 +682,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 417,
+/**/
416,
/**/
415,