lynx-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

lynx-dev 2.8.2dev.8 minore fixes (patch)


From: Leonid Pauzner
Subject: lynx-dev 2.8.2dev.8 minore fixes (patch)
Date: Fri, 4 Dec 1998 15:49:45 +0300 (MSK)

diff -u old/changes ./changes
--- old/changes Thu Dec  3 10:28:20 1998
+++ ./changes   Fri Dec  4 15:42:30 1998
@@ -1,6 +1,15 @@
 Changes since Lynx 2.8.1 release
 
================================================================================

+* Fix -restrictions=bookmark check in forms-based options menu
+  (reported by KW & Rodiger Geys) - LP
+* Fix memory leaks in LYPrint.c and UCdomap.c - KW
+* When printing HEAD to email use URL in the subject, was title.
+  (it was especially annoying when we have 8bit title being sended as 7bit:
+  no charset information supplied for letters with 7bit message body) - LP
+* Remove "temp fix for HText_trimHightext side effect from partial mode by 
introducing
+  a flag in HText_beginInput()" from 1998-09-12 since it is now not needed
+  after KW changes in HText_trimHightext. - LP
 1998-12-03 (2.8.2dev.8)
 * use HTSprintf/HTSprintf0 in LYCookie.c, LYLocal.c - TD
 * correct logic in OpenHiddenFile, which did not check if a failure to open a
@@ -52,14 +61,13 @@
   parameter "final" is not set.
   Also empty anchors should now generally not any more move down over empty
   lines, if they happen at a line end.  Made some trace messages give more
-  information - KW, LP
+  information - KW
 * color styles:  reset screen style cache to avoid random coloring when a link
-  is unhighlighted - KW, LP
+  is unhighlighted - KW
 * Tweak in HText_setLastOptionValue:  if an OPTION tag was directly followed by
-  several newlines, characters could be dropped - KW, LP
-* modify havevisible() function in LYBookmark.c to compare against Unicode
-  value rather than ASCII.  Optimize title_convert8bit() by moving character
-  translation out of loop - LP
+  several newlines, characters could be dropped - KW
+* Tweak havevisible() function in LYBookmark.c to compare against Unicode
+  value rather than ASCII when checking for blanks. - LP
 * ifdef user/group function caching calls so that this builds with djgpp, which
   doesn't need/support this (patch by Gisle Vanem)
 * documentation updates for NLS - HN
Only in .: dif
Only in .: doug.1
diff -u old/gridtext.c ./gridtext.c
--- old/gridtext.c      Thu Dec  3 10:28:20 1998
+++ ./gridtext.c        Fri Dec  4 12:46:20 1998
@@ -4271,7 +4271,7 @@
        CTRACE(tfp, "GridText: HText_pageDisplay at line %d started\n", 
line_num);
     }

