about summary refs log tree commit diff stats
path: root/WWW
diff options
context:
space:
mode:
authorThomas E. Dickey <dickey@invisible-island.net>2012-02-10 01:52:10 -0500
committerThomas E. Dickey <dickey@invisible-island.net>2012-02-10 01:52:10 -0500
commit5307f5f9b8ef280d693fc38c1261fd7b3ffd94b1 (patch)
tree24fd5204c945357776458159e3806bea4e850ac6 /WWW
parent53628f60fd3902b835e8b6500bf5b4e2a584db97 (diff)
downloadlynx-snapshots-5307f5f9b8ef280d693fc38c1261fd7b3ffd94b1.tar.gz
snapshot of project "lynx", label v2-8-8dev_9m
Diffstat (limited to 'WWW')
-rw-r--r--WWW/Library/Implementation/HTFTP.c6
-rw-r--r--WWW/Library/Implementation/HTFile.c8
-rw-r--r--WWW/Library/Implementation/HTFile.h4
-rw-r--r--WWW/Library/Implementation/HTParse.c4
-rw-r--r--WWW/Library/Implementation/HTString.c10
-rw-r--r--WWW/Library/Implementation/HTTCP.c8
-rw-r--r--WWW/Library/Implementation/LYLeaks.h56
7 files changed, 77 insertions, 19 deletions
diff --git a/WWW/Library/Implementation/HTFTP.c b/WWW/Library/Implementation/HTFTP.c
index 5ca71225..480eacfd 100644
--- a/WWW/Library/Implementation/HTFTP.c
+++ b/WWW/Library/Implementation/HTFTP.c
@@ -1,5 +1,5 @@
 /*
- * $LynxId: HTFTP.c,v 1.100 2011/05/24 09:49:44 tom Exp $
+ * $LynxId: HTFTP.c,v 1.101 2012/02/09 12:34:48 tom Exp $
  *
  *			File Transfer Protocol (FTP) Client
  *			for a WorldWideWeb browser
@@ -1304,7 +1304,7 @@ static int get_listen_socket(void)
 	    return HTInetStatus("getsockname");
 #ifdef INET6
 	CTRACE((tfp, "HTFTP: This host is %s\n",
-		HTInetString((SockA *) soc_in)));
+		HTInetString((void *) soc_in)));
 
 	soc_in->sin_port = 0;	/* Unspecified: please allocate */
 #else
@@ -1352,7 +1352,7 @@ static int get_listen_socket(void)
 #ifdef INET6
     CTRACE((tfp, "HTFTP: bound to port %d on %s\n",
 	    (int) ntohs(soc_in->sin_port),
-	    HTInetString((SockA *) soc_in)));
+	    HTInetString((void *) soc_in)));
 #else
     CTRACE((tfp, "HTFTP: bound to port %d on %s\n",
 	    (int) ntohs(soc_in->sin_port),
diff --git a/WWW/Library/Implementation/HTFile.c b/WWW/Library/Implementation/HTFile.c
index 69b537a5..be561e44 100644
--- a/WWW/Library/Implementation/HTFile.c
+++ b/WWW/Library/Implementation/HTFile.c
@@ -1,5 +1,5 @@
 /*
- * $LynxId: HTFile.c,v 1.128 2011/06/06 09:27:35 tom Exp $
+ * $LynxId: HTFile.c,v 1.129 2012/02/10 01:10:51 tom Exp $
  *
  *			File Access				HTFile.c
  *			===========
@@ -3086,7 +3086,7 @@ void HTSetProgramPath(ProgramPaths code, const char *path)
 /*
  * Reset the list of known program paths to the ones that are compiled-in
  */
-void HTInitProgramPaths(void)
+void HTInitProgramPaths(BOOL init)
 {
     ProgramPaths code;
     int n;
@@ -3218,7 +3218,9 @@ void HTInitProgramPaths(void)
 	if (test != NULL && test != path) {
 	    free((char *) test);
 	}
-	HTSetProgramPath(code, path);
+	if (init) {
+	    HTSetProgramPath(code, path);
+	}
     }
 }
 
diff --git a/WWW/Library/Implementation/HTFile.h b/WWW/Library/Implementation/HTFile.h
index 2a548060..937907d4 100644
--- a/WWW/Library/Implementation/HTFile.h
+++ b/WWW/Library/Implementation/HTFile.h
@@ -1,5 +1,5 @@
 /*
- * $LynxId: HTFile.h,v 1.32 2010/09/24 00:32:16 tom Exp $
+ * $LynxId: HTFile.h,v 1.33 2012/02/10 00:59:15 tom Exp $
  *							File access in libwww
  *				FILE ACCESS
  *
@@ -347,7 +347,7 @@ extern "C" {
 /*
  * Reset the list of known program paths to the ones that are compiled-in
  */
-    extern void HTInitProgramPaths(void);
+    extern void HTInitProgramPaths(BOOL init);
 
 /*
  *  The Protocols
diff --git a/WWW/Library/Implementation/HTParse.c b/WWW/Library/Implementation/HTParse.c
index 2e74e7f7..0338dfd4 100644
--- a/WWW/Library/Implementation/HTParse.c
+++ b/WWW/Library/Implementation/HTParse.c
@@ -1,5 +1,5 @@
 /*
- * $LynxId: HTParse.c,v 1.69 2011/06/06 10:46:18 tom Exp $
+ * $LynxId: HTParse.c,v 1.70 2012/02/09 19:57:37 tom Exp $
  *
  *		Parse HyperText Document Address		HTParse.c
  *		================================
@@ -300,7 +300,7 @@ static void convert_to_idna(char *host)
 			buffer,
 			idna_strerror((Idna_rc) code)));
 	    }
-	    if (output)
+	    if (output)		/* "(free)" to bypass LYLeaks.c */
 		(free) (output);
 	}
 	free(buffer);
