=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/awk/main.c,v retrieving revision 1.33 retrieving revision 1.34 diff -c -r1.33 -r1.34 *** src/usr.bin/awk/main.c 2020/06/10 21:03:36 1.33 --- src/usr.bin/awk/main.c 2020/06/10 21:03:56 1.34 *************** *** 1,4 **** ! /* $OpenBSD: main.c,v 1.33 2020/06/10 21:03:36 millert Exp $ */ /**************************************************************** Copyright (C) Lucent Technologies 1997 All Rights Reserved --- 1,4 ---- ! /* $OpenBSD: main.c,v 1.34 2020/06/10 21:03:56 millert Exp $ */ /**************************************************************** Copyright (C) Lucent Technologies 1997 All Rights Reserved *************** *** 23,29 **** THIS SOFTWARE. ****************************************************************/ ! const char *version = "version 20191025"; #define DEBUG #include --- 23,29 ---- THIS SOFTWARE. ****************************************************************/ ! const char *version = "version 20191110"; #define DEBUG #include *************** *** 46,53 **** extern FILE *yyin; /* lex input file */ char *lexprog; /* points to program argument if it exists */ extern int errorflag; /* non-zero if any syntax errors; set by yyerror */ ! int compile_time = 2; /* for error printing: */ ! /* 2 = cmdline, 1 = compile, 0 = running */ #define MAX_PFILE 20 /* max number of -f's */ --- 46,52 ---- extern FILE *yyin; /* lex input file */ char *lexprog; /* points to program argument if it exists */ extern int errorflag; /* non-zero if any syntax errors; set by yyerror */ ! enum compile_states compile_time = ERROR_PRINTING; #define MAX_PFILE 20 /* max number of -f's */ *************** *** 55,61 **** int npfile = 0; /* number of filenames */ int curpfile = 0; /* current filename */ ! int safe = 0; /* 1 => "safe" mode */ int main(int argc, char *argv[]) { --- 54,60 ---- int npfile = 0; /* number of filenames */ int curpfile = 0; /* current filename */ ! bool safe = false; /* true => "safe" mode */ int main(int argc, char *argv[]) { *************** *** 90,96 **** switch (argv[1][1]) { case 's': if (strcmp(argv[1], "-safe") == 0) ! safe = 1; break; case 'f': /* next argument is program filename */ if (argv[1][2] != 0) { /* arg is -fsomething */ --- 89,95 ---- switch (argv[1][1]) { case 's': if (strcmp(argv[1], "-safe") == 0) ! safe = true; break; case 'f': /* next argument is program filename */ if (argv[1][2] != 0) { /* arg is -fsomething */ *************** *** 178,184 **** } recinit(recsize); syminit(); ! compile_time = 1; argv[0] = cmdname; /* put prog name at front of arglist */ DPRINTF( ("argc=%d, argv[0]=%s\n", argc, argv[0]) ); arginit(argc, argv); --- 177,183 ---- } recinit(recsize); syminit(); ! compile_time = COMPILING; argv[0] = cmdname; /* put prog name at front of arglist */ DPRINTF( ("argc=%d, argv[0]=%s\n", argc, argv[0]) ); arginit(argc, argv); *************** *** 190,196 **** *FS = qstring(fs, '\0'); DPRINTF( ("errorflag=%d\n", errorflag) ); if (errorflag == 0) { ! compile_time = 0; run(winner); } else bracecheck(); --- 189,195 ---- *FS = qstring(fs, '\0'); DPRINTF( ("errorflag=%d\n", errorflag) ); if (errorflag == 0) { ! compile_time = RUNNING; run(winner); } else bracecheck();