sp: don't return '.' in case of empty path

Fixes #2481