diff --git a/scripts/publish-macosx.sh b/scripts/publish-macosx.sh index cca941d7..aff08095 100755 --- a/scripts/publish-macosx.sh +++ b/scripts/publish-macosx.sh @@ -22,6 +22,7 @@ update_www_download_links() local $* filesize=$(human_filesize $filesize) webdir=../openscad.github.com + # FIXME: release vs. snapshot incfile=inc/mac_snapshot_links.js BASEURL='http://files.openscad.org/' DATECODE=`date +"%Y.%m.%d"` diff --git a/src/winconsole.c b/src/winconsole.c index 7182ea8f..d9e1ad81 100644 --- a/src/winconsole.c +++ b/src/winconsole.c @@ -37,7 +37,7 @@ #define WEXITSTATUS(S) (((S) >> 8) & 0xff) #endif -#define MAXCMDLEN 64000 +#define MAXCMDLEN /*64000*/ 32768 /* MS Windows limit */ #define BUFFSIZE 42 int main( int argc, char * argv[] ) @@ -63,7 +63,10 @@ int main( int argc, char * argv[] ) quote = NULL != strpbrk((s = argv[i]), " \"&'<>^|\t"); if (quote) cmd[n++] = '"'; while (*s) { // copy & check - if ('"' == *s) cmd[n++] = *s; // duplicate it + // The following test is compomise between brevity, clarity and performance. + // It could be boiled down to: if ('"' == s[strspn(s,"\\")]) + // or expanded to avoid repetitive passes of strspn() over same data. + if ('"' == *s || ('\\' == *s && '"' == s[strspn(s,"\\")])) cmd[n++] = '\\'; cmd[n++] = *s++; if (n >= MAXCMDLEN-sizeof(redirect_str)) { fprintf(stderr, "Command line length exceeds limit of %d\n", MAXCMDLEN);