Merge branch 'master' of github.com:openscad/openscad

jawsreader
Marius Kintel 2014-02-23 14:58:11 -05:00
commit 2712465a1d
2 changed files with 6 additions and 2 deletions

View File

@ -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"`

View File

@ -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);