diff options
Diffstat (limited to 'bin/stty/gfmt.c')
-rw-r--r-- | bin/stty/gfmt.c | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/bin/stty/gfmt.c b/bin/stty/gfmt.c index 38ee46f..19baf83 100644 --- a/bin/stty/gfmt.c +++ b/bin/stty/gfmt.c @@ -77,15 +77,16 @@ gprint(tp, wp, ldisc, timeout) } void -gread(tp, top, s) - struct termios *tp; - int *top; +gread(i, s) + struct info *i; char *s; { struct cchar *cp; + struct termios *tp; char *ep, *p; long tmp; + tp = &(i->t); if ((s = strchr(s, ':')) == NULL) gerr(NULL); for (++s; s != NULL;) { @@ -100,33 +101,40 @@ gread(tp, top, s) #define CHK(s) (*p == s[0] && !strcmp(p, s)) if (CHK("cflag")) { tp->c_cflag = tmp; + i->set = 1; continue; } if (CHK("iflag")) { tp->c_iflag = tmp; + i->set = 1; continue; } if (CHK("ispeed")) { (void)sscanf(ep, "%ld", &tmp); tp->c_ispeed = tmp; + i->set = 1; continue; } if (CHK("lflag")) { tp->c_lflag = tmp; + i->set = 1; continue; } if (CHK("oflag")) { tp->c_oflag = tmp; + i->set = 1; continue; } if (CHK("ospeed")) { (void)sscanf(ep, "%ld", &tmp); tp->c_ospeed = tmp; + i->set = 1; continue; } if (CHK("drainwait")) { (void)sscanf(ep, "%ld", &tmp); - *top = tmp; + i->timeout = tmp; + i->tset = 1; continue; } for (cp = cchars1; cp->name != NULL; ++cp) @@ -134,6 +142,7 @@ gread(tp, top, s) if (cp->sub == VMIN || cp->sub == VTIME) (void)sscanf(ep, "%ld", &tmp); tp->c_cc[cp->sub] = tmp; + i->set = 1; break; } if (cp->name == NULL) |