setup_path: more POSIXly

X seems to start sessions using dash or something else that doesn't
support the bash style of pattern matching. Use a case statement.