incubator-stdcxx-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Travis Vitek" <>
Subject RE: spaces in rw_xxx_expand()
Date Wed, 02 Apr 2008 18:50:42 GMT

>Martin Sebor wrote:
>PING? Should I open an issue for this or is it something you're
>already working on or planning to?

Well if we want 100% compatibility with the shell, then it should be
implemented. I took a look, and I think I can fix it by modifying
_rw_brace_graph::brace_expand_write() to treat quoted blocks literally
and failing if an unescaped quote isn't matched. That will break
rw_brace_expand(), but that isn't too big of a deal as we've discussed
removing that function several times.

Would you please open an issue for this? I would have done this myself,
but I'm not sure how high a priority this is for you. I'm assuming that
this is not to serious because you should be able to work around it by
using escapes.

>Martin Sebor wrote:
>> In the shell, spaces that are otherwise treated as separators can
>> be either escaped or quoted to have them interpreted as ordinary
>> characters. The rw_xxx_expand() functions let me escape spaces but
>> they don't seem to like quoting. For example, the shell expands
>> the following three strings to the same result:
>>      "a{b\ c,d}"    ==> "ab c ad"
>>      "a{b' 'c,d}"
>>      "a{b" "c,d}"
>> but rw_brace_expand() fails on the last two. It should work the
>> same as the shell.
>> In the change below I've enhanced the 0.braceexpand.cpp test to
>> exercise a number of (passing) test cases including plan as well
>> as escaped whitespace:
>> I think the same test cases should be added for quoted whitespace.
>> Martin

View raw message