On Sat, Mar 08, 2008 at 06:11:09PM -0500, Jeff Johnson wrote:
> Hmmm, we appear to have different behavior wrto echo. Your
> patch changes testit.sh to include an explicit "--", which (when
> I last fixed testit.sh like 3 weeks ago) does not appear in the
> output I am (and was) seeing.
I tried it on Ubuntu 7.10 and CentOS 5 with the same result, so it's
obviously a difference between whatever version of "echo" you have and
the one in the gnu coreutils package. I'll attach a patch that makes
the code use a simple perl -e construct to accomplish the same thing in
a compatible manner (for any system with perl). Using that avoids the
need to add the "--" chars to the output like I did in my earlier patch.
> I have added the tests and the 1 liner to have -c=foo functionality,
> just commented out and disabled for now.
Please note that that one-line fix won't work without my prior patch
that fixes the problem with a short option that has an embedded (or
leading) equal in an abutting arg (e.g. "test1 -2foo=bar"). I'll attach
it here in case you missed it.
..wayne..
--- test-poptrc 16 Feb 2008 22:16:10 -0000 1.4
+++ test-poptrc 9 Mar 2008 04:13:55 -0000
@@ -7,6 +7,6 @@ test1 alias -O --arg1
test1 alias --grab --arg2 "'foo !#:+'"
test1 alias --grabbar --grab bar
-test1 exec --echo-args echo --
+test1 exec --echo-args perl -e 'print "@ARGV"' --
test1 alias -e --echo-args
-test1 exec -a /bin/echo --
+test1 exec -a perl -e 'print "@ARGV"' --
--- popt.c 8 Mar 2008 17:26:30 -0000 1.116
+++ popt.c 8 Mar 2008 20:48:43 -0000
@@ -901,6 +901,7 @@ int poptGetNextOpt(poptContext con)
if (!opt) {
con->os->nextCharArg = origOptString + 1;
+ longArg = NULL;
} else {
if (con->os == con->optionStack && F_ISSET(opt, STRIP))
{