pathspec.c: use the right index instead of the_index