diff --git a/WWW/Library/Implementation/HTString.c b/WWW/Library/Implementation/HTString.c
index 9bbc3577..e22c937e 100644
--- a/WWW/Library/Implementation/HTString.c
+++ b/WWW/Library/Implementation/HTString.c
@@ -1,5 +1,5 @@
 /*
- * $LynxId: HTString.c,v 1.67 2012/02/08 00:34:44 tom Exp $
+ * $LynxId: HTString.c,v 1.69 2012/02/09 22:02:21 tom Exp $
  *
  *	Case-independent string comparison		HTString.c
  *
@@ -359,7 +359,7 @@ char *HTSACopy_extra(char **dest,
 	EXTRA_TYPE size = 0;
 
 	if (*dest != 0) {
-	    size = *(EXTRA_TYPE *) ((*dest) - EXTRA_SIZE);
+	    size = *(EXTRA_TYPE *) (void *) ((*dest) - EXTRA_SIZE);
 	}
 	if ((*dest == 0) || (size < srcsize)) {
 	    FREE_extra(*dest);
@@ -368,7 +368,7 @@ char *HTSACopy_extra(char **dest,
 	    if (*dest == NULL)
 		outofmem(__FILE__, "HTSACopy_extra");
 	    assert(*dest != NULL);
-	    *(EXTRA_TYPE *) (*dest) = size;
+	    *(EXTRA_TYPE *) (void *) (*dest) = size;
 	    *dest += EXTRA_SIZE;
 	}
 	MemCpy(*dest, src, srcsize);
@@ -649,9 +649,8 @@ PUBLIC_IF_FIND_LEAKS char *StrAllocVsprintf(char **pstr,
 	    result = HTAlloc(pstr ? *pstr : 0, new_len);
 	    if (result != 0) {
 		strcpy(result + dst_len, temp);
-		mark_malloced(temp, new_len);
 	    }
-	    free(temp);
+	    (free) (temp);
 	} else {
 	    result = temp;
 	    mark_malloced(temp, strlen(temp));
@@ -1198,6 +1197,7 @@ void HTSABAlloc(bstring **dest, int len)
 
     if ((*dest)->len != len) {
 	(*dest)->str = typeRealloc(char, (*dest)->str, len);
+
 	(*dest)->len = len;
     }
 }
diff --git a/WWW/Library/Implementation/HTTCP.c b/WWW/Library/Implementation/HTTCP.c
index d366d732..2723422c 100644
--- a/WWW/Library/Implementation/HTTCP.c
+++ b/WWW/Library/Implementation/HTTCP.c
@@ -1,5 +1,5 @@
 /*
- * $LynxId: HTTCP.c,v 1.106 2010/11/07 21:20:58 tom Exp $
+ * $LynxId: HTTCP.c,v 1.107 2012/02/09 12:36:45 tom Exp $
  *
  *			Generic Communication Code		HTTCP.c
  *			==========================
@@ -450,7 +450,7 @@ static size_t fill_rehostent(char *rehostent,
 			     size_t rehostentsize,
 			     const LYNX_HOSTENT *phost)
 {
-    AlignedHOSTENT *data = (AlignedHOSTENT *) rehostent;
+    AlignedHOSTENT *data = (AlignedHOSTENT *) (void *) rehostent;
     int num_addrs = 0;
     int num_aliases = 0;
     char **pcnt;
@@ -513,7 +513,7 @@ static size_t fill_rehostent(char *rehostent,
 
     data->h.h_addrtype = phost->h_addrtype;
     data->h.h_length = phost->h_length;
-    p_next_charptr = (char **) (rehostent + curlen);
+    p_next_charptr = (char **) (void *) (rehostent + curlen);
     p_next_char = rehostent + curlen;
     if (phost->h_addr_list)
 	p_next_char += (size_t) (num_addrs + 1) * sizeof(phost->h_addr_list[0]);
@@ -706,7 +706,7 @@ LYNX_HOSTENT *LYGetHostByName(char *str)
      *   in the child's, otherwise the internal pointers built by the child's
      *   call to fill_rehostent would be invalid when seen by the parent).  -kw
      */
