lynx-dev
[Top][All Lists]
Advanced

[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 09:46:43 -0700 (MST)

In a recent note, Klaus Weide said:

> Date: Sun, 7 Mar 1999 14:11:33 -0600 (CST)
> 
> Btw, PG if you are reading - did you see my note
>    <http://www.flora.org/lynx-dev/html/month0299/msg00314.html>
> referring to dev.15 -> dev.16 changes from
>    <http://www.flora.org/lynx-dev/html/month0299/msg00186.html>?
> 
Thanks for pointing this out.  None of our S/390s are running sendmail,
so I can't fully test this.  But I made the changes that appeared necessary,
aliased "cat" as "sendmail", and inspected the output.  Patch attached.
> 
> Seems to me EBCDIC needs this small fix - no way to test it though.
> * Fix of HTUnEscapeSome for non-ASCII.
> 
Do you mean that lacking an EBCDIC platform, you are unable to
test it, or that there's a fundamental obstacle to testing?  :-)

If the former, can you point me at a URL on which it should make a
difference?  I tried it on one of the entities tests distributed with
Lynx, and could see no difference before-and-after patch.

Thanks,
gil
=======================================================================
%%% Created Mon Mar  8 09:10:00 MST 1999 by target lynx.patch. %%%
diff -bru orig/lynx2-8-2/WWW/Library/Implementation/HTUtils.h 
lynx2-8-2/WWW/Library/Implementation/HTUtils.h
--- orig/lynx2-8-2/WWW/Library/Implementation/HTUtils.h Sun Mar  7 18:56:26 1999
+++ lynx2-8-2/WWW/Library/Implementation/HTUtils.h      Sun Mar  7 18:50:55 1999
@@ -307,6 +307,12 @@
 #define WHITE(c) (((unsigned char)(c)) <= ' ')
 
 
+/*     Inline Function LYIsASCII: Is character c a traditional ASCII
+**     character (i.e. <128) after converting from host character set.  */
+
+#define LYIsASCII(c) (TOASCII((unsigned char)(c)) < 128)
+
+
 /*
 
 Sucess (>=0) and failure (<0) codes
diff -bru orig/lynx2-8-2/src/LYCharUtils.c lynx2-8-2/src/LYCharUtils.c
--- orig/lynx2-8-2/src/LYCharUtils.c    Mon Feb  8 03:32:59 1999
+++ lynx2-8-2/src/LYCharUtils.c Sun Mar  7 18:49:24 1999
@@ -3866,7 +3866,7 @@
        char *messageid = NULL;
        char *p;
        for (cp = comment+17; *cp; cp++) {
-           if ((unsigned char)*cp >= 127 || !isgraph((unsigned char)*cp)) {
+           if ((!LYIsASCII(*cp)) || !isgraph((unsigned char)*cp)) {
                break;
            }
        }
@@ -3879,7 +3879,7 @@
        if (!LYUCFullyTranslateString(&messageid, 0, 0, NO, NO, YES, st_URL))
            return FALSE;
        for (p = messageid; *p; p++) {
-           if ((unsigned char)*p >= 127 || !isgraph((unsigned char)*p)) {
+           if ((!LYIsASCII(*p)) || !isgraph((unsigned char)*p)) {
                break;
            }
        }
@@ -3910,7 +3910,7 @@
        char *subject = NULL;
        char *p;
        for (cp = comment+14; *cp; cp++) {
-           if ((unsigned char)*cp >= 127 || !isprint((unsigned char)*cp)) {
+           if ((!LYIsASCII(*cp)) || !isprint((unsigned char)*cp)) {
                return FALSE;
            }
        }
@@ -3931,7 +3931,7 @@
        if (!LYUCFullyTranslateString(&subject, 0, 0, NO, YES, NO, st_HTML))
            return FALSE;
        for (p = subject; *p; p++) {
-           if ((unsigned char)*p >= 127 || !isprint((unsigned char)*p)) {
+           if ((!LYIsASCII(*p)) || !isprint((unsigned char)*p)) {
                FREE(subject);
                return FALSE;
            }
diff -bru orig/lynx2-8-2/src/LYMail.c lynx2-8-2/src/LYMail.c
--- orig/lynx2-8-2/src/LYMail.c Wed Feb 17 07:29:33 1999
+++ lynx2-8-2/src/LYMail.c      Mon Mar  8 09:09:00 1999
@@ -37,8 +37,9 @@
      HTUnEscape(string);
      for (i=0; string[i] != '\0'; i++)
      {
-       /* FIXME: this is explicitly 7-bit ASCII */
-       if (string[i] < ' ' || string[i] >= 127)
+       /* FIXME: this is no longer explicitly 7-bit ASCII,
+          but are there portability problems? */
+       if ((!LYIsASCII(string[i])) || !isprint(string[i]))
        {
           string[i] = '?';
           flg = TRUE;

reply via email to

[Prev in Thread] Current Thread [Next in Thread]