diff -c -r -N texinfo3.9-orig/configdj.sed texinfo3.9/configdj.sed
*** texinfo3.9-orig/configdj.sed	Thu Jan  1 00:00:00 1970
--- texinfo3.9/configdj.sed	Sat Oct 12 14:36:52 1996
***************
*** 0 ****
--- 1,61 ----
+ s%@CC@%gcc%g
+ s%@INSTALL@%ginstall%g
+ s%@INSTALL_PROGRAM@%$(INSTALL)%g
+ s%@INSTALL_DATA@%$(INSTALL) -m 644%g
+ s%@DEFS@%-imacros $(srcdir)/config.h%
+ s%@LIBS@%%g
+ s%@ALLOCA@%%g
+ s%@CFLAGS@%-O2 -g%g
+ s%@LDFLAGS@%%g
+ /^DEFAULT_INFOPATH *=/s/:/;/
+ s%@prefix@%$(DJDIR)%g
+ s%@exec_prefix@%$(DJDIR)%g
+ s%@srcdir@%.%g
+ /^VPATH *=/c\
+ vpath %.c %.h $(srcdir);$(common)
+ 
+ /^DEFS *=/i\
+ # The following is necessary to avoid the loooong list of -DSOMETHING\
+ # in $DEFS where we already have everything set up in the system-wide\
+ # <sys/config.h> (#include'd by ../config.h)\
+ 
+ /^	\$(SHELL)/c\
+ 	sed -f $^ > $@
+ 
+ /^configure:/d
+ /config.status  *--recheck/d
+ 
+ /^sub-all  *TAGS:/,/^[^	]/{
+ 	/^	/d
+ }
+ /^sub-all  *TAGS:/c\
+ sub-all TAGS clean mostlyclean:\
+ 	$(MAKE) -C libtxi $(MDEFINES) $@\
+ 	$(MAKE) -C makeinfo $(MDEFINES) $@\
+ 	$(MAKE) -C info $(MDEFINES) $@\
+ 	$(MAKE) -C util $(MDEFINES) $@\
+ 	$(MAKE) -C emacs $(MDEFINES) $@\
+ 
+ /^clean  *mostlyclean:/,/^[^	]/{
+ 	/^	/d
+ }
+ /^clean  *mostlyclean:/d
+ /^distclean:/,/^[^	]/{
+ 	/^	/d
+ }
+ /^distclean:/a\
+ 	$(MAKE) -C libtxi $(MDEFINES) $@\
+ 	$(MAKE) -C makeinfo $(MDEFINES) $@\
+ 	$(MAKE) -C info $(MDEFINES) $@\
+ 	$(MAKE) -C util $(MDEFINES) $@\
+ 	$(MAKE) -C emacs $(MDEFINES) $@\
+ 	$(RM) Makefile config.h *.tmp *.cache *.log texinfo texinf-? texin-?? texinfo.i*\
+ 
+ /^dvi  *texinfo.dvi:/,/^\.PHONY/c\
+ dvi texinfo.dvi: $(srcdir)/texinfo.txinfo\
+ 	$(TEX) texinfo.txinfo\
+ 	$(TEXINDEX) texinfo.??\
+ 	$(TEX) texinfo.txinfo\
+ .PHONY: dvi\
+ 
+ s%texinfo\.texi%texinfo.txinfo%
diff -c -r -N texinfo3.9-orig/configur.bat texinfo3.9/configur.bat
*** texinfo3.9-orig/configur.bat	Thu Jan  1 00:00:00 1970
--- texinfo3.9/configur.bat	Sat Oct 12 14:09:56 1996
***************
*** 0 ****
--- 1,33 ----
+ @echo off
+ Rem
+ Rem Never again say that MSDOS batch files aren't
+ Rem powerful (i.e. cryptic) enough unless you can grasp
+ Rem in less than a minute what the following 2 lines do.
+ if [%1]==[] %0 %0
+ for %%c in (%1.bat* %1.!@{?) do %0 ) %%c
+ Rem
+ Rem Do they have Sed?
+ Rem We need 2 redir so the error message of the first
+ Rem also goes to the great void.
+ redir -o NUL -eo redir -o NUL -eo sed -n -e p %0
+ if errorlevel 1 goto NoSed
+ echo Configuring Texinfo for MS-DOS/DJGPP...
+ echo Creating Makefiles...
+ redir -o Makefile -e config.status sed -f configdj.sed Makefile.in
+ redir -o libtxi/Makefile -ea config.status sed -f confsub.sed libtxi/Makefile.in
+ redir -o info/Makefile -ea config.status sed -f confsub.sed info/Makefile.in
+ redir -o makeinfo/Makefile -ea config.status sed -f confsub.sed makeinfo/Makefile.in
+ redir -o util/Makefile -ea config.status sed -f confsub.sed util/Makefile.in
+ redir -o emacs/Makefile -ea config.status sed -f confsub.sed emacs/Makefile.in
+ echo Creating `config.h'...
+ redir -o  config.h echo "#include <sys/config.h>"
+ redir -oa config.h echo "#define LONG_FILENAMES  _USE_LFN"
+ redir -oa config.h echo "#undef HAVE_MEMSET"
+ redir -oa config.h echo "#define HAVE_MEMSET 1"
+ redir -oa config.h echo "#define HAVE_TERMIOS_H 1"
+ goto End
+ :NoSed
+ echo You need a Unix-style Sed program to configure Texinfo
+ echo but I cannot seem to find it anywhere.
+ echo Please put it on your PATH and try again.
+ :End
diff -c -r -N texinfo3.9-orig/confsub.sed texinfo3.9/confsub.sed
*** texinfo3.9-orig/confsub.sed	Thu Jan  1 00:00:00 1970
--- texinfo3.9/confsub.sed	Sat Oct 12 14:12:24 1996
***************
*** 0 ****
--- 1,86 ----
+ s%@srcdir@%.%
+ s%@prefix@%$(DJDIR)%
+ s%@exec_prefix@%$(DJDIR)%
+ s%@CC@%gcc%
+ s%@DEFS@%-imacros ../config.h%
+ s%@LIBOBJS@%%g
+ s%@LIBS@%%
+ s%@ALLOCA@%%
+ s%@CFLAGS@%-O2 -g%
+ s%@LDFLAGS@%%
+ s%@RANLIB@%ranlib%
+ s%@INSTALL@%ginstall%g
+ s%@INSTALL_PROGRAM@%$(INSTALL)%g
+ s%@INSTALL_DATA@%$(INSTALL) -m 644%g
+ s%@TERMLIBS@%%
+ 1s%-\*- Indented-Text -\*-%%
+ /^VPATH *=/c\
+ vpath %.c %.h $(srcdir);$(common)\
+ EMACS = emacs
+ 
+ /sh  *config\.status/c\
+ 	sed -f ../confsub.sed $< > $@\
+ 
+ /\$(SHELL)  *\.\/config\.status/c\
+ 	sed -f ../confsub.sed $< > $@\
+ 
+ /^	 *clib\.c/s/clib\.c/&	pc_term.c/
+ s/clib\.h *$/clib.h	pc_term.h/
+ s/clib\.o *$/clib.o pc_term.o/
+ s/\*\.info/*.inf/g
+ s/\*\.info\*/*.i*/g
+ /^	PATH=/d
+ /\.dvi:/a\
+ 	$(TEX) $<\
+ 	$(TEXINDEX) $<\
+ 	$(TEX) $<\
+ 
+ s%\*\.info\*%*.i*%g
+ /^	 *cat makedoc-TAGS/c\
+ 	sed -n -e p makedoc-TAGS >> TAGS\
+ 	$(RM) makedoc-TAGS
+ /^funs\.h:/,/^[^	]/{
+ 	/^	/d
+ }
+ /^funs\.h:/a\
+ 	command.com /c if exist old-funs.h del old-funs.h > nul\
+ 	command.com /c if exist funs.h ren funs.h old-funs.h > nul\
+ 	command.com /c if exist old-doc.c del old-doc.c > nul\
+ 	command.com /c if exist doc.c ren doc.c old-doc.c > nul\
+ 	./makedoc $(CMDFILES)\
+ 	update funs.h old-funs.h\
+ 	update doc.c old-doc.c\
+ 	command.com /c del funs.h > nul\
+ 	command.com /c del doc.c > nul\
+ 	command.com /c ren old-funs.h funs.h > nul\
+ 	command.com /c ren old-doc.c doc.c > nul
+ 
+ /^session\.o:/s/session\.c/& pc_getc.c/
+ /^search\.o:/i\
+ pc_pc_term.o:      pc_term.c pc_term.h
+ 
+ /elisp-comp /c\
+ 	@echo "(setq load-path (cons nil load-path))" > elc.tmp\
+ 	$(EMACS) -batch -l elc.tmp -f batch-byte-compile $<\
+ 	command.com /c del elc.tmp > nul\
+ 
+ / -o install-info/a\
+ 	stubify -g instinfo.exe\
+ 	stubedit instinfo.exe runfile=install-
+ /uninstall:/,/^[^	]/{
+ 	/	\(rm -f\|\$(RM)\) /s%/texindex %/texindex.exe %g
+ 	/	\(rm -f\|\$(RM)\) /s%/info %/info.exe %g
+ 	/	\(rm -f\|\$(RM)\) /s%/install-info %/install-info.exe %g
+ 	/	\(rm -f\|\$(RM)\) /s%/makeinfo %/makeinfo.exe %g
+ 	/	\(rm -f\|\$(RM)\) /s%/texindex$%/texindex.exe%g
+ 	/	\(rm -f\|\$(RM)\) /s%/info$%/info.exe%g
+ 	/	\(rm -f\|\$(RM)\) /s%/install-info$%/install-info.exe%g
+ 	/	\(rm -f\|\$(RM)\) /s%/makeinfo$%/makeinfo.exe%g
+ }
+ /^clean[ :]/a\
+ 	$(RM) *.exe
+ /^PROGS *= *makeinfo/s/makeinfo/& makeinfo.exe/
+ /^makeinfo:/s/makeinfo/& makeinfo.exe/
+ /^	\$(INSTALL_PROGRAM)  *install-info /a\
+ 	$(INSTALL_PROGRAM) instinfo.exe $(bindir)/instinfo.exe
+ 
diff -c -r -N texinfo3.9-orig/info/dir.c texinfo3.9/info/dir.c
*** texinfo3.9-orig/info/dir.c	Fri Jun 16 17:59:20 1995
--- texinfo3.9/info/dir.c	Tue Oct  8 19:50:00 1996
***************
*** 22,27 ****
--- 22,30 ----
     Written by Brian Fox (bfox@ai.mit.edu). */
  
  #include <stdio.h>
+ #if defined (HAVE_STDLIB_H)
+ #include <stdlib.h> /* for free() */
+ #endif
  #include <sys/types.h>
  #include <sys/stat.h>
  #if defined (HAVE_SYS_FILE_H)
diff -c -r -N texinfo3.9-orig/info/display.c texinfo3.9/info/display.c
*** texinfo3.9-orig/info/display.c	Fri Jun 16 17:59:24 1995
--- texinfo3.9/info/display.c	Tue Oct  8 19:50:00 1996
***************
*** 22,27 ****
--- 22,30 ----
     Written by Brian Fox (bfox@ai.mit.edu). */
  
  #include <stdio.h>
+ #if defined (HAVE_STDLIB_H)
+ #include <stdlib.h> /* for free() */
+ #endif
  #include <ctype.h>
  #include <sys/types.h>
  #include <sys/stat.h>
***************
*** 138,144 ****
  
    for (; nodetext < last_node_char; nodetext++)
      {
!       char *rep, *rep_carried_over, rep_temp[2];
        int replen;
  
        if (isprint (*nodetext))
--- 141,148 ----
  
    for (; nodetext < last_node_char; nodetext++)
      {
!       /* Assignment shuts up -Wall.  */
!       char *rep = 0, *rep_carried_over, rep_temp[2];
        int replen;
  
        if (isprint (*nodetext))
diff -c -r -N texinfo3.9-orig/info/dribble.c texinfo3.9/info/dribble.c
*** texinfo3.9-orig/info/dribble.c	Fri Jun 16 17:59:30 1995
--- texinfo3.9/info/dribble.c	Sat Oct  5 21:03:04 1996
***************
*** 37,43 ****
--- 37,48 ----
    /* Perhaps close existing dribble file. */
    close_dribble_file ();
  
+ #if defined (__MSDOS__)
+   /* The dribble file is a binary file.  */
+   info_dribble_file = fopen (name, "wb");
+ #else
    info_dribble_file = fopen (name, "w");
+ #endif
  
  #if defined (HAVE_SETVBUF)
    if (info_dribble_file)
diff -c -r -N texinfo3.9-orig/info/filesys.c texinfo3.9/info/filesys.c
*** texinfo3.9-orig/info/filesys.c	Fri Jun 16 17:59:40 1995
--- texinfo3.9/info/filesys.c	Tue Oct  8 19:50:00 1996
***************
*** 22,27 ****
--- 22,30 ----
     Written by Brian Fox (bfox@ai.mit.edu). */
  
  #include <stdio.h>
+ #if defined (HAVE_STDLIB_H)
+ #include <stdlib.h> /* for free() */
+ #endif
  #include <sys/types.h>
  #include <sys/stat.h>
  #if defined (HAVE_SYS_FILE_H)
***************
*** 40,45 ****
--- 43,53 ----
  #endif /* !HAVE_SYS_FCNTL_H */
  #endif /* !O_RDONLY */
  
+ /* Are long filenames supported on MSDOS?  Default: no.  */
+ #ifndef LONG_FILENAMES
+ #define LONG_FILENAMES (0)
+ #endif
+ 
  #if !defined (errno)
  extern int errno;
  #endif /* !errno */
***************
*** 121,126 ****
--- 129,149 ----
  	 after all. */
        if (initial_character == '/')
  	temp = info_file_in_path (partial + 1, "/");
+ #if defined (__MSDOS__)
+       /* Must handle the MS-DOS "d:/path" and "d:path" cases.  Sigh.  */
+       else if (partial[1] == ':')
+ 	{
+ 	  char drive[4];
+ 	  int  driv_idx = 0;
+ 
+ 	  drive[driv_idx++] = initial_character;
+ 	  drive[driv_idx++] = ':';
+ 	  if (partial[2] == '/')
+ 	    drive[driv_idx++] = '/';
+ 	  drive[driv_idx] = '\0';
+ 	  temp = info_file_in_path (partial + driv_idx, drive);
+ 	}
+ #endif
        else if (initial_character == '~')
  	{
  	  expansion = tilde_expand_word (partial);
***************
*** 129,134 ****
--- 152,171 ----
  	      temp = info_file_in_path (expansion + 1, "/");
  	      free (expansion);
  	    }
+ #if defined (__MSDOS__)
+ 	  else if (expansion[1] == ':')
+ 	    {
+ 	      char drive[4];
+ 	      int driv_idx = 0;
+ 
+ 	      drive[driv_idx++] = *expansion;
+ 	      drive[driv_idx++] = ':';
+ 	      if (expansion[2] == '/')
+ 		drive[driv_idx++] = '/';
+ 	      drive[driv_idx] = '\0';
+ 	      temp = info_file_in_path (expansion + driv_idx, drive);
+ 	    }
+ #endif
  	  else
  	    temp = expansion;
  	}
***************
*** 255,260 ****
--- 292,328 ----
  		  if (statable && (S_ISREG (finfo.st_mode)))
  		    return (temp);
  		}
+ #if defined (__MSDOS__)
+ 	      /* Under MS-DOS's 8.3 filename restriction, it is customary
+ 		 to just make "z" or "gz" the last character(s) of the
+ 		 extension.  Allow any extension which ends with "z" or
+ 		 "gz" to be handled by GZIP. */
+ 	      temp [pre_compress_suffix_length] = '\0';
+ 
+ 	      if (!LONG_FILENAMES)
+ 		{
+ 		  char *dot = strrchr (temp, '.');
+ 
+ 		  if (dot)
+ 		    for (j = 3; j > 1; j--)
+ 		      {
+ 			strcpy (dot + j, "z");
+ 			statable = (stat (temp, &finfo) == 0);
+ 			if (statable && (S_ISREG (finfo.st_mode)))
+ 			  return (temp);
+ 
+ 			/* Don't try "gz" unless we only leave 1 character
+ 			   from the original extension.  */
+ 			if (j < 3)
+ 			  {
+ 			    strcpy (dot + j, "gz");
+ 			    statable = (stat (temp, &finfo) == 0);
+ 			    if (statable && (S_ISREG (finfo.st_mode)))
+ 			      return (temp);
+ 			  }
+ 		      }
+ 		}
+ #endif
  	    }
  	}
        free (temp);
***************
*** 276,282 ****
    if ((i >= strlen (string)) || !string)
      return ((char *) NULL);
  
!   while (string[i] && string[i] != ':')
      i++;
    if (i == start)
      {
--- 344,350 ----
    if ((i >= strlen (string)) || !string)
      return ((char *) NULL);
  
!   while (string[i] && string[i] != PATH_SEPARATOR[0])
      i++;
    if (i == start)
      {
***************
*** 387,400 ****
      strcpy (infopath, path);
    else if (where == INFOPATH_APPEND)
      {
!       strcat (infopath, ":");
        strcat (infopath, path);
      }
    else if (where == INFOPATH_PREPEND)
      {
        char *temp = strdup (infopath);
        strcpy (infopath, path);
!       strcat (infopath, ":");
        strcat (infopath, temp);
        free (temp);
      }
--- 455,468 ----
      strcpy (infopath, path);
    else if (where == INFOPATH_APPEND)
      {
!       strcat (infopath, PATH_SEPARATOR);
        strcat (infopath, path);
      }
    else if (where == INFOPATH_PREPEND)
      {
        char *temp = strdup (infopath);
        strcpy (infopath, path);
!       strcat (infopath, PATH_SEPARATOR);
        strcat (infopath, temp);
        free (temp);
      }
***************
*** 444,450 ****
--- 512,543 ----
        /* Try to read the contents of this file. */
        st_size = (long) finfo->st_size;
        contents = (char *)xmalloc (1 + st_size);
+ #ifdef __MSDOS__
+       /* This is a TERRIBLE kludge!
+ 	 On MSDOS we can read less characters than `stat'
+ 	 returns because the CR characters, if any, are
+ 	 stripped away.  But we need to know the *real* size
+ 	 of the file (to see if it was changed while we browse
+ 	 it).  So we use the st_blksize field to hold the real
+ 	 file size (it is otherwise unused in this package).  */
+       {
+ 	int e = errno;
+ 
+ 	errno = 0;
+ 	finfo->st_size = read (descriptor, contents, st_size);
+ 	finfo->st_blksize = st_size;
+ 	if (errno)
+ 	  st_size = -1;
+ 	else
+ 	  {
+ 	    errno = e;
+ 	    st_size = finfo->st_size;
+ 	  }
+       }
+       if (st_size < 0)
+ #else
        if ((read (descriptor, contents, st_size)) != st_size)
