diff options
Diffstat (limited to 'usr.bin/login/login.c')
-rw-r--r-- | usr.bin/login/login.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/usr.bin/login/login.c b/usr.bin/login/login.c index 549e015..2a42924 100644 --- a/usr.bin/login/login.c +++ b/usr.bin/login/login.c @@ -245,8 +245,8 @@ main(int argc, char *argv[]) (void)snprintf(tname, sizeof(tname), "%s??", _PATH_TTY); ttyn = tname; } - if ((tty = strrchr(ttyn, '/')) != NULL) - ++tty; + if (strncmp(ttyn, _PATH_DEV, sizeof _PATH_DEV - 1) == 0) + tty = ttyn + sizeof _PATH_DEV - 1; else tty = ttyn; |