From: Denis Vlasenko Date: Mon, 28 Jul 2008 23:49:42 +0000 (-0000) Subject: tr: fix "tr [=" case. Closes bug 4374. X-Git-Tag: 1_12_0~73 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=043d15da31200d35c24bc1939ae6b561f5016c84;p=oweals%2Fbusybox.git tr: fix "tr [=" case. Closes bug 4374. function old new delta expand 1701 1738 +37 tr_main 472 474 +2 --- diff --git a/coreutils/tr.c b/coreutils/tr.c index 28798fe4f..860b8122b 100644 --- a/coreutils/tr.c +++ b/coreutils/tr.c @@ -135,6 +135,8 @@ static unsigned int expand(const char *arg, char *buffer) /* "[xyz...", i=x, arg points to y */ if (ENABLE_FEATURE_TR_EQUIV && i == '=') { /* [=CHAR=] */ *buffer++ = *arg; /* copy CHAR */ + if (!*arg || arg[1] != '=' || arg[2] != ']') + bb_show_usage(); arg += 3; /* skip CHAR=] */ continue; }