use const char pointers

and no longer modify the given `path` (`strtok` modifies stuff)