about summary refs log tree commit diff stats
path: root/src
diff options
context:
space:
mode:
authorThomas E. Dickey <dickey@invisible-island.net>2013-05-02 11:09:30 -0400
committerThomas E. Dickey <dickey@invisible-island.net>2013-05-02 11:09:30 -0400
commit844a17014bd45706a13ee5318b36a56fbcf6924c (patch)
tree1f6fbe9df293ae7e477671384c5a69a195e15b26 /src
parent81905f18dc0594e372cf38cfb0e0b71b69849a43 (diff)
downloadlynx-snapshots-844a17014bd45706a13ee5318b36a56fbcf6924c.tar.gz
snapshot of project "lynx", label v2-8-8dev-15c
Diffstat (limited to 'src')
-rw-r--r--src/GridText.c32
-rw-r--r--src/HTFWriter.c18
-rw-r--r--src/HTInit.c4
-rw-r--r--src/HTML.c22
-rw-r--r--src/LYBookmark.c16
-rw-r--r--src/LYCharUtils.c18
-rw-r--r--src/LYForms.c6
-rw-r--r--src/LYLocal.c4
-rw-r--r--src/LYMail.c4
-rw-r--r--src/LYMain.c6
-rw-r--r--src/LYNews.c4
-rw-r--r--src/LYUtils.c54
-rw-r--r--src/tidy_tls.c4
13 files changed, 98 insertions, 94 deletions
diff --git a/src/GridText.c b/src/GridText.c
index 1ba334b2..07814a06 100644
--- a/src/GridText.c
+++ b/src/GridText.c
@@ -1,5 +1,5 @@
 /*
- * $LynxId: GridText.c,v 1.252 2013/05/01 00:43:19 tom Exp $
+ * $LynxId: GridText.c,v 1.255 2013/05/02 10:47:41 tom Exp $
  *
  *		Character grid hypertext object
  *		===============================
@@ -8846,7 +8846,7 @@ BOOLEAN HTreparse_document(void)
 	fp = fopen(HTMainAnchor->source_cache_file, "r");
 	if (!fp) {
 	    CTRACE((tfp, "  Cannot read file %s\n", HTMainAnchor->source_cache_file));
-	    LYRemoveTemp(HTMainAnchor->source_cache_file);
+	    (void) LYRemoveTemp(HTMainAnchor->source_cache_file);
 	    FREE(HTMainAnchor->source_cache_file);
 	} else {
 
@@ -11136,14 +11136,21 @@ int HText_SubmitForm(FormInfo * submit_item, DocInfo *doc,
 	assert(my_data != NULL);
     }
 
-    if (target_csname == NULL && target_cs >= 0) {
-	if ((form_is_special & SPECIAL_8BIT) != 0) {
-	    target_csname = LYCharSet_UC[target_cs].MIMEname;
-	} else if ((form_is_special & SPECIAL_FORM) != 0) {
-	    target_csname = LYCharSet_UC[target_cs].MIMEname;
+    if (target_csname == NULL) {
+	if (target_cs >= 0) {
+	    if ((form_is_special & SPECIAL_8BIT) != 0) {
+		target_csname = LYCharSet_UC[target_cs].MIMEname;
+	    } else if ((form_is_special & SPECIAL_FORM) != 0) {
+		target_csname = LYCharSet_UC[target_cs].MIMEname;
+	    } else {
+		target_csname = "us-ascii";
+	    }
 	} else {
 	    target_csname = "us-ascii";
+	    target_cs = UCLYhndl_for_unspec;	/* always >= 0 */
 	}
+    } else if (target_cs < 0) {
+	target_cs = UCLYhndl_for_unspec;	/* always >= 0 */
     }
 
     if (submit_item->submit_method == URL_GET_METHOD && Boundary == NULL) {
@@ -13292,7 +13299,7 @@ int HText_EditTextArea(LinkInfo * form_link)
 
 	    CTRACE((tfp, "GridText: exiting HText_EditTextArea()\n"));
 	}
-	LYRemoveTemp(ed_temp);
+	(void) LYRemoveTemp(ed_temp);
 	FREE(ed_temp);
     }
 
@@ -13358,7 +13365,7 @@ void HText_EditTextField(LinkInfo * form_link)
 	}
     }
 
