Merge lp:~widelands-dev/widelands/try_fixing_hosting_on_windows into lp:widelands

Proposed by SirVer
Status: Merged
Merged at revision: 7367
Proposed branch: lp:~widelands-dev/widelands/try_fixing_hosting_on_windows
Merge into: lp:widelands
Diff against target: 22 lines (+4/-1)
1 file modified
src/io/filesystem/disk_filesystem.cc (+4/-1)
To merge this branch: bzr merge lp:~widelands-dev/widelands/try_fixing_hosting_on_windows
Reviewer Review Type Date Requested Status
Tino Pending
Widelands Developers Pending
Review via email: mp+247217@code.launchpad.net

Description of the change

Try to get rid of all \\ in windows paths. Windows seem to do nicely with /, but sending them over the network breaks stuff left and right.

To post a comment you must log in.
Revision history for this message
SirVer (sirver) wrote :

Tino, could you try if this is still working on windows? Please test starting a single player, a scenario and a multiplayer game - ideally with a linux host. If all of this works I would be delighted and this would have been a super easy fix :).

Remember the discussion we had about boost filesystem.... I wonder how many more bugs we have in our IO code.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/io/filesystem/disk_filesystem.cc'
2--- src/io/filesystem/disk_filesystem.cc 2014-12-03 07:15:40 +0000
3+++ src/io/filesystem/disk_filesystem.cc 2015-01-21 20:49:21 +0000
4@@ -22,8 +22,8 @@
5 #include <cassert>
6 #include <cerrno>
7
8+#include <boost/algorithm/string/replace.hpp>
9 #include <sys/stat.h>
10-
11 #ifdef _WIN32
12 #include <dos.h>
13 #include <windows.h>
14@@ -126,6 +126,9 @@
15 }
16 const std::string filename = canonicalize_name(realpath + c_file.name);
17 const std::string result = filename.substr(m_root.size() + 1);
18+
19+ // Paths should not contain any windows line separators.
20+ boost::replace_all(result, "\\", "/");
21 results.insert(result);
22 } while (_findnext(hFile, &c_file) == 0);
23

Subscribers

People subscribed via source and target branches

to status/vote changes: