From patchwork Sun Aug 14 00:20:02 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?0L3QsNCx?= X-Patchwork-Id: 12942830 X-Patchwork-Delegate: herbert@gondor.apana.org.au Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id AB520C19F2D for ; Sun, 14 Aug 2022 00:28:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229735AbiHNA2N (ORCPT ); Sat, 13 Aug 2022 20:28:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39214 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229703AbiHNA2M (ORCPT ); Sat, 13 Aug 2022 20:28:12 -0400 Received: from tarta.nabijaczleweli.xyz (unknown [139.28.40.42]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id EEFED76445 for ; Sat, 13 Aug 2022 17:28:09 -0700 (PDT) Received: from tarta.nabijaczleweli.xyz (unknown [192.168.1.250]) by tarta.nabijaczleweli.xyz (Postfix) with ESMTPSA id 71C1E1886 for ; Sun, 14 Aug 2022 02:20:03 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=nabijaczleweli.xyz; s=202205; t=1660436403; bh=R4HAme1jmeJma7kdnMMKOC4Dlo/ERPPcElsh8QH8zC8=; h=Date:From:To:Subject:References:In-Reply-To:From; b=MjD27z160/1L6tTPMMU3GnObTwv5a2IbT5e2SFT7V8vhQEmL5GPCjqYIVhKOB6Do/ fLVvqw8MMQ+VHN4QhqWP4guT2T3fno+BdRaQY6nPKMoTG/tKQDAt5DjIoZfy44Rt99 VuQDDzVonxEow5y9trq/JhkztsMmXWyxUHUI/0QnEJWpUVPnqzUGpaFAhmEgxs1yJY vg0SebckHgYieSBZCOQoJj+9Bvv7jyso5KIFEHdKk7hniMugiwb+KDWntdCxW4u3hb MUAe/hmwTErg8RLvd0nmGAAEuvU9uLrDpTjLB5x55LWNDXEkZvY5g58q1JzdDVTLe2 YrYG9l1MybQU+0XDg1AVSM7a0aPXD1o0zluwhrOAzSAAav8mu164Iv4HQL8JwkOYqP pIwTDJzI2mOjhFbsODlR2JG7mUQrbcXBJOelG0tA68g2iPaqckXh3/WBmJNrcszMhB Zzkc+aWHXvmn95b/jHpzKmKZCu4spSGw33olTyYnsvxYgo8u37Xi77XXliYqNqg1aQ HJOgz60X8cCUr4shIrC2WYMgjLWj2rWp07JdMnL50daIrzHoizuZKxH/05btPD25XG kXbB6NEISHeUWPV6k+q0z9MWC4sHK7aMWf3SGpb7S8qBgi64vmk4C3yAfD0wNJXPkA /V4WpZ/JrA1MvSaQHwZHtjfc= Date: Sun, 14 Aug 2022 02:20:02 +0200 From: =?utf-8?b?0L3QsNCx?= To: dash@vger.kernel.org Subject: [PATCH 2/2] man: printf: in 'X, X is a byte under dash Message-ID: References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20220429 Precedence: bulk List-ID: X-Mailing-List: dash@vger.kernel.org Multiple issues: * the encoding is not always ASCII * what ASCII code is assigned to я * dash isn't internationalised (this is nonconformant but out of scope), and uses the next /byte/; in a UTF-8 locale: $ printf %d\\n \'ą 196 $ printf %d\\n \'я 196 this is in contrast to POSIX (and bash), which says: > If the leading character is a single-quote or double-quote, > the value shall be the numeric value in the underlying codeset > of the character following the single-quote or double-quote. (i.e. mbrtowc(&val, argv[n], ...)) Signed-off-by: Ahelenia Ziemiańska --- src/dash.1 | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/dash.1 b/src/dash.1 index bd5c311..19d4d3b 100644 --- a/src/dash.1 +++ b/src/dash.1 @@ -1556,9 +1556,7 @@ otherwise it is evaluated as a C constant, with the following extensions: .It A leading plus or minus sign is allowed. .It -If the leading character is a single or double quote, the value is the -.Tn ASCII -code of the next character. +If the leading character is a single or double quote, the value of the next byte. .El .Pp The format string is reused as often as necessary to satisfy the