From 7b8ed083e1bd9eb09e24b7adc2871f13846a3636 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Fredrik=20H=C3=BCbinette=20=28Hubbe=29?= <hubbe@hubbe.net>
Date: Fri, 7 May 1999 17:20:22 -0700
Subject: [PATCH] some minor fixes

Rev: NT/tools/rntcc:1.24
---
 NT/tools/rntcc | 44 ++++++++++++++++++++++----------------------
 1 file changed, 22 insertions(+), 22 deletions(-)

diff --git a/NT/tools/rntcc b/NT/tools/rntcc
index f5ee62dbde..744ef737e4 100755
--- a/NT/tools/rntcc
+++ b/NT/tools/rntcc
@@ -73,24 +73,23 @@ int compile(string *sources,
     return silent_do_cmd(cmd);
 }
 
-string check_errorfile(string errorfile)
+void check_errorfile(string errorfile)
 {
   object f=Stdio.File();
-  if(f->open(errorfile,"r"))
-  {
-    string data;
-    werror(data=f->read());
-    f->close();
-    data=replace(data,"\r","");
-    rm(errorfile);
-    foreach(data/"\n", string line)
-      {
-	if(!strlen(line)) continue;
-	if(search(line,"Warning")!=-1) continue;
-	werror("Error in compilation detected. "+line+"\n");
-	exit(1);
-      }
-  }
+  if(!f->open(errorfile,"r")) return;
+	
+  string data;
+  werror(data=f->read());
+  f->close();
+  data=replace(data,"\r","");
+  rm(errorfile);
+  foreach(data/"\n", string line)
+    {
+      if(!strlen(line)) continue;
+      if(search(line,"Warning")!=-1) continue;
+      werror("Error in compilation detected. "+line+"\n");
+      exit(1);
+    }
 }
 
 int main(int argc, string *argv)
@@ -144,11 +143,11 @@ int main(int argc, string *argv)
 	case "oper_pre": operation="preprocess"; break;
 	case "oper_comp": operation="compile"; break;
 	case "debug":
-	  cflags+=({"-d2"});
-	  ldopts+=({"DEBUG","WATCOM","ALL"});
+//	  cflags+=({"-d2i","-hw"});
+//	  ldopts+=({"DEBUG","WATCOM","ALL"});
 
-//	  cflags+=({"-d2","-hd"});
-//	  ldopts+=({"DEBUG","DWARF"});
+	  cflags+=({"-d2","-hd"});
+	  ldopts+=({"DEBUG","DWARF"});
 
 //	  cflags+=({"-d2","-hc"});
 //	  ldopts+=({"DEBUG","CODEVIEW","OPTION","CVPACK"});
@@ -252,7 +251,7 @@ int main(int argc, string *argv)
 
   if(output) rm(output);
 
-  string errorfile="tmp"+getpid()+".err";
+  string errorfile="TMP"+getpid()+".ERR";
   rm(errorfile);
   tmpfiles+=({errorfile});
 
@@ -350,7 +349,8 @@ int main(int argc, string *argv)
 		     "int main(int argc, string *argv) {\n"
 		     "argv[0]+=\".exe\";\n"
 		     "argv[0]=getenv(\"NTDRIVE\")+fixpath(combine_path(getcwd(),argv[0]));\n"
-		     "  exit(silent_do_cmd(argv));\n"
+		     "  int ret=silent_do_cmd(argv);\n"
+		     "  exit(ret);\n"
 		     "}\n");
     chmod(output,0755);
   }
-- 
GitLab