Commit Diff


commit - 98cd2746cff82ab359de6d6ce2c3f87b2c4166a8
commit + b4a659b6cffd452fbdf54a81210f0540426b678a
blob - 787920bcf6d8da4f81a7f47f07c137263ba4baae
blob + 5becb9347fb9201ba5f1b046fc57907540fe719a
--- INSTALL
+++ INSTALL
@@ -7,6 +7,7 @@ cd src
 make
 mk clean
 mk install
+mk clean
 
 echo "Set PLAN9=$PLAN9 in your profile environment."
 echo 'Add $PLAN9/bin to your PATH.'
blob - 6979d3cc4f3ba45fcce313bdf8fe4d045cdd8ada
blob + 7a75343189bb9834a87dd6260a691f54bdb46c36
--- src/cmd/9term/9term.c
+++ src/cmd/9term/9term.c
@@ -10,6 +10,8 @@
 #include <plumb.h>
 #include <complete.h>
 #include "term.h"
+
+int noecho = 0;
 
 typedef struct Text	Text;
 typedef struct Readbuf	Readbuf;
blob - 6dba6dd455adca122db008fea04146939ba247c4
blob + eec79c286b4360f3f20ac5f3478d7b949e150ddf
--- src/cmd/9term/FreeBSD.c
+++ src/cmd/9term/FreeBSD.c
@@ -1,58 +1 @@
-#include <u.h>
-#include <sys/types.h>
-#include <termios.h>
-#include <sys/termios.h>
-#include <libutil.h>
-#include <libc.h>
-#include "term.h"
-
-int
-getpts(int fd[], char *slave)
-{
-	return openpty(&fd[1], &fd[0], slave, 0, 0);
-}
-
-int
-childpty(int fd[], char *slave)
-{
-	int sfd;
-
-	close(fd[1]);
-	setsid();
-	sfd = open(slave, ORDWR);
-	if(sfd < 0)
-		sysfatal("open %s: %r\n", slave);
-	if(ioctl(sfd, TIOCSCTTY, 0) < 0)
-		fprint(2, "ioctl TIOCSCTTY: %r\n");
-	return sfd;
-}
-
-struct winsize ows;
-
-void
-updatewinsize(int row, int col, int dx, int dy)
-{
-	struct winsize ws;
-
-	ws.ws_row = row;
-	ws.ws_col = col;
-	ws.ws_xpixel = dx;
-	ws.ws_ypixel = dy;
-	if(ws.ws_row != ows.ws_row || ws.ws_col != ows.ws_col)
-	if(ioctl(rcfd[0], TIOCSWINSZ, &ws) < 0)
-		fprint(2, "ioctl: %r\n");
-	ows = ws;
-}
-
-int
-israw(int fd)
-{
-	return 0;
-}
-
-int
-setecho(int fd, int on)
-{
-	return 0;
-}
-
+#include "bsdpty.c"
blob - ebcf2ef0f0992fec9c9d834f767f5fce6907d3c1
blob + 8c0bf2c3aef8f7480512ab360436717c2e981338
--- src/cmd/9term/bsdpty.c
+++ src/cmd/9term/bsdpty.c
@@ -1,9 +1,13 @@
 #include <u.h>
+#include <sys/types.h>
+#include <sys/stat.h>
 #include <errno.h>
 #include <grp.h>
 #include <termios.h>
 #include <sys/termios.h>
+#ifdef __linux__
 #include <pty.h>
+#endif
 #include <fcntl.h>
 #include <libc.h>
 #include "term.h"
