about summary refs log tree commit diff stats
path: root/WWW
diff options
context:
space:
mode:
authorThomas E. Dickey <dickey@invisible-island.net>1999-05-17 03:16:27 -0400
committerThomas E. Dickey <dickey@invisible-island.net>1999-05-17 03:16:27 -0400
commitc7742b57ba05ecb66932512320e2a7e8adaf11c5 (patch)
tree40e16d43812ccf88ff22ce4d6aaea9ea45b97275 /WWW
parent0bafa3a38906a8ffc183d758baa774d8b23a9fa4 (diff)
downloadlynx-snapshots-c7742b57ba05ecb66932512320e2a7e8adaf11c5.tar.gz
snapshot of project "lynx", label v2-8-2pre_4
Diffstat (limited to 'WWW')
-rw-r--r--WWW/Library/Implementation/HTAccess.c3
-rw-r--r--WWW/Library/Implementation/HTFile.c2
-rw-r--r--WWW/Library/Implementation/HTMLDTD.c10
-rw-r--r--WWW/Library/Implementation/HTPlain.c2
-rw-r--r--WWW/Library/Implementation/HTString.c59
-rw-r--r--WWW/Library/Implementation/HTString.h16
-rw-r--r--WWW/Library/Implementation/SGML.c2
7 files changed, 80 insertions, 14 deletions
diff --git a/WWW/Library/Implementation/HTAccess.c b/WWW/Library/Implementation/HTAccess.c
index 0fca482d..008d42b7 100644
--- a/WWW/Library/Implementation/HTAccess.c
+++ b/WWW/Library/Implementation/HTAccess.c
@@ -1011,7 +1011,8 @@ PRIVATE BOOL HTLoadDocument ARGS4(
 
     /* Failure in accessing a document */
     cp = NULL;
-    StrAllocCopy(cp, "Can't Access `");
+    StrAllocCopy(cp, gettext("Can't Access"));
+    StrAllocCat(cp, " `");
     StrAllocCat(cp, full_address);
     StrAllocCat(cp, "'");
     _HTProgress(cp);
diff --git a/WWW/Library/Implementation/HTFile.c b/WWW/Library/Implementation/HTFile.c
index be5212bf..18efcc9e 100644
--- a/WWW/Library/Implementation/HTFile.c
+++ b/WWW/Library/Implementation/HTFile.c
@@ -1556,7 +1556,7 @@ PRIVATE int print_local_dir ARGS5(
 
 
     {
-	HTBTree * bt = HTBTree_new((HTComparer)strcmp);
+	HTBTree * bt = HTBTree_new((HTComparer)AS_cmp);
 	int num_of_entries = 0;	    /* lines counter */
 
 	_HTProgress (gettext("Reading directory..."));
diff --git a/WWW/Library/Implementation/HTMLDTD.c b/WWW/Library/Implementation/HTMLDTD.c
index 58e6c235..b5b6706e 100644
--- a/WWW/Library/Implementation/HTMLDTD.c
+++ b/WWW/Library/Implementation/HTMLDTD.c
@@ -1540,26 +1540,16 @@ static CONST HTTag tags_new[HTML_ELEMENTS] = {
  { P("FORM")	, form_attr,	HTML_FORM_ATTRIBUTES,	SGML_MIXED,T_FORM},
  { P("FRAME")	, frame_attr,	HTML_FRAME_ATTRIBUTES,	SGML_EMPTY,T_FRAME},
  { P("FRAMESET"), frameset_attr,HTML_FRAMESET_ATTRIBUTES, SGML_ELEMENT,T_FRAMESET},
-#ifndef   EBCDIC  /* S/390 -- gil -- 0177 */
  { P("H1")	, h_attr,	HTML_H_ATTRIBUTES,	SGML_MIXED,T_H1},
  { P("H2")	, h_attr,	HTML_H_ATTRIBUTES,	SGML_MIXED,T_H2},
  { P("H3")	, h_attr,	HTML_H_ATTRIBUTES,	SGML_MIXED,T_H3},
  { P("H4")	, h_attr,	HTML_H_ATTRIBUTES,	SGML_MIXED,T_H4},
  { P("H5")	, h_attr,	HTML_H_ATTRIBUTES,	SGML_MIXED,T_H5},
  { P("H6")	, h_attr,	HTML_H_ATTRIBUTES,	SGML_MIXED,T_H6},
-#endif /* EBCDIC  S/390 -- gil -- 0187 */
  { P("HEAD")	, gen_attr,	HTML_GEN_ATTRIBUTES,	SGML_ELEMENT,T_HEAD},
  { P("HR")	, hr_attr,	HTML_HR_ATTRIBUTES,	SGML_EMPTY,T_HR},
  { P("HTML")	, gen_attr,	HTML_GEN_ATTRIBUTES,	SGML_MIXED,T_HTML},
  { P("HY")	, gen_attr,	HTML_GEN_ATTRIBUTES,	SGML_EMPTY,T_HY},
-#ifdef    EBCDIC
- { P("H1")	, h_attr,	HTML_H_ATTRIBUTES,	SGML_MIXED,T_H1},
- { P("H2")	, h_attr,	HTML_H_ATTRIBUTES,	SGML_MIXED,T_H2},
- { P("H3")	, h_attr,	HTML_H_ATTRIBUTES,	SGML_MIXED,T_H3},
- { P("H4")	, h_attr,	HTML_H_ATTRIBUTES,	SGML_MIXED,T_H4},
- { P("H5")	, h_attr,	HTML_H_ATTRIBUTES,	SGML_MIXED,T_H5},
- { P("H6")	, h_attr,	HTML_H_ATTRIBUTES,	SGML_MIXED,T_H6},
-#endif /* EBCDIC <heavy sigh> -- gil */
  { P("I")	, gen_attr,	HTML_GEN_ATTRIBUTES,	SGML_MIXED,T_I},
  { P("IFRAME")	, iframe_attr,	HTML_IFRAME_ATTRIBUTES, SGML_MIXED,T_IFRAME},
  { P("IMG")	, img_attr,	HTML_IMG_ATTRIBUTES,	SGML_EMPTY,T_IMG},
diff --git a/WWW/Library/Implementation/HTPlain.c b/WWW/Library/Implementation/HTPlain.c
index fd9f3f8b..c49d14c2 100644
--- a/WWW/Library/Implementation/HTPlain.c
+++ b/WWW/Library/Implementation/HTPlain.c
@@ -167,7 +167,7 @@ PRIVATE void HTPlain_put_character ARGS2(
 		diff < 0 ? (low = i+1) : (high = i)) {
 		/* Binary search */
 		i = (low + (high-low)/2);
-		diff = strncmp(HTML_dtd.entity_names[i], name, len);
+		diff = AS_ncmp(HTML_dtd.entity_names[i], name, len);
 		if (diff == 0) {
 		    HText_appendText(me->text,
 				     LYCharSets[me->outUCLYhndl][i]);
diff --git a/WWW/Library/Implementation/HTString.c b/WWW/Library/Implementation/HTString.c
index 4e12d159..90b6665b 100644
--- a/WWW/Library/Implementation/HTString.c
+++ b/WWW/Library/Implementation/HTString.c
@@ -122,6 +122,65 @@ PUBLIC int strncasecomp ARGS3(
 }
 #endif /* VM */
 
+#ifdef NOT_ASCII
+
+/*	Case-insensitive with ASCII collating sequence
+**	----------------
+*/
+PUBLIC int AS_casecomp ARGS2(
+	CONST char*,	p,
+	CONST char*,	q)
+{
+    int diff;
+
+    for ( ; ; p++, q++) {
+	if (!(*p && *q))
+	    return ((unsigned char) *p - (unsigned char) *q);
+	diff = TOASCII(TOLOWER(*p))
+	     - TOASCII(TOLOWER(*q));
+	if (diff)
+	    return diff;
+    }
+    /*NOTREACHED*/
+}
+
+
+/*	With count limit and ASCII collating sequence
+**	----------------
+**	AS_cmp uses n == -1 to compare indefinite length.
+*/
+PUBLIC int AS_ncmp ARGS3(
+	CONST char *,	p,
+	CONST char *,	q,
+	unsigned int,	n)
+{
+    CONST char *a = p;
+    int diff;
+
+    for ( ; (p-a) < n; p++, q++) {
+	if (!(*p && *q))
+	    return ((unsigned char) *p - (unsigned char) *q);
+	diff = TOASCII(*p)
+	     - TOASCII(*q);
+	if (diff)
+	    return diff;
+    }
+    return 0;	/*   Match up to n characters */
+}
+
+
+/*	With ASCII collating sequence
+**	----------------
+*/
+PUBLIC int AS_cmp ARGS2(
+	CONST char *,	p,
+	CONST char *,	q)
+{
+    return( AS_ncmp( p, q, -1 ) );
+}
+#endif /* NOT_ASCII */
+
+
 /*	Allocate a new copy of a string, and returns it
 */
 PUBLIC char * HTSACopy ARGS2(
diff --git a/WWW/Library/Implementation/HTString.h b/WWW/Library/Implementation/HTString.h
index 1041d0fd..2891b295 100644
--- a/WWW/Library/Implementation/HTString.h
+++ b/WWW/Library/Implementation/HTString.h
@@ -16,6 +16,22 @@ extern int WWW_TraceFlag;       /* Global flag for all W3 trace */
 extern CONST char * HTLibraryVersion;   /* String for help screen etc */
 
 /*
+    EBCDIC string comparison using ASCII collating sequence
+*/
+#ifdef    NOT_ASCII
+extern int AS_casecomp  PARAMS((CONST char *a, CONST char *b));
+extern int AS_ncmp PARAMS((CONST char *a, CONST char *b, unsigned int n));
+#define    AS_cmp( a, b )  ( AS_ncmp( ( a ), ( b ), -1 ) )
+extern int AS_cmp PARAMS((CONST char *a, CONST char *b));
+
+#else
+#define AS_casecomp( a, b ) ( strcasecomp( ( a ), ( b ) ) )
+#define AS_ncmp( a, b, c )  ( strncmp( ( a ), ( b ), ( c ) ) )
+#define AS_cmp strcmp
+
+#endif /* NOT_ASCII */
+
+/*
 
 Case-insensitive string comparison
 
diff --git a/WWW/Library/Implementation/SGML.c b/WWW/Library/Implementation/SGML.c
index 8b1d30c2..b219ad0b 100644
--- a/WWW/Library/Implementation/SGML.c
+++ b/WWW/Library/Implementation/SGML.c
@@ -1215,7 +1215,7 @@ PUBLIC HTTag * SGMLFindTag ARGS2(
 	 high > low;
 	 diff < 0 ? (low = i+1) : (high = i)) {	 /* Binary search */
 	i = (low + (high-low)/2);
-	diff = strcasecomp(dtd->tags[i].name, string);	/* Case insensitive */
+	diff = AS_casecomp(dtd->tags[i].name, string);	/* Case insensitive */
 	if (diff == 0) {		/* success: found it */
 	    return &dtd->tags[i];
 	}