Problem: Undefined behavior when 'undodir' contains empty entry. Solution: Don't try to remove trailing slashes from empty path. Also don't remove a colon on Windows while at it.
StatusLine[NC]