diff options
author | Richard M. Stallman <rms@gnu.org> | 1996-04-10 01:00:12 +0000 |
---|---|---|
committer | Richard M. Stallman <rms@gnu.org> | 1996-04-10 01:00:12 +0000 |
commit | 7e8e53da8ccc5cd5bb47b6df823f4e2b7f976d93 (patch) | |
tree | 3a5690b3db29e978cee43c4cfb2a5b85e250ad2f | |
parent | 151644e8d467bab24841902514b3671c6a63bdff (diff) | |
download | emacs-7e8e53da8ccc5cd5bb47b6df823f4e2b7f976d93.tar.gz |
(main) [MSDOS]: Handle DJGPP version 2.
-rw-r--r-- | lib-src/b2m.c | 7 | ||||
-rw-r--r-- | src/emacs.c | 23 |
2 files changed, 28 insertions, 2 deletions
diff --git a/lib-src/b2m.c b/lib-src/b2m.c index 9da7a91b60f..88d0acd5cd8 100644 --- a/lib-src/b2m.c +++ b/lib-src/b2m.c @@ -89,8 +89,15 @@ main (argc, argv) #ifdef MSDOS _fmode = O_BINARY; /* all of files are treated as binary files */ +#if __DJGPP__ > 1 + if (!isatty (fileno (stdout))) + setmode (fileno (stdout), O_BINARY); + if (!isatty (fileno (stdin))) + setmode (fileno (stdin), O_BINARY); +#else /* not __DJGPP__ > 1 */ (stdout)->_flag &= ~_IOTEXT; (stdin)->_flag &= ~_IOTEXT; +#endif /* not __DJGPP__ > 1 */ #endif progname = argv[0]; diff --git a/src/emacs.c b/src/emacs.c index 3b221a108ec..b6e97bc8c9e 100644 --- a/src/emacs.c +++ b/src/emacs.c @@ -532,9 +532,20 @@ main (argc, argv, envp) /* We do all file input/output as binary files. When we need to translate newlines, we do that manually. */ _fmode = O_BINARY; + +#if __DJGPP__ >= 2 + if (!isatty (fileno (stdin))) + setmode (fileno (stdin), O_BINARY); + if (!isatty (fileno (stdout))) + { + fflush (stdout); + setmode (fileno (stdout), O_BINARY); + } +#else /* not __DJGPP__ >= 2 */ (stdin)->_flag &= ~_IOTEXT; (stdout)->_flag &= ~_IOTEXT; (stderr)->_flag &= ~_IOTEXT; +#endif /* not __DJGPP__ >= 2 */ #endif /* MSDOS */ #ifdef SET_EMACS_PRIORITY @@ -776,9 +787,17 @@ Usage: %s [-t term] [--terminal term] [-nw] [--no-windows] [--batch]\n\ /* Call early 'cause init_environment needs it. */ init_dosfns (); /* Set defaults for several environment variables. */ - if (initialized) init_environment (argc, argv, skip_args); - else init_gettimeofday (); + if (initialized) + init_environment (argc, argv, skip_args); + else + { +#if __DGJPP__ >= 2 + tzset (); +#else + init_gettimeofday (); #endif + } +#endif /* MSDOS */ #ifdef WINDOWSNT /* Initialize environment from registry settings. */ |