11 * and limitations under the License.
12 *
13 * When distributing Covered Code, include this CDDL HEADER in each
14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 * If applicable, add the following below this CDDL HEADER, with the
16 * fields enclosed by brackets "[]" replaced with your own identifying
17 * information: Portions Copyright [yyyy] [name of copyright owner]
18 *
19 * CDDL HEADER END
20 */
21 /*
22 * Copyright 2007 Sun Microsystems, Inc. All rights reserved.
23 * Use is subject to license terms.
24 */
25
26 /* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
27 /* All Rights Reserved */
28
29 /* Copyright (c) 1981 Regents of the University of California */
30
31 #pragma ident "%Z%%M% %I% %E% SMI"
32
33 #include "ex.h"
34 #include "ex_argv.h"
35 #include "ex_temp.h"
36 #include "ex_tty.h"
37 #include <stdlib.h>
38 #include <locale.h>
39 #include <stdio.h>
40 #ifdef TRACE
41 unsigned char tttrace[BUFSIZ];
42 #endif
43
44 #define EQ(a, b) (strcmp(a, b) == 0)
45
46 char *strrchr();
47 void init_re(void);
48
49 /*
50 * The code for ex is divided as follows:
51 *
52 * ex.c Entry point and routines handling interrupt, hangup
224 if ((envcolumns = atoi(envptr)) <= 0) {
225 envcolumns = -1;
226 }
227 }
228 }
229 #endif /* XPG4 */
230
231 draino();
232 pstop();
233
234 /*
235 * Initialize interrupt handling.
236 */
237 oldhup = signal(SIGHUP, SIG_IGN);
238 if (oldhup == SIG_DFL)
239 signal(SIGHUP, onhup);
240 oldquit = signal(SIGQUIT, SIG_IGN);
241 ruptible = signal(SIGINT, SIG_IGN) == SIG_DFL;
242 if (signal(SIGTERM, SIG_IGN) == SIG_DFL)
243 signal(SIGTERM, onhup);
244 if (signal(SIGEMT, SIG_IGN) == SIG_DFL)
245 signal(SIGEMT, onemt);
246 signal(SIGILL, oncore);
247 signal(SIGTRAP, oncore);
248 signal(SIGIOT, oncore);
249 signal(SIGFPE, oncore);
250 signal(SIGBUS, oncore);
251 signal(SIGSEGV, oncore);
252 signal(SIGPIPE, oncore);
253 init_re();
254 while (1) {
255 #ifdef TRACE
256 while ((c = getopt(ac, (char **)av, "VU:Lc:Tvt:rlw:xRCsS")) !=
257 EOF)
258 #else
259 while ((c = getopt(ac, (char **)av,
260 "VLc:vt:rlw:xRCsS")) != EOF)
261 #endif
262 switch (c) {
263 case 's':
264 hush = 1;
265 value(vi_AUTOPRINT) = 0;
|
11 * and limitations under the License.
12 *
13 * When distributing Covered Code, include this CDDL HEADER in each
14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 * If applicable, add the following below this CDDL HEADER, with the
16 * fields enclosed by brackets "[]" replaced with your own identifying
17 * information: Portions Copyright [yyyy] [name of copyright owner]
18 *
19 * CDDL HEADER END
20 */
21 /*
22 * Copyright 2007 Sun Microsystems, Inc. All rights reserved.
23 * Use is subject to license terms.
24 */
25
26 /* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
27 /* All Rights Reserved */
28
29 /* Copyright (c) 1981 Regents of the University of California */
30
31 #include "ex.h"
32 #include "ex_argv.h"
33 #include "ex_temp.h"
34 #include "ex_tty.h"
35 #include <stdlib.h>
36 #include <locale.h>
37 #include <stdio.h>
38 #ifdef TRACE
39 unsigned char tttrace[BUFSIZ];
40 #endif
41
42 #define EQ(a, b) (strcmp(a, b) == 0)
43
44 char *strrchr();
45 void init_re(void);
46
47 /*
48 * The code for ex is divided as follows:
49 *
50 * ex.c Entry point and routines handling interrupt, hangup
222 if ((envcolumns = atoi(envptr)) <= 0) {
223 envcolumns = -1;
224 }
225 }
226 }
227 #endif /* XPG4 */
228
229 draino();
230 pstop();
231
232 /*
233 * Initialize interrupt handling.
234 */
235 oldhup = signal(SIGHUP, SIG_IGN);
236 if (oldhup == SIG_DFL)
237 signal(SIGHUP, onhup);
238 oldquit = signal(SIGQUIT, SIG_IGN);
239 ruptible = signal(SIGINT, SIG_IGN) == SIG_DFL;
240 if (signal(SIGTERM, SIG_IGN) == SIG_DFL)
241 signal(SIGTERM, onhup);
242 signal(SIGILL, oncore);
243 signal(SIGTRAP, oncore);
244 signal(SIGIOT, oncore);
245 signal(SIGFPE, oncore);
246 signal(SIGBUS, oncore);
247 signal(SIGSEGV, oncore);
248 signal(SIGPIPE, oncore);
249 init_re();
250 while (1) {
251 #ifdef TRACE
252 while ((c = getopt(ac, (char **)av, "VU:Lc:Tvt:rlw:xRCsS")) !=
253 EOF)
254 #else
255 while ((c = getopt(ac, (char **)av,
256 "VLc:vt:rlw:xRCsS")) != EOF)
257 #endif
258 switch (c) {
259 case 's':
260 hush = 1;
261 value(vi_AUTOPRINT) = 0;
|