/*
- * Copyright (C) 1984-2012 Mark Nudelman
+ * Copyright (C) 1984-2022 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.
#if MSDOS_COMPILER
#include <dos.h>
+#if MSDOS_COMPILER==WIN32C && defined(MINGW)
+#include <direct.h>
+#define setdisk(n) _chdrive((n)+1)
+#else
#ifdef _MSC_VER
#include <direct.h>
#define setdisk(n) _chdrive((n)+1)
#include <dir.h>
#endif
#endif
+#endif
extern int screen_trashed;
extern IFILE curr_ifile;
char *cmd;
char *donemsg;
{
- register int inp;
+ int inp;
#if HAVE_SHELL
- register char *shell;
- register char *p;
+ char *shell;
+ char *p;
#endif
IFILE save_ifile;
#if MSDOS_COMPILER && MSDOS_COMPILER!=WIN32C
* De-initialize the terminal and take out of raw mode.
*/
deinit();
- flush(); /* Make sure the deinit chars get out */
+ flush(); /* Make sure the deinit chars get out */
raw_mode(0);
#if MSDOS_COMPILER==WIN32C
close_getchr();
*/
inp = dup(0);
close(0);
-#if OS2
- /* The __open() system call translates "/dev/tty" to "con". */
- if (__open("/dev/tty", OPEN_READ) < 0)
-#else
- if (open("/dev/tty", OPEN_READ) < 0)
+#if !MSDOS_COMPILER
+ if (open_tty() < 0)
#endif
dup(inp);
#endif
char *esccmd = shell_quote(cmd);
if (esccmd != NULL)
{
- int len = strlen(shell) + strlen(esccmd) + 5;
+ int len = (int) (strlen(shell) + strlen(esccmd) + 5);
p = (char *) ecalloc(len, sizeof(char));
SNPRINTF3(p, len, "%s %s %s", shell, shell_coption(), esccmd);
free(esccmd);
* also makes trouble with some DPMI servers).
*/
__djgpp_exception_toggle();
- system(cmd);
+ system(cmd);
__djgpp_exception_toggle();
#else
system(cmd);
tpos = ch_zero();
bpos = position(BOTTOM);
- if (c == '.')
- return (pipe_data(cmd, tpos, bpos));
- else if (mpos <= tpos)
- return (pipe_data(cmd, mpos, bpos));
- else if (bpos == NULL_POSITION)
- return (pipe_data(cmd, tpos, bpos));
- else
- return (pipe_data(cmd, tpos, mpos));
+ if (c == '.')
+ return (pipe_data(cmd, tpos, bpos));
+ else if (mpos <= tpos)
+ return (pipe_data(cmd, mpos, bpos));
+ else if (bpos == NULL_POSITION)
+ return (pipe_data(cmd, tpos, bpos));
+ else
+ return (pipe_data(cmd, tpos, mpos));
}
/*
POSITION spos;
POSITION epos;
{
- register FILE *f;
- register int c;
- extern FILE *popen();
+ FILE *f;
+ int c;
/*
* This is structured much like lsystem().
/*
* Finish up the last line.
*/
- while (c != '\n' && c != EOI )
- {
- c = ch_forw_get();
- if (c == EOI)
- break;
- if (putc(c, f) == EOF)
- break;
- }
+ while (c != '\n' && c != EOI )
+ {
+ c = ch_forw_get();
+ if (c == EOI)
+ break;
+ if (putc(c, f) == EOF)
+ break;
+ }
pclose(f);