GRMustache.swift icon indicating copy to clipboard operation
GRMustache.swift copied to clipboard

Incorrect use of URL causes failure on files containing spaces.

Open jeff-h opened this issue 5 years ago • 0 comments

In several places URL(string:) is called when constructing file paths. I believe these should instead be URL(fileURLWithPath:) calls. The existing code crashes when the filename string contains spaces (or other characters that are illegal in a URL, but not a filename)

let fails = URL(string: "my file.txt") // nil
let works = URL(fileURLWithPath: "my file.txt") // my%20file.txt -- file:///

If anyone agrees I'm more than happy to put up a PR with the changes.

jeff-h avatar Apr 28 '20 22:04 jeff-h