summaryrefslogtreecommitdiffstats
path: root/atc
diff options
context:
space:
mode:
authorhubertf <hubertf@NetBSD.org>1998-09-13 15:20:31 +0000
committerhubertf <hubertf@NetBSD.org>1998-09-13 15:20:31 +0000
commited89da5290dfc1fae8d5c88bbb3dd80da8851456 (patch)
tree3e0fa7a33c59a91dea340bbd9faf98310d15d3d4 /atc
parentd4de8e1ababdda6a6038ee33ec030ca98da14907 (diff)
downloadbsdgames-darwin-ed89da5290dfc1fae8d5c88bbb3dd80da8851456.tar.gz
bsdgames-darwin-ed89da5290dfc1fae8d5c88bbb3dd80da8851456.tar.zst
bsdgames-darwin-ed89da5290dfc1fae8d5c88bbb3dd80da8851456.zip
Replace special handling of \r by using ICRNL (PR#6078 by Joseph Myers <jsm28@cam.ac.uk>)
Diffstat (limited to 'atc')
-rw-r--r--atc/input.c19
-rw-r--r--atc/main.c5
2 files changed, 5 insertions, 19 deletions
diff --git a/atc/input.c b/atc/input.c
index a311d502..eb0fa9e6 100644
--- a/atc/input.c
+++ b/atc/input.c
@@ -1,4 +1,4 @@
-/* $NetBSD: input.c,v 1.9 1998/07/28 03:00:09 briggs Exp $ */
+/* $NetBSD: input.c,v 1.10 1998/09/13 15:20:31 hubertf Exp $ */
/*-
* Copyright (c) 1990, 1993
@@ -50,7 +50,7 @@
#if 0
static char sccsid[] = "@(#)input.c 8.1 (Berkeley) 5/31/93";
#else
-__RCSID("$NetBSD: input.c,v 1.9 1998/07/28 03:00:09 briggs Exp $");
+__RCSID("$NetBSD: input.c,v 1.10 1998/09/13 15:20:31 hubertf Exp $");
#endif
#endif not lint
@@ -61,9 +61,6 @@ __RCSID("$NetBSD: input.c,v 1.9 1998/07/28 03:00:09 briggs Exp $");
#define MAXDEPTH 15
#define RETTOKEN '\n'
-#ifdef SYSV
-#define CRTOKEN '\r'
-#endif
#define REDRAWTOKEN '\014' /* CTRL(L) */
#define SHELLTOKEN '!'
#define HELPTOKEN '?'
@@ -103,9 +100,6 @@ typedef struct {
RULE state0[] = { { ALPHATOKEN, 1, "%c:", setplane},
{ RETTOKEN, -1, "", NULL },
-#ifdef SYSV
- { CRTOKEN, -1, "", NULL },
-#endif
{ HELPTOKEN, 12, " [a-z]<ret>", NULL }},
state1[] = { { 't', 2, " turn", turn },
{ 'a', 3, " altitude:", NULL },
@@ -137,9 +131,6 @@ RULE state0[] = { { ALPHATOKEN, 1, "%c:", setplane},
state4[] = { { '@', 9, " at", NULL },
{ 'a', 9, " at", NULL },
{ RETTOKEN, -1, "", NULL },
-#ifdef SYSV
- { CRTOKEN, -1, "", NULL },
-#endif
{ HELPTOKEN, 12, " @a<ret>", NULL }},
state5[] = { { NUMTOKEN, 7, "%c", delayb },
{ HELPTOKEN, 12, " [0-9]", NULL }},
@@ -154,14 +145,8 @@ RULE state0[] = { { ALPHATOKEN, 1, "%c:", setplane},
{ 'a', 4, " 270", rel_dir },
{ 'q', 4, " 315", rel_dir },
{ RETTOKEN, -1, "", NULL },
-#ifdef SYSV
- { CRTOKEN, -1, "", NULL },
-#endif
{ HELPTOKEN, 12, " @a<dir><ret>",NULL }},
state7[] = { { RETTOKEN, -1, "", NULL },
-#ifdef SYSV
- { CRTOKEN, -1, "", NULL },
-#endif
{ HELPTOKEN, 12, " <ret>", NULL }},
state8[] = { { NUMTOKEN, 4, "%c", benum },
{ HELPTOKEN, 12, " [0-9]", NULL }},
diff --git a/atc/main.c b/atc/main.c
index 8ef87974..2bed8d77 100644
--- a/atc/main.c
+++ b/atc/main.c
@@ -1,4 +1,4 @@
-/* $NetBSD: main.c,v 1.6 1997/10/11 02:01:05 lukem Exp $ */
+/* $NetBSD: main.c,v 1.7 1998/09/13 15:20:31 hubertf Exp $ */
/*-
* Copyright (c) 1990, 1993
@@ -55,7 +55,7 @@ __COPYRIGHT("@(#) Copyright (c) 1990, 1993\n\
#if 0
static char sccsid[] = "@(#)main.c 8.1 (Berkeley) 5/31/93";
#else
-__RCSID("$NetBSD: main.c,v 1.6 1997/10/11 02:01:05 lukem Exp $");
+__RCSID("$NetBSD: main.c,v 1.7 1998/09/13 15:20:31 hubertf Exp $");
#endif
#endif /* not lint */
@@ -168,6 +168,7 @@ main(ac, av)
tcgetattr(fileno(stdin), &tty_start);
tty_new = tty_start;
tty_new.c_lflag &= ~(ICANON|ECHO);
+ tty_new.c_iflag |= ICRNL;
tty_new.c_cc[VMIN] = 1;
tty_new.c_cc[VTIME] = 0;
tcsetattr(fileno(stdin), TCSADRAIN, &tty_new);