diff src/misc2.c @ 1685:7015ddf81055 v7.2b.018

updated for version 7.2b-018
author vimboss
date Thu, 24 Jul 2008 18:29:37 +0000
parents 553c97222cc0
children 563bd9a63fdc
line wrap: on
line diff
--- a/src/misc2.c
+++ b/src/misc2.c
@@ -1257,6 +1257,17 @@ vim_strsave_escaped_ext(string, esc_char
     return escaped_string;
 }
 
+#if !defined(BACKSLASH_IN_FILENAME) || defined(FEAT_EVAL) || defined(PROTO)
+/*
+ * Return TRUE when 'shell' has "csh" in the tail.
+ */
+    int
+csh_like_shell()
+{
+    return (strstr((char *)gettail(p_sh), "csh") != NULL);
+}
+#endif
+
 #if defined(FEAT_EVAL) || defined(PROTO)
 /*
  * Escape "string" for use as a shell argument with system().
@@ -1283,7 +1294,7 @@ vim_strsave_shellescape(string, do_speci
      * the like we must not put a backslash before it, it will be taken
      * literally.  If do_special is set the '!' will be escaped twice.
      * Csh also needs to have "\n" escaped twice when do_special is set. */
-    csh_like = (strstr((char *)gettail(p_sh), "csh") != NULL);
+    csh_like = csh_like_shell();
 
     /* First count the number of extra bytes required. */
     length = (unsigned)STRLEN(string) + 3;  /* two quotes and a trailing NUL */