diff options
author | mdodd <mdodd@FreeBSD.org> | 2005-07-25 17:57:15 +0000 |
---|---|---|
committer | mdodd <mdodd@FreeBSD.org> | 2005-07-25 17:57:15 +0000 |
commit | 3491fe3f14f725fbdd8fb97c38c5748a7abf0cb0 (patch) | |
tree | 1ab4473c5fbca092ba3c636d2353113144a071fc /lib | |
parent | 7238cb10db18f9a1f6fd105e8cec1762b8a12149 (diff) | |
download | FreeBSD-src-3491fe3f14f725fbdd8fb97c38c5748a7abf0cb0.zip FreeBSD-src-3491fe3f14f725fbdd8fb97c38c5748a7abf0cb0.tar.gz |
Move initialization above point of first possible reference to
avoid overwriting ty_status values set from the 'type' field.
Previously TTY_DIALUP and TTY_NETWORK flags did not match
specified type.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/libc/gen/getttyent.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/libc/gen/getttyent.c b/lib/libc/gen/getttyent.c index e4eadc4..5578f04 100644 --- a/lib/libc/gen/getttyent.c +++ b/lib/libc/gen/getttyent.c @@ -105,6 +105,10 @@ getttyent() zapchar = 0; tty.ty_name = p; + tty.ty_status = 0; + tty.ty_window = NULL; + tty.ty_group = _TTYS_NOGROUP; + p = skip(p); if (!*(tty.ty_getty = p)) tty.ty_getty = tty.ty_type = NULL; @@ -121,9 +125,6 @@ getttyent() p = skip(p); } } - tty.ty_status = 0; - tty.ty_window = NULL; - tty.ty_group = _TTYS_NOGROUP; for (; *p; p = skip(p)) { if (scmp(_TTYS_OFF)) |