aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/nvim/ex_getln.c23
-rw-r--r--src/nvim/os_unix.c5
-rw-r--r--src/nvim/path.c3
-rw-r--r--src/nvim/path.h2
4 files changed, 17 insertions, 16 deletions
diff --git a/src/nvim/ex_getln.c b/src/nvim/ex_getln.c
index 1a410759a3..a4e5a4dcd7 100644
--- a/src/nvim/ex_getln.c
+++ b/src/nvim/ex_getln.c
@@ -4017,20 +4017,19 @@ static void expand_shellcmd(char_u *filepat, int *num_file, char_u ***file,
*/
ga_init(&ga, (int)sizeof(char *), 10);
for (s = path; ; s = e) {
- if (*s == NUL)
- {
- if (did_curdir) {
- break;
- }
- // Find directories in the current directory, path is empty.
- did_curdir = true;
- }
- else if (*s == '.') {
- did_curdir = true;
+ if (*s == NUL) {
+ if (did_curdir) {
+ break;
+ }
+ // Find directories in the current directory, path is empty.
+ did_curdir = true;
+ } else if (*s == '.') {
+ did_curdir = true;
}
- if (*s == ' ')
- ++s; /* Skip space used for absolute path name. */
+ if (*s == ' ') {
+ s++; // Skip space used for absolute path name.
+ }
e = vim_strchr(s, ':');
if (e == NULL)
diff --git a/src/nvim/os_unix.c b/src/nvim/os_unix.c
index cc4fb2653d..2ed0c2c856 100644
--- a/src/nvim/os_unix.c
+++ b/src/nvim/os_unix.c
@@ -576,10 +576,11 @@ int mch_expand_wildcards(int num_pat, char_u **pat, int *num_file,
if ((dir && !(flags & EW_DIR)) || (!dir && !(flags & EW_FILE)))
continue;
- /* Skip files that are not executable if we check for that. */
+ // Skip files that are not executable if we check for that.
if (!dir && (flags & EW_EXEC)
- && !os_can_exe((*file)[i], NULL, !(flags & EW_SHELLCMD)))
+ && !os_can_exe((*file)[i], NULL, !(flags & EW_SHELLCMD))) {
continue;
+ }
p = xmalloc(STRLEN((*file)[i]) + 1 + dir);
STRCPY(p, (*file)[i]);
diff --git a/src/nvim/path.c b/src/nvim/path.c
index 252e9430ec..aff0ee2d48 100644
--- a/src/nvim/path.c
+++ b/src/nvim/path.c
@@ -1321,8 +1321,9 @@ void addfile(
// If the file isn't executable, may not add it. Do accept directories.
// When invoked from expand_shellcmd() do not use $PATH.
if (!isdir && (flags & EW_EXEC)
- && !os_can_exe(f, NULL, !(flags & EW_SHELLCMD)))
+ && !os_can_exe(f, NULL, !(flags & EW_SHELLCMD))) {
return;
+ }
char_u *p = xmalloc(STRLEN(f) + 1 + isdir);
diff --git a/src/nvim/path.h b/src/nvim/path.h
index 860cc0da86..4e466d1b71 100644
--- a/src/nvim/path.h
+++ b/src/nvim/path.h
@@ -22,7 +22,7 @@
* is used when executing commands and EW_SILENT for interactive expanding. */
#define EW_ALLLINKS 0x1000 // also links not pointing to existing file
#define EW_SHELLCMD 0x2000 // called from expand_shellcmd(), don't check
- // if executable is in $PATH
+ // if executable is in $PATH
#define EW_DODOT 0x4000 // also files starting with a dot
#define EW_EMPTYOK 0x8000 // no matches is not an error