diff options
author | 2011-09-16 18:12:09 +0000 | |
---|---|---|
committer | 2011-09-16 18:12:09 +0000 | |
commit | 168565f4ae9b6df7424a2fca62495238a147033d (patch) | |
tree | a1a1dabaa2b2d9abe35b8c756640775c8b1f911c /usr.bin/less/lsystem.c | |
parent | Set the shared priority entry to the value of the current maxipl entry, (diff) | |
download | wireguard-openbsd-168565f4ae9b6df7424a2fca62495238a147033d.tar.xz wireguard-openbsd-168565f4ae9b6df7424a2fca62495238a147033d.zip |
Merge in less 444 plus local changes
ok nicm@
Diffstat (limited to 'usr.bin/less/lsystem.c')
-rw-r--r-- | usr.bin/less/lsystem.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/usr.bin/less/lsystem.c b/usr.bin/less/lsystem.c index bfb9fe817ff..0d9a980b1a3 100644 --- a/usr.bin/less/lsystem.c +++ b/usr.bin/less/lsystem.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 1984-2002 Mark Nudelman + * Copyright (C) 1984-2011 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. @@ -49,7 +49,7 @@ lsystem(cmd, donemsg) register char *p; #endif IFILE save_ifile; -#if MSDOS_COMPILER +#if MSDOS_COMPILER && MSDOS_COMPILER!=WIN32C char cwd[FILENAME_MAX+1]; #endif @@ -68,6 +68,10 @@ lsystem(cmd, donemsg) } #if MSDOS_COMPILER +#if MSDOS_COMPILER==WIN32C + if (*cmd == '\0') + cmd = getenv("COMSPEC"); +#else /* * Working directory is global on MSDOS. * The child might change the working directory, so we @@ -77,6 +81,7 @@ lsystem(cmd, donemsg) */ getcwd(cwd, FILENAME_MAX); #endif +#endif /* * Close the current input file. @@ -135,8 +140,7 @@ lsystem(cmd, donemsg) { size_t len = strlen(shell) + strlen(esccmd) + 5; p = (char *) ecalloc(len, sizeof(char)); - snprintf(p, len, "%s %s %s", shell, - shell_coption(), esccmd); + SNPRINTF3(p, len, "%s %s %s", shell, shell_coption(), esccmd); free(esccmd); } } @@ -193,7 +197,7 @@ lsystem(cmd, donemsg) init(); screen_trashed = 1; -#if MSDOS_COMPILER +#if MSDOS_COMPILER && MSDOS_COMPILER!=WIN32C /* * Restore the previous directory (possibly * changed by the child program we just ran). |