From: curt Date: Tue, 15 Jun 1999 19:55:10 +0000 (+0000) Subject: Fixed a bug in handling windoze driver letter ":" notation. X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=6b2bf2fa8ef47fc41a172beb209e793eb0ac4181;p=simgear.git Fixed a bug in handling windoze driver letter ":" notation. --- diff --git a/Lib/Misc/fgpath.cxx b/Lib/Misc/fgpath.cxx index a49c025f..d31b44c6 100644 --- a/Lib/Misc/fgpath.cxx +++ b/Lib/Misc/fgpath.cxx @@ -28,12 +28,19 @@ // If Unix, replace all ":" with "/". If MacOS, replace all "/" with // ":" it should go without saying that neither of these characters -// should be used in file or directory names. +// should be used in file or directory names. In windoze, allow the +// second character to be a ":" for things like c:\foo\bar static string fix_path( const string path ) { string result = path; for ( int i = 0; i < (int)path.size(); ++i ) { +#if defined( WIN32 ) + // for windoze, don't replace the ":" for the second character + if ( i == 1 ) { + continue; + } +#endif if ( result[i] == FG_BAD_PATH_SEP ) { result[i] = FG_PATH_SEP; } diff --git a/Lib/Misc/fgpath.hxx b/Lib/Misc/fgpath.hxx index a3d3fc71..30ba3b7c 100644 --- a/Lib/Misc/fgpath.hxx +++ b/Lib/Misc/fgpath.hxx @@ -27,6 +27,10 @@ #define _FGPATH_HXX +#ifdef HAVE_CONFIG_H +# include +#endif + #include #include STL_STRING