about summary refs log tree commit diff stats
path: root/src/LYUtils.c
diff options
context:
space:
mode:
authorThomas E. Dickey <dickey@invisible-island.net>2013-10-19 20:04:16 -0400
committerThomas E. Dickey <dickey@invisible-island.net>2013-10-19 20:04:16 -0400
commitf5c107c419d617e6fbe62dbc87894413cbdba851 (patch)
treeb03a24517b91da6ad3d5966d67b279237fc86328 /src/LYUtils.c
parent010545f528265f5275cba0ed0eb4075b5ca62315 (diff)
downloadlynx-snapshots-f5c107c419d617e6fbe62dbc87894413cbdba851.tar.gz
snapshot of project "lynx", label v2-8-8dev_16t
Diffstat (limited to 'src/LYUtils.c')
-rw-r--r--src/LYUtils.c111
1 files changed, 38 insertions, 73 deletions
diff --git a/src/LYUtils.c b/src/LYUtils.c
index 8256e44b..6aedd0e3 100644
--- a/src/LYUtils.c
+++ b/src/LYUtils.c
@@ -1,5 +1,5 @@
 /*
- * $LynxId: LYUtils.c,v 1.253 2013/10/18 00:39:19 tom Exp $
+ * $LynxId: LYUtils.c,v 1.254 2013/10/19 00:59:45 tom Exp $
  */
 #include <HTUtils.h>
 #include <HTTCP.h>
@@ -2292,16 +2292,14 @@ static BOOLEAN compare_type(char *tst,
 	&& CompareType(tst, cmp, len))
 
 /*
- *  Must recognize a URL and return the type.
- *  If recognized, based on a case-insensitive
- *  analysis of the scheme field, ensures that
- *  the scheme field has the expected case.
+ * Must recognize a URL and return the type.  If recognized, based on a
+ * case-insensitive analysis of the scheme field, ensures that the scheme field
+ * has the expected case.
  *
- *  Returns 0 (not a URL) for a NULL argument,
- *  one which lacks a colon.
+ * Returns 0 (not a URL) for a NULL argument, one which lacks a colon.
  *
- *  Chains to LYCheckForProxyURL() if a colon
- *  is present but the type is not recognized.
+ * Chains to LYCheckForProxyURL() if a colon is present but the type is not
+ * recognized.
  */
 UrlTypes is_url(char *filename)
 {
@@ -2357,92 +2355,56 @@ UrlTypes is_url(char *filename)
 	    } else if (CompareType(cp, STR_LYNXPROG, LEN_LYNXPROG)) {
 		/*
 		 * Special External Lynx type to handle execution of commands,
-		 * scripts or programs with do not require a pause to read
+		 * scripts or programs which do not require a pause to read
 		 * screen upon completion.
 		 */
 		result = LYNXPROG_URL_TYPE;
 
 	    } else if (CompareType(cp, STR_LYNXCGI, LEN_LYNXCGI)) {
-		/*
-		 * Special External Lynx type to handle cgi scripts.
-		 */
 		result = LYNXCGI_URL_TYPE;
 
 	    } else if (CompareType(cp, STR_LYNXPRINT, LEN_LYNXPRINT)) {
-		/*
-		 * Special Internal Lynx type.
-		 */
 		result = LYNXPRINT_URL_TYPE;
 
 	    } else if (CompareType(cp, STR_LYNXOPTIONS, LEN_LYNXOPTIONS)) {
-		/*
-		 * Special Internal Lynx type.
-		 */
 		result = LYNXOPTIONS_URL_TYPE;
 
 	    } else if (CompareType(cp, STR_LYNXCFG, LEN_LYNXCFG)) {
-		/*
-		 * Special Internal Lynx type.
-		 */
 		result = LYNXCFG_URL_TYPE;
 
 	    } else if (CompareType(cp, STR_LYNXMESSAGES, LEN_LYNXMESSAGES)) {
-		/*
-		 * Special Internal Lynx type.
-		 */
 		result = LYNXMESSAGES_URL_TYPE;
 
 	    } else if (CompareType(cp, STR_LYNXCFLAGS, LEN_LYNXCFLAGS)) {
-		/*
-		 * Special Internal Lynx type.
-		 */
 		result = LYNXCOMPILE_OPTS_URL_TYPE;
 
 	    } else if (CompareType(cp, STR_LYNXDOWNLOAD, LEN_LYNXDOWNLOAD)) {
-		/*
-		 * Special Internal Lynx type.
-		 */
 		result = LYNXDOWNLOAD_URL_TYPE;
 
 	    } else if (CompareType(cp, STR_LYNXDIRED, LEN_LYNXDIRED)) {
-		/*
-		 * Special Internal Lynx type.
-		 */
 		result = LYNXDIRED_URL_TYPE;
 
+	    } else if (CompareType(cp, STR_LYNXEDITMAP, LEN_LYNXEDITMAP)) {
+		result = LYNXEDITMAP_URL_TYPE;
+
 	    } else if (CompareType(cp, STR_LYNXHIST, LEN_LYNXHIST)) {
-		/*
-		 * Special Internal Lynx type.
-		 */
 		result = LYNXHIST_URL_TYPE;
 
 #ifdef USE_CACHEJAR
 	    } else if (CompareType(cp, STR_LYNXCACHE, LEN_LYNXCACHE)) {
-		/* 
-		 * Special Internal Lynx type.
-		 */
 		result = LYNXCACHE_URL_TYPE;
 #endif
-
 	    } else if (CompareType(cp, STR_LYNXKEYMAP, LEN_LYNXKEYMAP)) {
-		/*
-		 * Special Internal Lynx type.
-		 */
 		result = LYNXKEYMAP_URL_TYPE;
 
 	    } else if (CompareType(cp, STR_LYNXIMGMAP, LEN_LYNXIMGMAP)) {
-		/*
-		 * Special Internal Lynx type.
-		 */
 		/* force lower/uppercase of next part */
 		(void) is_url(&cp[LEN_LYNXIMGMAP]);
 		result = LYNXIMGMAP_URL_TYPE;
 
 	    } else if (CompareType(cp, STR_LYNXCOOKIE, LEN_LYNXCOOKIE)) {
-		/*
-		 * Special Internal Lynx type.
-		 */
 		result = LYNXCOOKIE_URL_TYPE;
+
 	    }
 	    break;
 #ifndef DISABLE_NEWS
