From f8d8aa1cea915ce115345e6e729eddc80e86f021 Mon Sep 17 00:00:00 2001 From: Denys Vlasenko Date: Tue, 6 Apr 2010 18:50:05 +0200 Subject: libbb: add skip_dev_pfx() Signed-off-by: Denys Vlasenko --- libbb/skip_whitespace.c | 7 +++++++ libbb/utmp.c | 8 -------- 2 files changed, 7 insertions(+), 8 deletions(-) (limited to 'libbb') diff --git a/libbb/skip_whitespace.c b/libbb/skip_whitespace.c index 7b123261b..f5a61a3cf 100644 --- a/libbb/skip_whitespace.c +++ b/libbb/skip_whitespace.c @@ -30,3 +30,10 @@ char* FAST_FUNC skip_non_whitespace(const char *s) return (char *) s; } + +char* FAST_FUNC skip_dev_pfx(const char *tty_name) +{ + if (strncmp(tty_name, "/dev/", 5) == 0) + tty_name += 5; + return (char*)tty_name; +} diff --git a/libbb/utmp.c b/libbb/utmp.c index d6ba336e3..68c358e9a 100644 --- a/libbb/utmp.c +++ b/libbb/utmp.c @@ -15,14 +15,6 @@ static void touch(const char *filename) close(open(filename, O_WRONLY | O_CREAT, 0664)); } -// TODO: move to libbb -static const char* skip_dev_pfx(const char *tty_name) -{ - if (strncmp(tty_name, "/dev/", 5) == 0) - tty_name += 5; - return tty_name; -} - void FAST_FUNC write_new_utmp(pid_t pid, int new_type, const char *tty_name, const char *username, const char *hostname) { struct utmp utent; -- cgit v1.2.3-55-g6feb