Deleted Added
full compact
main.c (85587) main.c (90902)
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
25char *version = "version 20001115";
25char *version = "version 20020101";
26
27#define DEBUG
28#include <stdio.h>
29#include <ctype.h>
30#include <stdlib.h>
31#include <string.h>
32#include <signal.h>
33#include "awk.h"

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

47char *pfile[20]; /* program filenames from -f's */
48int npfile = 0; /* number of filenames */
49int curpfile = 0; /* current filename */
50
51int safe = 0; /* 1 => "safe" mode */
52
53int main(int argc, char *argv[])
54{
26
27#define DEBUG
28#include <stdio.h>
29#include <ctype.h>
30#include <stdlib.h>
31#include <string.h>
32#include <signal.h>
33#include "awk.h"

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

47char *pfile[20]; /* program filenames from -f's */
48int npfile = 0; /* number of filenames */
49int curpfile = 0; /* current filename */
50
51int safe = 0; /* 1 => "safe" mode */
52
53int main(int argc, char *argv[])
54{
55 char *fs = NULL, *marg;
56 int temp;
55 char *fs = NULL;
57
58 cmdname = argv[0];
59 if (argc == 1) {
60 fprintf(stderr, "Usage: %s [-f programfile | 'program'] [-Ffieldsep] [-v var=value] [files]\n", cmdname);
61 exit(1);
62 }
63 signal(SIGFPE, fpecatch);
64 yyin = NULL;

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

97 if (fs == NULL || *fs == '\0')
98 WARNING("field separator FS is empty");
99 break;
100 case 'v': /* -v a=1 to be done NOW. one -v for each */
101 if (argv[1][2] == '\0' && --argc > 1 && isclvar((++argv)[1]))
102 setclvar(argv[1]);
103 break;
104 case 'm': /* more memory: -mr=record, -mf=fields */
56
57 cmdname = argv[0];
58 if (argc == 1) {
59 fprintf(stderr, "Usage: %s [-f programfile | 'program'] [-Ffieldsep] [-v var=value] [files]\n", cmdname);
60 exit(1);
61 }
62 signal(SIGFPE, fpecatch);
63 yyin = NULL;

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

96 if (fs == NULL || *fs == '\0')
97 WARNING("field separator FS is empty");
98 break;
99 case 'v': /* -v a=1 to be done NOW. one -v for each */
100 if (argv[1][2] == '\0' && --argc > 1 && isclvar((++argv)[1]))
101 setclvar(argv[1]);
102 break;
103 case 'm': /* more memory: -mr=record, -mf=fields */
105 /* no longer needed */
106 marg = argv[1];
107 if (argv[1][3])
108 temp = atoi(&argv[1][3]);
109 else {
110 argv++; argc--;
111 temp = atoi(&argv[1][0]);
112 }
113 switch (marg[2]) {
114 case 'r': recsize = temp; break;
115 case 'f': nfields = temp; break;
116 default: FATAL("unknown option %s\n", marg);
117 }
104 /* no longer supported */
105 WARNING("obsolete option %s ignored", argv[1]);
118 break;
119 case 'd':
120 dbg = atoi(&argv[1][2]);
121 if (dbg == 0)
122 dbg = 1;
123 printf("awk %s\n", version);
124 break;
125 case 'V': /* added for exptools "standard" */

--- 72 unchanged lines hidden ---
106 break;
107 case 'd':
108 dbg = atoi(&argv[1][2]);
109 if (dbg == 0)
110 dbg = 1;
111 printf("awk %s\n", version);
112 break;
113 case 'V': /* added for exptools "standard" */

--- 72 unchanged lines hidden ---