From 8dea6828fe16058f828379e85fc1450cdede3936 Mon Sep 17 00:00:00 2001 From: Leo Broukhis Date: Wed, 7 Jan 2015 02:34:27 -0800 Subject: [PATCH] BESM6: All arguments of "attach tty" but the magic word "console" are passed to tmxr_attach(). BESM6: Fix windows compile to support "console" besm6_tty attach . --- BESM6/besm6_tty.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/BESM6/besm6_tty.c b/BESM6/besm6_tty.c index 515b3452..c3ddefd9 100644 --- a/BESM6/besm6_tty.c +++ b/BESM6/besm6_tty.c @@ -303,9 +303,14 @@ t_stat tty_setmode (UNIT *u, int32 val, char *cptr, void *desc) t_stat tty_attach (UNIT *u, char *cptr) { int num = u - tty_unit; + char gbuf[CBUFSIZE]; int r, m, n; - if (*cptr >= '0' && *cptr <= '9') { + /* All arguments but the magic word "console" are passed + * to tmxr_attach(). + */ + get_glyph (cptr, gbuf, 0); + if (strcmp (gbuf, "CONSOLE")) { /* Saving and restoring all .conn, * because tmxr_attach() zeroes them. */ for (m=0, n=1; n<=LINES_MAX; ++n) @@ -317,9 +322,7 @@ t_stat tty_attach (UNIT *u, char *cptr) if (m >> (LINES_MAX-n) & 1) tty_line[n].conn = 1; return r; - } - - if (strcmp (cptr, "console") == 0) { + } else { /* Attaching SIMH console to a particular terminal. */ u->flags &= ~TTY_STATE_MASK; u->flags |= TTY_VT340_STATE; @@ -331,7 +334,7 @@ t_stat tty_attach (UNIT *u, char *cptr) return 0; } /* Disallowing future connections to a line */ - if (strcmp (cptr, "none") == 0) { + if (strcmp (gbuf, "NONE") == 0) { /* Marking the TTY as unusable. */ tty_line[num].conn = 1; tty_line[num].rcve = 0;