GeertJohan/go.rice

Filenames containing backtick are not escaped properly

nkovacs opened this issue · 3 comments

Although unlikely, it's valid for a filename to contain a backtick, which would result in an invalid go file.

I have a fix in https://github.com/nkovacs/go.rice/tree/filename-quote, but it depends on #93 for tests.

Another (even more unlikely) issue: it's possible for a filename to contain a newline, which will break the // {{.Filename}} part, since the generated code will look like this:

		ChildFiles:  []*embedded.EmbeddedFile{
			filec, // new
line
			filed, // test1.txt
			filee, // test2.txt
			
		},

Edit: nkovacs@f79b376.

I'd be happy to take that as a PR!

Thanks, I've merged it.