Only in new: README2
Only in new: bison.def
Only in new: bison.exe
Only in new: bison2.exe
diff -c bison-1.25/files.c new/files.c
*** bison-1.25/files.c	Sun Oct 15 15:01:30 1995
--- new/files.c	Thu Aug  1 10:10:04 1996
***************
*** 99,111 ****
  }
  
  
  /* JF this has been hacked to death.  Nowaday it sets up the file names for
     the output files, and opens the tmp files and the parser */
  void
  openfiles()
  {
    char *name_base;
-   register char *cp;
    char *filename;
    int base_length;
    int short_base_length;
--- 99,131 ----
  }
  
  
+ #ifdef _MSDOS
+ #ifdef OS2
+ #define DOSMODE (_osmode == DOS_MODE)
+ #else
+ #define DOSMODE 1
+ #endif
+ 
+ void
+ searchenv(char *name, char *path)
+ {
+   char *env_var[] = {"INIT", "DPATH", "PATH", NULL};
+   char **p = env_var;
+ 
+   while (*p) {
+     _searchenv(name, *p++, path);
+     if (*path) break;
+   }
+ }
+ #endif
+ 
+ 
  /* JF this has been hacked to death.  Nowaday it sets up the file names for
     the output files, and opens the tmp files and the parser */
  void
  openfiles()
  {
    char *name_base;
    char *filename;
    int base_length;
    int short_base_length;
***************
*** 117,128 ****
  #endif
    int tmp_len;
  
! #ifdef MSDOS
    tmp_base = getenv ("TMP");
    if (tmp_base == 0)
      tmp_base = "";
!   strlwr (infile);
! #endif /* MSDOS */
  
    tmp_len = strlen (tmp_base);
  
--- 137,157 ----
  #endif
    int tmp_len;
  
! #ifdef _MSDOS
    tmp_base = getenv ("TMP");
    if (tmp_base == 0)
      tmp_base = "";
!   else {
!     tmp_len = strlen (tmp_base);
!     if (! strchr("/\\:", tmp_base[tmp_len-1]) ) {
!       tmp_base = xmalloc(tmp_len+2);
!       strcpy (tmp_base, getenv("TMP"));
!       strcat (tmp_base, "/");
!     }
!   }
!   if (DOSMODE) 
!     strlwr (infile);
! #endif /* _MSDOS */
  
    tmp_len = strlen (tmp_base);
  
***************
*** 131,139 ****
        /* -o was specified.  The precise -o name will be used for ftable.
  	 For other output files, remove the ".c" or ".tab.c" suffix.  */
        name_base = spec_outfile;
! #ifdef MSDOS
!       strlwr (name_base);
! #endif /* MSDOS */
        /* BASE_LENGTH includes ".tab" but not ".c".  */
        base_length = strlen (name_base);
        if (!strcmp (name_base + base_length - 2, ".c"))
--- 160,169 ----
        /* -o was specified.  The precise -o name will be used for ftable.
  	 For other output files, remove the ".c" or ".tab.c" suffix.  */
        name_base = spec_outfile;
! #ifdef _MSDOS
!       if (DOSMODE)
! 	strlwr (name_base);
! #endif /* _MSDOS */
        /* BASE_LENGTH includes ".tab" but not ".c".  */
        base_length = strlen (name_base);
        if (!strcmp (name_base + base_length - 2, ".c"))
***************
*** 160,168 ****
  #else
        strcat (name_base, ".tab");
  #endif
! #ifdef MSDOS
!       strlwr (name_base);
! #endif /* MSDOS */
      }
    else
      {
--- 190,199 ----
  #else
        strcat (name_base, ".tab");
  #endif
! #ifdef _MSDOS
!       if (DOSMODE)
! 	strlwr (name_base);
! #endif /* _MSDOS */
      }
    else
      {
***************
*** 181,191 ****
  #ifdef VMS
        name_base = stringappend(name_base, short_base_length, "_tab");
  #else
! #ifdef MSDOS
        name_base = stringappend(name_base, short_base_length, "_tab");
  #else
        name_base = stringappend(name_base, short_base_length, ".tab");
! #endif /* not MSDOS */
  #endif
        base_length = short_base_length + 4;
      }