@@ -30,7 +34,6 @@ getpts(int fd[], char *slave)
 		pty[8] = *a;
 		pty[9] = *z;
 		if((fd[1] = open(pty, ORDWR)) < 0){
-fprint(2, "try %s: %r\n", pty);
 			if(errno == ENOENT)
 				break;
 		}else{
blob - 8b06911da5d5c40f90a4bfbf2bc53fc19900add7
blob + acfd0b3ef4ac4271229401aaf8081fba59f62a99
--- src/cmd/9term/mkfile
+++ src/cmd/9term/mkfile
@@ -1,4 +1,3 @@
-PLAN9=../../..
 <$PLAN9/src/mkhdr
 
 TARG=9term win
@@ -13,5 +12,5 @@ SHORTLIB=complete frame draw plumb fs mux thread 9
 
 LDFLAGS=-L$X11/lib -lX11
 
-Linux.$O: bsdpty.c
+Linux.$O FreeBSD.$O: bsdpty.c
 
blob - 4b3248309bba698fd49623c7fafb268780e23ca5
blob + 7ee49350462bb15fbe5820e63e60a90269a015f0
--- src/cmd/9term/rcstart.c
+++ src/cmd/9term/rcstart.c
@@ -1,9 +1,6 @@
 #include <u.h>
-#include <libc.h>
-#if 0
-#include <sys/wait.h>
-#endif
 #include <signal.h>
+#include <libc.h>
 #include "term.h"
 
 int
@@ -37,6 +34,8 @@ rcstart(int argc, char **argv, int *pfd, int *tfd)
 		dup(sfd, 1);
 		dup(sfd, 2);
 		system("stty tabs -onlcr onocr icanon echo erase '^h' intr '^?'");
+		if(noecho)
+			system("stty -echo");
 		for(i=3; i<100; i++)
 			close(i);
 		execvp(argv[0], argv);
blob - 4b5339ce72ff72dc62472e7054dbad36ec975b7a
blob + 62ef0e68d816b92130a678b8870b06d3a9352a53
--- src/cmd/9term/term.h
+++ src/cmd/9term/term.h
@@ -5,3 +5,4 @@ extern int rcfd;
 extern int rcstart(int, char*[], int*, int*);
 extern int isecho(int);
 extern int setecho(int, int);
+extern int noecho;
blob - 0e1fd8a68df345c75d0d5ac6dfade4923a59729a
blob + fd42abe76b9560edd00b4f3e3b8e9b12b7ea2cd2
--- src/cmd/9term/win.c
+++ src/cmd/9term/win.c
@@ -4,6 +4,8 @@
 #include <fcall.h>
 #include <fs.h>
 #include "term.h"
+
+int noecho = 1;
 
 #define	EVENTSIZE	256
 #define	STACK	32768
blob - 559839f33077e6968f430601e63fa7c28d399a46
blob + 5e68e466253b6c284817fbef392839be5d87a937
--- src/cmd/acid/main.c
+++ src/cmd/acid/main.c
@@ -112,10 +112,12 @@ main(int argc, char *argv[])
 
 	l = look("acidmap");
 	if(l && l->proc) {
-		n = an(ONAME, ZN, ZN);
-		n->sym = l;
-		n = an(OCALL, n, ZN);
-		execute(n);
+		if(setjmp(err) == 0){
+			n = an(ONAME, ZN, ZN);
+			n->sym = l;
+			n = an(OCALL, n, ZN);
+			execute(n);
+		}
 	}
 
 	interactive = 1;
@@ -146,12 +148,14 @@ main(int argc, char *argv[])
 static int
 attachfiles(int argc, char **argv)
 {
+	int pid;
 	char *s;
 	int i, omode;
 	Fhdr *hdr;
 	Lsym *l;
 	Value *v;
 
+	pid = 0;
 	interactive = 0;
 	if(setjmp(err))
 		return -1;
blob - e372fd8875dcabaaf65f17259f1ec2a49015b25e
blob + 35c938c11069f5a8e9926e1109fb447c006cbb8f
--- src/cmd/acid/mkfile
+++ src/cmd/acid/mkfile
@@ -18,7 +18,6 @@ OFILES=$UOFILES y.tab.$O
 YFILES=dbg.y
 HFILES=acid.h
 
-BIN=/home/rsc/bin
 
 SHORTLIB=mach regexp9 bio 9
 
blob - 3b862aa942b662c19f15a801ccb73dcd65f04639
blob + 2c286e1593cbde409556f0e0f8d0bfc0e71d99e4
--- src/cmd/acid/proc.c
+++ src/cmd/acid/proc.c
@@ -51,8 +51,7 @@ sproc(int xpid)
 int
 nproc(char **argv)
 {
-	char buf[128];
-	int pid, i, fd;
+	int pid, i;
 
 	pid = fork();
 	switch(pid) {
blob - e9e830e357ecf2ec636f38862e1db77f127a20df
blob + 2bea33255ecc44754e9afc2355217d3be2020008
--- src/cmd/acidtypes/mkfile
+++ src/cmd/acidtypes/mkfile
@@ -11,7 +11,7 @@ OFILES=\
 
 HFILES=\
 	dat.h\
-	../../libmach/mach.h\
+	$PLAN9/include/mach.h\
 	../../libmach/elf.h\
 	../../libmach/dwarf.h\
 	../../libmach/stabs.h\
blob - 3cabc6680c4bbf08abb3ad9c3ca729b283af8853
blob + 2257d681a094ea3569e7af968285b005d7bf5d21
--- src/cmd/acme/fns.h
+++ src/cmd/acme/fns.h
@@ -55,6 +55,8 @@ void	get(Text*, Text*, Text*, int, int, Rune*, int);
 void	put(Text*, Text*, Text*, int, int, Rune*, int);
 void	putfile(File*, int, int, Rune*, int);
 void	fontx(Text*, Text*, Text*, int, int, Rune*, int);
+#undef isalnum
+#define isalnum acmeisalnum
 int	isalnum(Rune);
 void	execute(Text*, uint, uint, int, Text*);
 int	search(Text*, Rune*, uint);
blob - d4738bef5f3f4ece72218a65f4ce3c91eab7d13d
blob + fbb34d1ad26c35cfd085dd6c029b09a76b2b2425
--- src/cmd/acme/mkfile
+++ src/cmd/acme/mkfile
@@ -1,6 +1,5 @@
 # Acme is up-to-date w.r.t. sources as of 29 February 2004
 
-PLAN9=../../..
 <$PLAN9/src/mkhdr
 
 TARG=acme
blob - 40810d15ae65c48d68eb05d93b2730c58dccd683
blob + f75d6abe6c059579dd5c60519d833a707249735b
--- src/cmd/bzip2/lib/mkfile
+++ src/cmd/bzip2/lib/mkfile
@@ -1,4 +1,3 @@
-PLAN9=../../../..
 <$PLAN9/src/mkhdr
 
 OFILES=\
blob - a1781fc4c9dd0f9f933c3f0e6061010168e77866
blob + e544d4d79cc10951a2476dd2a40e86d90d6f1ea8
--- src/cmd/bzip2/mkfile
+++ src/cmd/bzip2/mkfile
@@ -1,4 +1,3 @@
-PLAN9=../../..
 <$PLAN9/src/mkhdr
 
 OFILES=
blob - c3168a2ad6aaee02e6c8b3d0942db768b3fcc2af
blob + e5519156350163bfa7a452ab892e7ed37b2f3a90
--- src/cmd/idiff.c
+++ src/cmd/idiff.c
@@ -104,7 +104,7 @@ rundiff(char *arg1, char *arg2, int outfd)
 	Waitmsg *w;
 
 	narg = 0;
-	arg[narg++] = "/bin/diff";
+	arg[narg++] = "diff";
 	arg[narg++] = "-n";
 	if(diffbflag)
 		arg[narg++] = "-b";
@@ -121,7 +121,7 @@ rundiff(char *arg1, char *arg2, int outfd)
 	case 0:
 		dup(outfd, 1);
 		close(0);
-		exec("/bin/diff", arg);
+		exec("diff", arg);
 		sysfatal("exec: %r");
 
 	default:
@@ -143,7 +143,7 @@ runcmd(char *cmd)
 	int narg, pid, wpid;
 
 	narg = 0;
-	arg[narg++] = "/bin/rc";
+	arg[narg++] = "rc";
 	arg[narg++] = "-c";
 	arg[narg++] = cmd;
 	arg[narg] = nil;
@@ -153,7 +153,7 @@ runcmd(char *cmd)
 		sysfatal("fork: %r");
 
 	case 0:
-		exec("/bin/rc", arg);
+		exec("rc", arg);
 		sysfatal("exec: %r");
 
 	default:
blob - 5b3008688978594d27b90251f276ff1ab7500c23
blob + b1d098b4ce48e5f689c58ef3de8c4e8df1d6e19a
--- src/cmd/look.c
+++ src/cmd/look.c
@@ -3,6 +3,13 @@
 #include <bio.h>
 	/* Macros for Rune support of ctype.h-like functions */
 
+#undef isupper
+#undef islower
+#undef isalpha
+#undef isdigit
+#undef isalnum
+#undef isspace
+#undef tolower
 #define	isupper(r)	(L'A' <= (r) && (r) <= L'Z')
 #define	islower(r)	(L'a' <= (r) && (r) <= L'z')
 #define	isalpha(r)	(isupper(r) || islower(r))
blob - 25a334d0939736a62375ec0d9516a917dbbe4088
blob + 9731209d1946cd56509b81ee83e26a545dd8a20c
--- src/cmd/mkfile
+++ src/cmd/mkfile
@@ -1,4 +1,3 @@
-PLAN9=../..
 <$PLAN9/src/mkhdr
 
 TARG=`ls *.c | sed 's/\.c//'`
@@ -7,7 +6,7 @@ SHORTLIB=sec fs mux regexp9 draw thread bio 9
 
 <$PLAN9/src/mkmany
 
-BUGGERED='CVS|faces|factotum|htmlfmt|mk|upas|vac|venti'
+BUGGERED='CVS|faces|factotum|mk|upas|vac|venti'
 DIRS=`ls -l |sed -n 's/^d.* //p' |egrep -v "^($BUGGERED)$"`
 
 <$PLAN9/src/mkdirs
blob - dbf57ff85f1a9c0da284456aa5eca6dc8b38939b
blob + 19ed8b7190da59ea821531bdb659bddb526a0602
--- src/cmd/strings.c
+++ src/cmd/strings.c
@@ -10,6 +10,8 @@ Biobuf	fout;
 #define BUFSIZE		70
 
 void stringit(char *);
+#undef isprint
+#define isprint risprint
 int isprint(Rune);
 
 void
blob - a81246cd7a13b657f64e2d996a9d3708f32885cd
blob + 7f0503ca5466e4f85904d29a91e5ab180dc9f727
--- src/mkfile
+++ src/mkfile
@@ -1,6 +1,6 @@
 <mkhdr
 
-BUGGERED='9p|fmt|html|httpd|ip|utf|venti'
+BUGGERED='9p|fmt|httpd|ip|utf|venti'
 LIBDIRS=`ls -ld lib* | sed -n 's/^d.* //p' |egrep -v "^lib($BUGGERED)$"`
 
 DIRS=\