From 7f60bdbf1552460b67b77c5090e9ed3e316e8820 Mon Sep 17 00:00:00 2001 From: "davidmc%netscape.com" Date: Mon, 19 Apr 1999 22:17:10 +0000 Subject: [PATCH] fix morkParser::ReadValue() so it will notice '$' when reading values, and unescape bytes written in hex earlier by morkWriter. --- db/mork/src/morkParser.cpp | 16 ++++++++++++++++ mailnews/db/mork/src/morkParser.cpp | 16 ++++++++++++++++ 2 files changed, 32 insertions(+) diff --git a/db/mork/src/morkParser.cpp b/db/mork/src/morkParser.cpp index 7991fd85c002..617ae40aaeb0 100644 --- a/db/mork/src/morkParser.cpp +++ b/db/mork/src/morkParser.cpp @@ -828,6 +828,22 @@ morkBuf* morkParser::ReadValue(morkEnv* ev) if ( (c = s->Getc(ev)) == EOF || ev->Bad() ) break; // end while loop } + else if ( c == '$' ) // "$" escapes next two hex digits? + { + if ( (c = s->Getc(ev)) != EOF && ev->Good() ) + { + mork_ch first = (mork_ch) c; // first hex digit + if ( (c = s->Getc(ev)) != EOF && ev->Good() ) + { + mork_ch second = (mork_ch) c; // second hex digit + c = ev->HexToByte(first, second); + } + else + break; + } + else + break; + } spool->Putc(ev, c); } diff --git a/mailnews/db/mork/src/morkParser.cpp b/mailnews/db/mork/src/morkParser.cpp index 7991fd85c002..617ae40aaeb0 100644 --- a/mailnews/db/mork/src/morkParser.cpp +++ b/mailnews/db/mork/src/morkParser.cpp @@ -828,6 +828,22 @@ morkBuf* morkParser::ReadValue(morkEnv* ev) if ( (c = s->Getc(ev)) == EOF || ev->Bad() ) break; // end while loop } + else if ( c == '$' ) // "$" escapes next two hex digits? + { + if ( (c = s->Getc(ev)) != EOF && ev->Good() ) + { + mork_ch first = (mork_ch) c; // first hex digit + if ( (c = s->Getc(ev)) != EOF && ev->Good() ) + { + mork_ch second = (mork_ch) c; // second hex digit + c = ev->HexToByte(first, second); + } + else + break; + } + else + break; + } spool->Putc(ev, c); }