From 6b2bf2fa8ef47fc41a172beb209e793eb0ac4181 Mon Sep 17 00:00:00 2001 From: curt Date: Tue, 15 Jun 1999 19:55:10 +0000 Subject: [PATCH] Fixed a bug in handling windoze driver letter ":" notation. --- Lib/Misc/fgpath.cxx | 9 ++++++++- Lib/Misc/fgpath.hxx | 4 ++++ 2 files changed, 12 insertions(+), 1 deletion(-) 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 -- 2.39.5