Fix a problem with .svn/.git directories in path.

Signed-off-by: Jerome Maloberti <jmaloberti@gmail.com>