git: 9front

Download patch

ref: b73e7389fd68f5427f32a0d17dd3e82a21b16125
parent: 07e2802f11aef9ce1d2a490cea496f4db6c75272
author: noodle <noodle@pastanoggin.com>
date: Wed Jan 14 15:41:12 EST 2026

ircrc: tighten pretty()'s pattern matching because *anything* could be a CASEMAPPING

Compare only the first part (or the second, if the command starts with
a prefix) of server messages to command patterns for formatting.  The
problem (run "/q HELP NOTICE" to reproduce): the following server help
message matches "case *NOTICE*" before reaching "case *", so it
incorrectly gets sent to notice() for formatting instead of numeric():

server message	→ :coulomb.oftc.net 704 noodle notice :NOTICE <nick|channel> :message

expected output	→ ***	notice :NOTICE <nick|channel> :message

actual output	→ -coulomb.oftc.net 704 noodle notice -	⇒	message

--- a/rc/bin/ircrc
+++ b/rc/bin/ircrc
@@ -187,14 +187,16 @@
 fn pretty {
 	while (line=`$nl{read}) {
 		cmd=`{echo $line}
-		switch ($line) {
-		case *PRIVMSG*
+		if(~ $cmd(1) :*)
+			cmd=$cmd(2-)
+		switch ($cmd(1)) {
+		case PRIVMSG
 			line = `$nl{echo -n $line | privmsg}
-		case *JOIN* *QUIT* *PART* *NICK*
+		case JOIN QUIT PART NICK
 			line = `$nl{echo -n $line | misc}
-		case *NOTICE*
+		case NOTICE
 			line = `$nl{echo -n $line | notice}
-		case PING* # *PING* could also be CASEMAPPING
+		case PING
 			echo PONG $cmd(2) > $netdir/data
 			line = ()
 		case *
--