shithub: asif

Download patch

ref: 669bbb705f203f03b8cc04026e232ec9b3f40eb8
parent: d7ebb143b982b3c484758279d501e1d375526f27
author: qwx <qwx@sciops.net>
date: Fri Apr 8 21:22:35 EDT 2022

path: add debug parameter

--- a/path/client.c
+++ b/path/client.c
@@ -73,7 +73,7 @@
 static void
 usage(void)
 {
-	fprint(2, "usage: %s [-4] [-s width[,height]]\n", argv0);
+	fprint(2, "usage: %s [-D4] [-s width[,height]]\n", argv0);
 	threadexits("usage");
 }
 
@@ -85,6 +85,10 @@
 	mapwidth = 64;
 	mapheight = 64;
 	ARGBEGIN{
+	case 'D':
+		if(++debuglevel >= Logtrace)
+			mainmem->flags |= POOL_NOREUSE | POOL_PARANOIA | POOL_LOGGING;
+		break;
 	case '4':
 		fourdir = 1;
 		break;
@@ -102,7 +106,6 @@
 		break;
 	default: usage();
 	}ARGEND
-	//mainmem->flags |= POOL_PARANOIA | POOL_NOREUSE;
 	fmtinstall('P', Pfmt);
 	fmtinstall('R', Rfmt);
 	initfs();