]> granicus.if.org Git - vim/commitdiff
updated for version 7.1-087 v7.1.087
authorBram Moolenaar <Bram@vim.org>
Tue, 21 Aug 2007 16:03:51 +0000 (16:03 +0000)
committerBram Moolenaar <Bram@vim.org>
Tue, 21 Aug 2007 16:03:51 +0000 (16:03 +0000)
src/if_cscope.c
src/version.c

index 3e430168fe1de3172a927a7a864fe48a3e6bf5df..445494bcd07ddb2202eb771930d7acc147b16ffb 100644 (file)
@@ -73,6 +73,8 @@ static int        cs_show __ARGS((exarg_T *eap));
 
 
 static csinfo_T            csinfo[CSCOPE_MAX_CONNECTIONS];
+static int         eap_arg_len;    /* length of eap->arg, set in
+                                      cs_lookup_cmd() */
 static cscmd_T     cs_cmds[] =
 {
     { "add",   cs_add,
@@ -260,14 +262,7 @@ cs_fgets(buf, size)
 
     if ((p = cs_manage_matches(NULL, NULL, -1, Get)) == NULL)
        return TRUE;
-
-    if ((int)strlen(p) > size)
-    {
-       strncpy((char *)buf, p, size - 1);
-       buf[size] = '\0';
-    }
-    else
-       (void)strcpy((char *)buf, p);
+    vim_strncpy(buf, (char_u *)p, size - 1);
 
     return FALSE;
 } /* cs_fgets */
@@ -386,7 +381,7 @@ cs_connection(num, dbpath, ppath)
  * PRIVATE: cs_add
  *
  * add cscope database or a directory name (to look for cscope.out)
- * the the cscope connection list
+ * to the cscope connection list
  *
  * MAXPATHL 256
  */
@@ -966,7 +961,7 @@ cs_find(eap)
     }
 
     pat = opt + strlen(opt) + 1;
-    if (pat == NULL || (pat != NULL && pat[0] == '\0'))
+    if (pat >= (char *)eap->arg + eap_arg_len)
     {
        cs_usage_msg(Find);
        return FALSE;
@@ -1317,7 +1312,7 @@ cs_insert_filelist(fname, ppath, flags, sb)
 #else
            /* compare pathnames first */
            && ((fullpathcmp(csinfo[j].fname, fname, FALSE) & FPC_SAME)
-               /* if not Windows 9x, test index file atributes too */
+               /* if not Windows 9x, test index file attributes too */
                || (!mch_windows95()
                    && csinfo[j].nVolume == bhfi.dwVolumeSerialNumber
                    && csinfo[j].nIndexHigh == bhfi.nFileIndexHigh
@@ -1401,6 +1396,9 @@ cs_lookup_cmd(eap)
     if (eap->arg == NULL)
        return NULL;
 
+    /* Store length of eap->arg before it gets modified by strtok(). */
+    eap_arg_len = STRLEN(eap->arg);
+
     if ((stok = strtok((char *)(eap->arg), (const char *)" ")) == NULL)
        return NULL;
 
@@ -2195,7 +2193,7 @@ cs_reset(eap)
            cs_add_common(dblist[i], pplist[i], fllist[i]);
            if (p_csverbose)
            {
-               /* dont' use smsg_attr because want to display
+               /* don't use smsg_attr() because we want to display the
                 * connection number in the same line as
                 * "Added cscope database..."
                 */
index 9f952c47addd08c9bdd349be939318a3f48fdb2f..100913e3ffa5c638c4be04289a7426b441e21f35 100644 (file)
@@ -666,6 +666,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    87,
 /**/
     86,
 /**/