lynx-dev
[Top][All Lists]
Advanced

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

lynx-dev Re: pre4 (patch) SOURCE CACHE & LYK_SOURCE tiny charset fix


From: Leonid Pauzner
Subject: lynx-dev Re: pre4 (patch) SOURCE CACHE & LYK_SOURCE tiny charset fix
Date: Thu, 20 May 1999 13:06:20 +0400 (MSD)

* LYK_SOURCE & HTreparse_document(): when using SOURCE_CACHE_MEMORY
  fix tiny charset problem when switching to the source mode
  and the original document have its charset specified.
  Now aligned with SOURCE_CACHE_NONE and SOURCE_CACHE_FILE.
  More LYK_SOURCE fixes that might affect next coming document in come cases
  (mainly Info page and Options menu, which now show correct charset
  information).



diff -u old/gridtext.c ./gridtext.c
--- old/gridtext.c      Thu May 13 11:14:46 1999
+++ ./gridtext.c        Thu May 20 12:41:46 1999
@@ -6195,7 +6195,7 @@
            format = HTFileFormat(HTMainText->source_cache_file, NULL, NULL);
            format = HTCharsetFormat(format, HTMainText->node_anchor,
                                             UCLYhndl_for_unspec);
-           /* not UCLYhndl_HTFile_for_unspec - we are talking about remote 
documents... */
+               /* not UCLYhndl_HTFile_for_unspec - we are talking about remote 
documents... */
        }
        CTRACE(tfp, "  Content type is \"%s\"\n", format->name);

@@ -6240,6 +6240,19 @@

        CTRACE(tfp, "Reparsing from source memory cache %p\n",
               (void *)HTMainText->source_cache_chunk);
+
+       /*
+        * This only done to make things aligned with SOURCE_CACHE_NONE
+        * and SOURCE_CACHE_FILE when switching to source mode
+        * since the original document's charset will be LYPushAssumed()
+        * and then LYPopAssumed().
+        * See LYK_SOURCE in mainloop if change something here.
+        * No user-visible benefits, seems just '=' Info Page will show
+        * source's effective charset as "(assumed)".
+        */
+       format = HTCharsetFormat(format, HTMainText->node_anchor,
+                                            UCLYhndl_for_unspec);
+           /* not UCLYhndl_HTFile_for_unspec - we are talking about remote 
documents... */

        /*
         * Pass the source cache HTChunk on to the next HText.  Clear it
diff -u old/lymainlo.c ./lymainlo.c
--- old/lymainlo.c      Tue May 18 09:58:06 1999
+++ ./lymainlo.c        Thu May 20 12:14:58 1999
@@ -1231,10 +1231,6 @@
             */
            curdoc.line = -1;

-           /*
-            * I have no idea what this does, but it seems to be necessary... 
-dsb
-            */
-           LYUCPopAssumed();
        }
 #endif

@@ -1861,30 +1857,25 @@
                break;
            }

-
-#ifndef USE_PSRC
-           if (HTisDocumentSource()) {
-               HTOutputFormat = WWW_PRESENT;
-           } else {
-               if (HText_getOwner())
-                   StrAllocCopy(ownerS_address, HText_getOwner());
-               LYUCPushAssumed(HTMainAnchor);
-               HTOutputFormat = WWW_SOURCE;
-           }
-#else
            if (HTisDocumentSource()) {
                HTOutputFormat = WWW_PRESENT;
+#ifdef USE_PSRC
                psrc_view = FALSE;
+#endif
            } else {
                if (HText_getOwner())
                    StrAllocCopy(ownerS_address, HText_getOwner());
                LYUCPushAssumed(HTMainAnchor);
+#ifdef USE_PSRC
                if (LYpsrc)
                    psrc_view = TRUE;
                else
                    HTOutputFormat = WWW_SOURCE;
            }
+#else
+               HTOutputFormat = WWW_SOURCE;
 #endif
+
 #ifdef SOURCE_CACHE
            if (HTreparse_document()) {
                /*
@@ -1898,9 +1889,14 @@
                    HTMark_asSource();
                psrc_view = FALSE;
 #endif
+               FREE(ownerS_address);   /* not used with source_cache */
+               LYUCPopAssumed();  /* probably a right place here */
+               HTMLSetCharacterHandling(current_char_set);  /* restore now */
+
                break;
            }
 #endif
+
            FREE(curdoc.address); /* so it doesn't get pushed */
            LYforce_no_cache = TRUE;
            break;




reply via email to

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