Skip to content

Commit

Permalink
Fixed: Arguments of -cparse and -vdmap relative to pwd
Browse files Browse the repository at this point in the history
Also, de::CommandLine does not try to convert arguments that begin with a
dash (-) or basedir symbol (}) to absolute native paths.
  • Loading branch information
skyjake committed May 24, 2012
1 parent c71f987 commit e6055a0
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion doomsday/engine/portable/src/dd_main.c
Expand Up @@ -1799,7 +1799,7 @@ static int DD_StartupWorker(void* parm)
startTime = Sys_GetRealTime();
for(;;)
{
const char* arg = CommandLine_Next();
const char* arg = CommandLine_NextAsPath();
if(!arg || arg[0] == '-')
break;
Con_Message(" Processing \"%s\"...\n", F_PrettyPath(arg));
Expand Down
2 changes: 1 addition & 1 deletion doomsday/engine/portable/src/fs_main.c
Expand Up @@ -2282,7 +2282,7 @@ void F_InitVirtualDirectoryMappings(void)

if(i < argC - 1 && !CommandLine_IsOption(i + 1) && !CommandLine_IsOption(i + 2))
{
F_AddVirtualDirectoryMapping(CommandLine_At(i + 1), CommandLine_At(i + 2));
F_AddVirtualDirectoryMapping(CommandLine_PathAt(i + 1), CommandLine_At(i + 2));
i += 2;
}
}
Expand Down
3 changes: 2 additions & 1 deletion doomsday/libdeng2/src/core/commandline.cpp
Expand Up @@ -255,7 +255,8 @@ void CommandLine::makeAbsolutePath(duint pos)

std::string* arg = d->arguments[pos];

if(!QDir::isAbsolutePath(arg->c_str()))
if(!isOption(pos) && !QDir::isAbsolutePath(arg->c_str()) &&
!String::fromStdString(*arg).startsWith("}"))
{
// The path expansion logic here should match the native shell's behavior.
QDir oldDir = QDir::current();
Expand Down

0 comments on commit e6055a0

Please sign in to comment.