Deleted Added
full compact
1/*
2 * Copyright (C) 1984-2007 Mark Nudelman
2 * Copyright (C) 1984-2008 Mark Nudelman
3 *
4 * You may distribute under the terms of either the GNU General Public
5 * License or the Less License, as specified in the README file.
6 *
7 * For more information about less, or for information on how to
8 * contact the author, see the README file.
9 */
10

--- 33 unchanged lines hidden (view full) ---

44 char *donemsg;
45{
46 register int inp;
47#if HAVE_SHELL
48 register char *shell;
49 register char *p;
50#endif
51 IFILE save_ifile;
52#if MSDOS_COMPILER
52#if MSDOS_COMPILER && MSDOS_COMPILER!=WIN32C
53 char cwd[FILENAME_MAX+1];
54#endif
55
56 /*
57 * Print the command which is to be executed,
58 * unless the command starts with a "-".
59 */
60 if (cmd[0] == '-')
61 cmd++;
62 else
63 {
64 clear_bot();
65 putstr("!");
66 putstr(cmd);
67 putstr("\n");
68 }
69
70#if MSDOS_COMPILER
71#if MSDOS_COMPILER==WIN32C
72 if (*cmd == '\0')
73 cmd = getenv("COMSPEC");
74#else
75 /*
76 * Working directory is global on MSDOS.
77 * The child might change the working directory, so we
78 * must save and restore CWD across calls to "system",
79 * or else we won't find our file when we return and
80 * try to "reedit_ifile" it.
81 */
82 getcwd(cwd, FILENAME_MAX);
83#endif
84#endif
85
86 /*
87 * Close the current input file.
88 */
89 save_ifile = save_curr_ifile();
90 (void) edit_ifile(NULL_IFILE);
91
92 /*

--- 99 unchanged lines hidden (view full) ---

192 putstr(" (press RETURN)");
193 get_return();
194 putchr('\n');
195 flush();
196 }
197 init();
198 screen_trashed = 1;
199
195#if MSDOS_COMPILER
200#if MSDOS_COMPILER && MSDOS_COMPILER!=WIN32C
201 /*
202 * Restore the previous directory (possibly
203 * changed by the child program we just ran).
204 */
205 chdir(cwd);
206#if MSDOS_COMPILER != DJGPPC
207 /*
208 * Some versions of chdir() don't change to the drive

--- 166 unchanged lines hidden ---