diff src/misc2.c @ 11127:506f5d8b7d8b v8.0.0451

patch 8.0.0451: some macros are in lower case commit https://github.com/vim/vim/commit/91acfffc1e6c0d8c2abfb186a0e79a5bf19c3f3f Author: Bram Moolenaar <Bram@vim.org> Date: Sun Mar 12 19:22:36 2017 +0100 patch 8.0.0451: some macros are in lower case Problem: Some macros are in lower case. Solution: Make a few more macros upper case. Avoid lower case macros use an argument twice.
author Christian Brabandt <cb@256bit.org>
date Sun, 12 Mar 2017 19:30:05 +0100
parents 4e7308525fe7
children f4ea50924c6d
line wrap: on
line diff
--- 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, 
 
     /* 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)