imap-quote.c revision 169d60e9729b7a047ed17e82607101e20c69dcb1
/* Copyright (c) 2002-2012 Dovecot authors, see the included COPYING file */
#include "lib.h"
#include "str.h"
#include "imap-quote.h"
{
return;
}
for (i = 0; i < value_len; i++) {
switch (value[i]) {
case 0:
/* it's converted to 8bit char */
break;
case '\t':
/* fall through */
case ' ':
extra++;
}
break;
case 13:
case 10:
if (!fix_text)
extra++;
break;
default:
if ((value[i] & 0x80) != 0 ||
}
}
if (!fix_text) {
extra = 0;
}
if (!literal) {
/* no 8bit chars or imapspecials, return as "string" */
} else {
/* return as literal */
}
if (!modify)
else {
for (i = 0; i < value_len; i++) {
switch (value[i]) {
case 0:
break;
case ' ':
case '\t':
if (!last_lwsp)
break;
case 13:
case 10:
break;
default:
break;
}
}
}
if (!literal)
}
static const char *
{
}
{
const char *ret;
return "NIL";
if (pool->datastack_pool)
else T_BEGIN {
} T_END;
return ret;
}
{
}
{
}
{
switch (*src) {
case '\r':
case '\n':
/* not allowed */
break;
case '"':
case '\\':
break;
default:
if ((unsigned char)*src >= 0x80) {
/* 8bit input not allowed in dquotes */
break;
}
break;
}
}
}