diff -cNr mawk-1.2.2/msdos/makefile.msc new/msdos/makefile.msc
*** mawk-1.2.2/msdos/makefile.msc	Sun Aug 20 12:44:35 1995
--- new/msdos/makefile.msc	Sun Feb  4 11:46:08 1996
***************
*** 1,106 ****
! # Microsoft C 6.0A makefile for mawk,
  # an implementation of The AWK Programming Language, 1988.
  # 
! # This makefile requires Microsoft C's NMAKE program
  
! ####################################
! # user settable macros
! #
  
! CC = cl.exe
! CFLAGS = -O -Gs
  
! ####################################
! # rules for large-memory object files
! #
! .c.obl:
! 	$(CC) $(CFLAGS) -AL -c -Fo$@ $<
  
! #######################################
  
! OBL = parse.obl \
! array.obl \
! bi_funct.obl \
! bi_vars.obl \
! cast.obl \
! code.obl \
! da.obl \
! error.obl \
! execute.obl \
! fcall.obl \
! field.obl \
! files.obl \
! fin.obl \
! hash.obl \
! init.obl \
! jmp.obl \
! kw.obl \
! main.obl \
! matherr.obl \
! memory.obl \
! print.obl \
! re_cmpl.obl \
! scan.obl \
! scancode.obl \
! split.obl \
! zmalloc.obl  \
! version.obl  \
! dosexec.obl
! 
! REXP_OBL = rexp.obl \
! rexp0.obl \
! rexp1.obl \
! rexp2.obl \
! rexp3.obl \
! rexpdb.obl
  
  
! mawk.exe : $(OBL)  $(REXP_OBL)
!         link.exe @msdos\mawkmsc.lnk
  
  
  RFLAGS=-I. -Irexp -DMAWK
  
! rexp.obl  :  rexp\rexp.c  rexp\rexp.h
!         $(CC) $(CFLAGS) $(RFLAGS) -AL -c -Fo$@ rexp\rexp.c
  
! rexp0.obl  :  rexp\rexp0.c  rexp\rexp.h
!         $(CC) $(CFLAGS) $(RFLAGS) -AL -c -Fo$@ rexp\rexp0.c
  
! rexp1.obl  :  rexp\rexp1.c  rexp\rexp.h
!         $(CC) $(CFLAGS) $(RFLAGS) -AL -c -Fo$@ rexp\rexp1.c
  
! rexp2.obl  :  rexp\rexp2.c  rexp\rexp.h
!         $(CC) $(CFLAGS) $(RFLAGS) -AL -c -Fo$@ rexp\rexp2.c
  
! rexp3.obl  :  rexp\rexp3.c  rexp\rexp.h
!         $(CC) $(CFLAGS) $(RFLAGS) -AL -c -Fo$@ rexp\rexp3.c
  
! rexpdb.obl  :  rexp\rexpdb.c  rexp\rexp.h
!         $(CC) $(CFLAGS) $(RFLAGS) -AL -c -Fo$@ rexp\rexpdb.c
  
! config.h : msdos\msc.h
  	copy msdos\msc.h  config.h
  
! dosexec.c : msdos\dosexec.c
  	copy msdos\dosexec.c dosexec.c
  
  test : mawk.exe  # test that we have a sane mawk
- 	copy mawk.exe test\mawk.exe
- 	cd test
  	@echo you may have to run the test manually
!         @mawktest.bat
! 	del mawk.exe
! 	cd ..
  
  fpe_test :  mawk.exe # test FPEs are handled OK
- 	copy mawk.exe test\mawk.exe
  	@echo testing floating point exception handling
- 	cd test
  	@echo you may have to run the test manually
!         @fpe_test.bat
! 	del mawk.exe
! 	cd ..
  
  ###################################################
  # parse.c is provided 
--- 1,97 ----
! # Microsoft C makefile for mawk,
  # an implementation of The AWK Programming Language, 1988.
  # 
! # Tested with Microsoft C vers 6 and 7, using the following make utils:
! #   dmake-3.8, GNUish make, Kneller's Ndmake, and Microsoft's nmake
  
! #========================== Configuration ===============================
! # Compiler flags:
! #  -AL large model
! #  -Gs remove stack probes, -G2 requires 286-or-better
! #  -O,-Ot optimize for time, -Os optimize for size
! # MSDOS and _MSC_VER are predefined.
  
