diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2010-04-06 20:50:05 +0400 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2010-04-06 20:50:05 +0400 |
commit | f8d8aa1cea915ce115345e6e729eddc80e86f021 (patch) | |
tree | abceef94710d221816cf56343b7cadf10de50e5c /loginutils | |
parent | 87fb72032e6aa6abe5ac8fb05d22f43e8dde557b (diff) |
libbb: add skip_dev_pfx()
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'loginutils')
-rw-r--r-- | loginutils/login.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/loginutils/login.c b/loginutils/login.c index bf21d6121..078cd68ed 100644 --- a/loginutils/login.c +++ b/loginutils/login.c @@ -249,9 +249,7 @@ int login_main(int argc UNUSED_PARAM, char **argv) full_tty = xmalloc_ttyname(STDIN_FILENO); if (!full_tty) full_tty = xstrdup("UNKNOWN"); - short_tty = full_tty; - if (strncmp(full_tty, "/dev/", 5) == 0) - short_tty += 5; + short_tty = skip_dev_pfx(full_tty); if (opt_host) { fromhost = xasprintf(" on '%s' from '%s'", short_tty, opt_host); |