--- 212,222 ----
  #ifdef VMS
        name_base = stringappend(name_base, short_base_length, "_tab");
  #else
! #ifdef _MSDOS
        name_base = stringappend(name_base, short_base_length, "_tab");
  #else
        name_base = stringappend(name_base, short_base_length, ".tab");
! #endif /* not _MSDOS */
  #endif
        base_length = short_base_length + 4;
      }
***************
*** 195,218 ****
    if (! noparserflag) 
      {
        filename = getenv("BISON_SIMPLE");
! #ifdef MSDOS
!       /* File doesn't exist in current directory; try in INIT directory.  */
!       cp = getenv("INIT");
!       if (filename == 0 && cp != NULL)
!         {
!           filename = xmalloc(strlen(cp) + strlen(PFILE) + 2);
!           strcpy(filename, cp);
!           cp = filename + strlen(filename);
!           *cp++ = '/';
!           strcpy(cp, PFILE);
!         }
! #endif /* MSDOS */
        fparser = tryopen(filename ? filename : PFILE, "r");
      }
  
    if (verboseflag)
      {
! #ifdef MSDOS
        outfile = stringappend(name_base, short_base_length, ".out");
  #else
        /* We used to use just .out if spec_name_prefix (-p) was used,
--- 226,247 ----
    if (! noparserflag) 
      {
        filename = getenv("BISON_SIMPLE");
! #ifdef _MSDOS
!       if (! filename) {  /* Search in standard locations */
! 	filename = xmalloc(_MAX_PATH+1);
! 	searchenv(PFILE, filename);
! 	if (*filename == '\0') {
! 	  free(filename);
! 	  filename = NULL;
! 	}
!       }
! #endif /* _MSDOS */
        fparser = tryopen(filename ? filename : PFILE, "r");
      }
  
    if (verboseflag)
      {
! #ifdef _MSDOS
        outfile = stringappend(name_base, short_base_length, ".out");
  #else
        /* We used to use just .out if spec_name_prefix (-p) was used,
***************
*** 229,235 ****
        faction = tryopen(actfile, "w");
      } 
  
! #ifdef MSDOS
    if (! noparserflag)
      actfile = mktemp(stringappend(tmp_base, tmp_len, "acXXXXXX"));
    tmpattrsfile = mktemp(stringappend(tmp_base, tmp_len, "atXXXXXX"));
--- 258,264 ----
        faction = tryopen(actfile, "w");
      } 
  
! #ifdef _MSDOS
    if (! noparserflag)
      actfile = mktemp(stringappend(tmp_base, tmp_len, "acXXXXXX"));
    tmpattrsfile = mktemp(stringappend(tmp_base, tmp_len, "atXXXXXX"));
***************
*** 241,247 ****
    tmpattrsfile = mktemp(stringappend(tmp_base, tmp_len, "attrs.XXXXXX"));
    tmptabfile = mktemp(stringappend(tmp_base, tmp_len, "tab.XXXXXX"));
    tmpdefsfile = mktemp(stringappend(tmp_base, tmp_len, "defs.XXXXXX"));
! #endif /* not MSDOS */
  
    if (! noparserflag)
      faction = tryopen(actfile, "w+");
--- 270,276 ----
    tmpattrsfile = mktemp(stringappend(tmp_base, tmp_len, "attrs.XXXXXX"));
    tmptabfile = mktemp(stringappend(tmp_base, tmp_len, "tab.XXXXXX"));
    tmpdefsfile = mktemp(stringappend(tmp_base, tmp_len, "defs.XXXXXX"));
! #endif /* not _MSDOS */
  
    if (! noparserflag)
      faction = tryopen(actfile, "w+");
***************
*** 254,260 ****
        fdefines = tryopen(tmpdefsfile, "w+");
      }
  
! #ifndef MSDOS
    if (! noparserflag)
      unlink(actfile);
    unlink(tmpattrsfile);
