> Come to think of it, why do we need PATH_SEPARATOR at all? At the > early stage, when we are detecting what kind of shell we're using, we > can transliterate ";" to ":" if we discover we are in a DOS > environment. Then we don't need to use PATH_SEPARATOR at all, except > in one little bit of code.
PATH=C:/djgpp/bin;C:/windows/command transliterated gives PATH=C:/djgpp/bin:C:/windows/command which can no longer be walked successfully. The whole problem with ':' is that it is the drive separator on DOS. Otherwise, transliterating ':' to ';' would indeed be a much cleaner method. Some environments, like cygwin, handle this by using '/cygdrive/C/' instead of C:/. DJGPP has partial support for this; it's libc can use /dev/C, but only its bash has special PATH handling to support ': as pathsep properly. OS/2 has no special handling at all.