-    LYRemoveTemp(ed_temp);
+    (void) LYRemoveTemp(ed_temp);
     FREE(ed_temp);
 
     CTRACE((tfp, "GridText: exiting HText_EditTextField()\n"));
@@ -14566,9 +14573,12 @@ void redraw_lines_of_link(int cur)
 	 row <= display_lines && (text = LYGetHiliteStr(cur, count)) != NULL;
 	 ++count) {
 	col = LYGetHilitePos(cur, count);
-	LYmove(row++, col);
-	redraw_part_of_line(todr1, text, (int) strlen(text), HTMainText);
+	if (col >= 0) {
+	    LYmove(row, col);
+	    redraw_part_of_line(todr1, text, (int) strlen(text), HTMainText);
+	}
 	todr1 = todr1->next;
+	row++;
     }
 #undef pvtTITLE_HEIGHT
     return;
diff --git a/src/HTFWriter.c b/src/HTFWriter.c
index dedb7bfa..6cdc8edd 100644
--- a/src/HTFWriter.c
+++ b/src/HTFWriter.c
@@ -1,5 +1,5 @@
 /*
- * $LynxId: HTFWriter.c,v 1.100 2012/08/15 23:25:33 tom Exp $
+ * $LynxId: HTFWriter.c,v 1.103 2013/05/02 11:05:53 tom Exp $
  *
  *		FILE WRITER				HTFWrite.h
  *		===========
@@ -211,7 +211,7 @@ static void HTFWriter_free(HTStream *me)
 #endif /* USE_ZLIB */
 		    {
 			path[len - 3] = '\0';
-			remove(path);
+			(void) remove(path);
 		    }
 		} else if (len > 4 && !strcasecomp(&path[len - 3], "bz2")) {
 #ifdef USE_BZLIB
@@ -221,11 +221,11 @@ static void HTFWriter_free(HTStream *me)
 #endif /* USE_BZLIB */
 		    {
 			path[len - 4] = '\0';
-			remove(path);
+			(void) remove(path);
 		    }
 		} else if (len > 2 && !strcasecomp(&path[len - 1], "Z")) {
 		    path[len - 2] = '\0';
-		    remove(path);
+		    (void) remove(path);
 		}
 		if (!use_zread) {
 		    if (!dump_output_immediately) {
@@ -251,7 +251,7 @@ static void HTFWriter_free(HTStream *me)
 			LYrefresh();
 		    }
 		    HTAlert(ERROR_UNCOMPRESSING_TEMP);
-		    LYRemoveTemp(me->anchor->FileCache);
+		    (void) LYRemoveTemp(me->anchor->FileCache);
 		    FREE(me->anchor->FileCache);
 		} else {
 		    /*
@@ -380,7 +380,7 @@ static void HTFWriter_free(HTStream *me)
 		    if (dump_output_immediately &&
 			me->output_format == HTAtom_for("www/present")) {
 			FREE(addr);
-			remove(me->anchor->FileCache);
+			(void) remove(me->anchor->FileCache);
 			FREE(me->anchor->FileCache);
 			FREE(me->remove_command);
 			FREE(me->end_command);
@@ -454,7 +454,7 @@ static void HTFWriter_free(HTStream *me)
 
     if (dump_output_immediately) {
 	if (me->anchor->FileCache)
-	    remove(me->anchor->FileCache);
+	    (void) remove(me->anchor->FileCache);
 	FREE(me);
 #ifdef USE_PERSISTENT_COOKIES
 	/*
@@ -491,7 +491,7 @@ static void HTFWriter_abort(HTStream *me, HTError e GCC_UNUSED)
 #ifdef VMS
 	    LYSystem(me->remove_command);
 #else
-	    chmod(me->remove_command, 0600);	/* Ignore errors */
+	    (void) chmod(me->remove_command, 0600);	/* Ignore errors */
 	    if (0 != unlink(me->remove_command)) {
 		char buf[560];
 
@@ -1145,7 +1145,7 @@ HTStream *HTCompressed(HTPresentation *pres,
      * Remove any old versions of the file.  - FM
      */
     if (anchor->FileCache) {
-	LYRemoveTemp(anchor->FileCache);
+	(void) LYRemoveTemp(anchor->FileCache);
 	FREE(anchor->FileCache);
     }
 
diff --git a/src/HTInit.c b/src/HTInit.c
index 6dbed814..e03a6d4b 100644
--- a/src/HTInit.c
+++ b/src/HTInit.c
@@ -1,5 +1,5 @@
 /*
- * $LynxId: HTInit.c,v 1.78 2013/01/04 21:44:57 tom Exp $
+ * $LynxId: HTInit.c,v 1.79 2013/05/02 11:04:48 tom Exp $
  *
  *		Configuration-specific Initialization		HTInit.c
  *		----------------------------------------
@@ -779,7 +779,7 @@ int LYTestMailcapCommand(const char *testcommand,
     }
 
     HTChunkFree(expanded);
-    LYRemoveTemp(TmpFileName);
+    (void) LYRemoveTemp(TmpFileName);
 
     return result;
 }
diff --git a/src/HTML.c b/src/HTML.c
index f6b8ead9..11cdf936 100644
--- a/src/HTML.c
+++ b/src/HTML.c
@@ -1,5 +1,5 @@
 /*
- * $LynxId: HTML.c,v 1.156 2013/04/30 22:13:50 tom Exp $
+ * $LynxId: HTML.c,v 1.159 2013/05/02 11:03:41 tom Exp $
  *
  *		Structured stream to Rich hypertext converter
  *		============================================
@@ -484,13 +484,6 @@ void HTML_put_character(HTStructured * me, int c)
 
     if (c == '\n' || c == '\t') {
 	HText_setLastChar(me->text, ' ');	/* set it to a generic separator */
-
-	/*
-	 * \r's are ignored.  In order to keep collapsing spaces correctly we
-	 * must default back to the previous separator if there was one.
-	 */
-    } else if (c == '\r' && HText_getLastChar(me->text) == ' ') {
-	HText_setLastChar(me->text, ' ');	/* set it to a generic separator */
     } else {
 	HText_setLastChar(me->text, c);
     }
@@ -724,11 +717,12 @@ void HTML_write(HTStructured * me, const char *s, int l)
    locally here, don't confuse with LYinternal_flag which is for
    overriding non-caching similar to LYoverride_no_cache. - kw */
 #define CHECK_FOR_INTERN(flag,s) \
-   	flag = (BOOLEAN) ((s && (*s=='#' || *s=='\0')) ? TRUE : FALSE)
+   	flag = (BOOLEAN) (((s) && (*(s)=='#' || *(s)=='\0')) ? TRUE : FALSE)
 
 /* Last argument to pass to HTAnchor_findChildAndLink() calls,
    just an abbreviation. - kw */
-#define INTERN_LT (HTLinkType *)(intern_flag ? HTInternalLink : NULL)
+#define INTERN_CHK(flag) (HTLinkType *)((flag) ? HTInternalLink : NULL)
+#define INTERN_LT         INTERN_CHK(intern_flag)
 
 #ifdef USE_COLOR_STYLE
 static char *Style_className = 0;
@@ -891,7 +885,7 @@ static void LYHandleFIG(HTStructured * me, const BOOL *present,
 		me->CurrentA = HTAnchor_findChildAndLink(me->node_anchor,	/* Parent */
 							 NULL,	/* Tag */
 							 href,	/* Addresss */
-							 INTERN_LT);	/* Type */
+							 INTERN_CHK(*intern_flag));	/* Type */
 		HText_beginAnchor(me->text, me->inUnderline, me->CurrentA);
 		if (me->inBoldH == FALSE)
 		    HText_appendCharacter(me->text, LY_BOLD_START_CHAR);
@@ -7841,7 +7835,7 @@ static void CacheThru_do_free(HTStream *me)
     if (me->anchor->source_cache_file) {
 	CTRACE((tfp, "SourceCacheWriter: Removing previous file %s\n",
 		me->anchor->source_cache_file));
-	LYRemoveTemp(me->anchor->source_cache_file);
+	(void) LYRemoveTemp(me->anchor->source_cache_file);
 	FREE(me->anchor->source_cache_file);
     }
     if (me->anchor->source_cache_chunk) {
@@ -7869,7 +7863,7 @@ static void CacheThru_do_free(HTStream *me)
 		HTAlert(gettext("Source cache error - disk full?"));
 		source_cache_file_error = TRUE;
 	    }
-	    LYRemoveTemp(me->filename);
+	    (void) LYRemoveTemp(me->filename);
 	    me->anchor->source_cache_file = NULL;
 	}
     } else if (me->status != HT_OK) {
@@ -7908,7 +7902,7 @@ static void CacheThru_abort(HTStream *me, HTError e)
 	if (me->filename) {
 	    CTRACE((tfp, "SourceCacheWriter: Removing active file %s\n",
 		    me->filename));
-	    LYRemoveTemp(me->filename);
+	    (void) LYRemoveTemp(me->filename);
 	    FREE(me->filename);
 	}
 	if (me->chunk) {
diff --git a/src/LYBookmark.c b/src/LYBookmark.c
index 481533b9..6b79f298 100644
--- a/src/LYBookmark.c
+++ b/src/LYBookmark.c
@@ -1,5 +1,5 @@
 /*
- * $LynxId: LYBookmark.c,v 1.72 2013/01/04 21:05:08 tom Exp $
+ * $LynxId: LYBookmark.c,v 1.74 2013/05/02 10:43:29 tom Exp $
  */
 #include <HTUtils.h>
 #include <HTAlert.h>
@@ -153,7 +153,7 @@ static const char *convert_mosaic_bookmark_file(const char *filename_buffer)
     char *buf = NULL;
     int line = -2;
 
-    LYRemoveTemp(newfile);
+    (void) LYRemoveTemp(newfile);
     if ((nfp = LYOpenTemp(newfile, HTML_SUFFIX, "w")) == NULL) {
 	LYMBM_statusline(NO_TEMP_FOR_HOTLIST);
 	LYSleepAlert();
@@ -321,8 +321,10 @@ void save_bookmark_link(const char *address,
 	have8bit(Title) && (!LYHaveCJKCharacterSet)) {
 	char *p = title_convert8bit(Title);
 
-	FREE(Title);
-	Title = p;
+	if (p != 0) {
+	    FREE(Title);
+	    Title = p;
+	}
     }
 
     /*
@@ -600,7 +602,7 @@ void remove_bookmark_link(int cur,
      */
     if (!regular) {
 	if (LYCopyFile(newfile, filename_buffer) == 0) {
-	    LYRemoveTemp(newfile);
+	    (void) LYRemoveTemp(newfile);
 	    return;
 	}
 	LYSleepAlert();		/* give a chance to see error from cp - kw */
@@ -682,7 +684,7 @@ void remove_bookmark_link(int cur,
 	HTUserMsg2(gettext("File may be recoverable from %s during this session"),
 		   newfile);
     } else {
-	LYRemoveTemp(newfile);
+	(void) LYRemoveTemp(newfile);
     }
 }
 
@@ -1063,7 +1065,7 @@ static char *title_convert8bit(const char *Title)
 	if (UCH(*temp) <= 127) {
 	    StrAllocCat(comment, temp);
 	    StrAllocCat(ncr, temp);
-	} else {
+	} else if (charset_out >= 0) {
 	    long unicode;
 	    char replace_buf[32];
 
diff --git a/src/LYCharUtils.c b/src/LYCharUtils.c
index 42e86003..9b21aae2 100644
--- a/src/LYCharUtils.c
+++ b/src/LYCharUtils.c
@@ -1,5 +1,5 @@
 /*
- * $LynxId: LYCharUtils.c,v 1.118 2013/04/30 22:16:02 tom Exp $
+ * $LynxId: LYCharUtils.c,v 1.120 2013/05/02 00:17:41 tom Exp $
  *
  *  Functions associated with LYCharSets.c and the Lynx version of HTML.c - FM
  *  ==========================================================================
@@ -746,10 +746,6 @@ char *LYUppercaseI_OL_String(int seqnum)
     if (Arabic >= 500) {
 	strcat(OLstring, "D");
 	Arabic -= 500;
-	while (Arabic >= 500) {
-	    strcat(OLstring, "C");
-	    Arabic -= 10;
-	}
     }
 
     if (Arabic >= 400) {
@@ -770,10 +766,6 @@ char *LYUppercaseI_OL_String(int seqnum)
     if (Arabic >= 50) {
 	strcat(OLstring, "L");
 	Arabic -= 50;
-	while (Arabic >= 50) {
-	    strcat(OLstring, "X");
-	    Arabic -= 10;
-	}
     }
 
     if (Arabic >= 40) {
@@ -880,10 +872,6 @@ char *LYLowercaseI_OL_String(int seqnum)
     if (Arabic >= 500) {
 	strcat(OLstring, "d");
 	Arabic -= 500;
-	while (Arabic >= 500) {
-	    strcat(OLstring, "c");
-	    Arabic -= 10;
-	}
     }
 
     if (Arabic >= 400) {
@@ -904,10 +892,6 @@ char *LYLowercaseI_OL_String(int seqnum)
     if (Arabic >= 50) {
 	strcat(OLstring, "l");
 	Arabic -= 50;
-	while (Arabic >= 50) {
-	    strcat(OLstring, "x");
-	    Arabic -= 10;
-	}
     }
 
     if (Arabic >= 40) {
diff --git a/src/LYForms.c b/src/LYForms.c
index 75492637..19b15a2f 100644
--- a/src/LYForms.c
+++ b/src/LYForms.c
@@ -1,4 +1,4 @@
-/* $LynxId: LYForms.c,v 1.101 2013/01/04 21:50:03 tom Exp $ */
+/* $LynxId: LYForms.c,v 1.102 2013/05/01 09:19:14 tom Exp $ */
 #include <HTUtils.h>
 #include <HTCJK.h>
 #include <HTTP.h>
@@ -387,6 +387,10 @@ static int form_getstr(int cur,
      * Get the initial position of the cursor.
      */
     LYGetYX(startline, startcol);
+    if (startline < 0)
+	startline = 0;
+    if (startcol < 0)
+	startcol = 0;
     if ((startcol + form->size) > LYcolLimit)
 	far_col = LYcolLimit;
     else
diff --git a/src/LYLocal.c b/src/LYLocal.c
index 3cfd5d0c..181ed7c1 100644
--- a/src/LYLocal.c
+++ b/src/LYLocal.c
@@ -1,5 +1,5 @@
 /*
- * $LynxId: LYLocal.c,v 1.123 2013/04/30 08:51:14 tom Exp $
+ * $LynxId: LYLocal.c,v 1.124 2013/05/02 10:42:28 tom Exp $
  *
  *  Routines to manipulate the local filesystem.
  *  Written by: Rick Mallett, Carleton University
@@ -1371,7 +1371,7 @@ static int permit_location(char *destpath,
 
 	user_filename = LYPathLeaf(srcpath);
 
-	LYRemoveTemp(tempfile);
+	(void) LYRemoveTemp(tempfile);
 	if ((fp0 = LYOpenTemp(tempfile, HTML_SUFFIX, "w")) == NULL) {
 	    HTAlert(gettext("Unable to open permit options file"));
 	    return (code);
diff --git a/src/LYMail.c b/src/LYMail.c
index 8e8bc81f..55115e00 100644
--- a/src/LYMail.c
+++ b/src/LYMail.c
@@ -1,5 +1,5 @@
 /*
- * $LynxId: LYMail.c,v 1.90 2012/07/07 13:48:13 tom Exp $
+ * $LynxId: LYMail.c,v 1.91 2013/05/02 11:02:26 tom Exp $
  */
 #include <HTUtils.h>
 #include <HTParse.h>
@@ -992,7 +992,7 @@ void mailmsg(int cur,
 	    }
 	}
 
-	convert_explorer(address);
+	(void) convert_explorer(address);
 
 	/*
 	 * Unescape the address field.  - FM
diff --git a/src/LYMain.c b/src/LYMain.c
index 75e84d63..02917d55 100644
--- a/src/LYMain.c
+++ b/src/LYMain.c
@@ -1,5 +1,5 @@
 /*
- * $LynxId: LYMain.c,v 1.240 2013/04/30 09:52:15 tom Exp $
+ * $LynxId: LYMain.c,v 1.241 2013/05/02 10:41:09 tom Exp $
  */
 #include <HTUtils.h>
 #include <HTTP.h>
@@ -2352,7 +2352,7 @@ void reload_read_cfg(void)
     }
     if (!save_rc(rcfp)) {
 	HTAlwaysAlert(NULL, OPTIONS_NOT_SAVED);
-	LYRemoveTemp(tempfile);
+	(void) LYRemoveTemp(tempfile);
 	FREE(tempfile);
 	return;			/* can not write the very own file :( */
     } {
@@ -2393,7 +2393,7 @@ void reload_read_cfg(void)
 	 */
 	rcfp = fopen(tempfile, "r");
 	read_rc(rcfp);
-	LYRemoveTemp(tempfile);
+	(void) LYRemoveTemp(tempfile);
 	FREE(tempfile);		/* done with it - kw */
 
 #ifdef USE_CHARSET_CHOICE
diff --git a/src/LYNews.c b/src/LYNews.c
index df4139d5..630925d0 100644
--- a/src/LYNews.c
+++ b/src/LYNews.c
@@ -1,5 +1,5 @@
 /*
- * $LynxId: LYNews.c,v 1.57 2010/09/25 11:20:13 tom Exp $
+ * $LynxId: LYNews.c,v 1.58 2013/05/02 10:39:50 tom Exp $
  */
 #include <HTUtils.h>
 #ifndef DISABLE_NEWS
@@ -139,7 +139,7 @@ char *LYNewsPost(char *newsgroups,
 	current_char_set == UCGetLYhndl_byMIME("shift_jis")) {
 	if ((fc = LYOpenTemp(CJKfile, HTML_SUFFIX, "w")) == NULL) {
 	    HTAlert(CANNOT_OPEN_TEMP);
-	    LYRemoveTemp(my_tempfile);
+	    (void) LYRemoveTemp(my_tempfile);
 	    return (postfile);
 	}
     }
diff --git a/src/LYUtils.c b/src/LYUtils.c
index 19bf4b67..e378e4b7 100644
--- a/src/LYUtils.c
+++ b/src/LYUtils.c
@@ -1,5 +1,5 @@
 /*
- * $LynxId: LYUtils.c,v 1.230 2013/04/30 23:56:38 tom Exp $
+ * $LynxId: LYUtils.c,v 1.237 2013/05/02 11:00:14 tom Exp $
  */
 #include <HTUtils.h>
 #include <HTTCP.h>
@@ -1211,6 +1211,8 @@ void LYhighlight(int flag,
 		int row = LYP + hi_count + title_adjust;
 
 		hi_offset = LYGetHilitePos(cur, hi_count);
+		if (hi_offset < 0)
+		    continue;
 		lynx_stop_link_color(flag == TRUE, links[cur].inUnderline);
 		LYmove(row, hi_offset);
 
@@ -2817,13 +2819,16 @@ BOOLEAN LYCloseOutput(FILE *fp)
  */
 BOOLEAN LYCanWriteFile(const char *filename)
 {
+    BOOLEAN result = FALSE;
+
     if (LYCloseOutput(fopen(filename, "w"))) {
-	remove(filename);
-	return TRUE;
+	if (remove(filename) == 0) {
+	    result = TRUE;
+	}
     } else {
 	_statusline(NEW_FILENAME_PROMPT);
-	return FALSE;
     }
+    return result;
 }
 
 /*
@@ -5897,9 +5902,10 @@ static FILE *OpenHiddenFile(const char *name, const char *mode)
 	if (fd < 0
 	    && errno == EEXIST
 	    && IsOurFile(name)) {
-	    remove(name);
-	    /* FIXME: there's a race at this point if directory is open */
-	    fd = open(name, O_CREAT | O_EXCL | O_WRONLY, HIDE_CHMOD);
+	    if (remove(name) == 0) {
+		/* FIXME: there's a race at this point if directory is open */
+		fd = open(name, O_CREAT | O_EXCL | O_WRONLY, HIDE_CHMOD);
+	    }
 	}
 	if (fd >= 0) {
 #if defined(O_BINARY) && defined(__CYGWIN__)
@@ -5930,7 +5936,7 @@ static FILE *OpenHiddenFile(const char *name, const char *mode)
 
 	if (chmod(name, HIDE_CHMOD) == 0 || errno == ENOENT)
 	    fp = fopen(name, mode);
-	umask(save);
+	(void) umask(save);
     }
     return fp;
 }
@@ -5943,7 +5949,7 @@ FILE *LYNewBinFile(const char *name)
 #ifdef VMS
     FILE *fp = fopen(name, BIN_W, "mbc=32");
 
-    chmod(name, HIDE_CHMOD);
+    (void) chmod(name, HIDE_CHMOD);
 #else
     FILE *fp = OpenHiddenFile(name, BIN_W);
 #endif
@@ -5956,7 +5962,7 @@ FILE *LYNewTxtFile(const char *name)
 
 #ifdef VMS
     fp = fopen(name, TXT_W, "shr=get");
-    chmod(name, HIDE_CHMOD);
+    (void) chmod(name, HIDE_CHMOD);
 #else
     SetDefaultMode(O_TEXT);
 
@@ -5974,7 +5980,7 @@ FILE *LYAppendToTxtFile(const char *name)
 
 #ifdef VMS
     fp = fopen(name, TXT_A, "shr=get");
-    chmod(name, HIDE_CHMOD);
+    (void) chmod(name, HIDE_CHMOD);
 #else
     SetDefaultMode(O_TEXT);
 
@@ -6007,8 +6013,8 @@ void LYRelaxFilePermissions(const char *name)
 	mode_t save = umask(HIDE_UMASK);
 
 	mode = ((mode & 0700) | 0066) & ~save;
-	umask(save);
-	chmod(name, mode);
+	(void) umask(save);
+	(void) chmod(name, mode);
     }
 }
 #endif
@@ -6016,18 +6022,22 @@ void LYRelaxFilePermissions(const char *name)
 /*
  * Check if the given anchor has an associated file-cache.
  */
-BOOLEAN LYCachedTemp(char *result,
+BOOLEAN LYCachedTemp(char *target,
 		     char **cached)
 {
+    BOOLEAN result = FALSE;
+
     if (*cached) {
-	LYStrNCpy(result, *cached, LY_MAXPATH);
+	LYStrNCpy(target, *cached, LY_MAXPATH);
 	FREE(*cached);
-	if (LYCanReadFile(result)) {
-	    remove(result);
+	if (LYCanReadFile(target)) {
+	    if (remove(target) != 0) {
+		CTRACE((tfp, "cannot remove %s\n", target));
+	    }
 	}
-	return TRUE;
+	result = TRUE;
     }
-    return FALSE;
+    return result;
 }
 
 #ifndef HAVE_MKDTEMP
@@ -6100,7 +6110,7 @@ FILE *LYOpenTemp(char *result,
 		printf("%s: %s\n", lynx_temp_space, LYStrerror(errno));
 		exit_immediately(EXIT_FAILURE);
 	    }
-	    umask(old_mask);
+	    (void) umask(old_mask);
 	    lynx_temp_subspace = 1;
 	    StrAllocCat(lynx_temp_space, "/");
 	    CTRACE((tfp, "made subdirectory %s\n", lynx_temp_space));
@@ -6434,7 +6444,7 @@ int LYRemoveTemp(char *name)
 void LYCleanupTemp(void)
 {
     while (ly_temp != 0) {
-	LYRemoveTemp(ly_temp->name);
+	(void) LYRemoveTemp(ly_temp->name);
     }
 #if defined(MULTI_USER_UNIX)
     if (lynx_temp_subspace > 0) {
@@ -6848,7 +6858,7 @@ FILE *InternalPageFP(char *filename,
     if (LYReuseTempfiles && reuse_flag) {
 	fp = LYOpenTempRewrite(filename, HTML_SUFFIX, BIN_W);
     } else {
-	LYRemoveTemp(filename);
+	(void) LYRemoveTemp(filename);
 	fp = LYOpenTemp(filename, HTML_SUFFIX, BIN_W);
     }
     if (fp == NULL) {
diff --git a/src/tidy_tls.c b/src/tidy_tls.c
index ad4ea37f..e08f1b79 100644
--- a/src/tidy_tls.c
+++ b/src/tidy_tls.c
@@ -1,5 +1,5 @@
 /*
- * $LynxId: tidy_tls.c,v 1.10 2011/05/11 10:49:57 tom Exp $
+ * $LynxId: tidy_tls.c,v 1.11 2013/05/01 08:52:41 tom Exp $
  * Copyright 2008-2011,2011 Thomas E. Dickey
  * with fix Copyright 2008 by Thomas Viehmann
  *
@@ -576,7 +576,7 @@ int SSL_read(SSL * ssl, void *buffer, int length)
 int SSL_set_fd(SSL * ssl, int fd)
 {
     gnutls_transport_set_ptr(ssl->gnutls_state,
-			     (gnutls_transport_ptr_t) (fd));
+			     (gnutls_transport_ptr_t) (intptr_t) (fd));
     return 1;
 }