From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-3.3 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 16257 invoked from network); 22 Apr 2021 14:00:01 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 22 Apr 2021 14:00:01 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20200801; t=1619100001; b=EO/Bef6OK9Nhkqthdvui5gLljJCxhaqKL/AYCAg4scbgZzD2EKB8JBJsnMTuiJl7/KDss6c6o8 g44xfE2Q37rAUfRmF+lxg1n9Rp5/+AAT0Th4FcG9bI7JK9d16qpmVcaQVKOPnpZkqjKyV+3EUw TTJqcnd8vU3JLnHfwki8/q8uFSgGgwiij20DbwMnXmAtIIYrks+5AHp5wYDFcN2KDOgxjAvLtg aqZ+fpBMvvMwzYT1qNbukr/XtJ/sQNgeCpSP+Cgy7wyCzhd+SIcc3OyoeUKpx0LxWUlnen+4dy cqhwh28OGw7EA2vD3s77/D8pHU2hHYEhrOoWabOMenL+3A==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (joooj.vinc17.net) smtp.remote-ip=155.133.131.76; dmarc=none header.from=vinc17.net; arc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed; d=zsh.org; s=rsa-20200801; t=1619100001; bh=TF6f2E5GOt0qtPVnNY1HACmJN7K/HLKD4cdmz4fVzr8=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:In-Reply-To:Content-Transfer-Encoding:Content-Type: MIME-Version:References:Message-ID:Subject:To:From:Date:DKIM-Signature; b=h/HPjhFXvAUr2q0ClZms9WRuDMC0aLIOWiJFIONBDvNe2snCtLkGiIHSgh27KrgK1MImw4AaU/ NIzYY/hchAF/nJvFHe5Oap37iRBPs2J0JEQf7djZCMUUJgzUQ7vWghMKchaKxG+kUDHWMKE4EJ uad6Wb6zp5+RYSjDf6z7/DVH18i/OTVmcMmd3x/FpeLMkT3xlpRwCEm7KS1qMhOVjEJdqMJFo4 k3vvHGFh3uMdYFqbbpOEhbMrhMQc87DjVBPbeRYjHjXyFbjXwmeuZxtoAcqtLNpeiHoNq1TPYw EJjMtsLyi/awfELUv0RJaK20HVDbEsFAaxu0EK83WwELVQ==; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=zsh.org; s=rsa-20200801; h=List-Archive:List-Owner:List-Post:List-Unsubscribe: List-Subscribe:List-Help:List-Id:Sender:In-Reply-To:Content-Transfer-Encoding :Content-Type:MIME-Version:References:Message-ID:Subject:To:From:Date: Reply-To:Cc:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID; bh=6Sr/+GnsQiv8U8k5oJFE905JpjrqSwt3Q7bzPB2cArk=; b=r3yqfMd+/FhsifZ2fbjU9bw1g8 3GuxLPItkI+ko9ojbQHdqHn+wIH+d611PwVFXyiYlQ2BC/eOPn8zf/F/J0l+PPb95VLLol3PiBvr9 x38AaNI0K424zi1Y7aE4DJrtdFOizmRepJxdTsOkqapK+L3tIqqKcjSIlc91KaaHhMNNzza3ygJZ4 7LoOBg87f+waDcUOREk2WhzZSYCKAff3gkhS8aQjPEv2qPZKQ2jrxnSMymf+pAKmazNuj9e47QxNG 98C6D8SpfU/WepZCZ7GLxntdviuGktQvgFJgIYMnvIA2MX3vGhrWRxKAXbhWmeGNYmQHi0HQBEksu DM3YDCjw==; Received: from authenticated user by zero.zsh.org with local id 1lZZs7-00055L-U5; Thu, 22 Apr 2021 13:59:59 +0000 Authentication-Results: zsh.org; iprev=pass (joooj.vinc17.net) smtp.remote-ip=155.133.131.76; dmarc=none header.from=vinc17.net; arc=none Received: from joooj.vinc17.net ([155.133.131.76]:52840) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_256_GCM_SHA384:256) id 1lZZrj-0004r1-AN; Thu, 22 Apr 2021 13:59:35 +0000 Received: from smtp-zira.vinc17.net (lfbn-tou-1-1431-42.w90-89.abo.wanadoo.fr [90.89.233.42]) by joooj.vinc17.net (Postfix) with ESMTPSA id A8D20239; Thu, 22 Apr 2021 15:59:34 +0200 (CEST) Received: by zira.vinc17.org (Postfix, from userid 1000) id 2C3FCC23154; Thu, 22 Apr 2021 15:59:34 +0200 (CEST) Date: Thu, 22 Apr 2021 15:59:34 +0200 From: Vincent Lefevre To: zsh-workers@zsh.org Subject: Re: sh emulation POSIX non-conformances (printf %10s and bytes vs character) Message-ID: <20210422135934.GA154089@zira.vinc17.org> Mail-Followup-To: zsh-workers@zsh.org References: <7FD930F4-37CD-402B-9A06-893818856199@dana.is> <20210411175726.hxnm33mxoska2tsm@chazelas.org> <20210411194205.e7mr2wx33wlkq3rs@chazelas.org> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20210411194205.e7mr2wx33wlkq3rs@chazelas.org> X-Mailer-Info: https://www.vinc17.net/mutt/ User-Agent: Mutt/2.0.6+158 (8162c129) vl-132933 (2021-04-22) X-Seq: 48653 Archived-At: X-Loop: zsh-workers@zsh.org Errors-To: zsh-workers-owner@zsh.org Precedence: list Precedence: bulk Sender: zsh-workers-request@zsh.org X-no-archive: yes List-Id: List-Help: List-Subscribe: List-Unsubscribe: List-Post: List-Owner: List-Archive: On 2021-04-11 20:42:05 +0100, Stephane Chazelas wrote: > 2021-04-11 18:57:26 +0100, Stephane Chazelas: > > Some non-POSIX conformances I can think of ATM: > [...] > > Another POSIX bug fixed by zsh (but which makes it non-compliant): > > With multibyte characters: > > $ printf '|%10s|\n' Stéphane Chazelas > | Stéphane| > | Chazelas| > > POSIX requires: > > | Stéphane| > | Chazelas| I would think that's intentional, at least for the precision (e.g. %.4s) in order to prevent buffer overflow. -- Vincent Lefèvre - Web: 100% accessible validated (X)HTML - Blog: Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)