diff src/ex_getln.c @ 1039:04943f311357 v7.0.165

updated for version 7.0-165
author vimboss
date Tue, 21 Nov 2006 10:29:45 +0000
parents 64e2b75e1615
children a91a2e0c4108
line wrap: on
line diff
--- a/src/ex_getln.c
+++ b/src/ex_getln.c
@@ -34,7 +34,7 @@ struct cmdline_info
     int		xp_context;	/* type of expansion */
 # ifdef FEAT_EVAL
     char_u	*xp_arg;	/* user-defined expansion arg */
-    int		input_fn;	/* Invoked for input() function */
+    int		input_fn;	/* when TRUE Invoked for input() function */
 # endif
 };
 
@@ -1390,7 +1390,17 @@ getcmdline(firstc, count, indent)
 		    {
 			c = gchar_cursor();
 			if (c != NUL)
+			{
+			    if (c == firstc || vim_strchr((char_u *)(
+					    p_magic ? "\\^$.*[" : "\\^$"), c)
+								      != NULL)
+			    {
+				/* put a backslash before special characters */
+				stuffcharReadbuff(c);
+				c = '\\';
+			    }
 			    break;
+			}
 		    }
 		    goto cmdline_not_changed;
 		}