You should have received a copy of the GNU General Public License
along with GNU Emacs; see the file COPYING. If not, write to
-the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
+the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+Boston, MA 02111-1307, USA. */
/* The arguments given to this program are all the C and Lisp source files
of GNU Emacs. .elc and .el and .c files are allowed.
int scan_lisp_file ();
int scan_c_file ();
+#ifdef MSDOS
+/* s/msdos.h defines this as sys_chdir, but we're not linking with the
+ file where that function is defined. */
+#undef chdir
+#endif
+
/* Stdio stream for output to the DOC file. */
FILE *outfile;
progname = argv[0];
+ outfile = stdout;
+
/* Don't put CRs in the DOC file. */
#ifdef MSDOS
_fmode = O_BINARY;
+#if 0 /* Suspicion is that this causes hanging.
+ So instead we require people to use -o on MSDOS. */
(stdout)->_flag &= ~_IOTEXT;
_setmode (fileno (stdout), O_BINARY);
+#endif
+ outfile = 0;
#endif /* MSDOS */
#ifdef WINDOWSNT
_fmode = O_BINARY;
_setmode (fileno (stdout), O_BINARY);
#endif /* WINDOWSNT */
- outfile = stdout;
-
/* If first two args are -o FILE, output to FILE. */
i = 1;
if (argc > i + 1 && !strcmp (argv[i], "-o"))
i += 2;
}
+ if (outfile == 0)
+ fatal ("No output file specified", "");
+
first_infile = i;
for (; i < argc; i++)
{
char *filename;
{
int len = strlen (filename);
- if (!strcmp (filename + len - 4, ".elc"))
+ if (len > 4 && !strcmp (filename + len - 4, ".elc"))
return scan_lisp_file (filename, READ_BINARY);
- else if (!strcmp (filename + len - 3, ".el"))
+ else if (len > 3 && !strcmp (filename + len - 3, ".el"))
return scan_lisp_file (filename, READ_TEXT);
else
return scan_c_file (filename, READ_TEXT);