! CC = cl -nologo
! CFLAGS = -AL -O $(DEFS)
  
! MSCLIB=llibce
! 
! # Link and bind for DOS-only programs
! STACK=0x4000
! LF2=$(MSCLIB)
! 
! # Link and bind for bound OS/2 and DOS programs
! STACK=0x4800
! LF2=$(MSCLIB)p,mawk.def
! BIND=bind $@
! DEFS=-DOS2
! 
! #========================================================================
! 
! 
! .c.obj:
! 	$(CC) $(CFLAGS) -c $<
  
! OBJ1 = parse.obj array.obj bi_funct.obj bi_vars.obj cast.obj code.obj \
! 	da.obj error.obj execute.obj fcall.obj 
  
! OBJ2 =  field.obj files.obj fin.obj hash.obj jmp.obj init.obj \
! 	kw.obj main.obj matherr.obj
  
+ OBJ3 = memory.obj print.obj re_cmpl.obj scan.obj scancode.obj split.obj \
+ 	zmalloc.obj version.obj dosexec.obj
  
! OBJ = $(OBJ1) $(OBJ2) $(OBJ3)
  
+ REXP_OBJ = rexp.obj rexp0.obj rexp1.obj rexp2.obj rexp3.obj rexpdb.obj
+ 
+ RSP = mawk.lnk
+ 
+ mawk.exe : $(OBJ) $(REXP_OBJ) $(RSP)
+ 	link @$(RSP) setargv.obj/NOE,$@,,/NOD:llibce $(LF2)/STACK:$(STACK);
+ 	$(BIND)
+ 
+ $(RSP) : $(OBJ) $(REXP_OBJ)
+ 	echo $(OBJ1)+ > $@
+ 	echo $(OBJ2)+ >> $@
+ 	echo $(OBJ3)+ >> $@
+ 	echo $(REXP_OBJ)+ >> $@
  
  RFLAGS=-I. -Irexp -DMAWK
  
! rexp.obj  :  rexp/rexp.c  rexp/rexp.h
! 	$(CC) $(CFLAGS) $(RFLAGS) -c rexp/rexp.c
  
! rexp0.obj  :  rexp/rexp0.c  rexp/rexp.h
! 	$(CC) $(CFLAGS) $(RFLAGS) -c rexp/rexp0.c
  
! rexp1.obj  :  rexp/rexp1.c  rexp/rexp.h
! 	$(CC) $(CFLAGS) $(RFLAGS) -c rexp/rexp1.c
  
! rexp2.obj  :  rexp/rexp2.c  rexp/rexp.h
! 	$(CC) $(CFLAGS) $(RFLAGS) -c rexp/rexp2.c
  
! rexp3.obj  :  rexp/rexp3.c  rexp/rexp.h
! 	$(CC) $(CFLAGS) $(RFLAGS) -c rexp/rexp3.c
  
! rexpdb.obj  :  rexp/rexpdb.c  rexp/rexp.h
! 	$(CC) $(CFLAGS) $(RFLAGS) -c rexp/rexpdb.c
  
! config.h : msdos/msc.h
  	copy msdos\msc.h  config.h
+ 	copy msdos\mawk.def .
  
! dosexec.c : msdos/dosexec.c
  	copy msdos\dosexec.c dosexec.c
  
  test : mawk.exe  # test that we have a sane mawk
  	@echo you may have to run the test manually
! 	cd test && mawktest.bat
  
  fpe_test :  mawk.exe # test FPEs are handled OK
  	@echo testing floating point exception handling
  	@echo you may have to run the test manually
! 	cd test && fpe_test.bat
  
  ###################################################
  # parse.c is provided 
***************
*** 121,161 ****
  #	del makescan.exe
  
  clean :
! 	del *.obl
  
  distclean :
! 	del *.obl
  	del config.h dosexec.c
  	del mawk.exe
  
  
  #  dependencies of .objs on .h
