aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--config/config.h.in1
-rw-r--r--runtime/autoload/provider/pythonx.vim6
-rwxr-xr-xscripts/vim-patch.sh2
-rw-r--r--src/nvim/ex_cmds2.c34
4 files changed, 15 insertions, 28 deletions
diff --git a/config/config.h.in b/config/config.h.in
index c2f52d8c7e..867278de0d 100644
--- a/config/config.h.in
+++ b/config/config.h.in
@@ -49,7 +49,6 @@
#cmakedefine UNIX
#cmakedefine USE_FNAME_CASE
-#define FEAT_CSCOPE
#cmakedefine FEAT_TUI
#ifndef UNIT_TESTING
diff --git a/runtime/autoload/provider/pythonx.vim b/runtime/autoload/provider/pythonx.vim
index b59cf92f59..c3256e8308 100644
--- a/runtime/autoload/provider/pythonx.vim
+++ b/runtime/autoload/provider/pythonx.vim
@@ -18,9 +18,9 @@ function! provider#pythonx#Require(host) abort
endfor
try
- let channel_id = rpcstart((ver == '2' ?
+ let channel_id = rpcstart((ver ==# '2' ?
\ provider#python#Prog() : provider#python3#Prog()), args)
- if rpcrequest(channel_id, 'poll') == 'ok'
+ if rpcrequest(channel_id, 'poll') ==# 'ok'
return channel_id
endif
catch
@@ -70,7 +70,7 @@ endfunction
function! s:check_interpreter(prog, major_ver, skip) abort
let prog_path = exepath(a:prog)
- if prog_path == ''
+ if prog_path ==# ''
return [0, a:prog . ' not found in search path or not executable.']
endif
diff --git a/scripts/vim-patch.sh b/scripts/vim-patch.sh
index 7a0001769a..62f2b80a82 100755
--- a/scripts/vim-patch.sh
+++ b/scripts/vim-patch.sh
@@ -92,7 +92,7 @@ commit_message() {
find_git_remote() {
git remote -v \
- | awk '$2 ~ /github.com[:/]neovim\/neovim/ && $3 == "(fetch)" {print $1}'
+ | awk '$2 ~ /github.com[:/]neovim\/neovim/ && $3 == "(fetch)" {print $1; exit}'
}
assign_commit_details() {
diff --git a/src/nvim/ex_cmds2.c b/src/nvim/ex_cmds2.c
index 5fe6209a0a..d167c28182 100644
--- a/src/nvim/ex_cmds2.c
+++ b/src/nvim/ex_cmds2.c
@@ -2481,32 +2481,31 @@ int source_level(void *cookie)
return ((struct source_cookie *)cookie)->level;
}
-
-#if (defined(WIN32) && defined(FEAT_CSCOPE)) || defined(HAVE_FD_CLOEXEC)
-# define USE_FOPEN_NOINH
-/*
- * Special function to open a file without handle inheritance.
- * When possible the handle is closed on exec().
- */
+/// Special function to open a file without handle inheritance.
+/// If possible the handle is closed on exec().
static FILE *fopen_noinh_readbin(char *filename)
{
+#ifdef WIN32
+ int fd_tmp = os_open(filename, O_RDONLY | O_BINARY | O_NOINHERIT, 0);
+#else
int fd_tmp = os_open(filename, O_RDONLY, 0);
+#endif
- if (fd_tmp < 0)
+ if (fd_tmp < 0) {
return NULL;
+ }
-# ifdef HAVE_FD_CLOEXEC
+#ifdef HAVE_FD_CLOEXEC
{
int fdflags = fcntl(fd_tmp, F_GETFD);
if (fdflags >= 0 && (fdflags & FD_CLOEXEC) == 0) {
(void)fcntl(fd_tmp, F_SETFD, fdflags | FD_CLOEXEC);
}
}
-# endif
+#endif
return fdopen(fd_tmp, READBIN);
}
-#endif
/*
@@ -2560,11 +2559,7 @@ do_source (
/* Apply SourcePre autocommands, they may get the file. */
apply_autocmds(EVENT_SOURCEPRE, fname_exp, fname_exp, FALSE, curbuf);
-#ifdef USE_FOPEN_NOINH
cookie.fp = fopen_noinh_readbin((char *)fname_exp);
-#else
- cookie.fp = mch_fopen((char *)fname_exp, READBIN);
-#endif
if (cookie.fp == NULL && check_other) {
/*
* Try again, replacing file name ".vimrc" by "_vimrc" or vice versa,
@@ -2573,15 +2568,8 @@ do_source (
p = path_tail(fname_exp);
if ((*p == '.' || *p == '_')
&& (STRICMP(p + 1, "nvimrc") == 0 || STRICMP(p + 1, "exrc") == 0)) {
- if (*p == '_')
- *p = '.';
- else
- *p = '_';
-#ifdef USE_FOPEN_NOINH
+ *p = (*p == '_') ? '.' : '_';
cookie.fp = fopen_noinh_readbin((char *)fname_exp);
-#else
- cookie.fp = mch_fopen((char *)fname_exp, READBIN);
-#endif
}
}