fix JOIN parser (again)

This commit is contained in:
Neale Pickett 2012-08-23 13:57:17 -05:00
parent efb3c7063d
commit dffd968152
3 changed files with 12 additions and 3 deletions

2
bot
View File

@ -19,6 +19,6 @@ export nickname realname
fi
)
mkfifo -m 0600 $botdir/fifo
[ -p $botdir/fifo ] || mkfifo -m 0600 $botdir/fifo
exec $d/dispatch -f $botdir/fifo $d/irc $botdir/handler

View File

@ -11,7 +11,15 @@ else
fd=1
fi
if [ -x $botdir/login ]; then
$botdir/login 1 >& $fd
else
nickname=$(cat $botdir/nickname)
realname=$(cat $botdir/realname 2>/dev/null || \
echo "I'm a little printf, short and stdout.")
echo "NICK $nickname" 1 >& $fd
echo "USER $nickname $nickname $nickname :$realname" 1 >& $fd
fi
if [ -p $botdir/fifo ]; then
fifo="-f $botdir/fifo"

View File

@ -111,7 +111,8 @@ main(int argc, char *argv[])
(0 == strcmp(cmd, "KICK"))) {
forum = parts[1];
} else if (0 == strcmp(cmd, "JOIN")) {
if (0 == nparts) {
DUMP_d(nparts);
if (1 == nparts) {
forum = text;
text = NULL;
} else {