Fix bug where subsearch was broken because of use of strtok_r on original line

Copying the line and using strtok on the copy fixes