[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: lynx-dev PSRC & source mode: chartrans stages problem
From: |
Vlad Harchev |
Subject: |
Re: lynx-dev PSRC & source mode: chartrans stages problem |
Date: |
Thu, 20 May 1999 09:16:02 +0500 (SAMST) |
On Thu, 20 May 1999, Leonid Pauzner wrote:
> Experiment with 2.8.2dev4 -
>
> load an html file with META charset and switch "\" to source mode.
> Now press ^R to reload:
>
> (1) In -prettysrc case you got a broken document
> (charset will be assumed by lynx from assume_charset or assume_local_charset,
> not from a META charset which was previously pushed with LYPushAssumed()
> so you got a problem with 8bit documents when assume_charset != META charset).
>
> (2) Without -prettysrc you got a document handled properly
> via META charset assumption. Now if you press ^R again
> you will got a broken document.
>
This patch fixes both problems. It's to pre3, but it should succeed on pre5.
It should solve problems even if lynx compiled without USE_PSRC (not tested).
Best regards,
-Vlad
diff -ruP -entation/HTFile.c 2.8.2p3-fixed/WWW/Library/Implementation/HTFile.c
--- lynx-2.8.2p3-orig/WWW/Library/Implementation/HTFile.c Sun May 16
16:11:37 1999
+++ 2.8.2p3-fixed/WWW/Library/Implementation/HTFile.c Thu May 20 09:05:05 1999
@@ -1910,6 +1910,13 @@
format = HTAtom_for(anchor->content_type);
myEncoding = HTAtom_for(anchor->content_encoding);
} else {
+ int default_UCLYhndl=UCLYhndl_HTFile_for_unspec;
+
+ if (force_old_UCLYhndl_on_reload) {
+ force_old_UCLYhndl_on_reload=FALSE;
+ default_UCLYhndl=forced_UCLYhdnl;
+ };
+
format = HTFileFormat(filename, &myEncoding, NULL);
/*
@@ -1918,7 +1925,7 @@
** by the last parameter (fallback will effectively be
** UCLYhndl_for_unspec, by default ISO-8859-1). - kw
*/
- format = HTCharsetFormat(format, anchor, UCLYhndl_HTFile_for_unspec);
+ format = HTCharsetFormat(format, anchor, default_UCLYhndl );
}
#ifdef VMS
diff -ruP lynx-2.8.2pre3-orig/src/GridText.c 2.8.2p3-fixed/src/GridText.c
--- lynx-2.8.2pre3-orig/src/GridText.c Sun May 16 16:11:38 1999
+++ 2.8.2p3-fixed/src/GridText.c Thu May 20 09:09:10 1999
@@ -10752,3 +10752,8 @@
HTMainText->source = TRUE;
}
#endif
+
+PUBLIC int HTMainText_Get_UCLYhndl NOARGS
+{
+ return (HTMainText ? HTMainText->node_anchor->UCStages->s[0].C.UChndl :0);
+}
diff -ruP lynx-2.8.2pre3-orig/src/GridText.h 2.8.2p3-fixed/src/GridText.h
--- lynx-2.8.2pre3-orig/src/GridText.h Wed Apr 28 18:37:48 1999
+++ 2.8.2p3-fixed/src/GridText.h Thu May 20 08:52:10 1999
@@ -283,4 +283,6 @@
extern void HTMark_asSource NOPARAMS;
#endif
+extern int HTMainText_Get_UCLYhndl NOPARAMS;
+
#endif /* LYGRIDTEXT_H */
diff -ruP lynx-2.8.2pre3-orig/src/LYCharSets.c 2.8.2p3-fixed/src/LYCharSets.c
--- lynx-2.8.2pre3-orig/src/LYCharSets.c Wed Apr 28 18:37:49 1999
+++ 2.8.2p3-fixed/src/LYCharSets.c Thu May 20 09:06:44 1999
@@ -21,6 +21,8 @@
PUBLIC HTkcode kanji_code = NOKANJI;
PUBLIC BOOLEAN LYHaveCJKCharacterSet = FALSE;
PUBLIC BOOLEAN DisplayCharsetMatchLocale = TRUE;
+PUBLIC BOOL force_old_UCLYhndl_on_reload;
+PUBLIC int forced_UCLYhdnl;
extern void UCInit NOARGS;
extern int UCInitialized;
PUBLIC int LYNumCharsets = 0; /* Will be initialized later by UC_Register. */
diff -ruP lynx-2.8.2pre3-orig/src/LYCharSets.h 2.8.2p3-fixed/src/LYCharSets.h
--- lynx-2.8.2pre3-orig/src/LYCharSets.h Sun May 16 16:11:39 1999
+++ 2.8.2p3-fixed/src/LYCharSets.h Thu May 20 09:06:35 1999
@@ -49,4 +49,6 @@
*/
+extern BOOL force_old_UCLYhndl_on_reload;
+extern int forced_UCLYhdnl;
#endif /* LYCHARSETS_H */
diff -ruP lynx-2.8.2pre3-orig/src/LYMainLoop.c 2.8.2p3-fixed/src/LYMainLoop.c
--- lynx-2.8.2pre3-orig/src/LYMainLoop.c Sun May 16 16:11:40 1999
+++ 2.8.2p3-fixed/src/LYMainLoop.c Thu May 20 09:05:58 1999
@@ -1959,6 +1959,8 @@
*/
if (HTisDocumentSource()) {
+ force_old_UCLYhndl_on_reload=TRUE;
+ forced_UCLYhdnl=HTMainText_Get_UCLYhndl();
#ifndef USE_PSRC
HTOutputFormat = WWW_SOURCE;
#else