Browse Source

Bug 1443: The -pw argument is added to PuTTY command-line, even when !P pattern is used + Custom command and PuTTY patterns are case-insensitive

https://winscp.net/tracker/1443

Source commit: 01d8ad847838e3f1e6d274a9ddf7690ebdb81f48
Martin Prikryl 9 years ago
parent
commit
8b45c7cf46
1 changed files with 6 additions and 6 deletions
  1. 6 6
      source/core/FileMasks.cpp

+ 6 - 6
source/core/FileMasks.cpp

@@ -974,7 +974,7 @@ bool __fastcall TCustomCommand::FindPattern(const UnicodeString & Command,
     int Len;
     wchar_t APatternCmd;
     GetToken(Command, Index, Len, APatternCmd);
-    if (((PatternCmd != L'!') && (PatternCmd == APatternCmd)) ||
+    if (((PatternCmd != L'!') && (tolower(PatternCmd) == tolower(APatternCmd))) ||
         ((PatternCmd == L'!') && (Len == 1) && (APatternCmd != TEXT_TOKEN)))
     {
       Result = true;
@@ -1170,17 +1170,17 @@ TFileCustomCommand::TFileCustomCommand(const TCustomCommandData & Data,
 int __fastcall TFileCustomCommand::PatternLen(const UnicodeString & Command, int Index)
 {
   int Len;
-  wchar_t PatternCmd = (Index < Command.Length()) ? Command[Index + 1] : L'\0';
+  wchar_t PatternCmd = (Index < Command.Length()) ? tolower(Command[Index + 1]) : L'\0';
   switch (PatternCmd)
   {
-    case L'S':
+    case L's':
     case L'@':
-    case L'U':
-    case L'P':
+    case L'u':
+    case L'p':
     case L'#':
     case L'/':
     case L'&':
-    case L'N':
+    case L'n':
       Len = 2;
       break;