NetBSD-Bugs archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
bin/59896: tr extends string2 incorrectly when [#*0] is specified
>Number: 59896
>Category: bin
>Synopsis: tr extends string2 incorrectly when [#*0] is specified
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: bin-bug-people
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Wed Jan 07 08:15:00 +0000 2026
>Originator: jarle.greipsland%norid.no@localhost
>Release: NetBSD 10.1_STABLE
>Organization:
>Environment:
System: NetBSD ulf.intern.norid.no 10.1_STABLE NetBSD 10.1_STABLE (GENERIC) #3: Mon Dec 1 13:50:12 CET 2025 jarle%ulf.intern.norid.no@localhost:/usr/obj/sys/arch/amd64/compile/GENERIC amd64
Architecture: x86_64
Machine: amd64
>Description:
NetBSD tr:
$ echo A N Y | tr A-Z 'a-c[q*20]x-z'
a q y
which is the expected output.
$ echo A N Y | tr A-Z 'a-c[q*0]x-z'
a q q
should have been equivalent to the first expression, but it isn't.
The man page states:
... If n is omitted or is zero, it is interpreted as
large enough to extend the string2 sequence to the length of
string1. If n has a leading zero, it is interpreted as an
octal value; otherwise, it is interpreted as a decimal
value.
It seems like NetBSD's tr does not take into account any characters
in string2 found after the [#*n] expression.
GNU tr from coreutils behaves as I would expect:
$ echo A N Y | gtr A-Z 'a-c[q*20]x-z'
a q y
$ echo A N Y | gtr A-Z 'a-c[q*0]x-z'
a q y
>How-To-Repeat:
see above
>Fix:
>Unformatted:
Home |
Main Index |
Thread Index |
Old Index