From aa6c18d21e36c6a8ca712e170bb8bd5a7bc8e131 Mon Sep 17 00:00:00 2001 From: SneakyTactician Date: Tue, 29 Aug 2017 16:35:27 -0500 Subject: [PATCH] Fixed the spaces in filepath bug! --- .../CommandEverythingCPP/CommandCd.cpp | 15 ++++++++------- .../CommandEverythingCPP.vcxproj.filters | 10 +++++----- 2 files changed, 13 insertions(+), 12 deletions(-) diff --git a/CommandEverything/CommandEverythingCPP/CommandCd.cpp b/CommandEverything/CommandEverythingCPP/CommandCd.cpp index 61fe877..6b1e64a 100644 --- a/CommandEverything/CommandEverythingCPP/CommandCd.cpp +++ b/CommandEverything/CommandEverythingCPP/CommandCd.cpp @@ -91,21 +91,22 @@ void CommandCd::GotoParentDir() void CommandCd::CdNormal(ParsedCommand* Parsed) { string arg = *FilePath; - register size_t i; - register size_t length = Parsed->Words->size(); - for (i = 0; i < length; i++) - { + register unsigned __int64 length = Input.size(); - if (i != 0) + for (register unsigned __int64 i = 0; i < length; i++) + { + if (Input[i] == 'c' || Input[i] == 'C') { - arg.append(Parsed->Words->at(i)); + arg.append(Input.substr(i + 3)); + break; } } if (Files->DoesDirectoryExist(&arg)) { - FilePath->append(Parsed->Words->at(1)); + delete FilePath; + FilePath = new string(arg); FilePath->append("\\"); } else diff --git a/CommandEverything/CommandEverythingCPP/CommandEverythingCPP.vcxproj.filters b/CommandEverything/CommandEverythingCPP/CommandEverythingCPP.vcxproj.filters index 20ec0c2..cf6be20 100644 --- a/CommandEverything/CommandEverythingCPP/CommandEverythingCPP.vcxproj.filters +++ b/CommandEverything/CommandEverythingCPP/CommandEverythingCPP.vcxproj.filters @@ -36,9 +36,6 @@ {26f725d9-456e-4da8-aed9-0d553bea28ca} - - {f28e51f0-e978-4ed3-8e81-037ef6965cff} - {3758dd7a-e7f1-4a91-a3c3-bef13afbdf04} @@ -90,6 +87,9 @@ {9aeff9bd-ccf8-4276-a17e-36ec183095a6} + + {f28e51f0-e978-4ed3-8e81-037ef6965cff} + @@ -132,7 +132,7 @@ Framework\Commands\List - Framework\WIP Commands\Cd + Framework\Commands\Cd Framework\Commands\Execute @@ -206,7 +206,7 @@ Framework\Commands\List - Framework\WIP Commands\Cd + Framework\Commands\Cd Framework\Commands\Execute