From nobody Wed Aug 07 14:06:04 2024 X-Original-To: bugs@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WfBmF5ZGgz5SBxW for ; Wed, 07 Aug 2024 14:06:05 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WfBmF3glPz4rLP for ; Wed, 7 Aug 2024 14:06:05 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1723039565; a=rsa-sha256; cv=none; b=jdR3MT6Tj6lBx9wL7gbCYaoQpK5KeVpTHOHJOoXITbSRDZoLCwos7r059zvqRYmx+BsBUk CO/2/+mMbdrHTBTqhO9TJz5c8QIOYlCQmfS/pbRbTn7ECX/YDxpfFURVLWuBoZjyfyU3SO /y8kJMRfZlWH9YcoLVBx76ckLbLWMkNuv0PPOu4ttFXVd7zJsS/hzDqpQNRvMz61Jv+68j Nmv8QlbqEOgoNrQbY1LdkzTZD+q7hB9igUlKS+k08i49MFO2/lnjSWGxSsAm7rRCz+GS4M VKTQ4uzg69MnPy2I0Mybo9mvTMgJP4w/sm6ENF+8+YgPvk1ceqJBFfsieOoXrg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1723039565; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=w4oOA52n3BOleB3izZaV5AgmJ8NADcCbnZLeC4/d+RU=; b=lVLnjQ6L6gJ5HDi4Qw80wyhjR5tQ4Tc/wtu0EIk/Cwe/jXafrorBC4wOE3JXEDpkJXE4qF 8V9SK9jR/i5ZJiJ/+50ftnBhv0TgnMmvLfPM5xOA0RC2x9IP9kybdcrbeSgI3NIsjq2U1L ltdnK54KUUTyfFNn2YNx1r02RX3kzQyAjfLTHfAvB41OSGsUSjO5MmS8rmg5UIQkrBIzxO 5cOONn53xiowWXez4uw+b6oA9tgc03l9z+y4Jfv59DDg9YzVazRt19ZMi5N5AlO4S8BRpp eeRQh8xXv1mRqJCDm1MCJhrK6QJ8P7TuSvqh8ZhT/scia4D2EyrHLUWqcCQbkQ== Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2610:1c1:1:606c::50:1d]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WfBmF39lpztGS for ; Wed, 7 Aug 2024 14:06:05 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org ([127.0.1.5]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id 477E65ZF003075 for ; Wed, 7 Aug 2024 14:06:05 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 477E65fx003074 for bugs@FreeBSD.org; Wed, 7 Aug 2024 14:06:05 GMT (envelope-from bugzilla-noreply@freebsd.org) X-Authentication-Warning: kenobi.freebsd.org: www set sender to bugzilla-noreply@freebsd.org using -f From: bugzilla-noreply@freebsd.org To: bugs@FreeBSD.org Subject: [Bug 280543] df -, isn't columnated if the thousands separator is multi-byte Date: Wed, 07 Aug 2024 14:06:04 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: bin X-Bugzilla-Version: CURRENT X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Many People X-Bugzilla-Who: dunkyp@gmail.com X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: bugs@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: cc attachments.created Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated List-Id: Bug reports List-Archive: https://lists.freebsd.org/archives/freebsd-bugs List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-bugs@FreeBSD.org MIME-Version: 1.0 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D280543 Duncan Paterson changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |dunkyp@gmail.com --- Comment #1 from Duncan Paterson --- Created attachment 252588 --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=3D252588&action= =3Dedit Don't multiply size of thousands separator by string length of sep The bug is in printf handling of thousands separators. In the case of multi= byte chars as in polish (C2 A0 NO-BREAK SPACE) the offset for thousands separato= r is being given in bytes however this isn't correct as there is only a single c= har. I've attached a patch to printf which corrects the output. Given the program=20 #include #include int main(void) { setlocale(LC_NUMERIC, ""); printf("%'*d\n", 20, 1123456789); return 0; } the output of the program is now correctly=20 env LC_ALL=3Dpl_PL.UTF-8 ./a.out 1=C2=A0123=C2=A0456=C2=A0789 rather than env LC_ALL=3Dpl_PL.UTF-8 ./a.out 1=C2=A0123=C2=A0456=C2=A0789 --=20 You are receiving this mail because: You are the assignee for the bug.=