about summary refs log tree commit diff stats
path: root/src/LYPrint.c
diff options
context:
space:
mode:
authorThomas E. Dickey <dickey@invisible-island.net>2014-02-03 00:34:01 -0500
committerThomas E. Dickey <dickey@invisible-island.net>2014-02-03 00:34:01 -0500
commitf25ab35dfce8d5620abc2a9b58594ba39d87ca21 (patch)
tree2d243ab3e3e85d20479a91d2a3e5c40f80b144b7 /src/LYPrint.c
parent3ab0f2b5217368844a5044f8155d7026b60b75e4 (diff)
downloadlynx-snapshots-f25ab35dfce8d5620abc2a9b58594ba39d87ca21.tar.gz
snapshot of project "lynx", label v2-8-8pre_3b
Diffstat (limited to 'src/LYPrint.c')
-rw-r--r--src/LYPrint.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/LYPrint.c b/src/LYPrint.c
index 781eca02..c68faeda 100644
--- a/src/LYPrint.c
+++ b/src/LYPrint.c
@@ -1,5 +1,5 @@
 /*
- * $LynxId: LYPrint.c,v 1.102 2013/11/28 11:21:09 tom Exp $
+ * $LynxId: LYPrint.c,v 1.103 2014/02/03 00:17:07 tom Exp $
  */
 #include <HTUtils.h>
 #include <HTAccess.h>
@@ -137,16 +137,18 @@ static void SetupFilename(bstring **filename,
 {
     HTFormat format;
     HTAtom *encoding;
+    char *cp;
 
     BStrCopy0(*filename, sug_filename);		/* add suggestion info */
     BStrAlloc(*filename, LY_MAXPATH);	/* FIXME */
     change_sug_filename((*filename)->str);
     if (!(HTisDocumentSource())
-	&& strrchr((*filename)->str, '.') != NULL) {
+	&& (cp = strrchr((*filename)->str, '.')) != NULL) {
 	format = HTFileFormat((*filename)->str, &encoding, NULL);
 	CTRACE((tfp, "... format %s\n", format->name));
 	if (!strcasecomp(format->name, "text/html") ||
 	    !IsUnityEnc(encoding)) {
+	    (*filename)->len = (cp - (*filename)->str);
 	    BStrCat0(*filename, TEXT_SUFFIX);
 	}
     }
@@ -181,7 +183,7 @@ static int RecallFilename(bstring **filename,
     recall = ((*total >= 1) ? RECALL_URL : NORECALL);
 
     if ((ch = LYgetBString(filename, FALSE, 0, recall)) < 0 ||
-	*filename == '\0' || ch == UPARROW_KEY || ch == DNARROW_KEY) {
+	isBEmpty(*filename) || ch == UPARROW_KEY || ch == DNARROW_KEY) {
 	if (recall && ch == UPARROW_KEY) {
 	    if (*first) {
 		*first = FALSE;