Deleted Added
full compact
getttyent.c (24899) getttyent.c (52856)
1/*
2 * Copyright (c) 1989, 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

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

24 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
25 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
26 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
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.
1/*
2 * Copyright (c) 1989, 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

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

24 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
25 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
26 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
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 * $FreeBSD: head/lib/libc/gen/getttyent.c 52856 1999-11-04 04:16:28Z ache $
32 */
33
34#if defined(LIBC_SCCS) && !defined(lint)
35static char sccsid[] = "@(#)getttyent.c 8.1 (Berkeley) 6/4/93";
36#endif /* LIBC_SCCS and not lint */
37
38#include <ttyent.h>
39#include <stdio.h>

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

87 if ((p = realloc(line, lbsize)) == NULL) {
88 (void)endttyent();
89 return (NULL);
90 }
91 line = p;
92 if (!fgets(&line[i], lbsize - i, tf))
93 return (NULL);
94 }
34 */
35
36#if defined(LIBC_SCCS) && !defined(lint)
37static char sccsid[] = "@(#)getttyent.c 8.1 (Berkeley) 6/4/93";
38#endif /* LIBC_SCCS and not lint */
39
40#include <ttyent.h>
41#include <stdio.h>

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

89 if ((p = realloc(line, lbsize)) == NULL) {
90 (void)endttyent();
91 return (NULL);
92 }
93 line = p;
94 if (!fgets(&line[i], lbsize - i, tf))
95 return (NULL);
96 }
95 while (isspace(*p))
97 while (isspace((unsigned char)*p))
96 ++p;
97 if (*p && *p != '#')
98 break;
99 }
100
98 ++p;
99 if (*p && *p != '#')
100 break;
101 }
102
101#define scmp(e) !strncmp(p, e, sizeof(e) - 1) && isspace(p[sizeof(e) - 1])
103#define scmp(e) !strncmp(p, e, sizeof(e) - 1) && isspace((unsigned char)p[sizeof(e) - 1])
102#define vcmp(e) !strncmp(p, e, sizeof(e) - 1) && p[sizeof(e) - 1] == '='
103
104 zapchar = 0;
105 tty.ty_name = p;
106 p = skip(p);
107 if (!*(tty.ty_getty = p))
108 tty.ty_getty = tty.ty_type = NULL;
109 else {

--- 155 unchanged lines hidden ---
104#define vcmp(e) !strncmp(p, e, sizeof(e) - 1) && p[sizeof(e) - 1] == '='
105
106 zapchar = 0;
107 tty.ty_name = p;
108 p = skip(p);
109 if (!*(tty.ty_getty = p))
110 tty.ty_getty = tty.ty_type = NULL;
111 else {

--- 155 unchanged lines hidden ---