summaryrefslogtreecommitdiffstats
path: root/src/if_cscope.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2009-03-18 13:32:24 +0000
committerBram Moolenaar <Bram@vim.org>2009-03-18 13:32:24 +0000
commit80b6a0e8d5aee3be938c731ac65c51f266ac7089 (patch)
tree68dcf62996625bb598c2c6dba0b6feb9881ccb68 /src/if_cscope.c
parentc84e8952eb4566a1fa9b1d68cc3d554ab8d5b5f3 (diff)
updated for version 7.2-145v7.2.145
Diffstat (limited to 'src/if_cscope.c')
-rw-r--r--src/if_cscope.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/if_cscope.c b/src/if_cscope.c
index 57d1984bfa..2407ad03e3 100644
--- a/src/if_cscope.c
+++ b/src/if_cscope.c
@@ -764,6 +764,7 @@ cs_create_cmd(csoption, pattern)
{
char *cmd;
short search;
+ char *pat;
switch (csoption[0])
{
@@ -797,10 +798,17 @@ cs_create_cmd(csoption, pattern)
return NULL;
}
- if ((cmd = (char *)alloc((unsigned)(strlen(pattern) + 2))) == NULL)
+ /* Skip white space before the patter, except for text and pattern search,
+ * they may want to use the leading white space. */
+ pat = pattern;
+ if (search != 4 && search != 6)
+ while vim_iswhite(*pat)
+ ++pat;
+
+ if ((cmd = (char *)alloc((unsigned)(strlen(pat) + 2))) == NULL)
return NULL;
- (void)sprintf(cmd, "%d%s", search, pattern);
+ (void)sprintf(cmd, "%d%s", search, pat);
return cmd;
} /* cs_create_cmd */