about summary refs log tree commit diff stats
path: root/src
diff options
context:
space:
mode:
authorThomas E. Dickey <dickey@invisible-island.net>1999-05-24 19:10:08 -0400
committerThomas E. Dickey <dickey@invisible-island.net>1999-05-24 19:10:08 -0400
commit46aabf47e7a5156ccee95d9ed587de6a71e4c603 (patch)
treeadcf859049fd4f8820ae55f074e0e4c4b120001f /src
parent479f8d01393c541fede1688676f860bb49d44668 (diff)
downloadlynx-snapshots-46aabf47e7a5156ccee95d9ed587de6a71e4c603.tar.gz
snapshot of project "lynx", label v2-8-2pre_6
Diffstat (limited to 'src')
-rw-r--r--src/GridText.c21
-rw-r--r--src/GridText.h2
-rw-r--r--src/HTAlert.c14
-rw-r--r--src/HTFWriter.c2
-rw-r--r--src/LYCgi.c1
-rw-r--r--src/LYCharSets.c2
-rw-r--r--src/LYCharSets.h2
-rw-r--r--src/LYCurses.c7
-rw-r--r--src/LYMainLoop.c50
9 files changed, 64 insertions, 37 deletions
diff --git a/src/GridText.c b/src/GridText.c
index 3ce36bb3..b0e3238b 100644
--- a/src/GridText.c
+++ b/src/GridText.c
@@ -6195,7 +6195,9 @@ PUBLIC BOOLEAN HTreparse_document NOARGS
 	    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);
 
@@ -6242,6 +6244,18 @@ PUBLIC BOOLEAN HTreparse_document NOARGS
 	       (void *)HTMainText->source_cache_chunk);
 
 	/*
+	 * This is 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 you 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
 	 * here so that it won't get deleted by HText_free().
 	 */
@@ -10752,3 +10766,8 @@ PUBLIC void HTMark_asSource NOARGS
         HTMainText->source = TRUE;
 }
 #endif
+
+PUBLIC int HTMainText_Get_UCLYhndl NOARGS
+{
+    return (HTMainText ? HTMainText->node_anchor->UCStages->s[0].C.UChndl : 0);
+}
diff --git a/src/GridText.h b/src/GridText.h
index a25ed496..f82dd2d2 100644
--- a/src/GridText.h
+++ b/src/GridText.h
@@ -283,4 +283,6 @@ extern void redraw_lines_of_link PARAMS((int cur));
 extern void HTMark_asSource NOPARAMS;
 #endif
 
+extern int HTMainText_Get_UCLYhndl NOPARAMS;
+
 #endif /* LYGRIDTEXT_H */
diff --git a/src/HTAlert.c b/src/HTAlert.c
index 205dc82c..d16b2665 100644
--- a/src/HTAlert.c
+++ b/src/HTAlert.c
@@ -111,8 +111,8 @@ PUBLIC void HTProgress ARGS1(
 	CONST char *,	Msg)
 {
     statusline(Msg);
-    LYstore_message(Msg); 
-    CTRACE(tfp, "%s\n", Msg); 
+    LYstore_message(Msg);
+    CTRACE(tfp, "%s\n", Msg);
 }
 
 /*	Issue a read-progress message.			HTReadProgress()
@@ -178,12 +178,10 @@ PUBLIC void HTReadProgress ARGS2(
 		if (total < -1)
 		    strcat(line, gettext(" (Press 'z' to abort)"));
 	    }
- 
-	    /* do not store the message for history page. */ 
-	    if (TRACE) 
-		fprintf(tfp, "%s\n", line); 
-	    else 
-		statusline(line); 
+
+	    /* do not store the message for history page. */
+	    statusline(line);
+	    CTRACE(tfp, "%s\n", line);
 	}
     }
 }
diff --git a/src/HTFWriter.c b/src/HTFWriter.c
index 60b710f6..28a4d1b5 100644
--- a/src/HTFWriter.c
+++ b/src/HTFWriter.c
@@ -31,7 +31,7 @@
 PUBLIC char * WWW_Download_File=NULL; /* contains the name of the temp file
 				      ** which is being downloaded into
 				      */
-PUBLIC char LYCancelDownload=FALSE;   /* exported to HTFormat.c in libWWW */
+PUBLIC BOOLEAN LYCancelDownload=FALSE;   /* exported to HTFormat.c in libWWW */
 
 #ifdef VMS
 PRIVATE char * FIXED_RECORD_COMMAND = NULL;
