forked from aniani/vim
updated for version 7.2a
This commit is contained in:
23
src/tag.c
23
src/tag.c
@@ -17,10 +17,6 @@
|
||||
|
||||
#include "vim.h"
|
||||
|
||||
#ifdef HAVE_FCNTL_H
|
||||
# include <fcntl.h> /* for lseek() */
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Structure to hold pointers to various items in a tag line.
|
||||
*/
|
||||
@@ -2664,7 +2660,7 @@ get_tagfname(tnp, first, buf)
|
||||
/* move the filename one char forward and truncate the
|
||||
* filepath with a NUL */
|
||||
filename = gettail(buf);
|
||||
mch_memmove(filename + 1, filename, STRLEN(filename) + 1);
|
||||
STRMOVE(filename + 1, filename);
|
||||
*filename++ = NUL;
|
||||
|
||||
tnp->tn_search_ctx = vim_findfile_init(buf, filename,
|
||||
@@ -3391,13 +3387,6 @@ expand_tag_fname(fname, tag_fname, expand)
|
||||
return retval;
|
||||
}
|
||||
|
||||
/*
|
||||
* Moves the tail part of the path (including the terminating NUL) pointed to
|
||||
* by "tail" to the new location pointed to by "here". This should accomodate
|
||||
* an overlapping move.
|
||||
*/
|
||||
#define movetail(here, tail) mch_memmove(here, tail, STRLEN(tail) + (size_t)1)
|
||||
|
||||
/*
|
||||
* Converts a file name into a canonical form. It simplifies a file name into
|
||||
* its simplest form by stripping out unneeded components, if any. The
|
||||
@@ -3451,7 +3440,7 @@ simplify_filename(filename)
|
||||
else
|
||||
#endif
|
||||
if (vim_ispathsep(*p))
|
||||
movetail(p, p + 1); /* remove duplicate "/" */
|
||||
STRMOVE(p, p + 1); /* remove duplicate "/" */
|
||||
else if (p[0] == '.' && (vim_ispathsep(p[1]) || p[1] == NUL))
|
||||
{
|
||||
if (p == start && relative)
|
||||
@@ -3468,7 +3457,7 @@ simplify_filename(filename)
|
||||
mb_ptr_adv(tail);
|
||||
else if (p > start)
|
||||
--p; /* strip preceding path separator */
|
||||
movetail(p, tail);
|
||||
STRMOVE(p, tail);
|
||||
}
|
||||
}
|
||||
else if (p[0] == '.' && p[1] == '.' &&
|
||||
@@ -3584,19 +3573,19 @@ simplify_filename(filename)
|
||||
{
|
||||
if (p > start && tail[-1] == '.')
|
||||
--p;
|
||||
movetail(p, tail); /* strip previous component */
|
||||
STRMOVE(p, tail); /* strip previous component */
|
||||
}
|
||||
|
||||
--components;
|
||||
}
|
||||
}
|
||||
else if (p == start && !relative) /* leading "/.." or "/../" */
|
||||
movetail(p, tail); /* strip ".." or "../" */
|
||||
STRMOVE(p, tail); /* strip ".." or "../" */
|
||||
else
|
||||
{
|
||||
if (p == start + 2 && p[-2] == '.') /* leading "./../" */
|
||||
{
|
||||
movetail(p - 2, p); /* strip leading "./" */
|
||||
STRMOVE(p - 2, p); /* strip leading "./" */
|
||||
tail -= 2;
|
||||
}
|
||||
p = tail; /* skip to char after ".." or "../" */
|
||||
|
Reference in New Issue
Block a user