Kaynağa Gözat

Rewritten File::getPathSeparators()

Tatsuhiro Tsujikawa 13 yıl önce
ebeveyn
işleme
0144397e4b
2 değiştirilmiş dosya ile 5 ekleme ve 6 silme
  1. 3 4
      src/File.cc
  2. 2 2
      src/File.h

+ 3 - 4
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

+ 2 - 2
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