Browse Source

- fixed win95/98 redirection and /

Laurent Bedubourg 18 years ago
parent
commit
ea6cab325a
1 changed files with 10 additions and 3 deletions
  1. 10 3
      std/mtwin/templo/Template.hx

+ 10 - 3
std/mtwin/templo/Template.hx

@@ -117,10 +117,17 @@ class Template {
 		f.write(s);
 		f.close();
 
-		var r = neko.Sys.command("nekoc -o "+Loader.TMP_DIR+" "+path+" 2> "+Loader.TMP_DIR+"/nekoc.out");
+		var r = null;
+		if ((neko.Sys.systemName()=="Windows")&&(neko.Sys.getEnv("OS")!="Windows_NT")){
+		    // Neither Windows 95 or Windows 98 support the 2> redirect
+		    r = neko.Sys.command("nekoc -o "+Loader.TMP_DIR+" "+path+" > "+Loader.TMP_DIR+"nekoc.out");
+		}
+		else {
+		    r = neko.Sys.command("nekoc -o "+Loader.TMP_DIR+" "+path+" 2> "+Loader.TMP_DIR+"nekoc.out");
+		} 
 		if (r != 0){
-			if (neko.FileSystem.exists(Loader.TMP_DIR+"/nekoc.out")){
-				throw "nekoc compilation of "+path+" failed ("+r+") : "+neko.io.File.getContent(Loader.TMP_DIR+"/nekoc.out");
+			if (neko.FileSystem.exists(Loader.TMP_DIR+"nekoc.out")){
+				throw "nekoc compilation of "+path+" failed ("+r+") : "+neko.io.File.getContent(Loader.TMP_DIR+"nekoc.out");
 			}
 			else {
 				throw "nekoc compilation of "+path+" failed ("+r+") -- no nekoc.out available";