Skip to content

Commit

Permalink
Fixed|Windows: "-userdir" path encoding regression
Browse files Browse the repository at this point in the history
QDir::cleanPath() takes a QString as argument, and QString implicitly
converts C strings as Latin-1 (!).

Here we can pass the C string path directly to NativePath::setWorkPath()
relying on the automatic conversion to NativePath (that happens as UTF-8).
  • Loading branch information
skyjake committed Jun 20, 2014
1 parent 2aee3ce commit 2dae789
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions doomsday/client/src/windows/dd_winit.cpp
Expand Up @@ -99,8 +99,7 @@ dd_bool DD_Win32_Init()
// Change to a custom working directory?
if(CommandLine_CheckWith("-userdir", 1))
{
String runtimePath = QDir::cleanPath(CommandLine_NextAsPath());
if(NativePath::setWorkPath(runtimePath))
if(NativePath::setWorkPath(CommandLine_NextAsPath()))
{
LOG_VERBOSE("Changed current directory to \"%s\"") << NativePath::workPath();
app.usingUserDir = true;
Expand Down

0 comments on commit 2dae789

Please sign in to comment.