Skip to content

Commit 0056c87

Browse files
hubertfhubertf
authored andcommitted
Replace special handling of \r by using ICRNL (PR#6078 by Joseph Myers <jsm28@cam.ac.uk>)
1 parent 9713f31 commit 0056c87

File tree

2 files changed

+5
-19
lines changed

2 files changed

+5
-19
lines changed

games/atc/input.c

Lines changed: 2 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* $NetBSD: input.c,v 1.9 1998/07/28 03:00:09 briggs Exp $ */
1+
/* $NetBSD: input.c,v 1.10 1998/09/13 15:20:31 hubertf Exp $ */
22

33
/*-
44
* Copyright (c) 1990, 1993
@@ -50,7 +50,7 @@
5050
#if 0
5151
static char sccsid[] = "@(#)input.c 8.1 (Berkeley) 5/31/93";
5252
#else
53-
__RCSID("$NetBSD: input.c,v 1.9 1998/07/28 03:00:09 briggs Exp $");
53+
__RCSID("$NetBSD: input.c,v 1.10 1998/09/13 15:20:31 hubertf Exp $");
5454
#endif
5555
#endif not lint
5656

@@ -61,9 +61,6 @@ __RCSID("$NetBSD: input.c,v 1.9 1998/07/28 03:00:09 briggs Exp $");
6161
#define MAXDEPTH 15
6262

6363
#define RETTOKEN '\n'
64-
#ifdef SYSV
65-
#define CRTOKEN '\r'
66-
#endif
6764
#define REDRAWTOKEN '\014' /* CTRL(L) */
6865
#define SHELLTOKEN '!'
6966
#define HELPTOKEN '?'
@@ -103,9 +100,6 @@ typedef struct {
103100

104101
RULE state0[] = { { ALPHATOKEN, 1, "%c:", setplane},
105102
{ RETTOKEN, -1, "", NULL },
106-
#ifdef SYSV
107-
{ CRTOKEN, -1, "", NULL },
108-
#endif
109103
{ HELPTOKEN, 12, " [a-z]<ret>", NULL }},
110104
state1[] = { { 't', 2, " turn", turn },
111105
{ 'a', 3, " altitude:", NULL },
@@ -137,9 +131,6 @@ RULE state0[] = { { ALPHATOKEN, 1, "%c:", setplane},
137131
state4[] = { { '@', 9, " at", NULL },
138132
{ 'a', 9, " at", NULL },
139133
{ RETTOKEN, -1, "", NULL },
140-
#ifdef SYSV
141-
{ CRTOKEN, -1, "", NULL },
142-
#endif
143134
{ HELPTOKEN, 12, " @a<ret>", NULL }},
144135
state5[] = { { NUMTOKEN, 7, "%c", delayb },
145136
{ HELPTOKEN, 12, " [0-9]", NULL }},
@@ -154,14 +145,8 @@ RULE state0[] = { { ALPHATOKEN, 1, "%c:", setplane},
154145
{ 'a', 4, " 270", rel_dir },
155146
{ 'q', 4, " 315", rel_dir },
156147
{ RETTOKEN, -1, "", NULL },
157-
#ifdef SYSV
158-
{ CRTOKEN, -1, "", NULL },
159-
#endif
160148
{ HELPTOKEN, 12, " @a<dir><ret>",NULL }},
161149
state7[] = { { RETTOKEN, -1, "", NULL },
162-
#ifdef SYSV
163-
{ CRTOKEN, -1, "", NULL },
164-
#endif
165150
{ HELPTOKEN, 12, " <ret>", NULL }},
166151
state8[] = { { NUMTOKEN, 4, "%c", benum },
167152
{ HELPTOKEN, 12, " [0-9]", NULL }},

games/atc/main.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* $NetBSD: main.c,v 1.6 1997/10/11 02:01:05 lukem Exp $ */
1+
/* $NetBSD: main.c,v 1.7 1998/09/13 15:20:31 hubertf Exp $ */
22

33
/*-
44
* Copyright (c) 1990, 1993
@@ -55,7 +55,7 @@ __COPYRIGHT("@(#) Copyright (c) 1990, 1993\n\
5555
#if 0
5656
static char sccsid[] = "@(#)main.c 8.1 (Berkeley) 5/31/93";
5757
#else
58-
__RCSID("$NetBSD: main.c,v 1.6 1997/10/11 02:01:05 lukem Exp $");
58+
__RCSID("$NetBSD: main.c,v 1.7 1998/09/13 15:20:31 hubertf Exp $");
5959
#endif
6060
#endif /* not lint */
6161

@@ -168,6 +168,7 @@ main(ac, av)
168168
tcgetattr(fileno(stdin), &tty_start);
169169
tty_new = tty_start;
170170
tty_new.c_lflag &= ~(ICANON|ECHO);
171+
tty_new.c_iflag |= ICRNL;
171172
tty_new.c_cc[VMIN] = 1;
172173
tty_new.c_cc[VTIME] = 0;
173174
tcsetattr(fileno(stdin), TCSADRAIN, &tty_new);

0 commit comments

Comments
 (0)