[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: lynx-dev 2.8.2dev.19 patch 1 - small ebcdic fix
From: |
pg |
Subject: |
Re: lynx-dev 2.8.2dev.19 patch 1 - small ebcdic fix |
Date: |
Mon, 8 Mar 1999 20:30:03 -0700 (MST) |
In a recent note, Klaus Weide said:
> Date: Mon, 8 Mar 1999 17:16:10 -0600 (CST)
>
> You don't need to go to the sendmail level to check *some* of this -
>
My technique was cruder than that in your other note, but sufficiently
effective.
> You know where the letters and numbers are in the EBCDIC table, so
> it should be much easier for you than for me to make a test case where
> (unsigned char)*p >= 127 is different from !LYIsASCII(*p) for one of
Easy indeed: all EBCDIC alphanumerics are above 127.
> The HTUnEscapeSome shouldn't have anything to do with the entity stuff.
My misunderstanding. I'm better now.
> by a later HTUnEscape), and I don't have a definitive test now.
> If I come across something I'll let you know...
>
I agree with your patch, even though my attempts to create a test case
that breaks in its absence have failed.
But a rearrangement to eliminate one call to FROMASCII (attached).
(Poor Tom!)
You may note that moving the FROMASCII call makes the assumption that
FROMASCII(0) == 0. This is true in particular for EBCDIC, and
essentially a requirement of ANSI C for any character set.
-- gil
===================================================================
* Fix of HTUnEscapeSome in HTParse.c for non-ASCII. -KW,PG
%%% Created Mon Mar 8 20:07:36 MST 1999 by target lynx.patch. %%%
diff -bru orig/lynx2-8-2/WWW/Library/Implementation/HTParse.c
lynx2-8-2/WWW/Library/Implementation/HTParse.c
--- orig/lynx2-8-2/WWW/Library/Implementation/HTParse.c Thu Jan 28 09:31:29 1999
+++ lynx2-8-2/WWW/Library/Implementation/HTParse.c Mon Mar 8 20:06:14 1999
@@ -843,9 +843,9 @@
p[1] && p[2] && /* tests shouldn't be needed, but.. */
isxdigit((unsigned char)p[1]) &&
isxdigit((unsigned char)p[2]) &&
- (testcode = from_hex(p[1])*16 + from_hex(p[2])) && /* %00 no good*/
+ (testcode = FROMASCII(from_hex(p[1])*16 + from_hex(p[2]))) && /*
%00 no good*/
strchr(do_trans, testcode)) { /* it's one of the ones we want */
- *q++ = FROMASCII(testcode);
+ *q++ = testcode;
p += 3;
} else {
*q++ = *p++;