-    if (display_partial && detected_forms_input_partial) {
+    if (display_partial) {
        /*
        **  Garbage is reported from forms input fields in incremental mode.
        **  So we start HText_trimHightext() to forget this side effect.
@@ -4283,7 +4283,6 @@
        */
        HText_trimHightext(HTMainText, FALSE);
     }
-    detected_forms_input_partial = FALSE;
 #endif

     display_page(HTMainText, line_num-1, target);
@@ -6548,11 +6547,6 @@
     int i, j;

     CTRACE(tfp,"Entering HText_beginInput\n");
-
-#ifdef DISP_PARTIAL
-    if (display_partial)
-       detected_forms_input_partial = TRUE; /* trimHightext temp fix */
-#endif

     if (a == NULL || f == NULL)
        outofmem(__FILE__, "HText_beginInput");
diff -u old/lyglobal.h ./lyglobal.h
--- old/lyglobal.h      Thu Dec  3 10:28:20 1998
+++ ./lyglobal.h        Fri Dec  4 12:44:10 1998
@@ -260,7 +260,6 @@
 extern int NumOfLines_partial;       /* -//- "current" number of lines */
 extern int partial_threshold;
 extern BOOLEAN debug_display_partial;  /* show with MessageSecs delay */
-extern BOOLEAN detected_forms_input_partial; /* trimHightext temp fix */
 #endif
 extern char *form_post_data;         /* User data for post form */
 extern char *form_get_data;          /* User data for get form */
diff -u old/lymain.c ./lymain.c
--- old/lymain.c        Thu Dec  3 10:28:20 1998
+++ ./lymain.c  Fri Dec  4 14:41:36 1998
@@ -367,7 +367,6 @@
 #ifdef DISP_PARTIAL
 PUBLIC BOOLEAN display_partial = TRUE; /* Display document during download */
 PUBLIC BOOLEAN debug_display_partial = FALSE; /* Show with MessageSecs delay */
-PUBLIC BOOLEAN detected_forms_input_partial = FALSE; /* trimHightext temp fix 
*/
 PUBLIC int partial_threshold = -1;  /* # of lines to be d/l'ed until we 
repaint */
 #endif

@@ -485,7 +484,6 @@
     FREE(lynxjumpfile);
     FREE(startrealm);
     FREE(personal_mail_address);
-    FREE(UC_TEMPcharset);
     FREE(URLDomainPrefixes);
     FREE(URLDomainSuffixes);
     FREE(XLoadImageCommand);
diff -u old/lyoption.c ./lyoption.c
--- old/lyoption.c      Thu Dec  3 10:28:20 1998
+++ ./lyoption.c        Fri Dec  4 15:38:20 1998
@@ -3526,7 +3526,10 @@
     if (strstr(newdoc->address, "LYNXOPTIONS://MBM_MENU")) {
        FREE(newdoc->post_data);
        FREE(data);
-       edit_bookmarks();
+       if (!no_bookmark)
+          edit_bookmarks();
+       else /* anonymous */
+          HTAlert(BOOKMARK_CHANGE_DISALLOWED);
        return(NULLFILE);
     }

@@ -3686,8 +3689,8 @@
            }
        }

