summaryrefslogtreecommitdiff
path: root/src/if_cscope.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2013-06-12 21:25:23 +0200
committerBram Moolenaar <Bram@vim.org>2013-06-12 21:25:23 +0200
commitcab465a6d7a7d158c99b04ddc81650b468d82227 (patch)
tree6f1620ff103430ac7167754f9b0c4d301be8f404 /src/if_cscope.c
parent0825c00f14bb60202bcd0391bc3f0eba4d188aac (diff)
downloadvim-git-cab465a6d7a7d158c99b04ddc81650b468d82227.tar.gz
updated for version 7.3.1180v7.3.1180
Problem: When current directory changes, path from cscope may no longer be valid. (AS Budden) Solution: Always store the absolute path. (Christian Brabandt)
Diffstat (limited to 'src/if_cscope.c')
-rw-r--r--src/if_cscope.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/if_cscope.c b/src/if_cscope.c
index c82448e08..605131156 100644
--- a/src/if_cscope.c
+++ b/src/if_cscope.c
@@ -539,12 +539,27 @@ cs_add_common(arg1, arg2, flags)
char *fname2 = NULL;
char *ppath = NULL;
int i;
+#ifdef FEAT_MODIFY_FNAME
+ int len;
+ int usedlen = 0;
+ char_u *fbuf = NULL;
+#endif
/* get the filename (arg1), expand it, and try to stat it */
if ((fname = (char *)alloc(MAXPATHL + 1)) == NULL)
goto add_err;
expand_env((char_u *)arg1, (char_u *)fname, MAXPATHL);
+#ifdef FEAT_MODIFY_FNAME
+ len = (int)STRLEN(fname);
+ fbuf = (char_u *)fname;
+ (void)modify_fname((char_u *)":p", &usedlen,
+ (char_u **)&fname, &fbuf, &len);
+ if (fname == NULL)
+ goto add_err;
+ fname = (char *)vim_strnsave((char_u *)fname, len);
+ vim_free(fbuf);
+#endif
ret = stat(fname, &statbuf);
if (ret < 0)
{