! array.obl : config.h field.h bi_vars.h mawk.h symtype.h nstd.h memory.h zmalloc.h types.h sizes.h
! bi_funct.obl : config.h field.h bi_vars.h mawk.h init.h regexp.h symtype.h nstd.h repl.h memory.h bi_funct.h files.h zmalloc.h fin.h types.h sizes.h
! bi_vars.obl : config.h field.h bi_vars.h mawk.h init.h symtype.h nstd.h memory.h zmalloc.h types.h sizes.h
! cast.obl : config.h field.h mawk.h parse.h symtype.h nstd.h memory.h repl.h scan.h zmalloc.h types.h sizes.h
! code.obl : config.h field.h code.h mawk.h init.h symtype.h nstd.h memory.h jmp.h zmalloc.h types.h sizes.h
! da.obl : config.h field.h code.h mawk.h symtype.h nstd.h memory.h repl.h bi_funct.h zmalloc.h types.h sizes.h
! error.obl : config.h bi_vars.h mawk.h parse.h vargs.h symtype.h nstd.h scan.h types.h sizes.h
! execute.obl : config.h field.h bi_vars.h code.h mawk.h regexp.h symtype.h nstd.h memory.h repl.h bi_funct.h zmalloc.h types.h fin.h sizes.h
! fcall.obl : config.h code.h mawk.h symtype.h nstd.h memory.h zmalloc.h types.h sizes.h
! field.obl : config.h field.h bi_vars.h mawk.h init.h parse.h regexp.h symtype.h nstd.h memory.h repl.h scan.h zmalloc.h types.h sizes.h
! files.obl : config.h mawk.h nstd.h memory.h files.h zmalloc.h types.h fin.h sizes.h
! fin.obl : config.h field.h bi_vars.h mawk.h parse.h symtype.h nstd.h memory.h scan.h zmalloc.h types.h fin.h sizes.h
! hash.obl : config.h mawk.h symtype.h nstd.h memory.h zmalloc.h types.h sizes.h
! init.obl : config.h field.h bi_vars.h code.h mawk.h init.h symtype.h nstd.h memory.h zmalloc.h types.h sizes.h
! jmp.obl : config.h code.h mawk.h init.h symtype.h nstd.h memory.h jmp.h zmalloc.h types.h sizes.h
! kw.obl : config.h mawk.h init.h parse.h symtype.h nstd.h types.h sizes.h
! main.obl : config.h field.h bi_vars.h code.h mawk.h init.h symtype.h nstd.h memory.h files.h zmalloc.h types.h fin.h sizes.h
! makescan.obl : parse.h symtype.h scan.h
! matherr.obl : config.h mawk.h nstd.h types.h sizes.h
! memory.obl : config.h mawk.h nstd.h memory.h zmalloc.h types.h sizes.h
! parse.obl : config.h field.h bi_vars.h code.h mawk.h symtype.h nstd.h memory.h bi_funct.h files.h zmalloc.h jmp.h types.h sizes.h
! print.obl : config.h field.h bi_vars.h mawk.h parse.h symtype.h nstd.h memory.h scan.h bi_funct.h files.h zmalloc.h types.h sizes.h
! re_cmpl.obl : config.h mawk.h parse.h regexp.h symtype.h nstd.h memory.h repl.h scan.h zmalloc.h types.h sizes.h
! scan.obl : config.h field.h code.h mawk.h init.h parse.h symtype.h nstd.h memory.h repl.h scan.h files.h zmalloc.h types.h fin.h sizes.h
! split.obl : config.h field.h bi_vars.h mawk.h parse.h regexp.h symtype.h nstd.h memory.h scan.h bi_funct.h zmalloc.h types.h sizes.h
! version.obl : config.h mawk.h patchlev.h nstd.h types.h sizes.h
! zmalloc.obl : config.h mawk.h nstd.h zmalloc.h types.h sizes.h
! 
! 
--- 112,150 ----
  #	del makescan.exe
  
  clean :
! 	del *.obj
  
  distclean :
! 	del *.obj
  	del config.h dosexec.c
  	del mawk.exe
  
  
  #  dependencies of .objs on .h
