NetBSD-Bugs archive

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

bin/53756: /bin/sh strips too many characters with %% modifier



>Number:         53756
>Category:       bin
>Synopsis:       /bin/sh strips too many characters with %% modifier
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    bin-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sat Dec 01 07:50:00 +0000 2018
>Originator:     rillig%NetBSD.org@localhost
>Release:        NetBSD 7.0.2
>Organization:
	
>Environment:
	
	
System: NetBSD nb7.fritz.box 7.0.2 NetBSD 7.0.2 (GENERIC.201610210724Z) amd64
Architecture: x86_64
Machine: amd64
>Description:

line="// line comment /* block comment */"
printf '<%s>\n' "${line%%/\**}"

The %% should remove the longest suffix after "/*", since the first
asterisk is escaped. Bash and Ksh do it as expected, NetBSD's /bin/sh
doesn't. It removes everything after the first "/", whether or not that
is followed by a "*".

>Fix:

Unknown
>Unformatted:
 	
 	


Home | Main Index | Thread Index | Old Index