Browse Source

Bug 2022: Failure when submitting prompt with "Never ask me again" selected

https://winscp.net/tracker/2022
(cherry picked from commit f1af53095dbc53d6460476c696798ab10c9b5302)

Source commit: a519ea62a4ce5fa6be3d29d6fed92985faeb0718
Martin Prikryl 4 years ago
parent
commit
225590cc58
1 changed files with 10 additions and 2 deletions
  1. 10 2
      source/core/Terminal.cpp

+ 10 - 2
source/core/Terminal.cpp

@@ -1851,8 +1851,16 @@ unsigned int __fastcall TTerminal::QueryUser(const UnicodeString Query,
       }
     }
   }
-  UnicodeString Name, Caption;
-  AnswerNameAndCaption(Answer, Name, Caption);
+  UnicodeString Name;
+  if (Answer == qaNeverAskAgain)
+  {
+    Name = L"NeverAskAgain";
+  }
+  else
+  {
+    UnicodeString Caption;
+    AnswerNameAndCaption(Answer, Name, Caption);
+  }
   LogEvent(FORMAT(L"Answer: %s", (Name)));
   return Answer;
 }