From nobody Wed Jun 08 23:15:45 2022 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 C7F4B842CC5 for ; Wed, 8 Jun 2022 23:15:45 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4LJNPY3mhyz4cX4 for ; Wed, 8 Jun 2022 23:15:45 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) 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 613561911F for ; Wed, 8 Jun 2022 23:15:45 +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 258NFjBj075721 for ; Wed, 8 Jun 2022 23:15:45 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 258NFjMU075720 for bugs@FreeBSD.org; Wed, 8 Jun 2022 23:15:45 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 264559] unexpand: nonconformantly (to both POSIX and heirloom) replaces single spaces with tabs Date: Wed, 08 Jun 2022 23:15:45 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: new 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 Some People X-Bugzilla-Who: nabijaczleweli@nabijaczleweli.xyz X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: bugs@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version rep_platform op_sys bug_status bug_severity priority component assigned_to reporter Message-ID: 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 ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1654730145; 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; bh=ODvxlA9VTar4bWSvv3tnOz+qGVEgRW3ha36wbhXi/Zs=; b=NFpJDmw/UAvFL9nHgjpSpKxhbus6lxkXYujf1I2wKJ1TCwMRExBkwQD79dhOzOVM+BRrSV 51W4uCe3r4n7Em23VZRj2u66Wodn3xsmOHxYogjqHSrnxQiz/VaRB/Xsu1CxSGzl7c0n/X iLIqVR8i6CatRErGKVqffS1tOsVQe3WRPITf/LyOTQlvcqJ66AeM9DYkPDfJ2h8ucuQKiG E1lYCA0kC0CRJhBBLGYySYSNSrEdotJEDTySvKoJjB2u32ibyTbQ01Whr7v+EanR+yet7T OGNMTuNozJ/xXhUWv0ZtY9LA+00WKIoCn8Mj3V+ufMzp09zsjKaRNOayZPiumQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1654730145; a=rsa-sha256; cv=none; b=xfz6N6zsRUlJ4/gH6gm2Obl+wz4+kxJsK6WSQoiEI6JR7E7ggT2ngVdaBMvAHCWmPzzJRE qe57s6A7eZYods4PzIS86GwFRC7Z5xpIvb0aXegXLsCDTQhTN1SBQa3+hJ8wpt4bNlQAx3 8rLuKxWfhF4VKpJTSDBNnn+dldXf47PfUyju7cepBwHb03i+TpWULntRejPrqnT4nDQw/a wNUHvNkAp4P0iz2jJD5BytBK8tVIw3r6e9rzxTDr8iCfsjnB2fYOVRFSEFE2p0+XWdMR9o oRSW/zQZU0tA/jKxFDmMHc9TtCS7egK2Tmcjw9pMsIT+JeM+ILsiGfO5p5TQTA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D264559 Bug ID: 264559 Summary: unexpand: nonconformantly (to both POSIX and heirloom) replaces single spaces with tabs Product: Base System Version: CURRENT Hardware: Any OS: Any Status: New Severity: Affects Some People Priority: --- Component: bin Assignee: bugs@FreeBSD.org Reporter: nabijaczleweli@nabijaczleweli.xyz In many ways this report mirrors https://bugs.debian.org/1012545: printf 'a b' | unexpand -t1 | cat -A printf 'a b' | unexpand -t2 | cat -A both yield a^I b and printf 'a b' | unexpand -t2,3 | cat -A yields a^Ib According to 4.2BSD: If the -a option is given, then tabs are inserted whenever they would compress the resultant file by replacing two or more characters. of course, heirloom unexpand doesn't take tab lists, but this is still wrong according to Issue 7 (quoth IEEE Std 1003.1-2017 (Revision of IEEE Std 1003.1-2008)): In addition to translating characters at the beginning of each line, translate all sequences of two or more characters immediately preceding a tab stop to the maximum number of characters followed by the minimum number of characters needed to fill the same column positions originally filled by the translated characters. The correct output for all three is, of course: a b (NetBSD and the illumos gate agree; coreutils is broken differently, but that's unrelated). Best, =D0=BD=D0=B0=D0=B1 --=20 You are receiving this mail because: You are the assignee for the bug.=