! array.obj : config.h field.h bi_vars.h mawk.h symtype.h nstd.h memory.h zmalloc.h types.h sizes.h
! bi_funct.obj : config.h field.h bi_vars.h mawk.h init.h regexp.h symtype.h nstd.h repl.h memory.h bi_funct.h files.h zmalloc.h fin.h types.h sizes.h
! bi_vars.obj : config.h field.h bi_vars.h mawk.h init.h symtype.h nstd.h memory.h zmalloc.h types.h sizes.h
! cast.obj : config.h field.h mawk.h parse.h symtype.h nstd.h memory.h repl.h scan.h zmalloc.h types.h sizes.h
! code.obj : config.h field.h code.h mawk.h init.h symtype.h nstd.h memory.h jmp.h zmalloc.h types.h sizes.h
! da.obj : config.h field.h code.h mawk.h symtype.h nstd.h memory.h repl.h bi_funct.h zmalloc.h types.h sizes.h
! error.obj : config.h bi_vars.h mawk.h parse.h vargs.h symtype.h nstd.h scan.h types.h sizes.h
! execute.obj : config.h field.h bi_vars.h code.h mawk.h regexp.h symtype.h nstd.h memory.h repl.h bi_funct.h zmalloc.h types.h fin.h sizes.h
! fcall.obj : config.h code.h mawk.h symtype.h nstd.h memory.h zmalloc.h types.h sizes.h
! field.obj : config.h field.h bi_vars.h mawk.h init.h parse.h regexp.h symtype.h nstd.h memory.h repl.h scan.h zmalloc.h types.h sizes.h
! files.obj : config.h mawk.h nstd.h memory.h files.h zmalloc.h types.h fin.h sizes.h
! fin.obj : config.h field.h bi_vars.h mawk.h parse.h symtype.h nstd.h memory.h scan.h zmalloc.h types.h fin.h sizes.h
! hash.obj : config.h mawk.h symtype.h nstd.h memory.h zmalloc.h types.h sizes.h
! init.obj : config.h field.h bi_vars.h code.h mawk.h init.h symtype.h nstd.h memory.h zmalloc.h types.h sizes.h
! jmp.obj : config.h code.h mawk.h init.h symtype.h nstd.h memory.h jmp.h zmalloc.h types.h sizes.h
! kw.obj : config.h mawk.h init.h parse.h symtype.h nstd.h types.h sizes.h
! main.obj : config.h field.h bi_vars.h code.h mawk.h init.h symtype.h nstd.h memory.h files.h zmalloc.h types.h fin.h sizes.h
! makescan.obj : parse.h symtype.h scan.h
! matherr.obj : config.h mawk.h nstd.h types.h sizes.h
! memory.obj : config.h mawk.h nstd.h memory.h zmalloc.h types.h sizes.h
! parse.obj : config.h field.h bi_vars.h code.h mawk.h symtype.h nstd.h memory.h bi_funct.h files.h zmalloc.h jmp.h types.h sizes.h
! print.obj : config.h field.h bi_vars.h mawk.h parse.h symtype.h nstd.h memory.h scan.h bi_funct.h files.h zmalloc.h types.h sizes.h
! re_cmpl.obj : config.h mawk.h parse.h regexp.h symtype.h nstd.h memory.h repl.h scan.h zmalloc.h types.h sizes.h
! scan.obj : config.h field.h code.h mawk.h init.h parse.h symtype.h nstd.h memory.h repl.h scan.h files.h zmalloc.h types.h fin.h sizes.h
! split.obj : config.h field.h bi_vars.h mawk.h parse.h regexp.h symtype.h nstd.h memory.h scan.h bi_funct.h zmalloc.h types.h sizes.h
! version.obj : config.h mawk.h patchlev.h nstd.h types.h sizes.h
! zmalloc.obj : config.h mawk.h nstd.h zmalloc.h types.h sizes.h
diff -cNr mawk-1.2.2/msdos/mawk.def new/msdos/mawk.def
*** mawk-1.2.2/msdos/mawk.def	Wed Dec 31 18:00:00 1969
--- new/msdos/mawk.def	Sat Feb  3 09:56:34 1996
***************
*** 0 ****
--- 1,2 ----
+ NAME mawk WINDOWCOMPAT NEWFILES
+ DESCRIPTION 'mawk for OS/2 and DOS'
diff -cNr mawk-1.2.2/msdos/mawkmsc.lnk new/msdos/mawkmsc.lnk
*** mawk-1.2.2/msdos/mawkmsc.lnk	Sun Aug 20 12:31:04 1995
--- new/msdos/mawkmsc.lnk	Wed Dec 31 18:00:00 1969
***************
*** 1,9 ****
- parse.obl+scan.obl+memory.obl+main.obl+hash.obl+execute.obl+code.obl+
- da.obl+error.obl+init.obl+bi_vars.obl+cast.obl+print.obl+bi_funct.obl+
- kw.obl+jmp.obl+array.obl+field.obl++split.obl+re_cmpl.obl+zmalloc.obl+
- fin.obl+files.obl++scancode.obl+matherr.obl+fcall.obl+version.obl+
- dosexec.obl+
- rexp.obl+rexp0.obl+rexp1.obl+rexp2.obl+rexp3.obl+rexpdb.obl
- mawk/noe/noi/stack:16384
- 
- ;
--- 0 ----
diff -cNr mawk-1.2.2/msdos/msc.h new/msdos/msc.h
*** mawk-1.2.2/msdos/msc.h	Sun Aug 20 12:44:38 1995
--- new/msdos/msc.h	Sun Feb  4 10:51:34 1996
***************
*** 54,59 ****
--- 54,66 ----
  #define  SET_PROGNAME()  reargv(&argc,&argv) ; progname = argv[0]
  #else
  #define  SET_PROGNAME()  progname = "mawk"
