Ethereal-dev: RE: [Ethereal-dev] [PATCH][WSP]Decoding of Quoted-string

Note: This archive is from the project's previous web site, ethereal.com. This list is no longer active.

From: Biot Olivier <Olivier.Biot@xxxxxxxxxxx>
Date: Tue, 18 Nov 2003 19:27:36 +0100
| From: Loïc Minier
| 
| Biot Olivier - Tue, Nov 18, 2003:
| 
| > Regarding the Quoted-string issue, I have already seen the 
| following:
| > 	1. "text
| > 	2. "text"
| > 	3. text (on rare occasions; should be flagged as an 
| error anyway)
| 
|  Yes, case 3 is clearly an error and case 2 might no be one, as in:
|    ""Loïc Minier"
| 
|  So I don't think that removing the trailing quote is a good 
| idea. Is my
|  patch for removing the leading quote ok?

I've been looking more closely at your patch, and it eats a leading quote
whenever it sees one, which is not correct. I've verified with the ABNF for
WSP headers, and the only definitions where Quoted-string is used, is in
Expect, Content-ID, Parameter and Cache-Control (in the latter 2 as
Text-value). I will provide a fix to those headers only, as ["foo"] is a
valid Text-string, which would be displayed as [foo"] which is not expected.

The fixes will look like:

	get_text_string(...)
	if (ok) {
		if (is_quoted_string(val_str[0]) {
			/* Skip opening quote and add it at both sides of
string */
			. . .
		} else { /* Either Error, or (Token-text | 0x00) */
			. . .
		}
	}

I'll post a patch later today.

Regards,

Olivier