diff --git a/src/File.cc b/src/File.cc index 4bef6712..ca3caf3a 100644 --- a/src/File.cc +++ b/src/File.cc @@ -294,14 +294,13 @@ std::string File::getCurrentDir() #endif // !__MINGW32__ } -const std::string& File::getPathSeparators() +const char* File::getPathSeparators() { #ifdef __MINGW32__ - static std::string s = "/\\"; + return "/\\"; #else // !__MINGW32__ - static std::string s = "/"; + return "/"; #endif // !__MINGW32__ - return s; } } // namespace aria2 diff --git a/src/File.h b/src/File.h index 3a6ab846..d5489e72 100644 --- a/src/File.h +++ b/src/File.h @@ -119,8 +119,8 @@ public: // directory cannot be retrieved or its length is larger than 2048, // returns ".". static std::string getCurrentDir(); - // Returns possible path separators for the underlining platform. - static const std::string& getPathSeparators(); + // Returns possible path separators for the underlying platform. + static const char* getPathSeparators(); }; } // namespace aria2