spencersalazar / chuck

28 stars 8 forks source link

win32 OTF code temp file / path issue #21

Closed zeffii closed 10 years ago

zeffii commented 10 years ago

firstly. chuck blows my mind. Thank you for your efforts!

This would be awesome to get working again, this was not fixed by the update lately to 1.3.3.0 what it looks like

SSteve commented 10 years ago

The patch you linked to is not the fix for this problem. It's the fix for ChucK attempting to write temp files to the root of the C: drive under Windows.

This is the proposed patch to util_string.cpp for this problem:

266c266,270
<             if( s[i] == '\\' && (i+1) < s.length() )
---
> #ifdef  __PLATFORM_WIN32__
>             if( s[i] == '\\' && (i+1) < s.length() && filename != "") // if we're in the filename, allow backslashes
> #else
>           if( s[i] == '\\' && (i+1) < s.length())
> #endif
zeffii commented 10 years ago

Cool! removed reference to wrong patch! Glad you're keeping an eye on this!

spencersalazar commented 10 years ago

Thanks zeffii and SSteve. We don't really use chuck --shell that much any more, so we didnt catch this earlier. As far as that specific patch, we try to use '/' style paths in chuck as much as possible, since Windows accepts them in most cases. We also recommend that '/' style paths be used in ChucK code and file path arguments.

Filepath parsing in ChucK in general is fairly complex, being the result of a variety of compromises based on cross-platform concerns and common use cases. This patch does address the present bug, but there are a few other issues at play here.

spencersalazar commented 10 years ago

Hello,

This issue has been fixed as of bb10c15c18e209d6b0b743a44cca29f687c58112. Should be coming in an upcoming release, but feel free to compile + test before then!

Thanks, spencer