compiler/bootstrap: Fixes
authorJerome St-Louis <jerome@ecere.com>
Sun, 6 Jul 2014 09:30:29 +0000 (05:30 -0400)
committerJerome St-Louis <jerome@ecere.com>
Sun, 6 Jul 2014 09:30:29 +0000 (05:30 -0400)
compiler/bootstrap/ecere/bootstrap/File.c
compiler/bootstrap/libec/bootstrap/ecdefs.c
compiler/libec/src/ecdefs.ec
ecere/src/sys/File.ec

index 7d97b03..eee5abd 100644 (file)
@@ -262,6 +262,7 @@ unsigned int FILE_FileGetStats(const char * fileName, struct __ecereNameSpace__e
 void __ecereNameSpace__ecere__sys__MakeSlashPath(char * p)
 {
 __ecereNameSpace__ecere__sys__FileFixCase(p);
+if(__runtimePlatform == 1)
 __ecereNameSpace__ecere__sys__ChangeCh(p, '\\', '/');
 }
 
index c8c9976..3f47f19 100644 (file)
@@ -349,16 +349,34 @@ __ecereNameSpace__ecere__sys__ChangeCh(moduleName, '&', '_');
 
 char * PassArg(char * output, const char * input)
 {
-const char * escChars = " !\"%&'()+,;=[]^`{}~";
-const char * escCharsQuoted = "\"";
+const char * escChars, * escCharsQuoted;
 unsigned int quoting = 0;
 char * o = output;
 const char * i = input, * l = input;
 
+if(__runtimePlatform == 1)
+{
+escChars = " !\"%&'()+,;=[]^`{}~";
+escCharsQuoted = "\"";
 while(*l && !strchr(escChars, *l))
 l++;
 if(*l)
 quoting = 1;
+}
+else
+{
+escChars = " !\"$&'()*:;<=>?[\\`{|";
+escCharsQuoted = "\"()$";
+if(*i == '-')
+{
+l++;
+while(*l && !strchr(escChars, *l))
+l++;
+if(*l)
+quoting = 1;
+*o++ = *i++;
+}
+}
 if(quoting)
 *o++ = '\"';
 while(*i)
index dfc33d6..7b55810 100644 (file)
@@ -232,30 +232,31 @@ public void FixModuleName(char *moduleName)
 // todo support %var% variables for windows and $var for linux?
 public char * PassArg(char * output, const char * input)
 {
-#ifdef __WIN32__
-//define windowsFileNameCharsNeedEscaping = " !%&'()+,;=[]^`{}~"; // "#$-.@_" are ok
-   const char * escChars = " !\"%&'()+,;=[]^`{}~"; // windowsFileNameCharsNeedEscaping;
-   const char * escCharsQuoted = "\"";
-#else
-//define linuxFileNameCharsNeedEscaping = " !\"$&'()*:;<=>?[\\`{|"; // "#%+,-.@]^_}~" are ok
-   const char * escChars = " !\"$&'()*:;<=>?[\\`{|"; // linuxFileNameCharsNeedEscaping;
-   const char * escCharsQuoted = "\"()$";
-#endif
+   const char * escChars, * escCharsQuoted;
    bool quoting = false;
    char *o = output;
    const char *i = input, *l = input;
-#ifdef __WIN32__
-   while(*l && !strchr(escChars, *l)) l++;
-   if(*l) quoting = true;
-#else
-   if(*i == '-')
+   if(__runtimePlatform == win32)
    {
-      l++;
+//define windowsFileNameCharsNeedEscaping = " !%&'()+,;=[]^`{}~"; // "#$-.@_" are ok
+      escChars = " !\"%&'()+,;=[]^`{}~"; // windowsFileNameCharsNeedEscaping;
+      escCharsQuoted = "\"";
       while(*l && !strchr(escChars, *l)) l++;
       if(*l) quoting = true;
-      *o++ = *i++;
    }
-#endif
+//define linuxFileNameCharsNeedEscaping = " !\"$&'()*:;<=>?[\\`{|"; // "#%+,-.@]^_}~" are ok
+   else
+   {
+      escChars = " !\"$&'()*:;<=>?[\\`{|"; // linuxFileNameCharsNeedEscaping;
+      escCharsQuoted = "\"()$";
+      if(*i == '-')
+      {
+         l++;
+         while(*l && !strchr(escChars, *l)) l++;
+         if(*l) quoting = true;
+         *o++ = *i++;
+      }
+   }
    if(quoting)
       *o++ = '\"';
    while(*i)
index 9dd9459..ab12b58 100644 (file)
@@ -1830,9 +1830,8 @@ public void CreateTemporaryDir(char * tempFileName, const char * template)
 public void MakeSlashPath(char * p)
 {
    FileFixCase(p);
-#ifdef WIN32
-   ChangeCh(p, '\\', '/');
-#endif
+   if(__runtimePlatform == win32)
+      ChangeCh(p, '\\', '/');
 }
 
 public void MakeSystemPath(char * p)