Re: expand: Fix ghost fields with unquoted $@/$*

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Op 23-03-18 om 05:37 schreef Herbert Xu:
> You're right.  The proper fix to this is to ensure that nulonly
> is not set in varvalue for $*.  It should only be set for $@ when
> it's inside double quotes.
> 
> In fact there is another bug while we're playing with $@/$*.
> When IFS is set to a non-whitespace character such as :, $*
> outside quotes won't remove empty fields as it should.
> 
> This patch fixes both problems.

Unfortunately it also introduces a bug with $*.

$ src/dash -c 'IFS=:; v=$*; printf "[%s]\n" "$v"' _ abc 'def ghi' jkl
[abcdef ghijkl]

Expected:
[abc:def ghi:jkl]


$ src/dash -fc 'IFS=:; set ${v=$*}; printf [%s]\\n "$v" "$@"' \
	_ abc 'def ghi' jkl
[abcdef ghijkl]
[abcdef ghijkl]

Expected:

[abc:def ghi:jkl]
[abc]
[def ghi]
[jkl]


$ src/dash -fc 'IFS=:; set "${v=$*}"; printf [%s]\\n "$v" "$@"' \
	_ "abc" "def ghi" "jkl"
[abcdef ghijkl]
[abcdef ghijkl]

Expected:

[abc:def ghi:jkl]
[abc:def ghi:jkl]


Thanks,

- M.
--
To unsubscribe from this list: send the line "unsubscribe dash" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [LARTC]     [Bugtraq]     [Yosemite Forum]     [Photo]

  Powered by Linux