summaryrefslogtreecommitdiff
path: root/src/misc2.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/misc2.c')
-rw-r--r--src/misc2.c21
1 files changed, 16 insertions, 5 deletions
diff --git a/src/misc2.c b/src/misc2.c
index cfdfc4c4a..a6f3c1e21 100644
--- a/src/misc2.c
+++ b/src/misc2.c
@@ -196,7 +196,7 @@ coladvance2(
/* Count a tab for what it's worth (if list mode not on) */
#ifdef FEAT_LINEBREAK
csize = win_lbr_chartabsize(curwin, line, ptr, col, &head);
- mb_ptr_adv(ptr);
+ MB_PTR_ADV(ptr);
#else
csize = lbr_chartabsize_adv(line, &ptr, col);
#endif
@@ -1418,7 +1418,7 @@ vim_strsave_shellescape(char_u *string, int do_special, int do_newline)
/* First count the number of extra bytes required. */
length = (unsigned)STRLEN(string) + 3; /* two quotes and a trailing NUL */
- for (p = string; *p != NUL; mb_ptr_adv(p))
+ for (p = string; *p != NUL; MB_PTR_ADV(p))
{
# ifdef WIN32
if (!p_ssl)
@@ -1950,7 +1950,7 @@ vim_strrchr(char_u *string, int c)
{
if (*p == c)
retval = p;
- mb_ptr_adv(p);
+ MB_PTR_ADV(p);
}
return retval;
}
@@ -1971,7 +1971,7 @@ vim_strpbrk(char_u *s, char_u *charset)
{
if (vim_strchr(charset, *s) != NULL)
return s;
- mb_ptr_adv(s);
+ MB_PTR_ADV(s);
}
return NULL;
}
@@ -3364,7 +3364,7 @@ vim_chdirfile(char_u *fname)
* Used for systems where stat() ignores a trailing slash on a file name.
* The Vim code assumes a trailing slash is only ignored for a directory.
*/
- int
+ static int
illegal_slash(char *name)
{
if (name[0] == NUL)
@@ -3375,6 +3375,17 @@ illegal_slash(char *name)
return FALSE; /* trailing slash for a directory */
return TRUE;
}
+
+/*
+ * Special implementation of mch_stat() for Solaris.
+ */
+ int
+vim_stat(const char *name, stat_T *stp)
+{
+ /* On Solaris stat() accepts "file/" as if it was "file". Return -1 if
+ * the name ends in "/" and it's not a directory. */
+ return illegal_slash(n) ? -1 : stat(n, p);
+}
#endif
#if defined(CURSOR_SHAPE) || defined(PROTO)