=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/less/lsystem.c,v retrieving revision 1.7 retrieving revision 1.8 diff -c -r1.7 -r1.8 *** src/usr.bin/less/lsystem.c 2007/04/19 05:56:45 1.7 --- src/usr.bin/less/lsystem.c 2011/09/16 18:12:09 1.8 *************** *** 1,5 **** /* ! * Copyright (C) 1984-2002 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. --- 1,5 ---- /* ! * 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,55 **** register char *p; #endif IFILE save_ifile; ! #if MSDOS_COMPILER char cwd[FILENAME_MAX+1]; #endif --- 49,55 ---- register char *p; #endif IFILE save_ifile; ! #if MSDOS_COMPILER && MSDOS_COMPILER!=WIN32C char cwd[FILENAME_MAX+1]; #endif *************** *** 68,73 **** --- 68,77 ---- } #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,82 **** --- 81,87 ---- */ getcwd(cwd, FILENAME_MAX); #endif + #endif /* * Close the current input file. *************** *** 135,142 **** { size_t len = strlen(shell) + strlen(esccmd) + 5; p = (char *) ecalloc(len, sizeof(char)); ! snprintf(p, len, "%s %s %s", shell, ! shell_coption(), esccmd); free(esccmd); } } --- 140,146 ---- { size_t len = strlen(shell) + strlen(esccmd) + 5; p = (char *) ecalloc(len, sizeof(char)); ! SNPRINTF3(p, len, "%s %s %s", shell, shell_coption(), esccmd); free(esccmd); } } *************** *** 193,199 **** init(); screen_trashed = 1; ! #if MSDOS_COMPILER /* * Restore the previous directory (possibly * changed by the child program we just ran). --- 197,203 ---- init(); screen_trashed = 1; ! #if MSDOS_COMPILER && MSDOS_COMPILER!=WIN32C /* * Restore the previous directory (possibly * changed by the child program we just ran).