[chuck-dev] Error in chuck --shell under Windows - with potential fix

Steve Nicholson lists at steveandmimi.com
Tue Nov 26 16:35:00 EST 2013

One of my fellow students in the Coursera ChucK class found a bug in chuck --shell under Windows. When using "{" and "}" to enter ChucK code to be interpreted, he got the error:

[chuck]: unrecognized escape sequence: \s
[chuck]: malformed filename + argumentlist...    -->  '\s2i8.7'add: error: command failed

I tracked it down to util_string.cpp. The extract_args function is interpreting backslashes as the beginning of an escape sequence, not taking into account that Windows file paths can contain backslashes. I made this change which works. I've only done basic testing, though.

<             if( s[i] == '\\' && (i+1) < s.length() )
> #ifdef  __PLATFORM_WIN32__
>             if( s[i] == '\\' && (i+1) < s.length() && filename != "") // Wait until after parsing a filename before looking for escape sequences
> #else
> 			if( s[i] == '\\' && (i+1) < s.length())
> #endif


More information about the chuck-dev mailing list