aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--coreutils/tr.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/coreutils/tr.c b/coreutils/tr.c
index e439fcb5b..28798fe4f 100644
--- a/coreutils/tr.c
+++ b/coreutils/tr.c
@@ -138,7 +138,7 @@ static unsigned int expand(const char *arg, char *buffer)
138 arg += 3; /* skip CHAR=] */ 138 arg += 3; /* skip CHAR=] */
139 continue; 139 continue;
140 } 140 }
141 if (*arg != '-') { /* not [x-...] - copy verbatim */ 141 if (i == '\0' || *arg != '-') { /* not [x-...] - copy verbatim */
142 *buffer++ = '['; 142 *buffer++ = '[';
143 arg--; /* points to x */ 143 arg--; /* points to x */
144 continue; /* copy all, including eventual ']' */ 144 continue; /* copy all, including eventual ']' */