Handle .gitignore absolute paths

It basically transforms paths like '/foo' to './foo'

My C skills are a bit rusty, hope it works as a proof of concept at least.