Correct check for empty dirname (Fixes #2683)
release 2014.04.03.2