comparison base/StringBits.cpp @ 1019:a73c44ae5acb

Fix close-quote immediately before separator in StringBits::splitQuoted
author Chris Cannam
date Thu, 27 Nov 2014 17:50:34 +0000
parents 6a94bb528e9d
children eecf544bed92
comparison
equal deleted inserted replaced
1015:30afdc7c7b89 1019:a73c44ae5acb
81 81
82 if (c == '\'') { 82 if (c == '\'') {
83 switch (mode) { 83 switch (mode) {
84 case sep: mode = q1; break; 84 case sep: mode = q1; break;
85 case unq: case q2: tok += c; break; 85 case unq: case q2: tok += c; break;
86 case q1: mode = sep; tokens << tok; tok = ""; break; 86 case q1: mode = unq; break;
87 } 87 }
88 88
89 } else if (c == '"') { 89 } else if (c == '"') {
90 switch (mode) { 90 switch (mode) {
91 case sep: mode = q2; break; 91 case sep: mode = q2; break;
92 case unq: case q1: tok += c; break; 92 case unq: case q1: tok += c; break;
93 case q2: mode = sep; tokens << tok; tok = ""; break; 93 case q2: mode = unq; break;
94 } 94 }
95 95
96 } else if (c == separator || (separator == ' ' && c.isSpace())) { 96 } else if (c == separator || (separator == ' ' && c.isSpace())) {
97 switch (mode) { 97 switch (mode) {
98 case sep: if (separator != ' ') tokens << ""; break; 98 case sep: if (separator != ' ') tokens << ""; break;