Mercurial > vim
comparison 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 |
comparison
equal
deleted
inserted
replaced
11126:48599a3eae0b | 11127:506f5d8b7d8b |
---|---|
194 while (col <= wcol && *ptr != NUL) | 194 while (col <= wcol && *ptr != NUL) |
195 { | 195 { |
196 /* Count a tab for what it's worth (if list mode not on) */ | 196 /* Count a tab for what it's worth (if list mode not on) */ |
197 #ifdef FEAT_LINEBREAK | 197 #ifdef FEAT_LINEBREAK |
198 csize = win_lbr_chartabsize(curwin, line, ptr, col, &head); | 198 csize = win_lbr_chartabsize(curwin, line, ptr, col, &head); |
199 mb_ptr_adv(ptr); | 199 MB_PTR_ADV(ptr); |
200 #else | 200 #else |
201 csize = lbr_chartabsize_adv(line, &ptr, col); | 201 csize = lbr_chartabsize_adv(line, &ptr, col); |
202 #endif | 202 #endif |
203 col += csize; | 203 col += csize; |
204 } | 204 } |
1416 * Csh also needs to have "\n" escaped twice when do_special is set. */ | 1416 * Csh also needs to have "\n" escaped twice when do_special is set. */ |
1417 csh_like = csh_like_shell(); | 1417 csh_like = csh_like_shell(); |
1418 | 1418 |
1419 /* First count the number of extra bytes required. */ | 1419 /* First count the number of extra bytes required. */ |
1420 length = (unsigned)STRLEN(string) + 3; /* two quotes and a trailing NUL */ | 1420 length = (unsigned)STRLEN(string) + 3; /* two quotes and a trailing NUL */ |
1421 for (p = string; *p != NUL; mb_ptr_adv(p)) | 1421 for (p = string; *p != NUL; MB_PTR_ADV(p)) |
1422 { | 1422 { |
1423 # ifdef WIN32 | 1423 # ifdef WIN32 |
1424 if (!p_ssl) | 1424 if (!p_ssl) |
1425 { | 1425 { |
1426 if (*p == '"') | 1426 if (*p == '"') |
1948 | 1948 |
1949 while (*p) | 1949 while (*p) |
1950 { | 1950 { |
1951 if (*p == c) | 1951 if (*p == c) |
1952 retval = p; | 1952 retval = p; |
1953 mb_ptr_adv(p); | 1953 MB_PTR_ADV(p); |
1954 } | 1954 } |
1955 return retval; | 1955 return retval; |
1956 } | 1956 } |
1957 | 1957 |
1958 /* | 1958 /* |
1969 { | 1969 { |
1970 while (*s) | 1970 while (*s) |
1971 { | 1971 { |
1972 if (vim_strchr(charset, *s) != NULL) | 1972 if (vim_strchr(charset, *s) != NULL) |
1973 return s; | 1973 return s; |
1974 mb_ptr_adv(s); | 1974 MB_PTR_ADV(s); |
1975 } | 1975 } |
1976 return NULL; | 1976 return NULL; |
1977 } | 1977 } |
1978 # endif | 1978 # endif |
1979 #endif | 1979 #endif |
3362 /* | 3362 /* |
3363 * Check if "name" ends in a slash and is not a directory. | 3363 * Check if "name" ends in a slash and is not a directory. |
3364 * Used for systems where stat() ignores a trailing slash on a file name. | 3364 * Used for systems where stat() ignores a trailing slash on a file name. |
3365 * The Vim code assumes a trailing slash is only ignored for a directory. | 3365 * The Vim code assumes a trailing slash is only ignored for a directory. |
3366 */ | 3366 */ |
3367 int | 3367 static int |
3368 illegal_slash(char *name) | 3368 illegal_slash(char *name) |
3369 { | 3369 { |
3370 if (name[0] == NUL) | 3370 if (name[0] == NUL) |
3371 return FALSE; /* no file name is not illegal */ | 3371 return FALSE; /* no file name is not illegal */ |
3372 if (name[strlen(name) - 1] != '/') | 3372 if (name[strlen(name) - 1] != '/') |
3373 return FALSE; /* no trailing slash */ | 3373 return FALSE; /* no trailing slash */ |
3374 if (mch_isdir((char_u *)name)) | 3374 if (mch_isdir((char_u *)name)) |
3375 return FALSE; /* trailing slash for a directory */ | 3375 return FALSE; /* trailing slash for a directory */ |
3376 return TRUE; | 3376 return TRUE; |
3377 } | |
3378 | |
3379 /* | |
3380 * Special implementation of mch_stat() for Solaris. | |
3381 */ | |
3382 int | |
3383 vim_stat(const char *name, stat_T *stp) | |
3384 { | |
3385 /* On Solaris stat() accepts "file/" as if it was "file". Return -1 if | |
3386 * the name ends in "/" and it's not a directory. */ | |
3387 return illegal_slash(n) ? -1 : stat(n, p); | |
3377 } | 3388 } |
3378 #endif | 3389 #endif |
3379 | 3390 |
3380 #if defined(CURSOR_SHAPE) || defined(PROTO) | 3391 #if defined(CURSOR_SHAPE) || defined(PROTO) |
3381 | 3392 |