Ticket #3879: winmain.patch
File winmain.patch, 1.6 KB (added by , 13 years ago) |
---|
-
winmain.cpp
30 30 31 31 std::string current; 32 32 bool inside_quoted = false; 33 bool empty_quote = false; 33 34 int backslash_count = 0; 34 35 35 36 for(; i != e; ++i) { … … 38 39 // n/2 backslashes and is a quoted block delimiter 39 40 if (backslash_count % 2 == 0) { 40 41 current.append(backslash_count / 2, '\\'); 42 empty_quote = inside_quoted && current.empty(); 41 43 inside_quoted = !inside_quoted; 42 44 // '"' preceded by odd number (n) of backslashes generates 43 45 // (n-1)/2 backslashes and is literal quote. … … 59 61 // Space outside quoted section terminate the current argument 60 62 result.push_back(current); 61 63 current.resize(0); 64 empty_quote = false; 62 65 for(;i != e && isspace((unsigned char)*i); ++i) 63 66 ; 64 67 --i; … … 74 77 75 78 // If we have non-empty 'current' or we're still in quoted 76 79 // section (even if 'current' is empty), add the last token. 77 if (!current.empty() || inside_quoted )80 if (!current.empty() || inside_quoted || empty_quote) 78 81 result.push_back(current); 79 82 } 80 83 return result;