diff --git a/src/LYCgi.c b/src/LYCgi.c
index a28725bb..9e0bfce0 100644
--- a/src/LYCgi.c
+++ b/src/LYCgi.c
@@ -380,6 +380,7 @@ PRIVATE int LYLoadCGI ARGS4(
 	    }
 	    fflush(stdout);
 	    fflush(stderr);
+	    CTRACE_FLUSH(tfp);
 
 	    if ((pid = fork()) > 0) { /* The good, */
 		int chars, total_chars;
diff --git a/src/LYCharSets.c b/src/LYCharSets.c
index 837f4d9a..e58cc37e 100644
--- a/src/LYCharSets.c
+++ b/src/LYCharSets.c
@@ -21,6 +21,8 @@ extern HTCJKlang HTCJK;
 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 --git a/src/LYCharSets.h b/src/LYCharSets.h
index 5d35ee40..1f21db0f 100644
--- a/src/LYCharSets.h
+++ b/src/LYCharSets.h
@@ -49,4 +49,6 @@ extern CONST char * HTMLGetEntityName PARAMS((UCode_t code));
 		*/
 
 
+extern BOOL force_old_UCLYhndl_on_reload;
+extern int forced_UCLYhdnl;
 #endif /* LYCHARSETS_H */
diff --git a/src/LYCurses.c b/src/LYCurses.c
index a8a8c641..c6c08a2e 100644
--- a/src/LYCurses.c
+++ b/src/LYCurses.c
@@ -657,6 +657,7 @@ PUBLIC void start_curses NOARGS
 	sock_init();
 
     LYCursesON = TRUE;
+    CTRACE(tfp, "start_curses: done.\n");
     clear();
     noecho();
 }
@@ -670,8 +671,10 @@ PUBLIC void start_curses NOARGS
 #ifdef USE_SLANG
     static int slinit;
 
-    if (LYCursesON)
+    if (LYCursesON) {
+	CTRACE(tfp, "start_curses: Hmm, already ON.\n");
 	return;
+    }
 
     if (slinit == 0) {
 	SLtt_get_terminfo();
@@ -871,6 +874,7 @@ PUBLIC void start_curses NOARGS
 #endif
 
     LYCursesON = TRUE;
+    CTRACE(tfp, "start_curses: done.\n");
 }
 
 
@@ -960,6 +964,7 @@ PUBLIC void stop_curses NOARGS
     fflush(stderr);
 
     LYCursesON = FALSE;
+    CTRACE(tfp, "stop_curses: done.\n");
 
 #if defined(SIGTSTP) && defined(USE_SLANG)
 #ifndef VMS
diff --git a/src/LYMainLoop.c b/src/LYMainLoop.c
index 385dd714..1ddee54e 100644
--- a/src/LYMainLoop.c
+++ b/src/LYMainLoop.c
@@ -1231,10 +1231,6 @@ try_again:
 	     */
 	    curdoc.line = -1;
 
-	    /*
-	     * I have no idea what this does, but it seems to be necessary... -dsb
-	     */
-	    LYUCPopAssumed();
 	}
 #endif
 
@@ -1861,46 +1857,46 @@ new_cmd:  /*
 		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()) {
-		/*
-		 * These normally get cleaned up after getfile() returns;
-		 * since we're not calling getfile(), we have to clean them
-		 * up ourselves.  -dsb
-		 */
-		HTOutputFormat = WWW_PRESENT;
+			/*
+			 * These normally get cleaned up after getfile() returns;
+			 * since we're not calling getfile(), we have to clean them
+			 * up ourselves.  -dsb
+			 */
+			HTOutputFormat = WWW_PRESENT;
 #ifdef USE_PSRC
-		if (psrc_view)
-		    HTMark_asSource();
-		psrc_view = FALSE;
+			if (psrc_view)
+				HTMark_asSource();
+			psrc_view = FALSE;
 #endif
-		break;
+			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;
@@ -1922,6 +1918,8 @@ new_cmd:  /*
 	     */
 
 	    if (HTisDocumentSource()) {
+		force_old_UCLYhndl_on_reload = TRUE;
+		forced_UCLYhdnl = HTMainText_Get_UCLYhndl();
 #ifndef USE_PSRC
 		HTOutputFormat = WWW_SOURCE;
 #else