Where exactly is the bug? All I can see is the standard way mirc treats tokens. In case you didn't notice either, $2 is not empty; it returns a space, ie the part of text between the 2nd and 3rd separator (leading and trailing token separators are stripped off). $gettok("file 1.txt" "file 2.txt",2,34) returns a space too.