NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: bin/59896: tr extends string2 incorrectly when [#*0] is specified



The following reply was made to PR bin/59896; it has been noted by GNATS.

From: Jarle Greipsland <jarle.greipsland%norid.no@localhost>
To: gnats-bugs%netbsd.org@localhost, gnats-admin%NetBSD.org@localhost
Cc: netbsd-bugs%netbsd.org@localhost
Subject: Re: bin/59896: tr extends string2 incorrectly when [#*0] is
 specified
Date: Sun, 11 Jan 2026 16:02:44 +0100 (CET)

 "Robert Elz via gnats" <gnats-admin%NetBSD.org@localhost> writes:
 >  The GNU version as reported here (assuming there's no additional
 >  info, which is actually what I expect from many of their applications)
 >  is crazy.
 >  
 >  Consider
 >  
 >  	tr A-Z 'abc=5Bq*0=5Drst=5Bx*0=5Dyz
 >  
 >  and attempt to work out how many q's and how many x's should
 >  be in string 2.
 $ gtr A-Z 'abc[q*0]rst[x*0]yz'
 gtr: only one [c*] repeat construct may appear in string2
 
 >  Just close this PR and forget it.
 Fair enough.  I'll adjust my expectations.
 
 >  The (non-normative) rationale notes that one use of this notation is
 >  to allow the traditional BSD tr behaviour where a short string2 had its
 >  final char duplicated as many times as needed to make string2 the
 >  appropriate length, which would support this interpretation.
 Makes sense.
 				-jarle
 -- 
 "Computers are not intelligent.  They only think they are."
 


Home | Main Index | Thread Index | Old Index