GNU bug report logs - #54298
Reply for zdiff-fix-arg-handling-bug.patch

Previous Next

Package: gzip;

Reported by: Lv Ying <lvying6 <at> huawei.com>

Date: Tue, 8 Mar 2022 15:57:02 UTC

Severity: normal

Merged with 35209, 54290, 54291

Done: Paul Eggert <eggert <at> cs.ucla.edu>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Lv Ying <lvying6 <at> huawei.com>
To: <eggert <at> cs.ucla.edu>, <54290 <at> debbugs.gnu.org>
Cc: fanwentao <at> huawei.com, 54298 <at> debbugs.gnu.org
Subject: bug#54298: Reply for zdiff-fix-arg-handling-bug.patch
Date: Tue, 8 Mar 2022 10:22:23 +0800
Hi Paul:

Thanks for your quick reply. I apply 
0001-zdiff-fix-arg-handling-bug.patch at the latest gzip code(commit 
2b281564e142c68acbdc) and test the problem.

This patch can fix options with argument(e.g zdiff -C 5). This patch did 
an interesting job to identify zidff options with argument([CDFISUWXx]), 
this case put option argument into cmp="$cmp '$2'". At last, cmp="$cmp 
--" separate options and filename arguments.

However this manual separation job can not handle filename before options.
zdiff -i -W 200 -U 5 a.gz b.gz
--- /dev/fd/5	2022-03-08 13:33:06.029980436 -0500
+++ -	2022-03-08 13:33:06.031632168 -0500
@@ -1 +1 @@
-aaaa
+bbbb
zdiff a.gz b.gz -i -W 200 -U 5
/root/community/gzip/zdiff: line 75: -i: No such file or directory

getopt command from util-linux can handle such situation. getopt can 
separate arguments and options by "--", even though arguments are before 
options.

Please add me when you reply this thread, so I can join this thread 
discuss easily.

-- 
Thanks!
Lv Ying




This bug report was last modified 3 years and 49 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.