@@ -6586,34 +6548,37 @@ BOOL LYIsUIPage3(const char *url,
 {
     unsigned int i;
     size_t l;
+    BOOL result = NO;
 
-    if (!url)
-	return NO;
-    for (i = 0; i < TABLESIZE(ly_uip); i++) {
-	if (ly_uip[i].type == type) {
-	    if (!ly_uip[i].url) {
-		return NO;
-	    } else if ((flagparam & UIP_P_FRAG) ?
-		       (!StrNCmp(ly_uip[i].url, url, (l = strlen(ly_uip[i].url)))
-			&& (url[l] == '\0' || url[l] == '#')) :
-		       !strcmp(ly_uip[i].url, url)) {
-		return YES;
-	    } else if (ly_uip[i].flags & UIP_F_MULTI) {
-		char *p;
-		HTList *l0 = ly_uip[i].alturls;
-
-		while ((p = (char *) HTList_nextObject(l0)) != NULL) {
-		    if ((flagparam & UIP_P_FRAG) ?
-			(!StrNCmp(p, url, (l = strlen(p)))
-			 && (url[l] == '\0' || url[l] == '#')) :
-			!strcmp(p, url))
-			return YES;
+    if (url) {
+	for (i = 0; i < TABLESIZE(ly_uip); i++) {
+	    if (ly_uip[i].type == type) {
+		if (!ly_uip[i].url) {
+		    break;
+		} else if ((flagparam & UIP_P_FRAG) ?
+			   (!StrNCmp(ly_uip[i].url, url, (l = strlen(ly_uip[i].url)))
+			    && (url[l] == '\0' || url[l] == '#')) :
+			   !strcmp(ly_uip[i].url, url)) {
+		    result = YES;
+		} else if (ly_uip[i].flags & UIP_F_MULTI) {
+		    char *p;
+		    HTList *l0 = ly_uip[i].alturls;
+
+		    while ((p = (char *) HTList_nextObject(l0)) != NULL) {
+			if ((flagparam & UIP_P_FRAG)
+			    ? (!StrNCmp(p, url, (l = strlen(p))) &&
+			       (url[l] == '\0' || url[l] == '#'))
+			    : !strcmp(p, url)) {
+			    result = YES;
+			    break;
+			}
+		    }
 		}
+		break;
 	    }
-	    return NO;
 	}
     }
-    return NO;
+    return result;
 }
 
 void LYRegisterUIPage(const char *url,
the previous revision' href='/akkartik/mu/blame/chessboard-cursor.arc.t?h=hlt&id=e612b44f76e6ab450d82bd34b584053052bd44af'>^
79ca54b3 ^




5b698455 ^
79ca54b3 ^

5b698455 ^
79ca54b3 ^

5b698455 ^
4ca73eb6 ^

5b698455 ^
79ca54b3 ^




df0485ae ^
79ca54b3 ^
df0485ae ^
79ca54b3 ^

4ca73eb6 ^
79ca54b3 ^
5b698455 ^
79ca54b3 ^



f3060715 ^
47588257 ^
0c145043 ^
47588257 ^









14a1649c ^
0c145043 ^

47588257 ^
188206bd ^
47588257 ^









188206bd ^

14a1649c ^


188206bd ^

47588257 ^
188206bd ^
47588257 ^









14a1649c ^


188206bd ^

47588257 ^
33d602db ^
47588257 ^

f7a26719 ^

47588257 ^






f7a26719 ^

47588257 ^



33d602db ^


8799371a ^
cc36784d ^
33d602db ^









8799371a ^
445a1494 ^

47588257 ^
445a1494 ^
47588257 ^

47588257 ^


f7a26719 ^
47588257 ^






f7a26719 ^
47588257 ^















445a1494 ^


8799371a ^
cc36784d ^
445a1494 ^









8799371a ^
33d602db ^
47588257 ^
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239