Deleted Added
full compact
main.c (125601) main.c (146299)
1/****************************************************************
2Copyright (C) Lucent Technologies 1997
3All Rights Reserved
4
5Permission to use, copy, modify, and distribute this software and
6its documentation for any purpose and without fee is hereby
7granted, provided that the above copyright notice appear in all
8copies and that both that the copyright notice and this

--- 8 unchanged lines hidden (view full) ---

17IN NO EVENT SHALL LUCENT OR ANY OF ITS ENTITIES BE LIABLE FOR ANY
18SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
19WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER
20IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
21ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF
22THIS SOFTWARE.
23****************************************************************/
24
1/****************************************************************
2Copyright (C) Lucent Technologies 1997
3All Rights Reserved
4
5Permission to use, copy, modify, and distribute this software and
6its documentation for any purpose and without fee is hereby
7granted, provided that the above copyright notice appear in all
8copies and that both that the copyright notice and this

--- 8 unchanged lines hidden (view full) ---

17IN NO EVENT SHALL LUCENT OR ANY OF ITS ENTITIES BE LIABLE FOR ANY
18SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
19WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER
20IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
21ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF
22THIS SOFTWARE.
23****************************************************************/
24
25const char *version = "version 20040207";
25const char *version = "version 20050424";
26
27#define DEBUG
28#include <stdio.h>
29#include <ctype.h>
30#include <locale.h>
31#include <stdlib.h>
32#include <string.h>
33#include <signal.h>

--- 6 unchanged lines hidden (view full) ---

40int dbg = 0;
41char *cmdname; /* gets argv[0] for error messages */
42extern FILE *yyin; /* lex input file */
43char *lexprog; /* points to program argument if it exists */
44extern int errorflag; /* non-zero if any syntax errors; set by yyerror */
45int compile_time = 2; /* for error printing: */
46 /* 2 = cmdline, 1 = compile, 0 = running */
47
26
27#define DEBUG
28#include <stdio.h>
29#include <ctype.h>
30#include <locale.h>
31#include <stdlib.h>
32#include <string.h>
33#include <signal.h>

--- 6 unchanged lines hidden (view full) ---

40int dbg = 0;
41char *cmdname; /* gets argv[0] for error messages */
42extern FILE *yyin; /* lex input file */
43char *lexprog; /* points to program argument if it exists */
44extern int errorflag; /* non-zero if any syntax errors; set by yyerror */
45int compile_time = 2; /* for error printing: */
46 /* 2 = cmdline, 1 = compile, 0 = running */
47
48char *pfile[20]; /* program filenames from -f's */
48#define MAX_PFILE 20 /* max number of -f's */
49
50char *pfile[MAX_PFILE]; /* program filenames from -f's */
49int npfile = 0; /* number of filenames */
50int curpfile = 0; /* current filename */
51
52int safe = 0; /* 1 => "safe" mode */
53
54int main(int argc, char *argv[])
55{
56 const char *fs = NULL;

--- 19 unchanged lines hidden (view full) ---

76 if (strcmp(argv[1], "-safe") == 0)
77 safe = 1;
78 break;
79 case 'f': /* next argument is program filename */
80 argc--;
81 argv++;
82 if (argc <= 1)
83 FATAL("no program filename");
51int npfile = 0; /* number of filenames */
52int curpfile = 0; /* current filename */
53
54int safe = 0; /* 1 => "safe" mode */
55
56int main(int argc, char *argv[])
57{
58 const char *fs = NULL;

--- 19 unchanged lines hidden (view full) ---

78 if (strcmp(argv[1], "-safe") == 0)
79 safe = 1;
80 break;
81 case 'f': /* next argument is program filename */
82 argc--;
83 argv++;
84 if (argc <= 1)
85 FATAL("no program filename");
86 if (npfile >= MAX_PFILE - 1)
87 FATAL("too many -f options");
84 pfile[npfile++] = argv[1];
85 break;
86 case 'F': /* set field separator */
87 if (argv[1][2] != 0) { /* arg is -Fsomething */
88 if (argv[1][2] == 't' && argv[1][3] == 0) /* wart: t=>\t */
89 fs = "\t";
90 else if (argv[1][2] != 0)
91 fs = &argv[1][2];

--- 98 unchanged lines hidden ---
88 pfile[npfile++] = argv[1];
89 break;
90 case 'F': /* set field separator */
91 if (argv[1][2] != 0) { /* arg is -Fsomething */
92 if (argv[1][2] == 't' && argv[1][3] == 0) /* wart: t=>\t */
93 fs = "\t";
94 else if (argv[1][2] != 0)
95 fs = &argv[1][2];

--- 98 unchanged lines hidden ---