From 50007d443b834fe09cd084909ac7a84390c5de57 Mon Sep 17 00:00:00 2001 From: "Matthew N. Dodd" Date: Mon, 25 Jul 2005 17:57:15 +0000 Subject: [PATCH] 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. --- lib/libc/gen/getttyent.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/libc/gen/getttyent.c b/lib/libc/gen/getttyent.c index e4eadc46af1..5578f04704f 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))