diff options
Diffstat (limited to 'contrib/less/lsystem.c')
-rw-r--r-- | contrib/less/lsystem.c | 25 |
1 files changed, 5 insertions, 20 deletions
diff --git a/contrib/less/lsystem.c b/contrib/less/lsystem.c index 5c67526e1030..ebb249d8500d 100644 --- a/contrib/less/lsystem.c +++ b/contrib/less/lsystem.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 1984-2021 Mark Nudelman + * Copyright (C) 1984-2023 Mark Nudelman * * You may distribute under the terms of either the GNU General Public * License or the Less License, as specified in the README file. @@ -42,10 +42,7 @@ extern IFILE curr_ifile; * Pass the specified command to a shell to be executed. * Like plain "system()", but handles resetting terminal modes, etc. */ - public void -lsystem(cmd, donemsg) - char *cmd; - char *donemsg; +public void lsystem(char *cmd, char *donemsg) { int inp; #if HAVE_SHELL @@ -117,12 +114,7 @@ lsystem(cmd, donemsg) inp = dup(0); close(0); #if !MSDOS_COMPILER -#if OS2 - /* The __open() system call translates "/dev/tty" to "con". */ - if (__open(tty_device(), OPEN_READ) < 0) -#else - if (open(tty_device(), OPEN_READ) < 0) -#endif + if (open_tty() < 0) #endif dup(inp); #endif @@ -256,10 +248,7 @@ lsystem(cmd, donemsg) * If the mark is on the current screen, or if the mark is ".", * the whole current screen is piped. */ - public int -pipe_mark(c, cmd) - int c; - char *cmd; +public int pipe_mark(int c, char *cmd) { POSITION mpos, tpos, bpos; @@ -290,11 +279,7 @@ pipe_mark(c, cmd) * Create a pipe to the given shell command. * Feed it the file contents between the positions spos and epos. */ - public int -pipe_data(cmd, spos, epos) - char *cmd; - POSITION spos; - POSITION epos; +public int pipe_data(char *cmd, POSITION spos, POSITION epos) { FILE *f; int c; |