diff options
Diffstat (limited to 'src/lib')
| -rw-r--r-- | src/lib/film.cc | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/lib/film.cc b/src/lib/film.cc index 259c3a606..29008c38f 100644 --- a/src/lib/film.cc +++ b/src/lib/film.cc @@ -165,7 +165,16 @@ Film::set_name (string n) void Film::set_content (string c) { - if (filesystem::path(c).has_root_directory () && starts_with (c, _state.directory)) { + string check = _state.directory; + + filesystem::path slash ("/"); + string platform_slash = slash.make_preferred().native (); + + if (!ends_with (check, platform_slash)) { + check += platform_slash; + } + + if (filesystem::path(c).has_root_directory () && starts_with (c, check)) { c = c.substr (_state.directory.length() + 1); } |
