Originally Posted By: Wims
Originally Posted By: pishposh
1. If an IRC server uses text decoration control codes on the network name in its 001 "Welcome to the Green Network, YourNick" banner (example: ^U^B^09,03Green^O), mIRC's connection tip will be "You have connected to 0903Green Network as Nick". (Note: I didn't leave out the comma. It strangely strips control code characters and even the , within K control code sequences -- just not K's digits.)

1) It would be a good idea to provide a server you are testing this on.

I can't. I found this bug while locally configuring/testing an ircd. But if you want to reproduce it for yourself:

a) unpack http://ircd.bircd.org/bewareircd-win32.zip to a new temporary folder (for linux: http://ircd.bircd.org/bewareircd-linux.tar.gz) (note: this IRCd is open source and stand-alone: it has no installation process, makes no registry modifications, and modifies no files outside its own folder).
b) open bircd.ini and paste this line at the top: RPL001=Welcome to the 09,03Green IRC network, %s (%s)
c) save changes to bircd.ini and then execute bircd.exe ("bircd" in linux)
d) in mIRC, /timertest 1 5 /server -m 127.0.0.1:6667 (use the timer delay to unfocus mIRC's window before it connects, so tips will appear)
e) you'll see the bug when it connects
f) execute "bircd signal stop", then delete temp folder

Update: When I previously noticed this bug, the ircd was configured to send a 005 NETWORK= token. Out of the box, using the instructions above, no 005 NETWORK= token is sent. In that case, not only does the network name appear as 0903Green in mIRC's conenct tip, but it also appears as 0903Green in the switchbar button, status window title bar, and $network. So, it appears mIRC mainly relies on 005 NETWORK= for knowledge of a network's name (if it is present), but that the tip always relies on 001's mention of the network name, even when 005 NETWORK= isn't present. Either way... the same problem remains: mIRC strips control codes, including ^K control codes, but not the digits in ^K code sequences.

Quote:
2) It's not a bug, rather a feature, 0 is invalid for the second parameter so mirc use a default value of 1.

Hm, however, isn't it customary with any programming language that invalid input shall never return valid output? For instance, $left(abc,0) returns null, not "a". So why should $mid(abc,0,1) return "a", and not null?