aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/path.c
diff options
context:
space:
mode:
authordundargoc <33953936+dundargoc@users.noreply.github.com>2022-09-18 03:17:15 +0200
committerGitHub <noreply@github.com>2022-09-18 09:17:15 +0800
commit6d557e324fd4223fff3279a0112f40431c540163 (patch)
tree74b9d80ccfe5bb6ac628a3455aa1f2c6c3b20497 /src/nvim/path.c
parent3c3f3e7353ba2cb9071183cd05036ca2a98d3672 (diff)
downloadrneovim-6d557e324fd4223fff3279a0112f40431c540163.tar.gz
rneovim-6d557e324fd4223fff3279a0112f40431c540163.tar.bz2
rneovim-6d557e324fd4223fff3279a0112f40431c540163.zip
vim-patch:8.1.0941: macros for MS-Windows are inconsistent (#20215)
Problem: Macros for MS-Windows are inconsistent, using "32", "3264 and others. Solution: Use MSWIN for all MS-Windows builds. Use FEAT_GUI_MSWIN for the GUI build. (Hirohito Higashi, closes vim/vim#3932) https://github.com/vim/vim/commit/4f97475d326c2773a78561fb874e4f23c25cbcd9
Diffstat (limited to 'src/nvim/path.c')
-rw-r--r--src/nvim/path.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/nvim/path.c b/src/nvim/path.c
index 82b0124213..d1a7e14c9f 100644
--- a/src/nvim/path.c
+++ b/src/nvim/path.c
@@ -190,7 +190,7 @@ const char *path_next_component(const char *fname)
/// - 1 otherwise
int path_head_length(void)
{
-#ifdef WIN32
+#ifdef MSWIN
return 3;
#else
return 1;
@@ -205,7 +205,7 @@ int path_head_length(void)
/// - False otherwise
bool is_path_head(const char_u *path)
{
-#ifdef WIN32
+#ifdef MSWIN
return isalpha(path[0]) && path[1] == ':';
#else
return vim_ispathsep(*path);
@@ -219,7 +219,7 @@ char *get_past_head(const char *path)
{
const char *retval = path;
-#ifdef WIN32
+#ifdef MSWIN
// May skip "c:"
if (is_path_head((char_u *)path)) {
retval = path + 2;
@@ -642,7 +642,7 @@ static size_t do_path_expand(garray_T *gap, const char *path, size_t wildoff, in
s = p + 1;
} else if (path_end >= (char_u *)path + wildoff
&& (vim_strchr("*?[{~$", *path_end) != NULL
-#ifndef WIN32
+#ifndef MSWIN
|| (!p_fic && (flags & EW_ICASE) && mb_isalpha(utf_ptr2char((char *)path_end)))
#endif
)) {
@@ -897,7 +897,7 @@ static char_u *get_path_cutoff(char_u *fname, garray_T *gap)
int j = 0;
while ((fname[j] == path_part[i][j]
-#ifdef WIN32
+#ifdef MSWIN
|| (vim_ispathsep(fname[j]) && vim_ispathsep(path_part[i][j]))
#endif
) // NOLINT(whitespace/parens)
@@ -1816,7 +1816,7 @@ int vim_FullName(const char *fname, char *buf, size_t len, bool force)
if (strlen(fname) > (len - 1)) {
xstrlcpy(buf, fname, len); // truncate
-#ifdef WIN32
+#ifdef MSWIN
slash_adjust((char_u *)buf);
#endif
return FAIL;
@@ -1831,7 +1831,7 @@ int vim_FullName(const char *fname, char *buf, size_t len, bool force)
if (rv == FAIL) {
xstrlcpy(buf, fname, len); // something failed; use the filename
}
-#ifdef WIN32
+#ifdef MSWIN
slash_adjust((char_u *)buf);
#endif
return rv;
@@ -2356,7 +2356,7 @@ static int path_to_absolute(const char *fname, char *buf, size_t len, int force)
// expand it if forced or not an absolute path
if (force || !path_is_absolute((char_u *)fname)) {
p = strrchr(fname, '/');
-#ifdef WIN32
+#ifdef MSWIN
if (p == NULL) {
p = strrchr(fname, '\\');
}
@@ -2392,7 +2392,7 @@ static int path_to_absolute(const char *fname, char *buf, size_t len, int force)
/// @return `true` if "fname" is absolute.
int path_is_absolute(const char_u *fname)
{
-#ifdef WIN32
+#ifdef MSWIN
if (*fname == NUL) {
return false;
}