+ #endif
  	{
  	  filesys_error_number = errno;
  	  close (descriptor);
***************
*** 539,544 ****
--- 632,642 ----
    if (info_windows_initialized_p)
      unmessage_in_echo_area ();
  #endif /* !BUILDING_LIBRARY */
+ 
+ #if defined (__MSDOS__)
+   /* Make st_blksize consistent with st_size.  */
+   finfo->st_blksize = finfo->st_size;
+ #endif
    return (contents);
  }
  
***************
*** 582,587 ****
--- 680,692 ----
    for (i = 0; compress_suffixes[i].suffix; i++)
      if (strcmp (extension, compress_suffixes[i].suffix) == 0)
        return (compress_suffixes[i].decompressor);
+ 
+ #if defined (__MSDOS__)
+   /* If no other suffix matched, allow any extension which ends
+      with `z' to be decompressed by GUNZip.  */
+   if (extension[strlen (extension) - 1] == 'z')
+     return "gunzip";
+ #endif
  
    return ((char *)NULL);
  }
diff -c -r -N texinfo3.9-orig/info/general.h texinfo3.9/info/general.h
*** texinfo3.9-orig/info/general.h	Fri Jun 16 18:01:50 1995
--- texinfo3.9/info/general.h	Sun Oct  6 22:24:12 1996
***************
*** 91,94 ****
--- 91,101 ----
        } while (0)
  #endif /* !zero_mem */
  
+ /* Character that separates directories in $PATH etc.  */
+ #if defined (__MSDOS__)
+ #define PATH_SEPARATOR ";"
+ #else   /* not __MSDOS__ */
+ #define PATH_SEPARATOR ":"
+ #endif  /* not __MSDOS__ */
+ 
  #endif /* !_GENERAL_H_ */
diff -c -r -N texinfo3.9-orig/info/info-uti.c texinfo3.9/info/info-uti.c
*** texinfo3.9-orig/info/info-uti.c	Fri Jun 16 17:59:58 1995
--- texinfo3.9/info/info-uti.c	Tue Oct  8 19:50:00 1996
***************
*** 22,27 ****
--- 22,30 ----
     Written by Brian Fox (bfox@ai.mit.edu). */
  
  #include <stdio.h>		/* For "NULL".  Yechhh! */
+ #if defined (HAVE_STDLIB_H)
+ #include <stdlib.h>		/* For free() */
+ #endif
  #include <ctype.h>
  #include <sys/types.h>
  #include <sys/stat.h>
***************
*** 36,42 ****
--- 39,52 ----
  
  /* When non-zero, various display and input functions handle ISO Latin
     character sets correctly. */
