Deleted Added
full compact
wrterm.c (1591) wrterm.c (28370)
1/*-
2 * Copyright (c) 1991, 1993
3 * The Regents of the University of California. All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

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

27 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
28 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
29 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
30 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
31 * SUCH DAMAGE.
32 */
33
34#ifndef lint
1/*-
2 * Copyright (c) 1991, 1993
3 * The Regents of the University of California. All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

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

27 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
28 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
29 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
30 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
31 * SUCH DAMAGE.
32 */
33
34#ifndef lint
35#if 0
35static char sccsid[] = "@(#)wrterm.c 8.1 (Berkeley) 6/9/93";
36static char sccsid[] = "@(#)wrterm.c 8.1 (Berkeley) 6/9/93";
37#endif
38static const char rcsid[] =
39 "$Id$";
36#endif /* not lint */
37
38#include <sys/types.h>
40#endif /* not lint */
41
42#include <sys/types.h>
39#include <stdio.h>
40#include <ctype.h>
43#include <ctype.h>
44#include <err.h>
45#include <stdio.h>
41#include <string.h>
42#include "extern.h"
43
44/*
45 * Output termcap entry to stdout, quoting characters that would give the
46 * shell problems and omitting empty fields.
47 */
48void
49wrtermcap(bp)
50 char *bp;
51{
52 register int ch;
53 register char *p;
54 char *t, *sep;
55
56 /* Find the end of the terminal names. */
57 if ((t = index(bp, ':')) == NULL)
46#include <string.h>
47#include "extern.h"
48
49/*
50 * Output termcap entry to stdout, quoting characters that would give the
51 * shell problems and omitting empty fields.
52 */
53void
54wrtermcap(bp)
55 char *bp;
56{
57 register int ch;
58 register char *p;
59 char *t, *sep;
60
61 /* Find the end of the terminal names. */
62 if ((t = index(bp, ':')) == NULL)
58 err("termcap names not colon terminated");
63 errx(1, "termcap names not colon terminated");
59 *t++ = '\0';
60
61 /* Output terminal names that don't have whitespace. */
62 sep = "";
63 while ((p = strsep(&bp, "|")) != NULL)
64 if (*p != '\0' && strpbrk(p, " \t") == NULL) {
65 (void)printf("%s%s", sep, p);
66 sep = "|";

--- 46 unchanged lines hidden ---
64 *t++ = '\0';
65
66 /* Output terminal names that don't have whitespace. */
67 sep = "";
68 while ((p = strsep(&bp, "|")) != NULL)
69 if (*p != '\0' && strpbrk(p, " \t") == NULL) {
70 (void)printf("%s%s", sep, p);
71 sep = "|";

--- 46 unchanged lines hidden ---