File tree Expand file tree Collapse file tree 1 file changed +6
-5
lines changed
Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -152,15 +152,16 @@ void IOHandlerConfirm::IOHandlerComplete(IOHandler &io_handler,
152152
153153void IOHandlerConfirm::IOHandlerInputComplete (IOHandler &io_handler,
154154 std::string &line) {
155- if (line.empty ()) {
155+ const llvm::StringRef input = llvm::StringRef (line).rtrim ();
156+ if (input.empty ()) {
156157 // User just hit enter, set the response to the default
157158 m_user_response = m_default_response;
158159 io_handler.SetIsDone (true );
159160 return ;
160161 }
161162
162- if (line .size () == 1 ) {
163- switch (line [0 ]) {
163+ if (input .size () == 1 ) {
164+ switch (input [0 ]) {
164165 case ' y' :
165166 case ' Y' :
166167 m_user_response = true ;
@@ -176,10 +177,10 @@ void IOHandlerConfirm::IOHandlerInputComplete(IOHandler &io_handler,
176177 }
177178 }
178179
179- if (line == " yes" || line == " YES " || line == " Yes " ) {
180+ if (input. compare_insensitive ( " yes" ) ) {
180181 m_user_response = true ;
181182 io_handler.SetIsDone (true );
182- } else if (line == " no" || line == " NO " || line == " No " ) {
183+ } else if (input. compare_insensitive ( " no" ) ) {
183184 m_user_response = false ;
184185 io_handler.SetIsDone (true );
185186 }
You can’t perform that action at this time.
0 commit comments