From f68ec925d06b72c61fc27d0b75227d83e78dcfb9 Mon Sep 17 00:00:00 2001 From: Mike Richmond Date: Mon, 18 Jul 2016 15:32:19 -0700 Subject: [PATCH] Fixing comment support for the ConfigFileReader --- .../nativemsh/pwrshcommon/ConfigFileReader.cpp | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/powershell-native/nativemsh/pwrshcommon/ConfigFileReader.cpp b/src/powershell-native/nativemsh/pwrshcommon/ConfigFileReader.cpp index 4b1bd4b43..f1a13c00f 100644 --- a/src/powershell-native/nativemsh/pwrshcommon/ConfigFileReader.cpp +++ b/src/powershell-native/nativemsh/pwrshcommon/ConfigFileReader.cpp @@ -33,16 +33,16 @@ namespace NativeMsh std::wstring coreClrDirTag(L"CORECLRDIR="); while (std::getline(psConfigFile, line)) { - std::wstring::const_iterator iter = line.begin(); + ; // Search for the first actionable character in the line to // limit the number of passes that are made iterating through the line. - while(iter != line.end()) + for(std::wstring::const_iterator iter = line.begin(); iter != line.end(); iter++) { if (*iter == L'#') { // Stop parsing the line because the rest of it is a comment - break; + continue; } else if (*iter == L'p' || *iter == L'P') { @@ -72,9 +72,7 @@ namespace NativeMsh } } } - - // Do nothing to ignore unmatched characters (whitespace, etc.) - iter++; + // Else: Do nothing to ignore unmatched characters (whitespace, etc.) } } if (0 == this->pathToPowerShellAssemblies.size() ||