Browse Source

Plan 9 from Bell Labs 2012-05-22

David du Colombier 12 years ago
parent
commit
1481b4d2b5
5 changed files with 38 additions and 38 deletions
  1. 5 2
      lib/face/48x48x8/.dict
  2. BIN
      lib/face/48x48x8/c/coraid.2
  3. 7 7
      sys/lib/sysconfig/proto/portproto
  4. 1 1
      sys/man/1/cb
  5. 25 28
      sys/src/cmd/cb/cb.c

+ 5 - 2
lib/face/48x48x8/.dict

@@ -20,6 +20,7 @@ astro/boyd b/boyd.1
 astro/npe n/noah.1
 astro/paurea p/paurea.1
 at/unknown u/unknown.at
+att.com/plus p/plus.1
 au/unknown u/unknown.au
 be/unknown u/unknown.be
 berzerked.org/quanstro q/quanstro.1
@@ -43,7 +44,7 @@ comcast.net/unknown c/comcast.1
 coraid.com/mennis m/mennis.1
 coraid.com/quanstro q/quanstro.1
 coraid.com/stallion s/stallion.1
-coraid.com/unknown c/coraid.1
+coraid.com/unknown c/coraid.2
 cr/unknown u/unknown.cr
 cwru.edu/noah.evans n/noah.1
 cz/unknown u/unknown.cz
@@ -62,20 +63,22 @@ gmail.com/andresdju a/andresdju.1
 gmail.com/benavento f/fgb.1
 gmail.com/bruce.ellis b/brucee.1
 gmail.com/bruce.ellis b/brucee.2
+gmail.com/charles.forsyth f/forsyth.1
 gmail.com/devon.odell d/devon.1
 gmail.com/ericvh e/ericvh.2
 gmail.com/fariborz.t f/fst.1
 gmail.com/gabidiaz g/gabidiaz.1
 gmail.com/jmehat j/jmehat.1
 gmail.com/joelcsalomon c/chesky.1
+gmail.com/nemo.mbox n/nemo.1
 gmail.com/noah.evans n/noah.1
 gmail.com/pablohaya p/pablo.1
 gmail.com/paurea p/paurea.1
 gmail.com/rogpeppe r/rog.1
 gmail.com/saoret.one s/saoret.1
-gmail.com/stanley.lieber s/sl.1
 gmail.com/skip.tavakkolian f/fst.1
 gmail.com/sstallion s/stallion.1
+gmail.com/stanley.lieber s/sl.1
 gmail.com/unknown g/gmail.1
 gmail.com/uriel99 y/yipyip.1
 google.com/unknown g/google.1

BIN
lib/face/48x48x8/c/coraid.2


+ 7 - 7
sys/lib/sysconfig/proto/portproto

@@ -169,13 +169,13 @@ sys
 				tab.utf
 				tab.37
 	log
-		cs	666 sys sys	/sys/lib/pcdist/disk/empty
-		dns	666 sys sys	/sys/lib/pcdist/disk/empty
-		mail	666 sys sys	/sys/lib/pcdist/disk/empty
-		smtp	666 sys sys	/sys/lib/pcdist/disk/empty
-		smtpd	666 sys sys	/sys/lib/pcdist/disk/empty
-		listen	666 sys sys	/sys/lib/pcdist/disk/empty
-		ipboot	666 sys sys	/sys/lib/pcdist/disk/empty
+		cs	666 sys sys	/sys/lib/dist/pc/emptyfile
+		dns	666 sys sys	/sys/lib/dist/pc/emptyfile
+		mail	666 sys sys	/sys/lib/dist/pc/emptyfile
+		smtp	666 sys sys	/sys/lib/dist/pc/emptyfile
+		smtpd	666 sys sys	/sys/lib/dist/pc/emptyfile
+		listen	666 sys sys	/sys/lib/dist/pc/emptyfile
+		ipboot	666 sys sys	/sys/lib/dist/pc/emptyfile
 	man
 		fonts
 		1pub

+ 1 - 1
sys/man/1/cb

@@ -32,7 +32,7 @@ Join split lines.
 Print code in the so-called K&R style used in
 .IR "The C Programming Language" .
 .TP 
-.B -l length
+.B -l
 Split lines that are longer than
 .IR length .
 .PD

+ 25 - 28
sys/src/cmd/cb/cb.c

@@ -4,35 +4,34 @@
 #include "cb.h"
 #include "cbtype.h"
 
+static void
+usage(void)
+{
+	fprint(2, "usage: cb [-sj] [-l width]\n");
+	exits("usage");
+}
+
 void
 main(int argc, char *argv[])
 {
 	Biobuf stdin, stdout;
 
-	while (--argc > 0 && (*++argv)[0] == '-'){
-		switch ((*argv)[1]){
-		case 's':
-			strict = 1;
-			continue;
-		case 'j':
-			join = 1;
-			continue;
-		case 'l':
-			if((*argv)[2] != '\0'){
-				maxleng = atoi( &((*argv)[2]) );
-			}
-			else{
-				maxleng = atoi(*++argv);
-				argc--;
-			}
-			maxtabs = maxleng/TABLENG - 2;
-			maxleng -= (maxleng + 5)/10;
-			continue;
-		default:
-			fprint(2, "cb: illegal option %c\n", (*argv)[1]);
-			exits("boom");
-		}
-	}
+	ARGBEGIN{
+	case 'j':
+		join = 1;
+		break;
+	case 'l':
+		maxleng = atoi(EARGF(usage()));
+		maxtabs = maxleng/TABLENG - 2;
+		maxleng -= (maxleng + 5)/10;
+		break;
+	case 's':
+		strict = 1;
+		break;
+	default:
+		usage();
+	}ARGEND
+
 	Binit(&stdout, 1, OWRITE);
 	output = &stdout;
 	if (argc <= 0){
@@ -42,10 +41,8 @@ main(int argc, char *argv[])
 		Bterm(input);
 	} else {
 		while (argc-- > 0){
-			if ((input = Bopen( *argv, OREAD)) == 0){
-				fprint(2, "cb: cannot open input file %s\n", *argv);
-				exits("boom");
-			}
+			if ((input = Bopen(*argv, OREAD)) == 0)
+				sysfatal("can't open input file %s: %r", *argv);
 			work();
 			Bterm(input);
 			argv++;