-       /* Single Bookmarks filename: INPUT */
-       if (!strcmp(data[i].tag, single_bookmark_string)) {
+       /* Default Bookmarks filename: INPUT */
+       if (!strcmp(data[i].tag, single_bookmark_string) && (!no_bookmark)) {
            if (strcmp(data[i].value, "")) {
                FREE(bookmark_page);
                StrAllocCopy(bookmark_page, data[i].value);
diff -u old/lyprint.c ./lyprint.c
--- old/lyprint.c       Thu Dec  3 10:28:20 1998
+++ ./lyprint.c Fri Dec  4 13:27:18 1998
@@ -588,7 +588,17 @@
                 *  MORE readable and 8-bit letters shouldn't be a problem - LP
                 */
                /* change_sug_filename(sug_filename); */
-               StrAllocCopy(subject, subject_translate8bit(newdoc->title));
+               subject = subject_translate8bit(newdoc->title);
+
+               if (newdoc->isHEAD) {
+                       /*
+                        * Special case for mailing HEAD responce:
+                        * this is rather technical information, show URL.
+                        */
+                       FREE(subject);
+                       StrAllocCopy(subject, "HEAD  ");
+                       StrAllocCat(subject, newdoc->address);
+               }

 #ifdef VMS
                if (strchr(user_response,'@') && !strchr(user_response,':') &&
@@ -1234,6 +1244,7 @@
  *  it may correspond to US-ASCII as the safest value or any other
  *  lynx character handler, -1 for no translation (so display charset).
  *
+ *  Always returns a new allocated string which has to be freed.
  */
 PRIVATE char* subject_translate8bit ARGS1(char *, source)
 {
@@ -1250,7 +1261,8 @@
     if (i < 0
      || LYHaveCJKCharacterSet
      || LYCharSet_UC[i].enc == UCT_ENC_CJK) {
-       return(source); /* OK */
+       StrAllocCopy(target, source);
+       return(target); /* OK */
     } else {
        charset_out = i;
        charset_in  = current_char_set;
Only in .: old
Only in .: status.me
diff -u old/ucdomap.c ./ucdomap.c
--- old/ucdomap.c       Thu Dec  3 10:28:20 1998
+++ ./ucdomap.c Fri Dec  4 13:14:36 1998
@@ -69,8 +69,6 @@
 #include <mnem_suni.h>
 #endif /* NOTDEFINED */

-PUBLIC  char *UC_TEMPcharset = 0;      /* temporary in UCGetLYhndl_byMIME */
-
 /*
  *  Some of the code below, and some of the comments, are left in for
  *  historical reasons.  Not all those tables below are currently
@@ -1509,7 +1507,7 @@
 PUBLIC int UCGetLYhndl_byMIME ARGS1(
        CONST char *,   value)
 {
-#define UC_MIMEcharset UC_TEMPcharset
+    CONST char *UC_MIMEcharset = value;
     int i;
     int LYhndl = -1;

@@ -1518,14 +1516,12 @@
        return -1;
     }

-    StrAllocCopy(UC_MIMEcharset, value);
-    LYLowerCase(UC_MIMEcharset);

     for (i = 0;
         (i < MAXCHARSETS && i < LYNumCharsets &&
          LYchar_set_names[i]); i++) {
        if (LYCharSet_UC[i].MIMEname &&
-           !strcmp(UC_MIMEcharset, LYCharSet_UC[i].MIMEname)) {
+           !strcasecomp(UC_MIMEcharset, LYCharSet_UC[i].MIMEname)) {
            return i;
        }
     }
@@ -1533,62 +1529,62 @@
        /*
         *  Not yet found, try synonyms. - FM
         */
-       if (!strcmp(UC_MIMEcharset, "unicode-1-1-utf-8") ||
-           !strcmp(UC_MIMEcharset, "utf8")) {
+       if (!strcasecomp(UC_MIMEcharset, "unicode-1-1-utf-8") ||
+           !strcasecomp(UC_MIMEcharset, "utf8")) {
            /*
             *  Treat these as synonyms for the IANA registered name. - FM
             */
            return UCGetLYhndl_byMIME("utf-8");
        }
-       if (!strncmp(UC_MIMEcharset, "iso-2022-jp", 11) ||
-           !strcmp(UC_MIMEcharset, "x-euc-jp")) {
+       if (!strncasecomp(UC_MIMEcharset, "iso-2022-jp", 11) ||
+           !strcasecomp(UC_MIMEcharset, "x-euc-jp")) {
            return UCGetLYhndl_byMIME("euc-jp");
        }
-       if (!strcmp(UC_MIMEcharset, "x-shift-jis")) {
+       if (!strcasecomp(UC_MIMEcharset, "x-shift-jis")) {
            return UCGetLYhndl_byMIME("shift_jis");
        }
-       if (!strcmp(UC_MIMEcharset, "iso-2022-kr")) {
+       if (!strcasecomp(UC_MIMEcharset, "iso-2022-kr")) {
            return UCGetLYhndl_byMIME("euc-kr");
        }
-       if (!strcmp(UC_MIMEcharset, "gb2312") ||
-           !strncmp(UC_MIMEcharset, "cn-gb", 5) ||
-           !strcmp(UC_MIMEcharset, "iso-2022-cn")) {
+       if (!strcasecomp(UC_MIMEcharset, "gb2312") ||
+           !strncasecomp(UC_MIMEcharset, "cn-gb", 5) ||
+           !strcasecomp(UC_MIMEcharset, "iso-2022-cn")) {
            return UCGetLYhndl_byMIME("euc-cn");
        }
-       if (!strcmp(UC_MIMEcharset, "cn-big5")) {
+       if (!strcasecomp(UC_MIMEcharset, "cn-big5")) {
            return UCGetLYhndl_byMIME("big5");
        }
-       if (!strcmp(UC_MIMEcharset, "x-mac-roman") ||
-           !strcmp(UC_MIMEcharset, "mac-roman")) {
+       if (!strcasecomp(UC_MIMEcharset, "x-mac-roman") ||
+           !strcasecomp(UC_MIMEcharset, "mac-roman")) {
            return UCGetLYhndl_byMIME("macintosh");
        }
-       if (!strcmp(UC_MIMEcharset, "x-next") ||
-           !strcmp(UC_MIMEcharset, "nextstep") ||
-           !strcmp(UC_MIMEcharset, "x-nextstep")) {
+       if (!strcasecomp(UC_MIMEcharset, "x-next") ||
+           !strcasecomp(UC_MIMEcharset, "nextstep") ||
+           !strcasecomp(UC_MIMEcharset, "x-nextstep")) {
            return UCGetLYhndl_byMIME("next");
        }
-       if (!strcmp(UC_MIMEcharset, "iso-8859-1-windows-3.1-latin-1") ||
-           !strcmp(UC_MIMEcharset, "cp1252") ||
-           !strcmp(UC_MIMEcharset, "cp-1252") ||
-           !strcmp(UC_MIMEcharset, "ibm1252") ||
-           !strcmp(UC_MIMEcharset, "iso-8859-1-windows-3.0-latin-1")) {
+       if (!strcasecomp(UC_MIMEcharset, "iso-8859-1-windows-3.1-latin-1") ||
+           !strcasecomp(UC_MIMEcharset, "cp1252") ||
+           !strcasecomp(UC_MIMEcharset, "cp-1252") ||
+           !strcasecomp(UC_MIMEcharset, "ibm1252") ||
+           !strcasecomp(UC_MIMEcharset, "iso-8859-1-windows-3.0-latin-1")) {
            /*
             *  Treat these as synonyms for windows-1252, which is more
             *  commonly used than the IANA registered name. - FM
             */
            return UCGetLYhndl_byMIME("windows-1252");
        }
-       if (!strcmp(UC_MIMEcharset, "iso-8859-2-windows-latin-2") ||
-           !strcmp(UC_MIMEcharset, "cp1250") ||
-           !strcmp(UC_MIMEcharset, "cp-1250") ||
-           !strcmp(UC_MIMEcharset, "ibm1250")) {
+       if (!strcasecomp(UC_MIMEcharset, "iso-8859-2-windows-latin-2") ||
+           !strcasecomp(UC_MIMEcharset, "cp1250") ||
+           !strcasecomp(UC_MIMEcharset, "cp-1250") ||
+           !strcasecomp(UC_MIMEcharset, "ibm1250")) {
            /*
             *  Treat these as synonyms for windows-1250. - FM
             */
            return UCGetLYhndl_byMIME("windows-1250");
        }
-       if ((!strncmp(UC_MIMEcharset, "ibm", 3) ||
-            !strncmp(UC_MIMEcharset, "cp-", 3)) &&
+       if ((!strncasecomp(UC_MIMEcharset, "ibm", 3) ||
+            !strncasecomp(UC_MIMEcharset, "cp-", 3)) &&
            isdigit((unsigned char)UC_MIMEcharset[3]) &&
            isdigit((unsigned char)UC_MIMEcharset[4]) &&
            isdigit((unsigned char)UC_MIMEcharset[5])) {
@@ -1614,7 +1610,7 @@
            FREE(cptmp);
            return LYhndl;
        }
-       if (!strncmp(UC_MIMEcharset, "windows-", 8) &&
+       if (!strncasecomp(UC_MIMEcharset, "windows-", 8) &&
            isdigit((unsigned char)UC_MIMEcharset[8]) &&
            isdigit((unsigned char)UC_MIMEcharset[9]) &&
            isdigit((unsigned char)UC_MIMEcharset[10])) {
@@ -1630,7 +1626,7 @@
            FREE(cptmp);
            return LYhndl;
        }
-       if (!strcmp(UC_MIMEcharset, "koi-8")) { /* accentsoft bugosity */
+       if (!strcasecomp(UC_MIMEcharset, "koi-8")) { /* accentsoft bugosity */
          return UCGetLYhndl_byMIME("koi8-r");
        }
     }
@@ -1638,7 +1634,6 @@

     CTRACE(tfp, "UCGetLYhndl_byMIME: unrecognized MIME name \"%s\"\n", value);
     return -1; /* returns -1 if no charset found by that MIME name */
-#undef UC_MIMEcharset
 }

 /*


reply via email to

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