backport important changes of makePathfield for 0.9.31

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