diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/nvim/ex_cmds.c | 36 | ||||
-rw-r--r-- | src/nvim/ex_docmd.c | 4 | ||||
-rw-r--r-- | src/nvim/ex_getln.c | 2 | ||||
-rw-r--r-- | src/nvim/if_cscope.c | 4 | ||||
-rw-r--r-- | src/nvim/os/dl.c | 2 | ||||
-rw-r--r-- | src/nvim/os/env.c | 2 | ||||
-rw-r--r-- | src/nvim/os/time.c | 4 | ||||
-rw-r--r-- | src/nvim/path.c | 2 |
8 files changed, 25 insertions, 31 deletions
diff --git a/src/nvim/ex_cmds.c b/src/nvim/ex_cmds.c index 34c25589d4..29d87d0fc1 100644 --- a/src/nvim/ex_cmds.c +++ b/src/nvim/ex_cmds.c @@ -951,30 +951,26 @@ void do_bang(int addr_count, exarg_T *eap, int forceit, int do_in, int do_out) xfree(newcmd); } -/* - * do_filter: filter lines through a command given by the user - * - * We mostly use temp files and the call_shell() routine here. This would - * normally be done using pipes on a UNIX machine, but this is more portable - * to non-unix machines. The call_shell() routine needs to be able - * to deal with redirection somehow, and should handle things like looking - * at the PATH env. variable, and adding reasonable extensions to the - * command name given by the user. All reasonable versions of call_shell() - * do this. - * Alternatively, if on Unix and redirecting input or output, but not both, - * and the 'shelltemp' option isn't set, use pipes. - * We use input redirection if do_in is TRUE. - * We use output redirection if do_out is TRUE. - */ -static void -do_filter ( +// do_filter: filter lines through a command given by the user +// +// We mostly use temp files and the call_shell() routine here. This would +// normally be done using pipes on a Unix system, but this is more portable +// to non-Unix systems. The call_shell() routine needs to be able +// to deal with redirection somehow, and should handle things like looking +// at the PATH env. variable, and adding reasonable extensions to the +// command name given by the user. All reasonable versions of call_shell() +// do this. +// Alternatively, if on Unix and redirecting input or output, but not both, +// and the 'shelltemp' option isn't set, use pipes. +// We use input redirection if do_in is TRUE. +// We use output redirection if do_out is TRUE. +static void do_filter( linenr_T line1, linenr_T line2, exarg_T *eap, /* for forced 'ff' and 'fenc' */ char_u *cmd, int do_in, - int do_out -) + int do_out) { char_u *itmp = NULL; char_u *otmp = NULL; @@ -1690,7 +1686,7 @@ check_overwrite ( && os_file_exists(ffname)) { if (!eap->forceit && !eap->append) { #ifdef UNIX - /* with UNIX it is possible to open a directory */ + // It is possible to open a directory on Unix. if (os_isdir(ffname)) { EMSG2(_(e_isadir2), ffname); return FAIL; diff --git a/src/nvim/ex_docmd.c b/src/nvim/ex_docmd.c index 84bd31d9ad..cbe7c1a231 100644 --- a/src/nvim/ex_docmd.c +++ b/src/nvim/ex_docmd.c @@ -6843,9 +6843,9 @@ void ex_cd(exarg_T *eap) prev_dir = NULL; #if defined(UNIX) - /* for UNIX ":cd" means: go to home directory */ + // On Unix ":cd" means: go to home directory. if (*new_dir == NUL) { - /* use NameBuff for home directory name */ + // Use NameBuff for home directory name. expand_env((char_u *)"$HOME", NameBuff, MAXPATHL); new_dir = NameBuff; } diff --git a/src/nvim/ex_getln.c b/src/nvim/ex_getln.c index 6d81f3680a..eca62da949 100644 --- a/src/nvim/ex_getln.c +++ b/src/nvim/ex_getln.c @@ -596,7 +596,7 @@ static int command_line_execute(VimState *state, int key) } if (s->j > 0) { - // TODO(tarruda): this is only for DOS/UNIX systems - need to put in + // TODO(tarruda): this is only for DOS/Unix systems - need to put in // machine-specific stuff here and in upseg init cmdline_del(s->j); put_on_cmdline(upseg + 1, 3, false); diff --git a/src/nvim/if_cscope.c b/src/nvim/if_cscope.c index cd206e2e0d..2a766734fe 100644 --- a/src/nvim/if_cscope.c +++ b/src/nvim/if_cscope.c @@ -1841,9 +1841,7 @@ static void sig_handler(int s) { */ static void cs_release_csp(size_t i, int freefnpp) { - /* - * Trying to exit normally (not sure whether it is fit to UNIX cscope - */ + // Trying to exit normally (not sure whether it is fit to Unix cscope) if (csinfo[i].to_fp != NULL) { (void)fputs("q\n", csinfo[i].to_fp); (void)fflush(csinfo[i].to_fp); diff --git a/src/nvim/os/dl.c b/src/nvim/os/dl.c index b4a35e203e..fef02cc784 100644 --- a/src/nvim/os/dl.c +++ b/src/nvim/os/dl.c @@ -63,7 +63,7 @@ bool os_libcall(const char *libname, // call the library and save the result // TODO(aktau): catch signals and use jmp (if available) to handle - // exceptions. jmp's on UNIX seem to interact trickily with signals as + // exceptions. jmp's on Unix seem to interact trickily with signals as // well. So for now we only support those libraries that are well-behaved. if (str_out) { str_str_fn sfn = (str_str_fn) fn; diff --git a/src/nvim/os/env.c b/src/nvim/os/env.c index 734f6f9e38..c1804067e9 100644 --- a/src/nvim/os/env.c +++ b/src/nvim/os/env.c @@ -290,7 +290,7 @@ void expand_env_esc(char_u *srcp, char_u *dst, int dstlen, bool esc, bool one, } #if defined(UNIX) - // Verify that we have found the end of a UNIX ${VAR} style variable + // Verify that we have found the end of a Unix ${VAR} style variable if (src[1] == '{' && *tail != '}') { var = NULL; } else { diff --git a/src/nvim/os/time.c b/src/nvim/os/time.c index ba1dcf631a..188f0802c9 100644 --- a/src/nvim/os/time.c +++ b/src/nvim/os/time.c @@ -93,7 +93,7 @@ struct tm *os_localtime_r(const time_t *restrict clock, #endif } -/// Obtains the current UNIX timestamp and adjusts it to local time +/// Obtains the current Unix timestamp and adjusts it to local time. /// /// @param result Pointer to a 'struct tm' where the result should be placed /// @return A pointer to a 'struct tm' in the current time zone (the 'result' @@ -104,7 +104,7 @@ struct tm *os_get_localtime(struct tm *result) FUNC_ATTR_NONNULL_ALL return os_localtime_r(&rawtime, result); } -/// Obtains the current UNIX timestamp +/// Obtains the current Unix timestamp. /// /// @return Seconds since epoch. Timestamp os_time(void) diff --git a/src/nvim/path.c b/src/nvim/path.c index 23b22b67f1..5ac3d07f67 100644 --- a/src/nvim/path.c +++ b/src/nvim/path.c @@ -196,7 +196,7 @@ char_u *get_past_head(char_u *path) int vim_ispathsep(int c) { #ifdef UNIX - return c == '/'; /* UNIX has ':' inside file names */ + return c == '/'; // Unix has ':' inside file names #else # ifdef BACKSLASH_IN_FILENAME return c == ':' || c == '/' || c == '\\'; |