diff options
-rw-r--r-- | libbb/skip_whitespace.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/libbb/skip_whitespace.c b/libbb/skip_whitespace.c index 4df5d9e..37a24d3 100644 --- a/libbb/skip_whitespace.c +++ b/libbb/skip_whitespace.c @@ -32,7 +32,6 @@ char* FAST_FUNC skip_non_whitespace(const char *s) char* FAST_FUNC skip_dev_pfx(const char *tty_name) { - if (is_prefixed_with(tty_name, "/dev/")) - tty_name += 5; - return (char*)tty_name; + char *unprefixed = is_prefixed_with(tty_name, "/dev/"); + return unprefixed ? unprefixed : (char*)tty_name; } |