--- 283,289 ----
        fdefines = tryopen(tmpdefsfile, "w+");
      }
  
! #ifndef _MSDOS
    if (! noparserflag)
      unlink(actfile);
    unlink(tmpattrsfile);
***************
*** 272,284 ****
    attrsfile = stringappend(name_base, short_base_length, "_stype.h");
    guardfile = stringappend(name_base, short_base_length, "_guard.c");
  #else
! #ifdef MSDOS
    attrsfile = stringappend(name_base, short_base_length, ".sth");
    guardfile = stringappend(name_base, short_base_length, ".guc");
  #else
    attrsfile = stringappend(name_base, short_base_length, ".stype.h");
    guardfile = stringappend(name_base, short_base_length, ".guard.c");
! #endif /* not MSDOS */
  #endif /* not VMS */
  }
  
--- 301,313 ----
    attrsfile = stringappend(name_base, short_base_length, "_stype.h");
    guardfile = stringappend(name_base, short_base_length, "_guard.c");
  #else
! #ifdef _MSDOS
    attrsfile = stringappend(name_base, short_base_length, ".sth");
    guardfile = stringappend(name_base, short_base_length, ".guc");
  #else
    attrsfile = stringappend(name_base, short_base_length, ".stype.h");
    guardfile = stringappend(name_base, short_base_length, ".guard.c");
! #endif /* not _MSDOS */
  #endif /* not VMS */
  }
  
***************
*** 292,298 ****
  {
    FILE *ftmp;
    int c;
!   char *filename, *cp;
  
    if (fparser)
      fclose(fparser);
--- 321,327 ----
  {
    FILE *ftmp;
    int c;
!   char *filename;
  
    if (fparser)
      fclose(fparser);
***************
*** 300,316 ****
    if (! noparserflag) 
      {
        filename = (char *) getenv ("BISON_HAIRY");
! #ifdef MSDOS
!       /* File doesn't exist in current directory; try in INIT directory.  */
!       cp = getenv("INIT");
!       if (filename == 0 && cp != NULL)
!         {
!           filename = xmalloc(strlen(cp) + strlen(PFILE1) + 2);
!           strcpy(filename, cp);
!           cp = filename + strlen(filename);
!           *cp++ = '/';
!           strcpy(cp, PFILE1);
!         }
  #endif
        fparser= tryopen(filename ? filename : PFILE1, "r");
      }
--- 329,343 ----
    if (! noparserflag) 
      {
        filename = (char *) getenv ("BISON_HAIRY");
! #ifdef _MSDOS
!       if (! filename) {  /* Search in standard locations */
! 	filename = xmalloc(_MAX_PATH);
! 	searchenv(PFILE1, filename);
! 	if (*filename == '\0') {
! 	  free(filename);
! 	  filename = NULL;
! 	}
!       }
  #endif
        fparser= tryopen(filename ? filename : PFILE1, "r");
      }
***************
*** 403,414 ****
    if (k==0) sys$exit(SS$_NORMAL);
    sys$exit(SS$_ABORT);
  #else
! #ifdef MSDOS
    if (actfile && ! noparserflag) unlink(actfile);
    if (tmpattrsfile) unlink(tmpattrsfile);
    if (tmptabfile) unlink(tmptabfile);
    if (tmpdefsfile) unlink(tmpdefsfile);
! #endif /* MSDOS */
    exit(k);
  #endif /* not VMS, or __VMS_POSIX */
  }
--- 430,441 ----
    if (k==0) sys$exit(SS$_NORMAL);
    sys$exit(SS$_ABORT);
  #else
! #ifdef _MSDOS
    if (actfile && ! noparserflag) unlink(actfile);
    if (tmpattrsfile) unlink(tmpattrsfile);
    if (tmptabfile) unlink(tmptabfile);
    if (tmpdefsfile) unlink(tmpdefsfile);
! #endif /* _MSDOS */
    exit(k);
  #endif /* not VMS, or __VMS_POSIX */
  }
Only in new: makefile
