about summary refs log tree commit diff stats
path: root/src
diff options
context:
space:
mode:
authorThomas E. Dickey <dickey@invisible-island.net>2018-03-29 00:38:59 +0000
committerThomas E. Dickey <dickey@invisible-island.net>2018-03-29 00:38:59 +0000
commitac9f8d52a8715476153ade910dd81436bfdea2a7 (patch)
treef3ad7d4cdd50c3d4b5f8caf57438279c53756dc9 /src
parentd59cf1e795c0628c2f8b4dce3052627ecdad20a8 (diff)
downloadlynx-snapshots-ac9f8d52a8715476153ade910dd81436bfdea2a7.tar.gz
snapshot of project "lynx", label v2-8-9dev_17d
Diffstat (limited to 'src')
-rw-r--r--src/LYHash.c39
-rw-r--r--src/LYMain.c5
-rw-r--r--src/LYUtils.c8
3 files changed, 35 insertions, 17 deletions
diff --git a/src/LYHash.c b/src/LYHash.c
index 3aa8e2fe..f419c7ea 100644
--- a/src/LYHash.c
+++ b/src/LYHash.c
@@ -1,5 +1,5 @@
 /*
- * $LynxId: LYHash.c,v 1.38 2018/03/10 01:50:19 tom Exp $
+ * $LynxId: LYHash.c,v 1.39 2018/03/29 00:38:59 tom Exp $
  *
  * A hash table for the (fake) CSS support in Lynx-rp
  * (c) 1996 Rob Partington
@@ -10,9 +10,12 @@
 #include <LYUtils.h>
 #include <LYLeaks.h>
 #include <LYStrings.h>
+#include <LYGlobalDefs.h>
 
 #ifdef USE_COLOR_STYLE
 
+#undef HASH_TYPE
+
 #define HASH_SIZE CSHASHSIZE
 #define HASH_TYPE     int
 #define HASH_OF(h, v) ((HASH_TYPE)((h) * 3 + UCH(v)) % HASH_SIZE)
@@ -79,20 +82,34 @@ static HASH_TYPE cs_hash(const char *string)
 
 int color_style_1(const char *string)
 {
-    get_buffer(strlen(string));
-    strcpy(buffer, string);
-    LYLowerCase(buffer);
-    return cs_hash(buffer);
+    int hash;
+
+    if (dump_output_immediately) {
+	hash = 0;
+    } else {
+	get_buffer(strlen(string));
+	strcpy(buffer, string);
+	LYLowerCase(buffer);
+	hash = cs_hash(buffer);
+    }
+    return hash;
 }
 
 int color_style_3(const char *p, const char *q, const char *r)
 {
-    get_buffer(strlen(p) + strlen(q) + strlen(r));
-    strcpy(buffer, p);
-    strcat(buffer, q);
-    strcat(buffer, r);
-    LYLowerCase(buffer);
-    return cs_hash(buffer);
+    int hash;
+
+    if (dump_output_immediately) {
+	hash = 0;
+    } else {
+	get_buffer(strlen(p) + strlen(q) + strlen(r));
+	strcpy(buffer, p);
+	strcat(buffer, q);
+	strcat(buffer, r);
+	LYLowerCase(buffer);
+	hash = cs_hash(buffer);
+    }
+    return hash;
 }
 
 void report_hashStyles(void)
diff --git a/src/LYMain.c b/src/LYMain.c
index bccb6e47..054db9e1 100644
--- a/src/LYMain.c
+++ b/src/LYMain.c
@@ -1,5 +1,5 @@
 /*
- * $LynxId: LYMain.c,v 1.277 2018/03/28 20:07:59 tom Exp $
+ * $LynxId: LYMain.c,v 1.278 2018/03/28 21:41:50 tom Exp $
  */
 #include <HTUtils.h>
 #include <HTTP.h>
@@ -1043,7 +1043,6 @@ int main(int argc,
 #endif
 
 #ifdef LY_FIND_LEAKS
-    LYAddPathToHome(LYLeaksPath, (size_t) LY_MAXPATH, LEAKAGE_SINK);
     /*
      * Register the final function to be executed when being exited.  Will
      * display memory leaks if the -find-leaks option is used.  This should
@@ -1055,6 +1054,8 @@ int main(int argc,
      * Register the function which will free our allocated globals.
      */
     atexit(free_lynx_globals);
+
+    LYAddPathToHome(LYLeaksPath, (size_t) LY_MAXPATH, LEAKAGE_SINK);
 #endif /* LY_FIND_LEAKS */
 
 #ifdef    NOT_ASCII
diff --git a/src/LYUtils.c b/src/LYUtils.c
index 6b493afc..d123e916 100644
--- a/src/LYUtils.c
+++ b/src/LYUtils.c
@@ -1,5 +1,5 @@
 /*
- * $LynxId: LYUtils.c,v 1.290 2018/03/27 23:07:44 tom Exp $
+ * $LynxId: LYUtils.c,v 1.291 2018/03/28 21:14:39 tom Exp $
  */
 #include <HTUtils.h>
 #include <HTTCP.h>
@@ -4230,9 +4230,9 @@ static BOOLEAN LYExpandHostForURL(char **AllocatedString,
 	fprintf(stdout, "%s '%s'%s\r\n", WWW_FIND_MESSAGE, host, FIRST_SEGMENT);
     }
 #ifdef INET6
-    if (HTGetAddrInfo(host, 80) != NULL)
+    if (HTCheckAddrInfo(host, 80))
 #else
-    if (LYGetHostByName(host) != NULL)
+    if (LYCheckHostByName(host))
 #endif /* INET6 */
     {
 	/*
@@ -4334,7 +4334,7 @@ static BOOLEAN LYExpandHostForURL(char **AllocatedString,
 	    } else if (Startup && !dump_output_immediately) {
 		fprintf(stdout, "%s '%s'%s\n", WWW_FIND_MESSAGE, host, GUESSING_SEGMENT);
 	    }
-	    GotHost = (BOOL) (LYGetHostByName(host) != NULL);
+	    GotHost = LYCheckHostByName(host);
 	    if (HostColon != NULL) {
 		*HostColon = ':';
 	    }