9front - general discussion about 9front
 help / color / mirror / Atom feed
* [9front] ls and ascii: fix names
@ 2021-09-07 23:16 Stuart Morrow
  0 siblings, 0 replies; only message in thread
From: Stuart Morrow @ 2021-09-07 23:16 UTC (permalink / raw)
  To: 9front

yeah

diff 87a823332f9eaa4ff1e72f8524f6e59d1cc4f407 uncommitted
--- a/sys/src/cmd/ascii.c
+++ b/sys/src/cmd/ascii.c
@@ -57,7 +57,7 @@
 int 	ncol;
 int 	text=1;
 int	strip=0;
-Biobuf	bin;
+Biobuf	bout;

 void
 main(int argc, char **argv)
@@ -64,7 +64,7 @@
 {
 	int i;

-	Binit(&bin, 1, OWRITE);
+	Binit(&bout, 1, OWRITE);
 	ARGBEGIN{
 	case '8':
 		nchars=256; break;
@@ -95,7 +95,7 @@
 		for(i=0;i<nchars;i++){
 			put(i);
 			if((i&7)==7)
-				Bprint(&bin, "|\n");
+				Bprint(&bout, "|\n");
 		}
 	}else{
 		if(text==1)
@@ -106,7 +106,7 @@
 			else
 				putnum(*argv++);
 	}
-	Bputc(&bin, '\n');
+	Bputc(&bout, '\n');
 	exits(0);
 }
 void
@@ -118,9 +118,9 @@
 void
 put(int i)
 {
-	Bputc(&bin, '|');
+	Bputc(&bout, '|');
 	putn(i, ncol);
-	Bprint(&bin, " %s", str[i]);
+	Bprint(&bout, " %s", str[i]);
 }
 char dig[]="0123456789abcdefghijklmnopqrstuvwxyz";
 void
@@ -129,7 +129,7 @@
 	if(ndig==0)
 		return;
 	putn(n/base, ndig-1);
-	Bputc(&bin, dig[n%base]);
+	Bputc(&bout, dig[n%base]);
 }
 void
 puttext(char *s)
@@ -137,9 +137,9 @@
 	int n;
 	n=btoi(s)&0377;
 	if(strip)
-		Bputc(&bin, n);
+		Bputc(&bout, n);
 	else
-		Bprint(&bin, "%s\n", str[n]);
+		Bprint(&bout, "%s\n", str[n]);
 }
 void
 putnum(char *s)
@@ -146,7 +146,7 @@
 {
 	while(*s){
 		putn(*s++&0377, ncol);
-		Bputc(&bin, '\n');
+		Bputc(&bout, '\n');
 	}
 }
 int
--- a/sys/src/cmd/ls.c
+++ b/sys/src/cmd/ls.c
@@ -45,7 +45,7 @@
 int	mwidth;			/* max width of muid */
 int	lwidth;			/* max width of length */
 int	gwidth;			/* max width of groupid */
-Biobuf	bin;
+Biobuf	bout;

 void
 main(int argc, char *argv[])
@@ -52,7 +52,7 @@
 {
 	int i;

-	Binit(&bin, 1, OWRITE);
+	Binit(&bout, 1, OWRITE);
 	ARGBEGIN{
 	case 'F':	Fflag++; break;
 	case 'd':	dflag++; break;
@@ -153,7 +153,7 @@
 			format(dirbuf[i].d, dirbuf[i].d->name);
 	}
 	ndir = 0;
-	Bflush(&bin);
+	Bflush(&bout);
 }

 void
@@ -211,23 +211,23 @@
 	int i;

 	if(sflag)
-		Bprint(&bin, "%*llud ",
+		Bprint(&bout, "%*llud ",
 			swidth, (db->length+1023)/1024);
 	if(mflag){
-		Bprint(&bin, "[%q] ", db->muid);
+		Bprint(&bout, "[%q] ", db->muid);
 		for(i=2+strlen(db->muid); i<mwidth; i++)
-			Bprint(&bin, " ");
+			Bprint(&bout, " ");
 	}
 	if(qflag)
-		Bprint(&bin, "(%.16llux %*lud %.2ux) ",
+		Bprint(&bout, "(%.16llux %*lud %.2ux) ",
 			db->qid.path,
 			qwidth, db->qid.vers,
 			db->qid.type);
 	if(Tflag)
-		Bprint(&bin, "%c ", (db->mode&DMTMP)? 't': '-');
+		Bprint(&bout, "%c ", (db->mode&DMTMP)? 't': '-');

 	if(lflag)
-		Bprint(&bin, "%M %C %*ud %*q %*q %*llud %s ",
+		Bprint(&bout, "%M %C %*ud %*q %*q %*llud %s ",
 			db->mode, db->type,
 			vwidth, db->dev,
 			-uwidth, db->uid,
@@ -234,7 +234,7 @@
 			-gwidth, db->gid,
 			lwidth, db->length,
 			asciitime(uflag? db->atime: db->mtime));
-	Bprint(&bin, Qflag? "%s%s\n": "%q%s\n", name, fileflag(db));
+	Bprint(&bout, Qflag? "%s%s\n": "%q%s\n", name, fileflag(db));
 }

 void

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-09-07 23:22 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-07 23:16 [9front] ls and ascii: fix names Stuart Morrow

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).