Make the 'this_line_location' hack more reliable

It shouldn't be done if it's not needed.
This commit is contained in:
Robbert van der Helm
2020-05-16 16:08:01 +02:00
parent e76d4b474c
commit 312200f100
2 changed files with 14 additions and 3 deletions
+4
View File
@@ -13,6 +13,10 @@ Versioning](https://semver.org/spec/v2.0.0.html).
- Changed architecture to use one less socket.
- Removed dependency on 32-bit Boost.Filesystem.
### Fixed
- Made the plugin and host detection slightly more robust.
## [1.1.4] - 2020-05-12
### Fixed
+10 -3
View File
@@ -200,9 +200,16 @@ fs::path get_this_file_location() {
// on both Ubuntu 18.04 and 20.04, but not on Arch based distros.
// Under Linux a path starting with two slashes is treated the same as
// a path starting with only a single slash, but Wine will refuse to
// load any files when the path starts with two slashes. Prepending
// `/` to a pad coerces theses two slashes into a single slash.
return "/" / boost::dll::this_line_location();
// load any files when the path starts with two slashes. The easiest
// way to work around this if this happens is to just add another
// leading slash and then normalize the path, since three or more
// slashes will be coerced into a single slash.
fs::path this_file = boost::dll::this_line_location();
if (this_file.string().find("//") == 0) {
this_file = ("/" / this_file).lexically_normal();
}
return this_file;
}
std::string get_wine_version() {