File tree Expand file tree Collapse file tree 1 file changed +27
-2
lines changed
redis-desktop-manager/source/redis Expand file tree Collapse file tree 1 file changed +27
-2
lines changed Original file line number Diff line number Diff line change @@ -85,8 +85,33 @@ void Command::setOwner(QObject * o)
85
85
86
86
QByteArray Command::getByteRepresentation (const QString& command)
87
87
{
88
- QStringList parts = command.split (" " , QString::SkipEmptyParts, Qt::CaseInsensitive);
89
-
88
+ QStringList parts = QStringList ();
89
+ int i = 0 ;
90
+ bool inQuote = false ;
91
+ QString part = QString ();
92
+ while (i < command.length ())
93
+ {
94
+ if (command.at (i).isSpace () && !inQuote)
95
+ {
96
+ if (part.length () > 0 )
97
+ parts.append (part);
98
+ part = QString ();
99
+ }
100
+ else if (command.at (i) == QChar (' "' ))
101
+ {
102
+ if (inQuote)
103
+ parts.append (part);
104
+ part = QString ();
105
+ inQuote = !inQuote;
106
+ }
107
+ else
108
+ {
109
+ part.append (command.at (i));
110
+ }
111
+ ++i;
112
+ }
113
+ if (parts.length () < 1 || part.length () > 0 )
114
+ parts.append (part);
90
115
return Command::getByteRepresentation (parts);
91
116
}
92
117
You can’t perform that action at this time.
0 commit comments