+ #if defined (__MSDOS__)
+ /* On MSDOS we treat all characters as printable, because function
+    keys are recognized differently, not by their ASCII codes, and we
+    don't need this compromise.  */
+ int ISO_Latin_p = 1;
+ #else   /* not __MSDOS__ */
  int ISO_Latin_p = 0;
+ #endif  /* not __MSDOS__ */
  
  /* Variable which holds the most recent filename parsed as a result of
     calling info_parse_xxx (). */
***************
*** 617,622 ****
--- 627,637 ----
  
    if (filename)
      filename++;
+ #if defined (__MSDOS__)
+   /* Handle cases of "d:filename"  */
+   else if (pathname[1] == ':')
+     filename = pathname + 2;
+ #endif
    else
      filename = pathname;
  
diff -c -r -N texinfo3.9-orig/info/info.c texinfo3.9/info/info.c
*** texinfo3.9-orig/info/info.c	Fri Oct  4 18:19:54 1996
--- texinfo3.9/info/info.c	Sun Oct  6 22:42:56 1996
***************
*** 64,69 ****
--- 64,78 ----
     dumped in the order encountered.  This basically can print a book. */
  int dump_subnodes = 0;
  
+ #ifdef __MSDOS__
+ /* Non-zero indicates that screen output should be made 'speech-friendly'.
+    Since on MSDOS the usual behavior is to write directly to the video
+    memory, speech synthesizer software cannot grab the output.  Therefore,
+    we provide a user option which tells us to avoid direct screen output
+    and use stdout instead (and lose the color output).  */
+ int speech_friendly = 0;
+ #endif __MSDOS__
+ 
  /* Structure describing the options that Info accepts.  We pass this structure
     to getopt_long ().  If you add or otherwise change this structure, you must
     also change the string which follows it. */
***************
*** 81,91 ****
--- 90,107 ----
    { "version", 0, &print_version_p, 1 },
    { "dribble", 1, 0, DRIBBLE_OPTION },
    { "restore", 1, 0, RESTORE_OPTION },
+ #if defined (__MSDOS__)
+   { "speech-friendly", 0, &speech_friendly, 1 },
+ #endif
    {NULL, 0, NULL, 0}
  };
  
  /* String describing the shorthand versions of the long options found above. */
+ #if defined (__MSDOS__)
+ static char *short_options = "d:n:f:o:sb";
+ #else
  static char *short_options = "d:n:f:o:s";
+ #endif
  
  /* When non-zero, the Info window system has been initialized. */
  int info_windows_initialized_p = 0;
***************
*** 163,168 ****
--- 179,191 ----
  	  dump_subnodes = 1;
  	  break;
  
+ #ifdef __MSDOS__
+ 	  /* User specifies that she wants speech-friendly output.  */
+ 	case 'b':
+ 	  speech_friendly = 1;
+ 	  break;
+ #endif /* __MSDOS__ */
+ 
  	  /* User has specified a string to search all indices for. */
  	case APROPOS_OPTION:
  	  apropos_p = 1;
***************
*** 527,537 ****
  static void
  usage ()
  {
!   fprintf (stderr,"%s\n%s\n%s\n%s\n%s\n",
  "Usage: info [-d dir-path] [-f info-file] [-o output-file] [-n node-name]...",
  "            [--directory dir-path] [--file info-file] [--node node-name]...",
  "            [--help] [--output output-file] [--subnodes] [--version]",
  "            [--dribble dribble-file] [--restore from-file]",
  "            [menu-selection ...]");
    exit (1);
  }
--- 550,565 ----
  static void
  usage ()
  {
!   fprintf (stderr,"%s\n%s\n%s\n%s\n%s%s\n",
  "Usage: info [-d dir-path] [-f info-file] [-o output-file] [-n node-name]...",
  "            [--directory dir-path] [--file info-file] [--node node-name]...",
  "            [--help] [--output output-file] [--subnodes] [--version]",
  "            [--dribble dribble-file] [--restore from-file]",
+ #if defined (__MSDOS__)
+ "            [--speech-friendly|-b]"
+ #else
+ "           "
+ #endif
  "            [menu-selection ...]");
    exit (1);
  }
***************
*** 540,546 ****
  static void
  info_short_help ()
  {
!   puts ("\
  Here is a quick description of Info's options.  For a more complete\n\
  description of how to use Info, type `info info options'.\n\
  \n\
--- 568,574 ----
  static void
  info_short_help ()
  {
!   printf ("%s%s%s", "\
  Here is a quick description of Info's options.  For a more complete\n\
  description of how to use Info, type `info info options'.\n\
  \n\
***************
*** 550,556 ****
     --node NODENAME		Specify nodes in first visited Info file.\n\
     --output FILENAME		Output selected nodes to FILENAME.\n\
     --restore FILENAME		Read initial keystrokes from FILENAME.\n\
!    --subnodes			Recursively output menu items.\n\
     --help			Get this help message.\n\
     --version			Display Info's version information.\n\
  \n\
--- 578,590 ----
     --node NODENAME		Specify nodes in first visited Info file.\n\
     --output FILENAME		Output selected nodes to FILENAME.\n\
     --restore FILENAME		Read initial keystrokes from FILENAME.\n\
!    --subnodes			Recursively output menu items.\n",
! #if defined (__MSDOS__)
! "   --speech-friendly		Make output speech-friendly.\n",
! #else
! ""
! #endif
! "\
     --help			Get this help message.\n\
     --version			Display Info's version information.\n\
  \n\
diff -c -r -N texinfo3.9-orig/info/info.h texinfo3.9/info/info.h
*** texinfo3.9-orig/info/info.h	Fri Jun 16 18:02:00 1995
--- texinfo3.9/info/info.h	Tue Oct  8 19:50:00 1996
***************
*** 25,30 ****
--- 25,33 ----
  #define _INFO_H_
  
  #include <stdio.h>
+ #if defined (HAVE_STDLIB_H)
+ #include <stdlib.h>		/* For free() and qsort() prototypes */
+ #endif
  #include <ctype.h>
  #include <sys/types.h>
  #include <sys/stat.h>
diff -c -r -N texinfo3.9-orig/info/makedoc.c texinfo3.9/info/makedoc.c
*** texinfo3.9-orig/info/makedoc.c	Fri Jun 16 18:00:26 1995
--- texinfo3.9/info/makedoc.c	Tue Oct  8 19:49:58 1996
***************
*** 27,32 ****
--- 27,35 ----
     declared with DECLARE_INFO_COMMAND. */
  
  #include <stdio.h>
+ #if defined (HAVE_STDLIB_H)
+ #include <stdlib.h>		/* For free() */
+ #endif
  #include <ctype.h>
  #include <sys/types.h>
  #if defined (HAVE_SYS_FILE_H)
***************
*** 182,187 ****
--- 185,199 ----
  {
    register int i;
  
+ #if defined(__MSDOS__)
+   /* Emacs needs its TAGS file to be in Unix text format (i.e., only
+      newline at end of every line, no CR), so when we generate a
+      TAGS table, we must switch the output stream to binary mode.
+      (If the table is written to a terminal, this is obviously not needed.) */
+   if (!isatty (fileno (stream)))
+     setmode (fileno (stream), O_BINARY);
+ #endif
+ 
    /* Print out the information for each block. */
    for (i = 0; i < emacs_tags_index; i++)
      {
***************
*** 199,217 ****
  	  char digits[30];
  	  etag = block->entries[j];
  	  block_len += 3 + strlen (etag->name);
! 	  sprintf (digits, "%d,%d", etag->line, etag->char_offset);
  	  block_len += strlen (digits);
  	}
  
        /* Print out the defining line. */
!       fprintf (stream, "\f\n%s,%d\n", block->filename, block_len);
  
        /* Print out the individual tags. */
        for (j = 0; j < block->entries_index; j++)
  	{
  	  etag = block->entries[j];
  
! 	  fprintf (stream, "%s,\177%d,%d\n",
  		   etag->name, etag->line, etag->char_offset);
  	}
      }
--- 211,229 ----
  	  char digits[30];
  	  etag = block->entries[j];
  	  block_len += 3 + strlen (etag->name);
! 	  sprintf (digits, "%d,%ld", etag->line, etag->char_offset);
  	  block_len += strlen (digits);
  	}
  
        /* Print out the defining line. */
!       fprintf (stream, "\f\n%s,%ld\n", block->filename, block_len);
  
        /* Print out the individual tags. */
        for (j = 0; j < block->entries_index; j++)
  	{
  	  etag = block->entries[j];
  
! 	  fprintf (stream, "%s,\177%d,%ld\n",
  		   etag->name, etag->line, etag->char_offset);
  	}
      }
***************
*** 276,281 ****
--- 288,299 ----
  
    file_size = (long) finfo.st_size;
    buffer = (char *)xmalloc (1 + file_size);
+ #if defined (__MSDOS__)
+   /* If the file is a DOS-style text file, reading that file strips
+      the CR characters at the end of each line.  So we need to
+      update our notion of the number of characters in the buffer.  */
+   file_size = finfo.st_size =
+ #endif
    read (descriptor, buffer, file_size);
    close (descriptor);
  
diff -c -r -N texinfo3.9-orig/info/man.c texinfo3.9/info/man.c
*** texinfo3.9-orig/info/man.c	Sat Dec 23 21:23:40 1995
--- texinfo3.9/info/man.c	Wed Oct 23 19:44:16 1996
***************
*** 97,102 ****
--- 97,105 ----
  	  file_buffer->contents[newsize] = '\0';
  	  file_buffer->filesize = newsize;
  	  file_buffer->finfo.st_size = newsize;
+ #if defined (__MSDOS__)
+ 	  file_buffer->finfo.st_blksize = newsize;
+ #endif
  	  build_tags_and_nodes (file_buffer);
  	  free (page);
  	}
***************
*** 117,122 ****
--- 120,128 ----
    file_buffer->filename = strdup (MANPAGE_FILE_BUFFER_NAME);
    file_buffer->fullpath = strdup (MANPAGE_FILE_BUFFER_NAME);
    file_buffer->finfo.st_size = 0;
+ #if defined (__MSDOS__)
+   file_buffer->finfo.st_blksize = 0;
+ #endif
    file_buffer->filesize = 0;
    file_buffer->contents = (char *)NULL;
    file_buffer->flags = (N_IsInternal | N_CannotGC | N_IsManPage);
***************
*** 124,129 ****
--- 130,137 ----
    return (file_buffer);
  }
  
+ #if !defined (__MSDOS__)
+ 
  /* Scan the list of directories in PATH looking for FILENAME.  If we find
     one that is an executable file, return it as a new string.  Otherwise,
     return a NULL pointer. */
***************
*** 172,182 ****
--- 180,201 ----
    return ((char *)NULL);
  }
  
+ #endif  /* __MSDOS__ */
+ 
  /* Return the full pathname of the system man page formatter. */
  static char *
  find_man_formatter ()
  {
+ #if defined (__MSDOS__)
+   /* Since `man' isn't a standard program, all kind of local
+      hacks can be expected.  In particular, it can have *any*
+      executable filename extension (.exe, .com. .bat ...).
+      Therefore we will let `popen' find it instead of looking
+      along the $PATH ourselves.  */
+   return "man";
+ #else
    return (executable_file_in_path ("man", (char *)getenv ("PATH")));
+ #endif
  }
  
  static char *manpage_pagename = (char *)NULL;
***************
*** 217,222 ****
--- 236,242 ----
      }
  }
  
+ #if !defined (__MSDOS__)
  static void
  reap_children (sig)
       int sig;
***************
*** 224,229 ****
--- 244,250 ----
    unsigned int status;
    wait (&status);
  }
+ #endif
  
  static char *
  get_manpage_contents (pagename)
***************
*** 253,258 ****
--- 274,281 ----
    /* Open a pipe to this program, read the output, and save it away
       in FORMATTED_PAGE.  The reader end of the pipe is pipes[0]; the
       writer end is pipes[1]. */
+ 
+ #if !defined (__MSDOS__)
    pipe (pipes);
  
    signal (SIGCHLD, reap_children);
***************
*** 286,291 ****
--- 309,331 ----
        close (pipes[1]);
        exit (0);
      }
+ #else  /* __MSDOS__ */
+   /* Cannot fork/exec, but can popen/pclose.  */
+   {
+     FILE *fpipe;
+     char *cmdline = alloca (strlen (formatter_args[0])
+ 			    + strlen (manpage_pagename)
+ 			    + (arg_index > 2 ? strlen (manpage_section) : 0)
+ 			    + 3);
+     sprintf (cmdline, "%s %s %s", formatter_args[0], manpage_pagename,
+ 				  arg_index > 2 ? manpage_section : "");
+     fpipe = popen (cmdline, "rt");
+     if (fpipe == 0)
+       return ((char *)NULL);
+     formatted_page = read_from_fd (fileno (fpipe));
+     pclose (fpipe);
+   }
+ #endif /* __MSDOS__ */
  
    /* If we have the page, then clean it up. */
    if (formatted_page)
diff -c -r -N texinfo3.9-orig/info/nodemenu.c texinfo3.9/info/nodemenu.c
*** texinfo3.9-orig/info/nodemenu.c	Fri Jun 16 18:00:34 1995
--- texinfo3.9/info/nodemenu.c	Sun Oct  6 23:25:02 1996
***************
*** 98,104 ****
    }
  
    len = pad_to (44, line_buffer);
!   sprintf (line_buffer + len, "%d", node->nodelen);
  
    if (node->filename && *(node->filename))
      {
--- 98,104 ----
    }
  
    len = pad_to (44, line_buffer);