-    char *rehostent = (char *) &aligned_full_rehostent;
+    void *rehostent = (void *) &aligned_full_rehostent;
 
     /* for transfer of status from child to parent: */
     struct _statuses {
diff --git a/WWW/Library/Implementation/LYLeaks.h b/WWW/Library/Implementation/LYLeaks.h
index 69ccd4f4..b3672734 100644
--- a/WWW/Library/Implementation/LYLeaks.h
+++ b/WWW/Library/Implementation/LYLeaks.h
@@ -1,3 +1,6 @@
+/*
+ * $LynxId: LYLeaks.h,v 1.14 2012/02/10 00:15:56 tom Exp $
+ */
 #ifndef __LYLEAKS_H
 /*
  *	Avoid include redundancy
@@ -44,6 +47,9 @@
  *	1999-10-17	modified to handle HTSprintf0 and HTSprintf(),
  *			and to provide mark_malloced, if
  *			LY_FIND_LEAKS_EXTENDED is defined. - kw
+ *	2003-01-22	add sequence-id for counting mallocs/frees -TD
+ *	2004-04-27	ANSIfy'd -TD
+ *	2012-02-09	add bstring interfaces -TD
  */
 
 /* Undefine this to get no improved HTSprintf0/HTSprintf tracking: */
@@ -161,6 +167,31 @@ extern "C" {
 #endif				/* StrAllocCat */
 #define StrAllocCat(dest, src)  LYLeakSACat(&(dest), src, __FILE__, __LINE__)
 
+#ifdef BStrAlloc
+#undef BStrAlloc
+#endif
+#define BStrAlloc(d,n)   LYLeakSABAlloc( &(d), n, __FILE__, __LINE__)
+
+#ifdef BStrCopy
+#undef BStrCopy
+#endif
+#define BStrCopy(d,s)  LYLeakSABCopy( &(d), BStrData(s), BStrLen(s), __FILE__, __LINE__)
+
+#ifdef BStrCopy0
+#undef BStrCopy0
+#endif
+#define BStrCopy0(d,s)  LYLeakSABCopy0( &(d), s, __FILE__, __LINE__)
+
+#ifdef BStrCat
+#undef BStrCat
+#endif
+#define BStrCat(d,s)  LYLeakSABCat( &(d), BStrData(s), BStrLen(s), __FILE__, __LINE__)
+
+#ifdef BStrCat0
+#undef BStrCat0
+#endif
+#define BStrCat0(d,s)  LYLeakSABCat0( &(d), s, __FILE__, __LINE__)
+
 #define mark_malloced(a,size) LYLeak_mark_malloced(a,size, __FILE__, __LINE__)
 
 #if defined(LY_FIND_LEAKS_EXTENDED) && !defined(NO_EXTENDED_MEMORY_TRACKING)
@@ -224,6 +255,31 @@ extern "C" {
 			     const char *src,
 			     const char *cp_File,
 			     const short ssi_Line);
+    extern void LYLeakSABAlloc(bstring **dest,
+			       int len,
+			       const char *cp_File,
+			       const short ssi_Line);
+    extern void LYLeakSABCopy(bstring **dest,
+			      const char *src,
+			      int len,
+			      const char *cp_File,
+			      const short ssi_Line);
+    extern void LYLeakSABCopy0(bstring **dest,
+			       const char *src,
+			       const char *cp_File,
+			       const short ssi_Line);
+    extern void LYLeakSABCat(bstring **dest,
+			     const char *src,
+			     int len,
+			     const char *cp_File,
+			     const short ssi_Line);
+    extern void LYLeakSABCat0(bstring **dest,
+			      const char *src,
+			      const char *cp_File,
+			      const short ssi_Line);
+    extern void LYLeakSABFree(bstring **ptr,
+			      const char *cp_File,
+			      const short ssi_Line);
 
 #ifdef LY_FIND_LEAKS_EXTENDED
 /*