X-Git-Url: http://git.marmaro.de/?p=mmh;a=blobdiff_plain;f=sbr%2Ffmt_scan.c;h=7558eca532c084661c837a8630371efc62e08947;hp=357484b0bd50f3ce2d3f05ded56cf9a8588b988f;hb=e8635a8a1c577636becd53428ff290860280238f;hpb=5e0d718c31e05bfa80e610eb15620abeb5b1b3e9 diff --git a/sbr/fmt_scan.c b/sbr/fmt_scan.c index 357484b..7558eca 100644 --- a/sbr/fmt_scan.c +++ b/sbr/fmt_scan.c @@ -682,6 +682,38 @@ fmt_scan (struct format *format, char *scanl, int width, int *dat) } } } + break; + + + /* UNQUOTEs RFC-2822 quoted-string and quoted-pair */ + case FT_LS_UNQUOTE: + if (str) { + int m; + strncpy(buffer, str, sizeof(buffer)); + str = buffer; + + /* we will parse from buffer to buffer2 */ + n = 0; /* n is the input position in str */ + m = 0; /* m is the ouput position in buffer2 */ + + while ( str[n] != '\0') { + switch ( str[n] ) { + case '\\': + n++; + if ( str[n] != '\0') + buffer2[m++] = str[n++]; + break; + case '"': + n++; + break; + default: + buffer2[m++] = str[n++]; + break; + } + } + buffer2[m] = '\0'; + str = buffer2; + } break; case FT_LOCALDATE: