lineedit: \W on "/bin" should show "bin", not "/bin"
authorDenys Vlasenko <vda.linux@googlemail.com>
Fri, 29 Mar 2013 12:21:53 +0000 (13:21 +0100)
committerDenys Vlasenko <vda.linux@googlemail.com>
Fri, 29 Mar 2013 12:21:53 +0000 (13:21 +0100)
function                                             old     new   delta
parse_and_put_prompt                                 793     785      -8

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
libbb/lineedit.c

index 45448dfab962d1ca48ac3295bd0ddd7f97961e41..93ab86426b399afe2e36f79e61afae0fc8581fb1 100644 (file)
@@ -1875,7 +1875,7 @@ static void parse_and_put_prompt(const char *prmt_ptr)
                                        if (c == 'w')
                                                break;
                                        cp = strrchr(pbuf, '/');
-                                       if (cp != NULL && cp != pbuf)
+                                       if (cp)
                                                pbuf = (char*)cp + 1;
                                        break;
 # endif