Skip to content

Commit

Permalink
- the previous revision had a bug in the startup dir name check
Browse files Browse the repository at this point in the history
- it also didn't build :-)

git-svn-id: svn://localhost/private/Console2/trunk@972 8ae08d04-e83e-804b-908e-3db21359c104
  • Loading branch information
bozho committed Dec 7, 2008
1 parent 8552892 commit 6cd6491
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions Console/ConsoleHandler.cpp
Expand Up @@ -110,14 +110,13 @@ bool ConsoleHandler::StartShellProcess(const wstring& strCustomShell, const wstr

if (strStartupDir.length() > 0)
{
if ((strStartupDir.begin() == L'\"') && (*(strStartupDir.end() - 1) != L'\"'))
if ((*(strStartupDir.end() - 1) == L'\"') && (*strStartupDir.begin() != L'\"'))
{
// startup dir name starts with ", but doesn't end with ", the user passed
// something like "C:\" as the parameter, it got parsed to "C:"
// remove the leading "
// startup dir name ends with ", but doesn't start with ", the user passed
// something like "C:\" as the parameter, it got parsed to C:", remove the trailing "
//
// I added this check, since it's a common mistake.
strStartupDir = strStartupDir.substr(1);
// This is a common mistake, thus the check...
strStartupDir = strStartupDir.substr(0, strStartupDir.length()-1);
}

// startup dir doesn't end with \, add it
Expand Down

0 comments on commit 6cd6491

Please sign in to comment.