Commit:b314c7b701080d882249e0f793708f216564e79d (browse)
Parent:29bcaa927a15091164661069e56da7c2431f7a33
Author:Peter Mikkelsen <petermikkelsen10@gmail.com>
Date:Sat Feb 13 13:43:26 CET 2021
Message:
Remove one more global variable

main.c => main.c
@@ -40,8 +40,6 @@
 void	fillstat(Dir*, NeinFile);
 void	readchanlog(Req*, uvlong);
 
-char *username;
-
 NeinFile qroot[] = {
 	"nickname", {Qnickname, 0, QTFILE}, 0666,
 	"speak", {Qspeak, 0, QTFILE}, 0222,
@@ -67,7 +65,6 @@
 	};
 	char *postname = "neinchat";
 	char *addr = "tcp!*!12345";
-	username = getuser();
 	nchannels = 0;
 	channels = nil;
 	print("Starting neinchat server on %s and posting to /srv/%s\n", addr, postname);
@@ -288,6 +285,7 @@
 void
 fillstat(Dir *d, NeinFile f)
 {
+	char *username = getuser();
 	d->qid = f.qid;
 	d->mode = f.mode;
 	d->length = 0;