fix posix port, change normpath algorithm