Re: bash: remove the format string "%q" in the unicode3.sub

2016-08-11 Thread dengke...@windriver.com

1. My target was x86-64, using the master 4.3.30 version of bash
(Sorry for lacking the information)

2. I used the master version of bash on the unicode3.sub before
I will test it for the devel version of bash as soon as.

//dengke

On 2016年08月10日 19:10, Chet Ramey wrote:

On 8/10/16 2:42 AM, dengke...@windriver.com wrote:

Hi chet

Thanks for you help.

1. This file:


http://git.savannah.gnu.org/cgit/bash.git/tree/tests/unicode3.sub?h=devel=74b8cbb41398b4453d8ba04d0cdd1b25f9dcb9e3


When executed to the 3 line:

 "$payload"

On my target the output was:

 unicode3.sub: line 3: 5�@3�+�S8: command not found

You don't give any information about your target, but using the devel
version of bash on that file produces output using $'...' quoting on all
the systems I have tested, since the string contains an invalid multibyte
sequence.







Re: bash: remove the format string "%q" in the unicode3.sub

2016-08-10 Thread Chet Ramey
On 8/10/16 2:42 AM, dengke...@windriver.com wrote:
> Hi chet
> 
> Thanks for you help.
> 
> 1. This file:
> 
>
> http://git.savannah.gnu.org/cgit/bash.git/tree/tests/unicode3.sub?h=devel=74b8cbb41398b4453d8ba04d0cdd1b25f9dcb9e3
> 
> When executed to the 3 line:
> 
> "$payload"
> 
> On my target the output was:
> 
> unicode3.sub: line 3: 5�@3�+�S8: command not found

You don't give any information about your target, but using the devel
version of bash on that file produces output using $'...' quoting on all
the systems I have tested, since the string contains an invalid multibyte
sequence.


-- 
``The lyf so short, the craft so long to lerne.'' - Chaucer
 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, UTech, CWRUc...@case.eduhttp://cnswww.cns.cwru.edu/~chet/



Re: bash: remove the format string "%q" in the unicode3.sub

2016-08-10 Thread dengke...@windriver.com

Hi chet

Thanks for you help.

1. This file:

http://git.savannah.gnu.org/cgit/bash.git/tree/tests/unicode3.sub?h=devel=74b8cbb41398b4453d8ba04d0cdd1b25f9dcb9e3

When executed to the 3 line:

"$payload"

On my target the output was:

unicode3.sub: line 3: 5�@3�+�S8: command not found

not the ANSI-C style quoted string like: $'...' in the changed compared 
file intl.right, the same for the 5 line.


http://git.savannah.gnu.org/cgit/bash.git/diff/tests/intl.right?h=devel=74b8cbb41398b4453d8ba04d0cdd1b25f9dcb9e3


2. The fixed for

printf %q "$payload"

in intl.right is fine for me.


//dengke

On 2016年08月09日 22:39, Chet Ramey wrote:

On 8/9/16 3:18 AM, dengke...@windriver.com wrote:

Hi all

When I run the tests for the bash, the sub-test unicode3.sub of intl.tests
failed.

The sub-test unicode3.sub contain the following:

 payload=$'\065\247\100\063\231\053\306\123\070\237\242\352\263'
 "$payload"
 printf %q "$payload"

In this situation, the format string "%q" in command printf means that when the
character in the payload is not in {alpha & digit & punctuation & ISO
646(7-bit)}, it
would print the string with ANSI-C style quoted string: $'...' , we can
check the source code

This has already been changed in the devel branch (back in May, 2015), and
the test case and tets output was changed at the same time.





Re: bash: remove the format string "%q" in the unicode3.sub

2016-08-09 Thread Chet Ramey
On 8/9/16 3:18 AM, dengke...@windriver.com wrote:
> Hi all
> 
> When I run the tests for the bash, the sub-test unicode3.sub of intl.tests
> failed.
> 
> The sub-test unicode3.sub contain the following:
> 
> payload=$'\065\247\100\063\231\053\306\123\070\237\242\352\263'
> "$payload"
> printf %q "$payload"
> 
> In this situation, the format string "%q" in command printf means that when 
> the
> character in the payload is not in {alpha & digit & punctuation & ISO
> 646(7-bit)}, it
> would print the string with ANSI-C style quoted string: $'...' , we can
> check the source code

This has already been changed in the devel branch (back in May, 2015), and
the test case and tets output was changed at the same time.

-- 
``The lyf so short, the craft so long to lerne.'' - Chaucer
 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, UTech, CWRUc...@case.eduhttp://cnswww.cns.cwru.edu/~chet/