]> git.lyx.org Git - lyx.git/blobdiff - src/support/environment.C
hopefully fix tex2lyx linking.
[lyx.git] / src / support / environment.C
index 7722035edcf75e92edf7825839be44abf4f562f7..616025cf2a47ee78e0c790cab5805937a77bf673 100644 (file)
@@ -4,8 +4,8 @@
  * Licence details can be found in the file COPYING.
  *
  * \author Angus Leeming
- * \author João Luis M. Assirati
- * \author Lars Gullik Bjønnes
+ * \author João Luis M. Assirati
+ * \author Lars Gullik Bjønnes
  *
  * Full author contact details are available in file CREDITS.
  */
@@ -89,12 +89,20 @@ void setEnvPath(string const & name, vector<string> const & env)
 {
        char const separator(os::path_separator());
        std::ostringstream ss;
-       vector<string>::const_iterator it = env.begin();
+       vector<string>::const_iterator const begin = env.begin();
        vector<string>::const_iterator const end = env.end();
+       vector<string>::const_iterator it = begin;
        for (; it != end; ++it) {
-               if (ss.tellp() > 0)
+               if (it != begin)
                        ss << separator;
+#if defined(__CYGWIN__) || defined(__CYGWIN32__)
+               // On cygwin, os::external_path returns either posix or
+               // pseudo-win style paths, but here we always need posix style.
+               // This fixes bug 2344.
+               ss << os::internal_path(*it);
+#else
                ss << os::external_path(*it);
+#endif
        }
        setEnv(name, ss.str());
 }