From 47a5f42c2826eca281a6cde180e002e74984e7ad Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Fredrik=20H=C3=BCbinette=20=28Hubbe=29?= <hubbe@hubbe.net>
Date: Wed, 21 Jan 1998 11:35:01 -0800
Subject: [PATCH] updated

Rev: NT/tools/cp:1.2
Rev: NT/tools/install:1.2
Rev: NT/tools/lib:1.11
Rev: NT/tools/mkdir:1.2
Rev: NT/tools/rntcc:1.9
Rev: NT/tools/sprshd:1.4
---
 NT/tools/cp      |  4 ++--
 NT/tools/install |  4 ++--
 NT/tools/lib     |  4 ++--
 NT/tools/mkdir   |  2 +-
 NT/tools/rntcc   | 14 +++++++++++++-
 NT/tools/sprshd  | 24 +++++++++++++++++++++++-
 6 files changed, 43 insertions(+), 9 deletions(-)

diff --git a/NT/tools/cp b/NT/tools/cp
index e0641cef88..ff2ec26424 100755
--- a/NT/tools/cp
+++ b/NT/tools/cp
@@ -5,8 +5,8 @@ dest=`eval echo '$'$#`
 case "x$dest" in
   x[a-zA-Z]:*)
     . $NTTOOLS
-    do_cmd "copy `fixpath $*`"
-    exit 0
+    do_cmd copy `fixpath $*`
+    exit $?
   ;;
 esac
 
diff --git a/NT/tools/install b/NT/tools/install
index 4374c8409d..cef825764e 100755
--- a/NT/tools/install
+++ b/NT/tools/install
@@ -15,8 +15,8 @@ case "x$dest" in
      set -- "$1.exe" "$2"
    fi
     
-    do_cmd "copy `fixpath $*`"
-    exit 0
+    do_cmd copy `fixpath $*`
+    exit $?
   ;;
 esac
 
diff --git a/NT/tools/lib b/NT/tools/lib
index ddcaf35a36..005d50ef2e 100644
--- a/NT/tools/lib
+++ b/NT/tools/lib
@@ -24,7 +24,7 @@ s/
//g'
 
 silent_do_cmd() {
   if [ $USE_SPRSH = yes ]; then
-    sprsh "$*"
+    sprsh "$@"
   else
     BATFILE=TMP$$.bat
     PWD=`pwd`
@@ -36,7 +36,7 @@ silent_do_cmd() {
     fi
     echo >>$BATFILE "$NTDRIVE
"
     echo >>$BATFILE "cd $RPWD
"
-    echo >>$BATFILE "$*
"
+    echo >>$BATFILE "$@
"
     rsh $NTHOST $NTDRIVE$RPWD\\$BATFILE
     if [ x$CLEANUP = xyes ]; then
       rm $BATFILE || :
diff --git a/NT/tools/mkdir b/NT/tools/mkdir
index 3cb399cfd4..01df97c14d 100755
--- a/NT/tools/mkdir
+++ b/NT/tools/mkdir
@@ -4,7 +4,7 @@
 case "x$1" in
   x[a-zA-Z]:*)
     . $NTTOOLS
-    do_cmd "mkdir `fixpath $1`"
+    do_cmd mkdir `fixpath $1`
     exit 0
   ;;
 esac
diff --git a/NT/tools/rntcc b/NT/tools/rntcc
index 3bc8a062e3..0ae5085d57 100755
--- a/NT/tools/rntcc
+++ b/NT/tools/rntcc
@@ -77,8 +77,20 @@ while test "$#" != 0; do
     -R | -L) shift ;;
     -R* | -L* | -Wl*)  ;;
 
+    -W)
+      CFLAGS="$CFLAGS -w2"
+    ;;
+
+    -Wall)
+      CFLAGS="$CFLAGS -wx"
+    ;;
+
     -D*)
-      CFLAGS="$CFLAGS `echo $1 | sed -e 's/^-I/-d/g'`"
+      CFLAGS="$CFLAGS `echo $1 | sed -e 's/^-D/-d/g'`"
+    ;;
+
+    -U*)
+      CFLAGS="$CFLAGS `echo $1 | sed -e 's/^-U/-u/g'`"
     ;;
 
     -l*)
diff --git a/NT/tools/sprshd b/NT/tools/sprshd
index 6486a93cbd..82d2205814 100755
--- a/NT/tools/sprshd
+++ b/NT/tools/sprshd
@@ -20,8 +20,29 @@ void handle_incoming_connection(object(Stdio.File) io)
 
   write("Doing "+cmd*" "+"\n");
 
-  switch(cmd[0])
+  switch(lower_case(cmd[0]))
   {
+    case "mkdir":
+    {
+      io->write(sprintf("%4c",0));
+      mkdir(combine_path(combine_path(getcwd(),dir),cmd[1]));
+      io->write(sprintf("%4c",0));
+      break;
+    }
+
+    case "copy":
+    {
+      string from=combine_path(combine_path(getcwd(),dir),cmd[1]);
+      string to=combine_path(combine_path(getcwd(),dir),cmd[2]);
+
+      if(mixed stat=file_stat(to))
+	if(stat[1]==-2)
+	  to=combine_path(to,cmd[1]);
+
+      io->write(sprintf("%4c",0));
+      io->write(sprintf("%4c",!Stdio.cp(from,to)));
+      break;
+    }
     case "getenv":
     {
       string s=getenv(cmd[1])+"\n";
@@ -79,6 +100,7 @@ int main(int argc, string *argv)
 
   string *hosts=gethostbyname(argv[2])[1];
 
+  write("Ready.\n");
   while(1)
   {
     if(object io=accept())
-- 
GitLab