I experienced the following problem:

Trying to develop an RSS parser, I wrote a function that replaces HTML entities, Unicode text and some more stuff. It looks this way:

Code:
alias -l feedtextconvert {
  var %tempvar,%feedconverted = $1-

  %feedconverted = $replace(%feedconverted,$chr(9),$chr(32))

  %tempvar = $regsub(%feedconverted,/"/g,",%feedconverted)
  %tempvar = $regsub(%feedconverted,/&lt;/g,<,%feedconverted)
  %tempvar = $regsub(%feedconverted,/&gt;/g,>,%feedconverted)
  %tempvar = $regsub(%feedconverted,/&nbsp;/g,$chr(32),%feedconverted)
  %tempvar = $regsub(%feedconverted,/&auml;/g,ä,%feedconverted)
  %tempvar = $regsub(%feedconverted,/&uuml;/g,ü,%feedconverted)
  %tempvar = $regsub(%feedconverted,/&ouml;/g,ö,%feedconverted)
  %tempvar = $regsub(%feedconverted,/&Auml;/g,Ä,%feedconverted)
  %tempvar = $regsub(%feedconverted,/&Uuml;/g,Ü,%feedconverted)
  %tempvar = $regsub(%feedconverted,/&Ouml;/g,Ö,%feedconverted)
  %tempvar = $regsub(%feedconverted,/&szlig;/g,ß,%feedconverted)
  %tempvar = $regsub(%feedconverted,/&(\S*);/g,,%feedconverted)

  if ($isutf(%feedconverted)) { %feedconverted = $utfdecode(%feedconverted,0) }

  %tempvar = $regsub(%feedconverted,/<br( \/)?>/g,\\n,%feedconverted)
  %feedconverted = $regsubex(%feedconverted,/<a (\s|\S|=|\")*>(\s|\S|=|\")*<\/a>/g,\2)
  %feedconverted = $regsubex(%feedconverted,/<img(\s|\S|=|\")* alt=\"(\s|\S)\"(\s|\S|=|\")*( \/)?>/g,\2)
  %tempvar = $regsub(%feedconverted,/<(\/?)(\S*)>/g,,%feedconverted)

  return %feedconverted
}


Now, when I call the function with %something = $feedtextconvert(%x) in a socket (where %x contains the <title> line of a feed), mIRC crashes (reproducible). When I comment out the line replacing the < or I replace the particular line by:

Code:
%feedconverted = $replace(%feedconverted,&lt;,$+(<,$chr(32)))


..., it stops crashing. (Any additional character after the < works here, strange enough! Also, replacing < by $chr(60) does not work.)
The > line works fine anyway.

I presume mIRC has some difficulties with the less-than symbol here. May be worth a glance.


Gamers.IRC - The best way to use mIRC