shithub: snippets

Download patch

ref: bd75d8270da313ccbfd06d25799d346803a623bd
parent: a1a213fab617a3f238cb2984dd0c905d45904074
parent: fe3ec1a9c6b65cc8ed46e360aeffe1cdc65af71b
author: Sigrid Solveig Haflínudóttir <sigrid@ftrv.se>
date: Wed Feb 28 10:55:42 EST 2024

merge

--- a/README.md
+++ b/README.md
@@ -16,7 +16,7 @@
 * `xml.[ch]` XML parser, works as a streaming parser as well
 
 * `clear` removes all program output from the terminal, leaving only commands used
-* `gridup` connects to 9p.zone, mounts stuff from its registry and starts chat windows
+* `gridup` connects to 9grid chat
 * `helpmeport` generates files needed to port a Unix library or a binary
 * `watch` watch-like tool, imagine
 * `st-xx-lha-convert` extract `*.lha` archives and convert samples to WAV, on UNIX
--- a/gridup
+++ b/gridup
@@ -1,9 +1,11 @@
 #!/bin/rc
 
-srv tcp!registry.9p.zone!6675 registry /n/registry
-srv tcp!chat.9p.zone!9990 9p.zone.chat /n/chat.9p.zone
-srv -c tcp!9p.zone!9991 9p.zone.disk /n/disk
+# 9p.zone domain is gone
+#srv tcp!registry.9p.zone!6675 registry /n/registry
+#srv -c tcp!9p.zone!9991 9p.zone.disk /n/disk
 
+srv tcp!chat.only9fans.com!9990 chat.only9fans.com /n/9chat
+
 fn clean {
 	echo $1 | sed 's/.*!([^!]+)!.*/\1/'
 }
@@ -17,9 +19,9 @@
 #!/bin/rc
 chan=$1
 label $chan
-echo JOIN $nick to chat >>/n/chat.9p.zone/$chan
-cat /n/chat.9p.zone/$chan &
-while() cat | sed '1s/^/'$nick' → /' >>/n/chat.9p.zone/$chan
+echo JOIN $nick to chat >>/n/9chat/$chan
+cat /n/9chat/$chan &
+while() cat | sed '1s/^/'$nick' → /' >>/n/9chat/$chan
 ...
 chmod +x /tmp/chatcat
 
--- a/qp.c
+++ b/qp.c
@@ -103,6 +103,12 @@
 		*pv = t->leaf.v;
 		return 0;
 	}
+	if(*pk == t->leaf.k || strcmp(*pk, t->leaf.k) == 0){
+		*pk = nil;
+		*plen = 0;
+		*pv = nil;
+		return -1;
+	}
 
 	return -1;
 }