You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Tamas Cservenak (Jira)" <ji...@apache.org> on 2024/04/17 09:12:00 UTC

[jira] [Closed] (MWRAPPER-123) only-mvnw fails on ksh printf implementations

     [ https://issues.apache.org/jira/browse/MWRAPPER-123?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Tamas Cservenak closed MWRAPPER-123.
------------------------------------

> only-mvnw fails on ksh printf implementations
> ---------------------------------------------
>
>                 Key: MWRAPPER-123
>                 URL: https://issues.apache.org/jira/browse/MWRAPPER-123
>             Project: Maven Wrapper
>          Issue Type: Bug
>          Components: Maven Wrapper Scripts
>    Affects Versions: 3.1.1
>            Reporter: Benjamin Marwell
>            Assignee: Benjamin Marwell
>            Priority: Urgent
>             Fix For: 3.3.0
>
>
> the script {{only-mvnw}} contains this snippet in a line to calculate a hash:
> {code:bash}
> printf %d "'$str"
> {code}
> The idea is to convert {{$str}} to a number, where {{'}} has a special meaning for {{%d}} conversion. However, there is a major problem with it:
> It does not work on any ksh (and maybe other shells, too), because the behaviour of this conversion is undefined: https://pubs.opengroup.org/onlinepubs/9699919799/functions/printf.html 
> Instead, just do a conversion char-by-char.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)