about summary refs log tree commit diff stats
path: root/src
diff options
context:
space:
mode:
authorThomas E. Dickey <dickey@invisible-island.net>1998-02-28 21:10:46 -0500
committerThomas E. Dickey <dickey@invisible-island.net>1998-02-28 21:10:46 -0500
commit349da2fb30fd6d2be4bd47a95fee9915b50f6d67 (patch)
tree3452a35c54ff9cddbd3348c878b2ea57c9b431df /src
parent86b4d41a7463bd35cf662fc748aa338caef609c9 (diff)
downloadlynx-snapshots-349da2fb30fd6d2be4bd47a95fee9915b50f6d67.tar.gz
snapshot of project "lynx", label v2-8pre_2
Diffstat (limited to 'src')
-rw-r--r--src/LYStrings.c22
-rw-r--r--src/LYStrings.h4
-rw-r--r--src/LYStyle.c2
-rw-r--r--src/LYUtils.c18
-rw-r--r--src/chrtrans/makeuctb.c2
5 files changed, 16 insertions, 32 deletions
diff --git a/src/LYStrings.c b/src/LYStrings.c
index 2f546f72..64f74c05 100644
--- a/src/LYStrings.c
+++ b/src/LYStrings.c
@@ -1622,8 +1622,12 @@ PUBLIC char * SNACat ARGS3(
 **   have their "7bit approximation" images (in def7_uni.tbl)
 **   matched case-insensitive (7bit).
 **
-**   By this technique we cover *any* charset known for Lynx chartrans
-**   and need no extra information for it.  - LP
+**   By this technique we automatically cover *any* charset
+**   known for Lynx chartrans and need no any extra information for it.
+**
+**   The cost of this assumption is that several differently accented letters
+**   may be interpreted as equal, but this side effect is negligible
+**   if the user search string is more than one character long.  - LP
 **
 */
 PUBLIC int UPPER8(int ch1, int ch2)
@@ -1655,22 +1659,12 @@ PUBLIC int UPPER8(int ch1, int ch2)
 			      charset_in, charset_out, YES);
 	uck2 = UCTransCharStr(replace_buf2, sizeof(replace_buf2), ch2,
 			      charset_in, charset_out, YES);
-	/*
-	** Got both replacement strings (yippey).  - FM
-	*/
-	if (strcmp(replace_buf1, replace_buf2)!=0)  /* case-sensitive ! */
-	/*
-	** Two strings different.  We assume the different letters
-	** should not have the equal strings for "7bit approx",
-	** overwise differently accented letters may be vanished.
-	** Now we return case-INsensitive comparision of strings:
-	*/
 
-	if ((uck1 > 0) && (uck2 > 0))
+	if ((uck1 > 0) && (uck2 > 0))  /* both replacement strings found */
 	    return (strcasecomp(replace_buf1, replace_buf2));
     }
 
-    return(-10);  /* mismatch */
+    return(-10);  /* mismatch, if we come to here */
 }
 
 #endif /* EXP_8BIT_TOUPPER */
diff --git a/src/LYStrings.h b/src/LYStrings.h
index 3162ab78..f161f5a6 100644
--- a/src/LYStrings.h
+++ b/src/LYStrings.h
@@ -3,8 +3,8 @@
 
 #include <string.h>
 
-#if !defined(EXP_8BIT_TOUPPER) && !defined(LOCALE) && !defined(__DJGPP__)
-#define EXP_8BIT_TOUPPER 1
+#if !defined(EXP_8BIT_TOUPPER) && (!defined(LOCALE) || defined(__DJGPP__))
+#define EXP_8BIT_TOUPPER
 #endif
 
 #ifdef EXP_8BIT_TOUPPER
diff --git a/src/LYStyle.c b/src/LYStyle.c
index 73a55874..4c562208 100644
--- a/src/LYStyle.c
+++ b/src/LYStyle.c
@@ -1,6 +1,6 @@
 /* character level styles for Lynx
  * (c) 1996 Rob Partington -- donated to the Lyncei (if they want it :-)
- * @Id: LYStyle.c 1.15 Sat, 13 Dec 1997 16:30:40 -0700 dickey @
+ * @Id: LYStyle.c 1.16 Fri, 27 Feb 1998 11:25:07 -0700 dickey @
  */
 #include "HTUtils.h"
 #include "HTML.h"
diff --git a/src/LYUtils.c b/src/LYUtils.c
index c60ce6ed..17d959b9 100644
--- a/src/LYUtils.c
+++ b/src/LYUtils.c
@@ -3048,7 +3048,6 @@ PUBLIC void change_sug_filename ARGS1(
 	char *, 	fname)
 {
     char *temp, *cp, *cp1, *end;
-    size_t len;
 #ifdef VMS
     char *dot;
     int j, k;
@@ -3068,8 +3067,7 @@ PUBLIC void change_sug_filename ARGS1(
      *	Rename any temporary files.
      */
     temp = (char *)calloc(1, (strlen(lynx_temp_space) + 60));
-#ifdef FNAMES_8_3
-#ifdef DOSPATH
+#if defined(FNAMES_8_3) && defined(DOSPATH)
     cp = HTDOS_wwwName(lynx_temp_space);
 #else
     cp = lynx_temp_space;
@@ -3079,17 +3077,9 @@ PUBLIC void change_sug_filename ARGS1(
     } else {
 	sprintf(temp, "file://localhost/%s%d", cp, (int)getpid());
     }
-#else  /* FNAMES_8_3 */
-    if (*lynx_temp_space == '/') {
-	sprintf(temp, "file://localhost%sL%d", lynx_temp_space, (int)getpid());
-    } else {
-	sprintf(temp, "file://localhost/%sL%d", lynx_temp_space, (int)getpid());
-    }
-#endif	/* FNAMES_8_3 */
-    len = strlen(temp);
-    if (!strncmp(fname, temp, len)) {
+    if (!strncmp(fname, temp, strlen(temp))) {
 	cp = strrchr(fname, '.');
-	if (strlen(cp) > (len - 4))
+	if (strlen(cp) > (strlen(temp) - 4))
 	    cp = NULL;
 	strcpy(temp, (cp ? cp : ""));
 	strcpy(fname, "temp");
@@ -3882,7 +3872,7 @@ PUBLIC void LYConvertToURL ARGS1(
 		*cp_url = '\0';
 #endif
     }
-#endif
+#endif /* DOSPATH */
 
     *AllocatedString = NULL;  /* so StrAllocCopy doesn't free it */
     StrAllocCopy(*AllocatedString,"file://localhost");
diff --git a/src/chrtrans/makeuctb.c b/src/chrtrans/makeuctb.c
index 3e0c81c5..f1417cb7 100644
--- a/src/chrtrans/makeuctb.c
+++ b/src/chrtrans/makeuctb.c
@@ -60,7 +60,7 @@ PRIVATE void usage ARGS1(
 }
 
 /* copied from HTString.c, not everybody has strncasecmp */
-PRIVATE int strncasecomp ARGS3(
+PUBLIC int strncasecomp ARGS3(
 	CONST char*,	a,
 	CONST char *,	b,
 	int,		n)