Minor changes collected over the last months
authorwerner <werner>
Thu, 17 Jul 2003 13:42:31 +0000 (13:42 +0000)
committerwerner <werner>
Thu, 17 Jul 2003 13:42:31 +0000 (13:42 +0000)
mkdiff
webbsh.c

diff --git a/mkdiff b/mkdiff
index b3cef88..3579954 100644 (file)
--- a/mkdiff
+++ b/mkdiff
@@ -83,7 +83,7 @@ Please check the signature of this patch file:
 Change to directory $pack-$prev_ver (or however you renamed it)
 and give this command:
 
-     zcat somepath/$pack-$prev_ver-$curr_ver.diff.gz | patch -p1
+    zcat somepath/$pack-$prev_ver-$curr_ver.diff.gz | patch -p1
 
 It is a good idea to rename your current directory to $pack-$curr_ver now.
 
@@ -93,9 +93,12 @@ Prereq: $prev_ver
 
 EOF
 
-sed -ne '/^diff.*VERSION/,/^+[0-9][0-9]*/ p' $tmp_name >> $diff_name
-echo  >> $diff_name
-sed -e '/^diff.*VERSION/,/^+[0-9][0-9]*/ d'  $tmp_name >> $diff_name
+#sed -ne '/^diff.*VERSION/,/^+[0-9][0-9]*/ p' $tmp_name >> $diff_name
+#echo  >> $diff_name
+#sed -e '/^diff.*VERSION/,/^+[0-9][0-9]*/ d'  $tmp_name >> $diff_name
+awk '/^diff.*\/VERSION/ {x=1; print; next}; /^diff.*/ && x == 1 {x = 2}; x == 1 {print}' $tmp_name >> $diff_name
+awk '/^diff.*\/VERSION/ {x=1; next}; /^diff.*/ && x == 1 {x = 2; print}; x != 1 {print}' $tmp_name >> $diff_name
+
 
 rm $tmp_name
 
index 04b20fe..5783f27 100644 (file)
--- a/webbsh.c
+++ b/webbsh.c
@@ -21,6 +21,7 @@
 #include <string.h>
 #include <assert.h>
 #include <errno.h>
+#include <ctype.h>
 #include <sys/types.h>
 #include <sys/wait.h>
 #include <unistd.h>
@@ -139,8 +140,10 @@ check_for_suid (const char *directory)
               fputs ("' detected\n",stderr);
               esc = 2;
             }
-          else
+          else if (isascii (c) && isprint (c))
             putc (c, stderr);
+          else
+            printf ("\\%02x", c );
         }
       if ( (rc=pclose (fp)) )
         {