1.7.0-48: [BUG] Passing characters above 128 from bash command line

Edward Lam edward@sidefx.com
Thu May 28 17:30:00 GMT 2009


PS. In case you haven't noticed, copyright.txt is not a long file. It 
consists of a single byte, 0xA9.

Edward Lam wrote:
> Hi Larry,
> 
>  > This sounds allot like this report to me:
>  >
>  > <http://cygwin.com/ml/cygwin/2009-05/msg00611.html>
> 
> I don't think it's the same bug because if I replace copyright.txt with 
> a single printable character (eg. c), then it works.
> 
> Regards,
> -Edward
> 
> Larry Hall (Cygwin) wrote:
>> Edward Lam wrote:
>>> Hi Cygwin 1.7 developers,
>>>
>>> I think I've encountered bug in cygwin 1.7.0-48 on WinXP 32-bit. It 
>>> seems that passing a character on the command line (from either 
>>> ash.exe or bash.exe) that is greater than 127 to a native win32 
>>> process results in arguments being truncated.
>>>
>>> Hopefully you can reproduce and fix. Steps to reproduce outlined below.
>>>
>>> $ cat bug.c
>>> #include <stdio.h>
>>>
>>> int main(int argc, char *argv[])
>>> {
>>>     int i;
>>>     for (i = 0; i < argc; i++)
>>>         printf("%d: %s\n", i, argv[i]);
>>>     return 0;
>>> }
>>>
>>> $ xxd copyright.txt
>>> 0000000: a9                                       .
>>>
>>> $ $TOOLROOT/bin/cl -I$TOOLROOT/include bug.c /link 
>>> /libpath:$TOOLROOT/lib /libpath:$TOOLROOT/PlatformSDK/lib
>>>
>>> Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 13.10.3077 for 
>>> 80x86
>>> Copyright (C) Microsoft Corporation 1984-2002. All rights reserved.
>>>
>>> bug.c
>>> Microsoft (R) Incremental Linker Version 7.10.3077
>>> Copyright (C) Microsoft Corporation.  All rights reserved.
>>>
>>> /out:bug.exe
>>> /libpath:e:/msdev7/vc7/lib
>>> /libpath:e:/msdev7/vc7/PlatformSDK/lib
>>> bug.obj
>>>
>>> $ ./bug "before `cat copyright.txt` after"
>>> 0: E:\cygwin1.7\tmp\bug.exe
>>> 1: before
>>>
>>> Notice that for argument 1, we never see the contents of 
>>> copyright.txt and the text after it, "after" is never passed to the 
>>> win32 native application.
>>
>> This sounds allot like this report to me:
>>
>> <http://cygwin.com/ml/cygwin/2009-05/msg00611.html>
>>
>> No?
>>
> 
> 


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/



More information about the Cygwin mailing list