When $fline(foo,*foo*,0,1) is run in a query window $fline seems to count the occurences of "foo" in the window itself, even though the nicklist (which of course isn't available in a query window) is specified.
Is this behaviour intended?