trim path before checking, fixes #927

Signed-off-by: Michael Kaufmann (d00p) <d00p@froxlor.org>