*/
if (p != NULL)
{
+ if (STRCMP(p, "/..") == 0)
+ // for "/path/dir/.." include the "/.."
+ p += 3;
+
#ifdef HAVE_FCHDIR
/*
* Use fchdir() if possible, it's said to be faster and more
vim_strncpy(buf, fname, p - fname);
if (mch_chdir((char *)buf))
retval = FAIL;
- else
+ else if (*p == '/')
fname = p + 1;
+ else
+ fname = p;
*buf = NUL;
}
}
call assert_equal('r', fnamemodify('.', ':p:h')[-1:])
call assert_equal('t', fnamemodify('test.out', ':p')[-1:])
call assert_equal($HOME .. "/foo" , fnamemodify('~/foo', ':p'))
+ call assert_equal(fnamemodify('.', ':p:h:h:h') .. '/', fnamemodify($HOME .. '/../', ':p'))
+ call assert_equal(fnamemodify('.', ':p:h:h:h') .. '/', fnamemodify($HOME .. '/..', ':p'))
call assert_equal('test.out', fnamemodify('test.out', ':.'))
call assert_equal('a', fnamemodify('../testdir/a', ':.'))
call assert_equal('~/testdir/test.out', fnamemodify('test.out', ':~'))