- std::vector<std::string>::const_iterator it;
-
- char* home = getenv("HOME");
-
- for (it = filePaths.begin(); it != filePaths.end(); ++it)
+ std::vector<std::string> copy(path);
+ std::vector<std::string>::iterator it;
+
+#if defined(_WIN32) || defined(__WIN32__)
+ char* homeDrive = getenv("HOMEDRIVE");
+ char* homePath = getenv("HOMEPATH");
+ std::string home(homeDrive ? homeDrive : "");
+ if (homePath) home += homePath;
+#else
+ char *homePath = getenv("HOME");
+ std::string home(homePath ? homePath : "");
+#endif
+
+ for (it = copy.begin(); it != copy.end(); ++it)