Escape more than the first space on the input file paths

Previously only the first space of the input file paths were matched causing potential failures.