Parser: fix text code parsing for tagged responses

fork
mscdex 12 years ago
parent 2bbc17d6e3
commit bad60cf479

@ -939,8 +939,10 @@ Connection.prototype._resTagged = function(info) {
err.textCode = info.textCode;
err.source = 'protocol';
} else if (this._box) {
if (req.type === 'EXAMINE' || req.type === 'SELECT')
this._box.readOnly = (info.textCode.toUpperCase() === 'READ-ONLY');
if (req.type === 'EXAMINE' || req.type === 'SELECT') {
this._box.readOnly = (typeof info.textCode === 'string'
&& info.textCode.toUpperCase() === 'READ-ONLY');
}
// According to RFC 3501, UID commands do not give errors for
// non-existant user-supplied UIDs, so give the callback empty results

@ -141,7 +141,7 @@ Parser.prototype._resTagged = function() {
var m = RE_TAGGED.exec(this._buffer),
tagnum = parseInt(m[1], 10),
type = m[2].toLowerCase(),
textCode = (m[3] ? parseExpr(m[3], this._literals) : m[3]),
textCode = (m[3] ? parseTextCode(m[3], this._literals) : m[3]),
text = m[4];
this._literals = [];

Loading…
Cancel
Save