Copying filename before sending to dirname

The implementation of dirname on Wormulon modifies the string!