From unknown Tue Jun 17 01:42:53 2025 X-Loop: help-debbugs@gnu.org Subject: bug#35209: Bug in zdiff argument of an option separated by a space is not handled correctly Resent-From: Bram Mertens Original-Sender: "Debbugs-submit" Resent-CC: bug-gzip@gnu.org Resent-Date: Tue, 09 Apr 2019 14:24:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 35209 X-GNU-PR-Package: gzip X-GNU-PR-Keywords: To: 35209@debbugs.gnu.org X-Debbugs-Original-To: bug-gzip@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.155481980211486 (code B ref -1); Tue, 09 Apr 2019 14:24:02 +0000 Received: (at submit) by debbugs.gnu.org; 9 Apr 2019 14:23:22 +0000 Received: from localhost ([127.0.0.1]:51821 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hDrek-0002zC-8R for submit@debbugs.gnu.org; Tue, 09 Apr 2019 10:23:22 -0400 Received: from eggs.gnu.org ([209.51.188.92]:57260) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hDrTN-0002ba-LV for submit@debbugs.gnu.org; Tue, 09 Apr 2019 10:11:38 -0400 Received: from lists.gnu.org ([209.51.188.17]:57320) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hDrTI-0007RN-IO for submit@debbugs.gnu.org; Tue, 09 Apr 2019 10:11:32 -0400 Received: from eggs.gnu.org ([209.51.188.92]:43402) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hDrTG-0005at-BM for bug-gzip@gnu.org; Tue, 09 Apr 2019 10:11:32 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,FREEMAIL_FROM autolearn=disabled version=3.3.2 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hDrTF-0007QF-K5 for bug-gzip@gnu.org; Tue, 09 Apr 2019 10:11:30 -0400 Received: from mail-qk1-x732.google.com ([2607:f8b0:4864:20::732]:33637) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hDrTF-0007Pj-EX for bug-gzip@gnu.org; Tue, 09 Apr 2019 10:11:29 -0400 Received: by mail-qk1-x732.google.com with SMTP id k189so10334115qkc.0 for ; Tue, 09 Apr 2019 07:11:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=DPTkQBI48ncPRiFTpTl8PfXnbWY1StzLSl1EQpXvvn4=; b=dTTB+sU2RxcXP4Xz8upurixn65MlfS0/HNJry2F7MNF4Gkysxxdgqo2wBMbD9un/Qk LV0PajieTMTHKWUaUWkiQTJMWyGleCSn3QuipDrOmQthIa27Ch+kqYNZPHtn4ldQohcT 2lqikg5v/PBl5Go0faHdhNcUNSb5jQiEoyePkNMCLFjaoiv4zVyu/9pVY23XLkrIqp1Q IanThymzB4aWTTcPn1Hl8RL23kg2xa7zrikTe3b1MsWNUgRDiqTwPRtoe+hCLv+1HT17 gaj3NWIiP6QMKjRCWhxt0NZa/dbyBD22HRjgaKoekKDQ44+X/tFdjy1JZk0WV6xYUo7y sb8A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=DPTkQBI48ncPRiFTpTl8PfXnbWY1StzLSl1EQpXvvn4=; b=tVYsoOIR2tCtBR2TgSu1gdGT4LRzD8Mgye7gvrfqFdKabR0WJVYIbBjuEdRqjQpbiM F5cwcS0yzU5293jzFEz2Lyyhf7/B67uhLR8lnCXJCGZdT13TTXKrpCATiAxPYqnLiuAQ k6g8rBJ3JXMoJkEmLn4aYBqennAGjEgTI7j3hmwd1oqMOqDIDCttgqYsmhrHCrM+dZun E4ykPBdYMm4n6zIGaghd6bm7Iy79ZtX6DUE7sdGKz20MbxIm2vwTkoczR7EuCr72Umcn ZkCFMclz+Vs7Lesy8021OZWqvaOxQdWR9cfJ5GD2IaTEFRLicmUI3BIuG5fxbzXlr600 pPfw== X-Gm-Message-State: APjAAAU9EYrS68XpBk1a2I0psLKuge3Hw4m4Fx0CHVDu3Bd7mBQ6PqNr 2rzTg1WUZziSPgS1QFOyU6nA4+co+CRGM+sHJXVG+u49dwE= X-Google-Smtp-Source: APXvYqxnbT7kbwzYo0h7A9MhCtezPSs3c8PEx8TMaSLp5JepQO3rivFATyUTlGu2jANc0IxsGvwj9FNX05XxzGaW84E= X-Received: by 2002:a37:6381:: with SMTP id x123mr24925719qkb.110.1554819087629; Tue, 09 Apr 2019 07:11:27 -0700 (PDT) MIME-Version: 1.0 From: Bram Mertens Date: Tue, 9 Apr 2019 16:11:14 +0200 Message-ID: Content-Type: text/plain; charset="UTF-8" X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::732 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Spam-Score: 1.0 (+) X-Mailman-Approved-At: Tue, 09 Apr 2019 10:23:21 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.0 (/) Hi, The zdiff script does not handle options with arguments separated by a space correctly. The following if a valid diff command: "diff -y -W 200 /tmp/b1 /tmp/b2". But when passed to zdiff the space between "-W" and 200 causes the COLUMNS argument to be interpreted as a file: zdiff -y -W 200 /tmp/b1 /tmp/b2 /bin/zdiff: 72: /bin/zdiff: cannot open 200: No such file The error is caused by the following line in the loop that processes the arguments: -?*) cmp="$cmp '$1'";; (line 63 in version 1.6) There should be an additional check to catch options with arguments. I couldn't come up with a working solution quickly so I am currently using a workaround. If I remove the space between the option "-W" and it's COLUMNS argument the script works as expected. With this workaround the zdiff utility is great solution for the problem I'm working on, thanks! Thanks in advance Bram Mertens From unknown Tue Jun 17 01:42:53 2025 MIME-Version: 1.0 X-Mailer: MIME-tools 5.505 (Entity 5.505) X-Loop: help-debbugs@gnu.org From: help-debbugs@gnu.org (GNU bug Tracking System) To: Bram Mertens Subject: bug#35209: closed (Re: bug#35209: Bug in zdiff argument of an option separated by a space is not handled correctly) Message-ID: References: X-Gnu-PR-Message: they-closed 35209 X-Gnu-PR-Package: gzip Reply-To: 35209@debbugs.gnu.org Date: Tue, 29 Mar 2022 23:55:02 +0000 Content-Type: multipart/mixed; boundary="----------=_1648598102-19393-1" This is a multi-part message in MIME format... ------------=_1648598102-19393-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Your bug report #35209: Bug in zdiff argument of an option separated by a space is not hand= led correctly which was filed against the gzip package, has been closed. The explanation is attached below, along with your original report. If you require more details, please reply to 35209@debbugs.gnu.org. --=20 35209: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D35209 GNU Bug Tracking System Contact help-debbugs@gnu.org with problems ------------=_1648598102-19393-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 35209-done) by debbugs.gnu.org; 29 Mar 2022 23:54:07 +0000 Received: from localhost ([127.0.0.1]:33887 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nZLf4-00051d-Ts for submit@debbugs.gnu.org; Tue, 29 Mar 2022 19:54:07 -0400 Received: from zimbra.cs.ucla.edu ([131.179.128.68]:45498) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nZLf3-000517-5s for 35209-done@debbugs.gnu.org; Tue, 29 Mar 2022 19:54:05 -0400 Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id C970116005E; Tue, 29 Mar 2022 16:53:59 -0700 (PDT) Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id lrXImoFfMFhc; Tue, 29 Mar 2022 16:53:59 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id 0775B16006C; Tue, 29 Mar 2022 16:53:59 -0700 (PDT) X-Virus-Scanned: amavisd-new at zimbra.cs.ucla.edu Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id mPOuczLOvmUP; Tue, 29 Mar 2022 16:53:58 -0700 (PDT) Received: from [131.179.64.200] (Penguin.CS.UCLA.EDU [131.179.64.200]) by zimbra.cs.ucla.edu (Postfix) with ESMTPSA id DC35716005E; Tue, 29 Mar 2022 16:53:58 -0700 (PDT) Message-ID: Date: Tue, 29 Mar 2022 16:53:58 -0700 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.7.0 Subject: Re: bug#35209: Bug in zdiff argument of an option separated by a space is not handled correctly Content-Language: en-US To: Bram Mertens References: From: Paul Eggert Organization: UCLA Computer Science Department In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 35209-done Cc: 35209-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) On 4/9/19 07:11, Bram Mertens wrote: > The zdiff script does not handle options with arguments separated by a > space correctly. Thanks for reporting that. Lv Ying eventually followed up here: https://bugs.gnu.org/54291 and as mentioned there, a patch has been installed and should be in the next gzip release. ------------=_1648598102-19393-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by debbugs.gnu.org; 9 Apr 2019 14:23:22 +0000 Received: from localhost ([127.0.0.1]:51821 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hDrek-0002zC-8R for submit@debbugs.gnu.org; Tue, 09 Apr 2019 10:23:22 -0400 Received: from eggs.gnu.org ([209.51.188.92]:57260) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hDrTN-0002ba-LV for submit@debbugs.gnu.org; Tue, 09 Apr 2019 10:11:38 -0400 Received: from lists.gnu.org ([209.51.188.17]:57320) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hDrTI-0007RN-IO for submit@debbugs.gnu.org; Tue, 09 Apr 2019 10:11:32 -0400 Received: from eggs.gnu.org ([209.51.188.92]:43402) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hDrTG-0005at-BM for bug-gzip@gnu.org; Tue, 09 Apr 2019 10:11:32 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,FREEMAIL_FROM autolearn=disabled version=3.3.2 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hDrTF-0007QF-K5 for bug-gzip@gnu.org; Tue, 09 Apr 2019 10:11:30 -0400 Received: from mail-qk1-x732.google.com ([2607:f8b0:4864:20::732]:33637) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hDrTF-0007Pj-EX for bug-gzip@gnu.org; Tue, 09 Apr 2019 10:11:29 -0400 Received: by mail-qk1-x732.google.com with SMTP id k189so10334115qkc.0 for ; Tue, 09 Apr 2019 07:11:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=DPTkQBI48ncPRiFTpTl8PfXnbWY1StzLSl1EQpXvvn4=; b=dTTB+sU2RxcXP4Xz8upurixn65MlfS0/HNJry2F7MNF4Gkysxxdgqo2wBMbD9un/Qk LV0PajieTMTHKWUaUWkiQTJMWyGleCSn3QuipDrOmQthIa27Ch+kqYNZPHtn4ldQohcT 2lqikg5v/PBl5Go0faHdhNcUNSb5jQiEoyePkNMCLFjaoiv4zVyu/9pVY23XLkrIqp1Q IanThymzB4aWTTcPn1Hl8RL23kg2xa7zrikTe3b1MsWNUgRDiqTwPRtoe+hCLv+1HT17 gaj3NWIiP6QMKjRCWhxt0NZa/dbyBD22HRjgaKoekKDQ44+X/tFdjy1JZk0WV6xYUo7y sb8A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=DPTkQBI48ncPRiFTpTl8PfXnbWY1StzLSl1EQpXvvn4=; b=tVYsoOIR2tCtBR2TgSu1gdGT4LRzD8Mgye7gvrfqFdKabR0WJVYIbBjuEdRqjQpbiM F5cwcS0yzU5293jzFEz2Lyyhf7/B67uhLR8lnCXJCGZdT13TTXKrpCATiAxPYqnLiuAQ k6g8rBJ3JXMoJkEmLn4aYBqennAGjEgTI7j3hmwd1oqMOqDIDCttgqYsmhrHCrM+dZun E4ykPBdYMm4n6zIGaghd6bm7Iy79ZtX6DUE7sdGKz20MbxIm2vwTkoczR7EuCr72Umcn ZkCFMclz+Vs7Lesy8021OZWqvaOxQdWR9cfJ5GD2IaTEFRLicmUI3BIuG5fxbzXlr600 pPfw== X-Gm-Message-State: APjAAAU9EYrS68XpBk1a2I0psLKuge3Hw4m4Fx0CHVDu3Bd7mBQ6PqNr 2rzTg1WUZziSPgS1QFOyU6nA4+co+CRGM+sHJXVG+u49dwE= X-Google-Smtp-Source: APXvYqxnbT7kbwzYo0h7A9MhCtezPSs3c8PEx8TMaSLp5JepQO3rivFATyUTlGu2jANc0IxsGvwj9FNX05XxzGaW84E= X-Received: by 2002:a37:6381:: with SMTP id x123mr24925719qkb.110.1554819087629; Tue, 09 Apr 2019 07:11:27 -0700 (PDT) MIME-Version: 1.0 From: Bram Mertens Date: Tue, 9 Apr 2019 16:11:14 +0200 Message-ID: Subject: Bug in zdiff argument of an option separated by a space is not handled correctly To: bug-gzip@gnu.org Content-Type: text/plain; charset="UTF-8" X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::732 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Spam-Score: 1.0 (+) X-Debbugs-Envelope-To: submit X-Mailman-Approved-At: Tue, 09 Apr 2019 10:23:21 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.0 (/) Hi, The zdiff script does not handle options with arguments separated by a space correctly. The following if a valid diff command: "diff -y -W 200 /tmp/b1 /tmp/b2". But when passed to zdiff the space between "-W" and 200 causes the COLUMNS argument to be interpreted as a file: zdiff -y -W 200 /tmp/b1 /tmp/b2 /bin/zdiff: 72: /bin/zdiff: cannot open 200: No such file The error is caused by the following line in the loop that processes the arguments: -?*) cmp="$cmp '$1'";; (line 63 in version 1.6) There should be an additional check to catch options with arguments. I couldn't come up with a working solution quickly so I am currently using a workaround. If I remove the space between the option "-W" and it's COLUMNS argument the script works as expected. With this workaround the zdiff utility is great solution for the problem I'm working on, thanks! Thanks in advance Bram Mertens ------------=_1648598102-19393-1-- From debbugs-submit-bounces@debbugs.gnu.org Tue Mar 29 20:08:00 2022 Received: (at control) by debbugs.gnu.org; 30 Mar 2022 00:08:00 +0000 Received: from localhost ([127.0.0.1]:33900 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nZLsW-0007XF-9k for submit@debbugs.gnu.org; Tue, 29 Mar 2022 20:08:00 -0400 Received: from zimbra.cs.ucla.edu ([131.179.128.68]:47534) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nZLsU-0007X0-P4 for control@debbugs.gnu.org; Tue, 29 Mar 2022 20:07:59 -0400 Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id 745DD16005E for ; Tue, 29 Mar 2022 17:07:52 -0700 (PDT) Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id J7dwx_GKE39l for ; Tue, 29 Mar 2022 17:07:51 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id ED1E1160079 for ; Tue, 29 Mar 2022 17:07:49 -0700 (PDT) X-Virus-Scanned: amavisd-new at zimbra.cs.ucla.edu Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id gBMyLeZkvWsE for ; Tue, 29 Mar 2022 17:07:49 -0700 (PDT) Received: from [131.179.64.200] (Penguin.CS.UCLA.EDU [131.179.64.200]) by zimbra.cs.ucla.edu (Postfix) with ESMTPSA id ABC2916005E for ; Tue, 29 Mar 2022 17:07:49 -0700 (PDT) Message-ID: <75ed441e-97f8-a266-0ca8-df8f6da59550@cs.ucla.edu> Date: Tue, 29 Mar 2022 17:07:49 -0700 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.7.0 Content-Language: en-US To: GNU bug control From: Paul Eggert Subject: gzip bug maintenance Organization: UCLA Computer Science Department Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) merge 35209 54290