+ #ifdef OS2
+ # ifdef MSDOS
+ #  define DOS_STRING "dos+os2"
+ # else
+ #  define DOS_STRING "os2"
+ # endif
+ #endif
  #endif
  
  #endif  /* CONFIG_H  */
diff -cNr mawk-1.2.2/scan.c new/scan.c
*** mawk-1.2.2/scan.c	Sun Jun 18 14:42:24 1995
--- new/scan.c	Sun Feb  4 11:13:28 1996
***************
*** 120,125 ****
--- 120,129 ----
        scan_fillbuff() ;
     }
  
+ #ifdef OS2  /* OS/2 "extproc" is similar to #! */
+    if (strnicmp(buffp, "extproc ", 8) == 0)
+      eat_comment();
+ #endif
     eat_nl() ;			 /* scan to first token */
     if (next() == 0)
     {
diff -cNr mawk-1.2.2/test/fpe_test.bat new/test/fpe_test.bat
*** mawk-1.2.2/test/fpe_test.bat	Tue Aug 29 09:17:21 1995
--- new/test/fpe_test.bat	Sat Feb  3 11:02:44 1996
***************
*** 4,10 ****
  
  echo testing division by zero
  type fpetest1.awk
! mawk -f fpetest1.awk
  if errorlevel 128 goto :test1_128
  if errorlevel 3 goto :test1_3
  if errorlevel 2 goto :test1_2
--- 4,10 ----
  
  echo testing division by zero
  type fpetest1.awk
! ..\mawk -f fpetest1.awk
  if errorlevel 128 goto :test1_128
  if errorlevel 3 goto :test1_3
  if errorlevel 2 goto :test1_2
***************
*** 26,32 ****
  :test2
  echo testing overflow
  type fpetest2.awk
! mawk -f fpetest2.awk
  if errorlevel 128 goto :test2_128
  if errorlevel 3 goto :test2_3
  if errorlevel 2 goto :test2_2
--- 26,32 ----
  :test2
  echo testing overflow
  type fpetest2.awk
! ..\mawk -f fpetest2.awk
  if errorlevel 128 goto :test2_128
  if errorlevel 3 goto :test2_3
  if errorlevel 2 goto :test2_2
***************
*** 48,54 ****
  :test3
  echo testing domain error
  type fpetest3.awk
! mawk -f fpetest3.awk > temp$$
  if errorlevel 128 goto :test3_128
  if errorlevel 3 goto :test3_3
  if errorlevel 2 goto :test3_2
--- 48,54 ----
  :test3
  echo testing domain error
  type fpetest3.awk
! ..\mawk -f fpetest3.awk > temp$$
  if errorlevel 128 goto :test3_128
  if errorlevel 3 goto :test3_3
  if errorlevel 2 goto :test3_2
diff -cNr mawk-1.2.2/test/mawktest.bat new/test/mawktest.bat
*** mawk-1.2.2/test/mawktest.bat	Sat Jul  3 13:58:39 1993
--- new/test/mawktest.bat	Sat Feb  3 11:01:12 1996
***************
*** 10,50 ****
  rem  system utilities like fc still don't return valid exit codes!!!
  
  set dat=mawktest.dat
  
  rem  find out which mawk we're testing
! mawk -Wv
  
  rem ################################
  
  echo testing input and field splitting
! mawk -f wc.awk %dat% > temp$$
! fc temp$$ wc-awk.out
  if errorlevel 1 goto :done
  
  rem ####################################
  
  echo testing regular expression matching
! mawk -f reg0.awk %dat% > temp$$
! mawk -f reg1.awk %dat% >> temp$$
! mawk -f reg2.awk %dat% >> temp$$
! fc temp$$ reg-awk.out
  if errorlevel 1 goto :done
  
  rem ######################################
  
  echo testing arrays and flow of control
! mawk -f wfrq0.awk %dat% > temp$$
! fc temp$$ wfrq-awk.out
  if errorlevel 1 goto :done
  
  rem ################################
  
  echo testing function calls and general stress test
! mawk -f ../examples/decl.awk %dat% > temp$$
! fc temp$$ decl-awk.out
  if errorlevel 1 goto :done
  
! echo if fc always encountered "no differences", then the tested mawk seems OK
  :done
  del temp$$
  set dat=
--- 10,51 ----
  rem  system utilities like fc still don't return valid exit codes!!!
  
  set dat=mawktest.dat
+ if %CMP%.==. set CMP=cmp
  
  rem  find out which mawk we're testing
! ..\mawk -Wv
  
  rem ################################
  
  echo testing input and field splitting
! ..\mawk -f wc.awk %dat% > temp$$
! %CMP% temp$$ wc-awk.out
  if errorlevel 1 goto :done
  
  rem ####################################
  
  echo testing regular expression matching
! ..\mawk -f reg0.awk %dat% > temp$$
! ..\mawk -f reg1.awk %dat% >> temp$$
! ..\mawk -f reg2.awk %dat% >> temp$$
! %CMP% temp$$ reg-awk.out
  if errorlevel 1 goto :done
  
  rem ######################################
  
  echo testing arrays and flow of control
! ..\mawk -f wfrq0.awk %dat% > temp$$
! %CMP% temp$$ wfrq-awk.out
  if errorlevel 1 goto :done
  
  rem ################################
  
  echo testing function calls and general stress test
! ..\mawk -f ../examples/decl.awk %dat% > temp$$
! %CMP% temp$$ decl-awk.out
  if errorlevel 1 goto :done
  
! echo if %CMP% always encountered "no differences", then the tested mawk seems OK
  :done
  del temp$$
  set dat=
diff -cNr mawk-1.2.2/version.c new/version.c
*** mawk-1.2.2/version.c	Sun Aug 20 12:40:45 1995
--- new/version.c	Sun Feb  4 11:09:10 1996
***************
*** 27,41 ****
  #define	 VERSION_STRING	 \
    "mawk 1.2%s%s %s, Copyright (C) Michael D. Brennan\n\n"
  
- #define	 DOS_STRING	""
- 
  /* If use different command line syntax for MSDOS
     mark that in VERSION	 */
  
  #if  MSDOS && ! HAVE_REARGV
- #undef	 DOS_STRING
  #define DOS_STRING  "MsDOS"
  #endif
  
  static char fmt[] = "%-14s%10lu\n" ;
  
--- 27,44 ----
  #define	 VERSION_STRING	 \
    "mawk 1.2%s%s %s, Copyright (C) Michael D. Brennan\n\n"
  
  /* If use different command line syntax for MSDOS
     mark that in VERSION	 */
  
+ #ifndef DOS_STRING
  #if  MSDOS && ! HAVE_REARGV
  #define DOS_STRING  "MsDOS"
  #endif
+ #endif
+ 
+ #ifndef DOS_STRING
+ #define DOS_STRING	""
+ #endif
  
  static char fmt[] = "%-14s%10lu\n" ;
  
***************
*** 101,107 ****
  #endif
  
  #ifdef _MSC_VER
!    fprintf(stderr, "MS-DOS Microsoft C/C++ _MSC_VER %u\n", _MSC_VER) ;
  #endif
  
  #ifdef __ZTC__
--- 104,110 ----
  #endif
  
  #ifdef _MSC_VER
!    fprintf(stderr, "Microsoft C/C++ _MSC_VER %u\n", _MSC_VER) ;
  #endif
  
  #ifdef __ZTC__