!   sprintf (line_buffer + len, "%ld", node->nodelen);
  
    if (node->filename && *(node->filename))
      {
diff -c -r -N texinfo3.9-orig/info/nodes.c texinfo3.9/info/nodes.c
*** texinfo3.9-orig/info/nodes.c	Fri Jun 16 18:00:40 1995
--- texinfo3.9/info/nodes.c	Tue Oct  8 19:49:58 1996
***************
*** 22,27 ****
--- 22,30 ----
     Written by Brian Fox (bfox@ai.mit.edu). */
  
  #include <stdio.h>
+ #if defined (HAVE_STDLIB_H)
+ #include <stdlib.h> /* for free() */
+ #endif
  #include <ctype.h>
  #include <sys/types.h>
  #if defined (HAVE_SYS_FILE_H)
***************
*** 267,272 ****
--- 270,280 ----
  	if ((strcmp (filename, file_buffer->filename) == 0) ||
  	    (strcmp (filename, file_buffer->fullpath) == 0) ||
  	    ((*filename != '/') &&
+ #if defined (__MSDOS__)
+ 	     /* FILENAME with a drive spec ("d:foo/bar" or
+ 		"d:/foo/bar") is also an absolute pathname.  */
+ 	     (filename[1] != ':') &&
+ #endif
  	     strcmp (filename,
  		     filename_non_directory (file_buffer->fullpath)) == 0))
  	  {
***************
*** 294,301 ****
--- 302,317 ----
  
  	    old_info = &file_buffer->finfo;
  
+ #if defined (__MSDOS__)
+ 	    /* Under MS-DOS, we might have changed old_info->st_size
+ 	       to reflect the file size after weeding out CR characters.
+ 	       Use the real size (stashed away in st_blksize) instead.  */
+ 	    if ((new_info.st_size != old_info->st_blksize) ||
+ 		(new_info.st_mtime != old_info->st_mtime))
+ #else
  	    if ((new_info.st_size != old_info->st_size) ||
  		(new_info.st_mtime != old_info->st_mtime))
+ #endif
  	      {
  		/* The file has changed.  Forget that we ever had loaded it
  		   in the first place. */
***************
*** 369,374 ****
--- 385,395 ----
  
        if (basename)
  	basename++;
+ #if defined (__MSDOS__)
+       /* Handle the case of "d:filename"  */
+       else if (lowered_name[1] == ':')
+ 	basename = lowered_name + 2;
+ #endif
        else
  	basename = lowered_name;
  
diff -c -r -N texinfo3.9-orig/info/pc_getc.c texinfo3.9/info/pc_getc.c
*** texinfo3.9-orig/info/pc_getc.c	Thu Jan  1 00:00:00 1970
--- texinfo3.9/info/pc_getc.c	Tue Oct  8 18:59:36 1996
***************
*** 0 ****
--- 1,63 ----
+ /*
+  * A code fragment to allow using PC-specific keys.  It's here on a
+  * separate file to minimize clutter of the original source files.
+  */
+       if (info_input_stream == stdin) {
+         int i;
+         static struct
+         {
+           int inkey;
+           unsigned char outkey1, outkey2;
+         } DJGPP_keytab[] = {
+           {K_Control_PageDown,  'n', 0},  /*these are for moving between nodes*/
+           {K_Control_PageUp,    'p', 0},
+           {K_Control_Up,        'u', 0},
+           {K_Control_Down,      'm', 0},
+           {K_Control_Center,    'l', 0},
+ 
+           {K_Home,      K_Control_A, 0}, /* .. and these for moving IN a node */
+           {K_End,       K_Control_E, 0}, /* they're Numeric-Keypad-Keys, so */
+           {K_Left,      K_Control_B, 0}, /* NUMLOCK should be off !! */
+           {K_Right,     K_Control_F, 0},
+           {K_Down,      K_Control_N, 0},
+           {K_Up,        K_Control_P, 0},
+           {K_PageDown,  SPC, 0},
+           {K_PageUp,    K_Control_Backspace, 0},
+           {K_Control_Left,  ESC, 'b'},
+           {K_Control_Right, ESC, 'f'},
+           {K_Control_Home,  'B', 0},
+           {K_Control_End,   'E', 0},
+ 
+           {K_EHome,      K_Control_A, 0}, /* also for moving IN a node */
+           {K_EEnd,       K_Control_E, 0}, /* they're the 'extended' keys */
+           {K_ELeft,      K_Control_B, 0},
+           {K_ERight,     K_Control_F, 0},
+           {K_EDown,      K_Control_N, 0},
+           {K_EUp,        K_Control_P, 0},
+           {K_EPageDown,  SPC, 0},
+           {K_EPageUp,    K_Control_Backspace, 0},
+           {K_Control_ELeft,  ESC, 'b'},
+           {K_Control_ERight, ESC, 'f'},
+           {K_Control_EHome,  'B', 0},
+           {K_Control_EEnd,   'E', 0},
+ 
+           {K_BackTab, ESC, TAB},
+           {K_Alt_X, ESC, 'X'}, /* the most/only important M-???-key */
+           {K_F1, K_Control_H, 0}, /* YEAH, gimme that goodold F-one-thing */
+           {K_Delete, K_Control_Backspace, 0}, /* to make Delete be DEL (0x7f) */
+           {0, 0, 0}
+         };
+ 
+         do {
+           rawkey=getxkey();
+           if (rawkey & 0x300) {
+             for (i = 0; DJGPP_keytab[i].inkey; i++) {
+               if (rawkey == DJGPP_keytab[i].inkey) {
+                 rawkey = DJGPP_keytab[i].outkey1;
+                 pending_input_character = DJGPP_keytab[i].outkey2;
+                 break;
+               }
+             }
+           }
+         } while (rawkey & 0x300);
+       } else
diff -c -r -N texinfo3.9-orig/info/pc_term.c texinfo3.9/info/pc_term.c
*** texinfo3.9-orig/info/pc_term.c	Thu Jan  1 00:00:00 1970
--- texinfo3.9/info/pc_term.c	Tue Oct  8 19:49:58 1996
***************
*** 0 ****
--- 1,270 ----
+ /* pc_term.c */
+ 
+ /* This file is part of the MSDOS-DJGPP-port of the GNU standalone
+    Info-reader
+ 
+    This program is free software; you can redistribute it and/or modify
+    it under the terms of the GNU General Public License as published by
+    the Free Software Foundation; either version 2, or (at your option)
+    any later version.
+ 
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+ 
+    You should have received a copy of the GNU General Public License
+    along with this program; if not, write to the Free Software
+    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ 
+  */
+ 
+ #include <stdio.h>
+ #include <stdlib.h>
+ #include <limits.h>
+ #include <termios.h>
+ #include <pc.h>
+ #include <conio.h>
+ #include "pc_term.h"
+ #include "terminal.h"
+ #include "termdep.h"
+ 
+ extern int speech_friendly; /* defined in info.c */
+ 
+ #define max(x,y) ((x)>(y) ? (x) : (y))
+ #define min(x,y) ((x)<(y) ? (x) : (y))
+ 
+ static struct text_info pc_info;    /* struct to hold the conio-status */
+ static struct text_info norm_info;  /* holds screen params outside Info */
+ void _set_screen_lines (int);
+ static unsigned char    norm_attr, inv_attr;
+ 
+ /* Put the screen in the video mode and colors which Info will use.  */
+ void pc_prep_terminal ()
+ {
+   textattr (norm_attr);
+ 
+   /* Do not set screen height if we already have it, because
+      doing so erases the screen.  */
+   if (screenheight != ScreenRows ())
+     _set_screen_lines (screenheight);
+ }
+ 
+ void pc_unprep_terminal ()
+ {
+   /* Do not set screen height if we already have it, because
+      doing so erases the screen.  */
+   if (norm_info.screenheight != ScreenRows ())
+   {
+     _set_screen_lines (norm_info.screenheight);
+     textmode (LASTMODE);
+   }
+   textattr (norm_info.normattr);
+   ScreenClear (); /* to leave behind a clean screen */
+ }
+ 
+ void pc_begin_inverse ()
+ {
+   textattr (inv_attr);
+ }
+ 
+ void pc_end_inverse ()
+ {
+   textattr (norm_attr);
+ }
+ 
+ void pc_up_line ()
+ {
+   int x, y;
+   ScreenGetCursor (&y, &x);
+   ScreenSetCursor (max (y-1, 0), x);
+ }
+ 
+ void pc_down_line ()
+ {
+   int x, y;
+   ScreenGetCursor (&y, &x);
+   ScreenSetCursor (min (screenheight-1, y+1), x);
+ }
+ 
+ void pc_clear_screen ()
+ {
+   ScreenClear ();
+ }
+ 
+ void pc_clear_to_eol ()
+ {
+   clreol (); /* perhaps to be replaced by a loop */
+ }
+ 
+ void pc_get_screen_size()
+ {
+   screenwidth  = ScreenCols ();
+   screenheight = ScreenRows ();
+ }
+ 
+ void pc_goto_xy (x, y)
+      int x, y;
+ {
+   ScreenSetCursor (y, x); /* yes, pc.h says ...(row, column) !! */
+ }
+ 
+ void pc_initialize_terminal (term_name)
+     char *term_name;
+ {
+   char *info_colors;
+ 
+   /* Get current video information, to be restored later.  */
+   if (norm_info.screenwidth == 0)
+     {
+       gppconio_init ();
+       gettextinfo (&norm_info);
+     }
+ 
+   /* Current screen dimensions and colors are the default.  */
+   screenwidth  = norm_info.screenwidth;
+   screenheight = norm_info.screenheight;
+   norm_attr    = norm_info.normattr;
+   inv_attr     = (((norm_info.normattr &    7) << 4) |
+                   ((norm_info.normattr & 0x7f) >> 4));
+ 
+   /* Environment variables "LINES" overrides the default.  */
+   if (getenv ("LINES") != NULL)
+     screenheight = atoi (getenv ("LINES"));
+ 
+   /* Environment variable "INFO_LINES" overrides "LINES".  */
+   if (getenv ("INFO_LINES") != NULL)
+       screenheight = atoi (getenv ("INFO_LINES"));
+ 
+   if (screenheight != norm_info.screenheight)
+     {
+       _set_screen_lines (screenheight);
+       screenwidth  = ScreenCols ();
+       screenheight = ScreenRows ();
+     }
+ 
+   /* Does the user want non-default colors?  */
+   info_colors = getenv ("INFO_COLORS");
+   if ((info_colors != (char *)0) && !speech_friendly)
+     {
+       char *next;
+       unsigned long coldesc = strtoul (info_colors, &next, 0);
+ 
+       if (next == info_colors || coldesc > UCHAR_MAX)
+         info_colors = (char *)0;
+       else
+         {
+           char *endp;
+           norm_attr = (unsigned char)coldesc;
+           coldesc = strtoul (next + 1, &endp, 0);
+           if (endp == next + 1 || coldesc > UCHAR_MAX)
+             info_colors = (char *)0;
+           else
+             inv_attr = (unsigned char)coldesc;
+         }
+     }
+ 
+   /* Try setting the colors user asked for.  */
+   textattr (norm_attr);
+   ScreenClear ();
+ 
+   /* We know how to produce a visible bell.  */
+   terminal_has_visible_bell_p = 1;
+ 
+   /* Set all the hooks to our PC-specific functions.  */
+   terminal_begin_inverse_hook       = pc_begin_inverse;
+   terminal_end_inverse_hook         = pc_end_inverse;
+   terminal_prep_terminal_hook       = pc_prep_terminal;
+   terminal_unprep_terminal_hook     = pc_unprep_terminal;
+   terminal_up_line_hook             = pc_up_line;
+   terminal_down_line_hook           = pc_down_line;
+   terminal_clear_screen_hook        = pc_clear_screen;
+   terminal_clear_to_eol_hook        = pc_clear_to_eol;
+   terminal_get_screen_size_hook     = pc_get_screen_size;
+   terminal_goto_xy_hook             = pc_goto_xy;
+   terminal_new_terminal_hook        = pc_new_terminal;
+   terminal_put_text_hook            = pc_put_text;
+   terminal_ring_bell_hook           = pc_ring_bell;
+   terminal_write_chars_hook         = pc_write_chars;
+   terminal_scroll_terminal_hook     = pc_scroll_terminal;
+ }
+ 
+ void pc_new_terminal (term_name)
+     char *term_name;
+ {
+   pc_initialize_terminal (term_name);
+ }
+ 
+ void pc_put_text (string)
+      char *string;
+ {
+   if (speech_friendly)
+     fputs (string, stdout);
+   else
+     cputs (string);
+ }
+ 
+ void pc_ring_bell()
+ {
+   if (terminal_has_visible_bell_p && terminal_use_visible_bell_p)
+     ScreenVisualBell ();
+   else
+     printf ("%c",'\a');
+ }
+ 
+ void pc_write_chars (string, nchars)
+     char *string;
+     int nchars;
+ {
+   if (speech_friendly)
+     printf ("%.*s",nchars, string);
+   else
+     cprintf ("%.*s",nchars, string);
+ }
+ 
+ void pc_scroll_terminal (start, end, amount)
+     int start, end, amount;
+ {
+   movetext (pc_info.winleft, start, pc_info.winright, end,
+ 	    pc_info.winleft, start+amount);
+ }
+ 
+ int       tputs (char *a, int b, int (*c)())
+ {
+   perror ("tputs"); return 0; /* here and below, added dummy retvals */
+ }
+ 
+ char*     tgoto (char*a, int b, int c)
+ {
+   perror ("tgoto"); return 0;
+ }
+ 
+ int       tgetnum (char*a)
+ {
+   perror ("tgetnum"); return 0;
+ }
+ 
+ int       tgetflag (char*a)
+ {
+   perror ("tgetflag"); return 0;
+ }
+ 
+ char*     tgetstr (char *a, char **b)
+ {
+   perror ("tgetstr"); return 0;
+ }
+ 
+ int       tgetent (char*a, char*b)
+ {
+   perror ("tgetent"); return 0;
+ }
+ 
+ int	tcgetattr(int fildes, struct termios *termios_p)
+ {
+   perror ("tcgetattr"); return 0;
+ }
+ 
+ int	tcsetattr(int fd, int opt_actions, const struct termios *termios_p)
+ {
+   perror ("tcsetattr"); return 0;
+ }
diff -c -r -N texinfo3.9-orig/info/pc_term.h texinfo3.9/info/pc_term.h
*** texinfo3.9-orig/info/pc_term.h	Thu Jan  1 00:00:00 1970
--- texinfo3.9/info/pc_term.h	Tue Oct  8 19:00:10 1996
***************
*** 0 ****
--- 1,43 ----
+ /* pc_term.h */
+ 
+ /* This file is part of the MSDOS-DJGPP-port of the GNU standalone
+    Info-reader
+ 
+    This program is free software; you can redistribute it and/or modify
+    it under the terms of the GNU General Public License as published by
+    the Free Software Foundation; either version 2, or (at your option)
+    any later version.
+ 
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+ 
+    You should have received a copy of the GNU General Public License
+    along with this program; if not, write to the Free Software
+    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ 
+ */
+ 
+ #ifndef PC_TERM_H
+ #define PC_TERM_H
+ 
+ void pc_begin_inverse();
+ void pc_end_inverse();
+ void pc_prep_terminal();
+ void pc_unprep_terminal();
+ void pc_up_line();
+ void pc_down_line();
+ void pc_clear_screen();
+ void pc_clear_to_eol();
+ void pc_get_screen_size();
+ void pc_goto_xy();
+ void pc_initialize_terminal();
+ void pc_new_terminal();
+ void pc_put_text();
+ void pc_ring_bell();
+ void pc_write_chars();
+ void pc_scroll_terminal();
+ 
+ #endif /* PC_TERM_H */
+  
diff -c -r -N texinfo3.9-orig/info/search.c texinfo3.9/info/search.c
*** texinfo3.9-orig/info/search.c	Fri Jun 16 18:00:44 1995
--- texinfo3.9/info/search.c	Tue Oct  8 19:49:58 1996
***************
*** 22,27 ****
--- 22,30 ----
     Written by Brian Fox (bfox@ai.mit.edu). */
  
  #include <ctype.h>
+ #if defined (HAVE_STDLIB_H)
+ #include <stdlib.h> /* for free() */
+ #endif
  #include <sys/types.h>
  #include <sys/stat.h>
  #include "general.h"
diff -c -r -N texinfo3.9-orig/info/session.c texinfo3.9/info/session.c
*** texinfo3.9-orig/info/session.c	Fri Jul 19 14:56:00 1996
--- texinfo3.9/info/session.c	Wed Oct 23 21:05:44 1996
***************
*** 22,27 ****
--- 22,31 ----
     Written by Brian Fox (bfox@ai.mit.edu). */
  
  #include "info.h"
+ #if defined (__DJGPP__)
+ #include <pc.h>     /* to allow read of single keys by getkey */
+ #include <keys.h>   /* the definitions of the special characters */
+ #endif  /* __DJGPP__ */
  #if defined (HAVE_SYS_FILE_H)
  #include <sys/file.h>
  #endif /* HAVE_SYS_FILE_H */
***************
*** 304,310 ****
--- 308,320 ----
  {
    FILE *stream;
  
+ #if defined(__MSDOS__)
+   /* We only need to open the stream when we read from a dribble
+      file.  But dribble files are binary, so open in binary mode.  */
+   stream = fopen (filename, "rb");
+ #else
    stream = fopen (filename, "r");
+ #endif
  
    if (!stream)
      return;
***************
*** 1322,1328 ****
        if (window == the_echo_area ||
  	  (window == windows && !echo_area_is_active))
  	{
! 	  register WINDOW *win, *last;
  
  	  for (win = windows; win; win = win->next)
  	    last = win;
--- 1332,1338 ----
        if (window == the_echo_area ||
  	  (window == windows && !echo_area_is_active))
  	{
! 	  register WINDOW *win, *last = 0; /* assignment shuts up -Wall */
  
  	  for (win = windows; win; win = win->next)
  	    last = win;
***************
*** 2795,2801 ****
       long start;
  {
    register int i;
!   long offset;
    char *target;
  
    target = strdup (string);
--- 2805,2811 ----
       long start;
  {
    register int i;
!   long offset = -1;	/* initialize for the case of i = 0 */
    char *target;
  
    target = strdup (string);
***************
*** 2872,2878 ****
       file's node list. */
    if (file_buffer->tags)
      {
!       register int current_tag, number_of_tags;
        char *last_subfile;
        TAG *tag;
  
--- 2882,2888 ----
       file's node list. */
    if (file_buffer->tags)
      {
!       register int current_tag = 0, number_of_tags; /* shut up -Wall */
        char *last_subfile;
        TAG *tag;
  
***************
*** 3471,3476 ****
--- 3481,3492 ----
  	{
  	  free (fb->contents);
  	  fb->contents = (char *)NULL;
+ #if defined (__MSDOS__)
+ 	  /* fb->finfo->st_size lies about the file size.  When the
+ 	     file is reloaded, it will not be read in its entirety
+ 	     unless we restore the original file size here.  */
+ 	  fb->finfo.st_size = fb->finfo.st_blksize;
+ #endif
  	}
      }
  }
***************
*** 4231,4236 ****
--- 4247,4256 ----
      {
        int rawkey;
  
+ #if defined (__DJGPP__)
+ /* DJGPP-specific keyboard-reading code for MSDOS.  */
+ #include "pc_getc.c"
+ #endif /* __DJGPP__ */
        rawkey = getc (info_input_stream);
        keystroke = rawkey;
  
***************
*** 4243,4249 ****
--- 4263,4277 ----
  	      display_inhibited = 0;
  	      display_update_display (windows);
  	      display_cursor_at_point (active_window);
+ #if 0
  	      rawkey = getc (info_input_stream);
+ #else
+ 	      /* Calling `info_get_input_char' rather than `getc' is
+ 		 required on MS-DOS (which doesn't use `getc' for
+ 		 reading from stdin) so that the input stream could
+ 		 be switched to keyboard when the dribble file ends.  */
+ 	      rawkey = info_get_input_char ();
+ #endif
  	      keystroke = rawkey;
  	    }
  
diff -c -r -N texinfo3.9-orig/info/terminal.c texinfo3.9/info/terminal.c
*** texinfo3.9-orig/info/terminal.c	Sun Sep 29 21:04:56 1996
--- texinfo3.9/info/terminal.c	Tue Oct  8 19:49:58 1996
***************
*** 25,30 ****
--- 25,33 ----
     Written by Brian Fox (bfox@ai.mit.edu). */
  
  #include <stdio.h>
+ #if defined (HAVE_STDLIB_H)
+ #include <stdlib.h> /* for atoi() */
+ #endif
  #include <sys/types.h>
  #include "terminal.h"
  #include "termdep.h"
***************
*** 52,58 ****
--- 55,69 ----
  VFunction *terminal_clear_to_eol_hook = (VFunction *)NULL;
  VFunction *terminal_get_screen_size_hook = (VFunction *)NULL;
  VFunction *terminal_goto_xy_hook = (VFunction *)NULL;
+ #ifdef  __MSDOS__
+ /* MSDOS uses the hooks for terminal I/O.  The only hook which needs
+    to be set here is the one that initializes the terminal.  All the
+    others are set by this initialization hook.  */
+ void pc_initialize_terminal(char *);
+ VFunction *terminal_initialize_terminal_hook = pc_initialize_terminal;
+ #else   /* not __MSDOS__ */
  VFunction *terminal_initialize_terminal_hook = (VFunction *)NULL;
+ #endif  /* not __MSDOS__ */
  VFunction *terminal_new_terminal_hook = (VFunction *)NULL;
  VFunction *terminal_put_text_hook = (VFunction *)NULL;
  VFunction *terminal_ring_bell_hook = (VFunction *)NULL;
diff -c -r -N texinfo3.9-orig/info/tilde.c texinfo3.9/info/tilde.c
*** texinfo3.9-orig/info/tilde.c	Sun Sep 29 23:12:30 1996
--- texinfo3.9/info/tilde.c	Tue Oct  8 19:43:26 1996
***************
*** 38,43 ****
--- 38,47 ----
  #include <stdlib.h>
  #endif
  
+ #if defined (HAVE_UNISTD_H) /* for getuid() */
+ #include <unistd.h>
+ #endif
+ 
  #include "tilde.h"
  #include <pwd.h>
  
diff -c -r -N texinfo3.9-orig/info/window.c texinfo3.9/info/window.c
*** texinfo3.9-orig/info/window.c	Mon Jun 19 20:37:08 1995
--- texinfo3.9/info/window.c	Tue Oct  8 19:49:58 1996
***************
*** 22,27 ****
--- 22,30 ----
     Written by Brian Fox (bfox@ai.mit.edu). */
  
  #include <stdio.h>
+ #if defined (HAVE_STDLIB_H)
+ #include <stdlib.h> /* for free() */
+ #endif
  #include <ctype.h>
  #include <sys/types.h>
  #include <sys/stat.h>
***************
*** 236,242 ****
  	  if ((win->height < WINDOW_MIN_HEIGHT) ||
  	      (win->height > avail))
  	    {
! 	      WINDOW *lastwin;
  
  	      /* Split the space among the available windows. */
  	      delta_each = avail / numwins;
--- 239,245 ----
  	  if ((win->height < WINDOW_MIN_HEIGHT) ||
  	      (win->height > avail))
  	    {
! 	      WINDOW *lastwin = 0; /* pacify -Wall */
  
  	      /* Split the space among the available windows. */
  	      delta_each = avail / numwins;
diff -c -r -N texinfo3.9-orig/makeinfo/makeinfo.c texinfo3.9/makeinfo/makeinfo.c
*** texinfo3.9-orig/makeinfo/makeinfo.c	Fri Oct  4 18:20:54 1996
--- texinfo3.9/makeinfo/makeinfo.c	Fri Oct 11 21:13:10 1996
***************
*** 60,65 ****
--- 60,70 ----
  #endif /* _AIX */
  
  #include <stdio.h>
+ 
+ #if defined (HAVE_STDLIB_H)
+ #include <stdlib.h>        /* for malloc() & Co. */
+ #endif /* !HAVE_STDLIB_H) */
+ 
  #include <sys/types.h>
  #include <ctype.h>
  #include <sys/stat.h>
***************
*** 118,123 ****
--- 123,141 ----
  extern void *malloc (), *realloc ();
  #endif /* __osf__ */
  
+ #if defined(__MSDOS__)
+ #define PATH_SEPARATOR ";"
+ /* LONG_FILENAMES (defined by "config.h" in DJGPP) determines
+    whether long filenames are supported on MSDOS.  It is NOT a
+    constant (DJGPP supports platforms that have long filenames and
+    those which do not) and therefore must be evaluated at run time. */
+ #ifndef LONG_FILENAMES
+ #define LONG_FILENAMES (0)
+ #endif
+ #else   /* !__MSDOS__ */
+ #define PATH_SEPARATOR ":"
+ #endif  /* __MSDOS__ */
+ 
  char **get_brace_args ();
  int array_len ();
  void free_array ();
***************
*** 873,879 ****
  	  include_files_path = (char *)
  	    xrealloc (include_files_path,
  		      2 + strlen (include_files_path) + strlen (optarg));
! 	  strcat (include_files_path, ":");
  	  strcat (include_files_path, optarg);
  	  break;
  
--- 891,897 ----
  	  include_files_path = (char *)
  	    xrealloc (include_files_path,
  		      2 + strlen (include_files_path) + strlen (optarg));
! 	  strcat (include_files_path, PATH_SEPARATOR);
  	  strcat (include_files_path, optarg);
  	  break;
  
***************
*** 1166,1180 ****
    /* VMS stat lies about the st_size value.  The actual number of
       readable bytes is always less than this value.  The arcane
       mysteries of VMS/RMS are too much to probe, so this hack
!     suffices to make things work. */
! #if defined (VMS)
    while ((n = read (file, result + count, file_size)) > 0)
      count += n;
    if (n == -1)
! #else /* !VMS */
      count = file_size;
      if (read (file, result, file_size) != file_size)
! #endif /* !VMS */
    error_exit:
      {
        if (result)
--- 1184,1201 ----
    /* VMS stat lies about the st_size value.  The actual number of
       readable bytes is always less than this value.  The arcane
       mysteries of VMS/RMS are too much to probe, so this hack
!      suffices to make things work. */
!   /* (No mysteries on MSDOS: the CR characters at end of each line
!      just get stripped, so we get less characters.  But the effect
!      is the same.)  */
! #if defined (VMS) || defined (__MSDOS__)
    while ((n = read (file, result + count, file_size)) > 0)
      count += n;
    if (n == -1)
! #else /* not VMS, not __MSDOS__ */
      count = file_size;
      if (read (file, result, file_size) != file_size)
! #endif /* not VMS, not __MSDOS__ */
    error_exit:
      {
        if (result)
***************
*** 1301,1306 ****
--- 1322,1332 ----
    char *basename;
  
    basename = strrchr (filename, '/');
+ #if defined (__MSDOS__)
+   /* There's always the case of `d:filename'...  */
+   if (!basename && filename[1] == ':')
+     basename = filename + 2;
+ #endif
    if (!basename)
      basename = filename;
    else
***************
*** 1339,1344 ****
--- 1365,1376 ----
    if (filename[i] == '/')
      i++;
  
+ #if defined(__MSDOS__)
+   /* If we have "d:file", return "d:".  */
+   if (i == 0 && filename[1] == ':')
+     i = 2;
+ #endif  /* __MSDOS__ */
+ 
    if (i)
      {
        result = (char *)xmalloc (1 + i);
***************
*** 1356,1362 ****
--- 1388,1398 ----
    register int i;
  
    for (i = strlen (name) - 1; i; i--)
+ #if defined(__MSDOS__)
+     if (name[i] == '/' || name[i] == ':')
+ #else
      if (name[i] == '/')
+ #endif
        return (strdup (name + i + 1));
  
    return (strdup (name));
***************
*** 1398,1404 ****
--- 1434,1450 ----
    if (filename[0] == '.' || filename[0] == '/')
      return (filename);
  
+ #if defined(__MSDOS__)
+   /* We can have filename like "d:file" which are also non-relative. */
+   if (filename[1] == ':')
+     return (filename);
+ 
+   if (filename[0] != '/'
+       && (input_name[0] == '/'
+ 	  || (filename[1] != ':' && input_name[1] == ':')))
+ #else   /* !__MSDOS__ */
    if (filename[0] != '/' && input_name[0] == '/')
+ #endif
      {
        /* Make it so that relative names work. */
        char *result;
***************
*** 1414,1419 ****
--- 1460,1470 ----
        if (result[i] == '/')
  	i++;
  
+ #if defined(__MSDOS__)
+       if (!i && result[1] == ':')
+ 	i = 2;
+ #endif
+ 
        strcpy (&result[i], filename);
        free (filename);
        return (result);
***************
*** 1435,1440 ****
--- 1486,1494 ----
    
    /* Already absolute? */
    if ((initial_character == '/') ||
+ #if defined(__MSDOS__)
+       (filename[1] == ':') ||
+ #endif
        ((strncmp (filename, "./", 2) == 0) ||
         (strncmp (filename, "../", 3) == 0)))
      return (strdup (filename));
***************
*** 1908,1916 ****
  /* Convert the file named by NAME.  The output is saved on the file
     named as the argument to the @setfilename command. */
  static char *suffixes[] = {
    ".texinfo",
    ".texi",
-   ".txinfo",
    "",
    (char *)NULL
  };
--- 1962,1970 ----
  /* Convert the file named by NAME.  The output is saved on the file
     named as the argument to the @setfilename command. */
  static char *suffixes[] = {
+   ".txinfo",	/* checked first, so on MSDOS .tex isn't treated as .texinfo */
    ".texinfo",
    ".texi",
    "",
    (char *)NULL
  };
***************
*** 3918,3924 ****
      }
  }
  
! #if defined (__osf__)
  #define LOCALTIME_CAST(x) (time_t *)(x)
  #else
  #define LOCALTIME_CAST(x) (x)
--- 3972,3978 ----
      }
  }
  
! #if defined (__osf__) || defined (__MSDOS__)
  #define LOCALTIME_CAST(x) (time_t *)(x)
  #else
  #define LOCALTIME_CAST(x) (x)
***************
*** 5273,5278 ****
--- 5327,5336 ----
      int which_file = 1;
      TAG_ENTRY *tags = tag_table;
      char *indirect_info = (char *)NULL;
+ #if defined (__MSDOS__)
+     int which_file_digits = 1;
+     int next_power_of_10  = 10;
+ #endif
  
      /* Remember the `header' of this file.  The first tag in the file is
         the bottom of the header; the top of the file is the start. */
***************
*** 5364,5369 ****
--- 5422,5444 ----
  		  sprintf
  		    (split_filename,
  		     "%s%s-%d", root_pathname, root_filename, which_file);
+ #if defined(__MSDOS__)
+ 		  if (!LONG_FILENAMES)
+ 		    {
+ 		      char *dot = strchr (root_filename, '.');
+ 		      /* If long filenames aren't supported, make sure we
+ 			 generate unique filenames (at least the 1st 999).  */
+ 		      if (dot)
+ 			/* Got extension. Make foo.i1,..,foo.i99,foo.100,... */
+ 			sprintf (split_filename, "%s%.*s%d", root_pathname,
+ 				 dot - root_filename + 1 + (which_file <= 99),
+ 				 root_filename, which_file);
+ 		      else /* foobar-1,..,fooba-10,..,foob-100,... */
+ 			sprintf (split_filename, "%s%.*s-%d", root_pathname,
+ 				 8 - which_file_digits - 1,
+ 				 root_filename, which_file);
+ 		    }
+ #endif
  
  		  fd = open
  		    (split_filename, O_WRONLY | O_TRUNC | O_CREAT, 0666);
***************
*** 5389,5395 ****
--- 5464,5490 ----
  
  		  sprintf (indirect_info, "%s-%d: %d\n",
  			   root_filename, which_file, file_top);
+ #if defined(__MSDOS__)
+ 		  if (!LONG_FILENAMES)
+ 		    {
+ 		      char *dot = strchr (root_filename, '.');
+ 		      if (dot)
+ 			/* foo.i1,..,foo.i10,..,foo.100,... */
+ 			sprintf (indirect_info, "%.*s%d: %d\n",
+ 				 dot - root_filename + 1 + (which_file <= 99),
+ 				 root_filename, which_file, file_top);
+ 		      else /* foobar-1,..,fooba-10,..,foob-100,... */
+ 			sprintf (indirect_info, "%.*s-%d: %d\n",
+ 				 8 - which_file_digits - 1,
+ 				 root_filename, which_file, file_top);
  
+ 		      if ((which_file + 1) / next_power_of_10 == 1)
+ 			{
+ 			  which_file_digits++;
+ 			  next_power_of_10 *= 10;
+ 			}
+ 		    }
+ #endif
  		  free (split_filename);
  		  indirect_info += strlen (indirect_info);
  		  which_file++;
***************
*** 7023,7028 ****
--- 7118,7125 ----
        execute_string (" -- %s on %s: %s %s", category, type_name, type_name2,
  		      defined_name);
        break;
+     default:
+       break;	/* pacify -Wall */
      }
    current_indent += default_indentation_increment;
  
***************
*** 7043,7048 ****
--- 7140,7147 ----
      case deftypemethod:
        process_defun_args (scan_args, 0);
        break;
+     default:
+       break;	/* pacify -Wall */
      }
    current_indent -= default_indentation_increment;
    close_single_paragraph ();
***************
*** 7069,7074 ****
--- 7168,7175 ----
        case deftp:
          execute_string ("%ctindex %s\n", COMMAND_PREFIX, defined_name);
          break;
+       default:
+ 	break;	/* pacify -Wall */
        }
  
    /* Deallocate the token list. */
***************
*** 9268,9279 ****
       `:'.  If I is 0, then the path has a leading colon.  Trailing colons
       are handled OK by the `else' part of the if statement; an empty
       string is returned in that case. */
!   if (i && string[i] == ':')
      i++;
  
    start = i;
  
!   while (string[i] && string[i] != ':') i++;
  
    *index = i;
  
--- 9369,9380 ----
       `:'.  If I is 0, then the path has a leading colon.  Trailing colons
       are handled OK by the `else' part of the if statement; an empty
       string is returned in that case. */
!   if (i && string[i] == PATH_SEPARATOR[0])
      i++;
  
    start = i;
  
!   while (string[i] && string[i] != PATH_SEPARATOR[0]) i++;
  
    *index = i;
  
***************
*** 9314,9319 ****
--- 9415,9424 ----
  
    /* Handle absolute pathnames. "./foo", "/foo", "../foo". */
    if (*filename == '/' ||
+ #ifdef  __MSDOS__
+       /* "d:something" is also treated as absolute pathname. */
+       (*filename && filename[1] == ':') ||
+ #endif
        (*filename == '.' &&
         (filename[1] == '/' ||
  	(filename[1] == '.' && filename[2] == '/'))))
diff -c -r -N texinfo3.9-orig/readme.djg texinfo3.9/readme.djg
*** texinfo3.9-orig/readme.djg	Thu Jan  1 00:00:00 1970
--- texinfo3.9/readme.djg	Sat Oct 12 13:52:46 1996
***************
*** 0 ****
--- 1,270 ----
+ Texinfo, Version 3.9 for MS-DOS/DJGPP v2.1
+ ==========================================
+ 
+ This is the README.djgpp file.  It discusses issues specific to the
+ port of GNU Texinfo 3.9 to the DJGPP environment under MS-DOS.  See
+ the other docs (README, NEWS, Changelog, INTRODUCTION, TODO) for more
+ general issues concerning this package.
+ 
+ Many thanks to Hans-Bernhard Broeker <Broeker@physik.rwth-aachen.de>
+ who did all the mundane work of applying DJGPP-specific DIFFS from the
+ Texinfo 3.6 distribution to v3.7, and also suggested many improvements
+ to the code.  This made my work of porting Texinfo 3.9 really easy and
+ pleasant.
+ 
+ 
+ 1. Installation
+    ------------
+ 
+    a. Go to your main DJGPP directory.  For instance, if your DJGPP
+       installation is rooted on C:\DJGPP, then type this:
+ 
+       cd c:\djgpp
+ 
+    b. Unzip the binary package:
+ 
+       pkunzip -d txi39b
+ 
+       or, if you prefer `unzip':
+ 
+       unzip txi39b
+ 
+    c. Optionally, set up environment variables for Info.  These are:
+ 
+        * INFO_LINES   -- screen size for Info.
+        * INFO_COLORS  -- screen colors for Info.
+ 
+       INFO_LINES can be one of 25 (the default), 28, 35, 40, 43, or 50
+       (that's if you have a VGA; EGAs only support 25, 35 and 43 lines).
+       I recommend 40 if your monitor is 17" or larger, and at least 28
+       lines for smaller monitors (I work with 40 lines even on 14"
+       monitors).
+ 
+       INFO_COLORS should have the following syntax:
+ 
+ 		set INFO_COLORS=XX.YY
+ 
+       where XX is the text attribute for text displayed in the text
+       windows and the echo area, and YY is the text attribute for the
+       modeline (aka the status line).  Each attribute is a numeric
+       value of a byte which describes the desired combination of
+       foreground and background colors.  The individual bits in the
+       attribute byte are defined as follows:
+ 
+ 			bBBBFFFF
+ 
+       where `b' is the blink bit, `BBB' are the 3 bits for background
+       color and `FFFF' are the 4 bits for the foreground color.  This is
+       the usual PC text attribute byte structure, and is further explained
+       in any standard reference on text-mode programming for PC.
+ 
+       My favorite setting for INFO_COLORS is `0x1e.0x31'.
+ 
+       After you've played with these variables and have chosen the values
+       you like, it's a good idea to put them on the DJGPP.ENV file, in the
+       [info] section.
+ 
+    d. Beginning with version 3.6, GNU Info can read Unix man pages.  If
+       you have a `man' clone on your system and would like to be able to
+       read man pages with Info, read the chapter ``Reading Man Pages''
+       below.
+ 
+    e. This port supports compressed Info files, like what Info under Unix
+       gives you.  For this to work, you will need to install a DOS port of
+       GNU `Gzip' package and to observe certain rules of file naming, so
+       that Info will find the compressed files working around the DOS 8.3
+       filename restriction.  The chapter ``Compressed Info Files'' below
+       explains the details of this.
+ 
+    f. If you need to use the `print-node' command, read the chapter
+       ``Printing Nodes'' below.
+ 
+    g. That's it!  You are now ready to use Info, Makeinfo, and Texindex.
+       To learn about them, type `Info' and press [Enter].  You will be
+       presented with the top-level menu of GNU/DJGPP hypertext
+       documentation.  If you are unfamiliar with Info, press `?' to see
+       the available commands.  Pressing `h' will cause Info to take you on
+       a guided tour through its features (recommended for first-time
+       users).
+ 
+    h. If you are used to Info ports of versions before 3.6, you should
+       know that the command binding to PC-specific keys has changed: the
+       numeric keypad keys invoke the same commands as their extended
+       namesakes.  That is, e.g., the key `PgUp' on the numeric keypad
+       invokes the same command as the grey `PgUp' key on the extended
+       keypad.  This was done at DJ's request, because laptop machines
+       don't have extended keys.  Commands to move between nodes
+       (previously bound to numeric keypad) are now bound to Ctrl-
+       varieties of numeric keypad keys (e.g., `next-node' is on
+       `Ctrl-PgDn', `prev-node' is on `Ctrl-PgUp', etc.).  You can use the
+       `M-x describe-key' command to see which command is invoked by a
+       particular key.
+ 
+    i. There are 3 MSDOS-specific changes in Texinfo 3.9, relative to
+       previous Texinfo ports:
+ 
+         * Info opens the dribble and input files in BINARY mode.  This
+ 	  allows to record keystrokes and restore them in another Info
+ 	  session, thus using dribble files as a startup or init file
+ 	  which changes default behavior, binds keys, etc.
+ 
+ 	* Info recognizes a new DOS-specific command-line option `-b'
+ 	  or `--speech-friendly'.  This option causes Info to use DOS
+ 	  I/O functions (`printf', `puts', etc.) instead of direct
+ 	  screen writes, which is required to enable speech
+ 	  synthesizer software (used by visually-impaired people) to
+ 	  grab the output.  When this option is given, the screen
+ 	  colors defined by the `INFO_COLORS' environment variable
+ 	  will be disabled, because stdio functions don't support
+ 	  color text.  This improvement was suggested and implemented
+ 	  by Hans-Bernhard Broeker <Broeker@physik.rwth-aachen.de>.
+ 
+         * Makeinfo now generates full .info-NN filenames when long
+ 	  filenames are supported (e.g. on Win9x) and short .iNN
+ 	  filenames otherwise.  When the Texinfo source or the
+ 	  command-line parameter -o specify an output file with no
+ 	  extension (like `texinfo'), and long filenames aren't
+ 	  supported, Makeinfo will make sure the generated names will
+ 	  be unique (it will create e.g. `texinf-1', `texin-10' etc.).
+ 
+ 
+ 2. Building Texinfo
+    ----------------
+ 
+    a. To recompile Texinfo, you will need the following tools:
+ 
+       - `update' and `redir' from the DJGPP djdev distribution
+       - `ar' and `ranlib' (e.g. from GNU Binutils)
+       - `sed' (the DJGPP port of GNU Sed recommended)
+       - `etags' (only if you need to generate the Emacs TAGS files)
+       - `rm' (for the `clean' targets only)
+       - `emacs' (to byte-compile the files in emacs/ directory); only
+ 	required if your Emacs version is older than 19.31, because
+ 	the .el files in Texinfo 3.9 are never newer than those which
+ 	come with Emacs 19.31 and later
+ 
+    b. From the root of your DJGPP installation, unzip the source package:
+ 
+       unzip txi39s
+ 
+       or
+ 
+       pkunzip -d txi39s
+ 
+       If you build Texinfo on Windows 9x, you are advised to use a
+       version of Unzip which supports long filenames, so that the
+       original long filenames of the source files will be preserved.
+ 
+    c. Go to the topmost directory of Texinfo distribution:
+ 
+       cd gnu\texinfo3.9
+ 
+    d. Run `CONFIGUR.BAT'.  This creates `config.h' file in the topmost
+       directory and Makefiles in all the directories.  It does so by
+       running the `configdj.sed' and `confsub.sed' Sed scripts.
+ 
+    e. Run `Make'.  This builds the programs and the Info files.
+ 
+    f. If you need the Emacs support files from the emacs/ directory, go
+       into that directory and type:
+ 
+       make elisp
+ 
+    g. Install the programs and the other products as appropriate.  The
+       various `install:' targets will only work if you have a
+       Unix-like shell installed anywhere on your PATH under the name
+       `sh' with any executable extensions, like `sh.exe', `sh.com',
+       `sh.bat' etc.
+ 
+    h. The `DIFFS' file in the topmost Texinfo directory (the one where
+       you run Make) describes the patches applied to the official GNU
+       distribution for this port, so you can see what I've broken.
+       Note that some of the patches correct what I think are genuine
+       bugs in the original sources (I've reported those to FSF; most
+       of them merely pacify gcc when invoked with -Wall switch).
+ 
+ 
+ 3. Reading Man Pages
+    -----------------
+ 
+    Yes, Info can now read man pages!  This port supports that feature,
+    but for it to work, you will have to make sure your `man' clone is
+    set up correctly:
+ 
+    a. You should have an executable file named `man.exe', `man.com'
+       etc. somewhere on your PATH.
+ 
+    b. When invoked with redirected stdout, that executable should
+       print the contents of the file it gets as its argument to stdout
+       and exit.  If your man command calls some pager, that pager
+       should have this behavior (various ports of Unix command `more'
+       and the DJGPP port of GNU Less behave that way).
+ 
+    In the extreme case, you can create a `man.bat' batch file which
+    just prints the contents of the file given as its argument, like
+    this:
+ 
+ 		@echo off
+ 		type d:\yourpath\%1.1
+ 
+    (this assumes that you hold formatted man pages in d:\yourpath).
+ 
+ 
+ 4. Compressed Info Files
+    ---------------------
+ 
+    Info allows you to hold your Info files in compressed form, to save
+    disk space.  When a file Info wants cannot be found, it will
+    automatically try to find that file in compressed form.  Info does
+    this by trying to find the original file with specific extensions.
+    Each extension tells Info which program should be called to
+    decompress the file.
+ 
+    This port supports compression by the GNU Gzip program.  When Info
+    cannot find a file `foo', it will first try to find `foo.z' or
+    `foo.gz'.  If this fails, and the file has an extension, the last
+    one or two characters of the extension are replaced by `z' and `gz'
+    respectively, and Info tries again.  If it finds any of these, it
+    will call the `GUnzip' program to decompress the file, catch its
+    output and display it.  (The original compressed file stays
+    intact.)
+ 
+    So, to use this feature, compress your files with Gzip and call the
+    compressed files using the following as guidelines:
+ 
+ 		foo       -->    foo.gz
+ 		foo.inf	  -->	 foo.igz
+ 		foo.i5	  -->	 foo.i5z
+ 		foo.25	  -->	 foo.25z
+ 
+    If you have a package whose Info docs are split into more than 9
+    sub-files and you need to compress those files, you will have to
+    rename the sub-files from `foo.iNN' to `foo.NN' so that there will
+    be place for the trailing `z' in the compressed names.  Don't
+    forget to edit the indirect file table in the main Info file and
+    change the sub-file filenames there too!
+ 
+    On platforms which support long filenames, the usual Info behavior
+    of appending `.gz' or `.Z' to the original filename also works;
+    this is done *before* Info checks the above butchered names.
+ 
+ 5. Printing Nodes
+    --------------
+       
+    Info has a `print-node' command.  It works by piping the contents of
+    the current node through a program which is named by the environment
+    variable INFO_PRINT_COMMAND.  That command should read its standard
+    input and write it to your printer.  Find any such program, put its
+    name into the above environment variable, and you can print nodes from
+    within Info.
+ 
+ 6. Bug Reports
+    -----------
+ 
+    If you see any bugs which seem specific to this DOS port, please tell
+    me about them.
+ 
+ 
+    Enjoy,
+ 
+ 				Eli Zaretskii <eliz@is.elta.co.il>
diff -c -r -N texinfo3.9-orig/util/install-.c texinfo3.9/util/install-.c
*** texinfo3.9-orig/util/install-.c	Thu Oct  3 23:13:36 1996
--- texinfo3.9/util/install-.c	Fri Oct 11 16:23:20 1996
***************
*** 614,619 ****
--- 614,628 ----
      unsigned basename_len;
      extern char *strrchr ();
      char *infile_basename = strrchr (infile, '/');
+ #if defined (__MSDOS__)
+     {
+       char *backslash = strrchr (infile, '\\');
+       if (!infile_basename || backslash > infile_basename)
+ 	infile_basename = backslash;
+       if (!infile_basename && infile[1] == ':')
+ 	infile_basename = infile + 1;
+     }
+ #endif
      if (infile_basename)
        infile_basename++;
      else
***************
*** 625,630 ****
--- 634,656 ----
           && strcmp (infile_basename + basename_len - 5, ".info") == 0)
          ? copy_string (infile_basename, basename_len - 5)
          : infile_basename;
+ 
+ #if defined (__MSDOS__)
+     if (infile_sans_info == infile_basename)
+       {
+ 	/* We need a case-insensitive comparison.  */
+ 	infile_sans_info
+ 	  = (strlen (infile_basename) > 5
+ 	     && stricmp (infile_basename + basename_len - 5, ".info") == 0)
+ 	  ? copy_string (infile_basename, basename_len - 5)
+ 	  : infile_basename;
+ 
+ 	/* We can have a .inf file instead of .info.  */
+ 	if (strlen (infile_basename) > 4
+ 	    && stricmp (infile_basename + basename_len - 4, ".inf") == 0)
+ 	  infile_sans_info = copy_string (infile_basename, basename_len - 4);
+       }
+ #endif
  
      infilelen_sans_info = strlen (infile_sans_info);
    }
diff -c -r -N texinfo3.9-orig/util/texindex.c texinfo3.9/util/texindex.c
*** texinfo3.9-orig/util/texindex.c	Fri Oct  4 18:21:30 1996
--- texinfo3.9/util/texindex.c	Fri Oct 11 16:35:20 1996
***************
*** 209,214 ****
--- 209,223 ----
    last_deleted_tempcount = 0;
  
    program_name = strrchr (argv[0], '/');
+ #ifdef __MSDOS__
+   {
+     char *backslash = strrchr (argv[0], '\\');
+     if (program_name == (char *)NULL || backslash > program_name)
+       program_name = backslash;
+     if (program_name == (char *)NULL && argv[0][1] == ':')
+       program_name = argv[0] + 1;
+   }
+ #endif
    if (program_name != (char *)NULL)
      program_name++;
    else
***************
*** 343,349 ****
  #ifdef VMS
    if (tempdir == NULL)
      tempdir = "sys$scratch:";
! #else
    if (tempdir == NULL)
      tempdir = "/tmp/";
    else
--- 352,365 ----
  #ifdef VMS
    if (tempdir == NULL)
      tempdir = "sys$scratch:";
! #else /* !VMS */
! #ifdef __MSDOS__
!   tempdir = getenv ("TEMP");
!   if (tempdir == NULL)
!     tempdir = getenv ("TMP");
!   if (tempdir == NULL)
!     tempdir = ".";
! #endif /* __MSDOS__ */
    if (tempdir == NULL)
      tempdir = "/tmp/";
    else
***************
*** 420,426 ****
--- 436,448 ----
       int count;
  {
    char tempsuffix[10];
+ #ifdef __MSDOS__
+   /* Use the extension: gives us 3 more characters
+      before we risk a collision.  */
+   sprintf (tempsuffix, ".%d", count);
+ #else
    sprintf (tempsuffix, "%d", count);
+ #endif
    return concat (tempdir, tempbase, tempsuffix);
  }
  
***************
*** 1310,1316 ****
  	{
  	  fprintf (ostream, "\\initial {");
  	  fwrite (initial, 1, initiallength, ostream);
! 	  fprintf (ostream, "}\n", initial);
  	  if (initial == initial1)
  	    {
  	      lastinitial = lastinitial1;
--- 1332,1338 ----
  	{
  	  fprintf (ostream, "\\initial {");
  	  fwrite (initial, 1, initiallength, ostream);
! 	  fputs ("}\n", ostream);
  	  if (initial == initial1)
  	    {
  	      lastinitial = lastinitial1;
