Commit Diff


commit - c619cc2cb9023d3f6ed9db515ff37b6479795245
commit + b4135f04f136150b27a89876d51797ba2a8a78c0
blob - e26d100352bb3daedef106a6ad7b23cc13ed1378
blob + 30a707a05a1c32a610a71527dbab0397b605fe4c
--- src/cmd/samterm/io.c
+++ src/cmd/samterm/io.c
@@ -9,6 +9,7 @@
 #include "flayer.h"
 #include "samterm.h"
 
+int	protodebug;
 int	cursorfd;
 int	plumbfd = -1;
 int	input;
@@ -126,12 +127,12 @@ again:
 	if(block & (1<<RResize))
 		alts[RResize].op = CHANNOP;
 
-if(0) print("waitforio %c%c%c%c%c\n",
-	"h-"[alts[RHost].op == CHANNOP],
-	"k-"[alts[RKeyboard].op == CHANNOP],
-	"m-"[alts[RMouse].op == CHANNOP],
-	"p-"[alts[RPlumb].op == CHANNOP],
-	"R-"[alts[RResize].op == CHANNOP]);
+	if(protodebug) print("waitforio %c%c%c%c%c\n",
+		"h-"[alts[RHost].op == CHANNOP],
+		"k-"[alts[RKeyboard].op == CHANNOP],
+		"m-"[alts[RMouse].op == CHANNOP],
+		"p-"[alts[RPlumb].op == CHANNOP],
+		"R-"[alts[RResize].op == CHANNOP]);
 
 	alts[NRes].op = CHANEND;
 
blob - ea47a1c24f1d3e6f79bd530db6d76def888f53c2
blob + c7371812fab87f08df28d322bc2549ebc6dd0377
--- src/cmd/samterm/mesg.c
+++ src/cmd/samterm/mesg.c
@@ -38,9 +38,9 @@ rcv(void)
 	static int i = 0;
 	static int errs = 0;
 
-if(0) print("rcv in\n");
+	if(protodebug) print("rcv in\n");
 	while((c=rcvchar()) != -1){
-if(0) print(".");
+		if(protodebug) print(".");
 		switch(state){
 		case 0:
 			h.type = c;
@@ -81,10 +81,10 @@ if(0) print(".");
 			}
 			break;
 		}
-if(0) print(":");
+		if(protodebug) print(":");
 	}
 
-if(0) print("rcv out\n");
+	if(protodebug) print("rcv out\n");
 }
 
 Text *
blob - 40f5a0692277ed7bd3effe6bdf62b06627c41a24
blob + a7f7866ee6f7133580e84496dbe093103f5f2146
--- src/cmd/samterm/samterm.h
+++ src/cmd/samterm/samterm.h
@@ -56,6 +56,8 @@ enum Resource
 	NRes,
 };
 
+extern int	protodebug;
+
 extern Text	**text;
 extern uchar	**name;
 extern ushort	*tag;