Mercurial > pidgin.yaz
comparison src/util.c @ 2048:3366311426df
[gaim-migrate @ 2058]
little things
committer: Tailor Script <tailor@pidgin.im>
author | Eric Warmenhoven <eric@warmenhoven.org> |
---|---|
date | Sun, 17 Jun 2001 08:37:44 +0000 |
parents | 1b8f4b90bf09 |
children | 424a40f12a6c |
comparison
equal
deleted
inserted
replaced
2047:21f1f1e0d4c5 | 2048:3366311426df |
---|---|
132 | 132 |
133 strncpy(cpy, text, strlen(text)); | 133 strncpy(cpy, text, strlen(text)); |
134 cpy[strlen(text)] = 0; | 134 cpy[strlen(text)] = 0; |
135 c = cpy; | 135 c = cpy; |
136 while (*c) { | 136 while (*c) { |
137 if (!strncasecmp(c, "<A", 2)) { | 137 if (!g_strncasecmp(c, "<A", 2)) { |
138 while (1) { | 138 while (1) { |
139 if (!strncasecmp(c, "/A>", 3)) { | 139 if (!strncasecmp(c, "/A>", 3)) { |
140 break; | 140 break; |
141 } | 141 } |
142 text[cnt++] = *c; | 142 text[cnt++] = *c; |
143 c++; | 143 c++; |
144 if (!(*c)) | 144 if (!(*c)) |
145 break; | 145 break; |
146 } | 146 } |
147 } else if ((!strncasecmp(c, "http://", 7) || (!strncasecmp(c, "https://", 8)))) { | 147 } else if ((!g_strncasecmp(c, "http://", 7) || (!g_strncasecmp(c, "https://", 8)))) { |
148 t = c; | 148 t = c; |
149 while (1) { | 149 while (1) { |
150 if (badchar(*t)) { | 150 if (badchar(*t)) { |
151 | 151 |
152 if (*(t) == ',' && (*(t + 1) != ' ')) { | 152 if (*(t) == ',' && (*(t + 1) != ' ')) { |
168 if (!t) | 168 if (!t) |
169 break; | 169 break; |
170 t++; | 170 t++; |
171 | 171 |
172 } | 172 } |
173 } else if (!strncasecmp(c, "www.", 4)) { | 173 } else if (!g_strncasecmp(c, "www.", 4)) { |
174 if (strncasecmp(c, "www..", 5)) { | 174 if (g_strncasecmp(c, "www..", 5)) { |
175 t = c; | 175 t = c; |
176 while (1) { | 176 while (1) { |
177 if (badchar(*t)) { | 177 if (badchar(*t)) { |
178 if (t - c == 4) { | 178 if (t - c == 4) { |
179 break; | 179 break; |
199 if (!t) | 199 if (!t) |
200 break; | 200 break; |
201 t++; | 201 t++; |
202 } | 202 } |
203 } | 203 } |
204 } else if (!strncasecmp(c, "ftp://", 6)) { | 204 } else if (!g_strncasecmp(c, "ftp://", 6)) { |
205 t = c; | 205 t = c; |
206 while (1) { | 206 while (1) { |
207 if (badchar(*t)) { | 207 if (badchar(*t)) { |
208 if (*(t - 1) == '.') | 208 if (*(t - 1) == '.') |
209 t--; | 209 t--; |
219 if (!t) | 219 if (!t) |
220 break; | 220 break; |
221 t++; | 221 t++; |
222 | 222 |
223 } | 223 } |
224 } else if (!strncasecmp(c, "ftp.", 4)) { | 224 } else if (!g_strncasecmp(c, "ftp.", 4)) { |
225 if (strncasecmp(c, "ftp..", 5)) { | 225 if (g_strncasecmp(c, "ftp..", 5)) { |
226 t = c; | 226 t = c; |
227 while (1) { | 227 while (1) { |
228 if (badchar(*t)) { | 228 if (badchar(*t)) { |
229 if (t - c == 4) { | 229 if (t - c == 4) { |
230 break; | 230 break; |
244 if (!t) | 244 if (!t) |
245 break; | 245 break; |
246 t++; | 246 t++; |
247 } | 247 } |
248 } | 248 } |
249 } else if (!strncasecmp(c, "mailto:", 7)) { | 249 } else if (!g_strncasecmp(c, "mailto:", 7)) { |
250 t = c; | 250 t = c; |
251 while (1) { | 251 while (1) { |
252 if (badchar(*t)) { | 252 if (badchar(*t)) { |
253 if (*(t - 1) == '.') | 253 if (*(t - 1) == '.') |
254 t--; | 254 t--; |
264 if (!t) | 264 if (!t) |
265 break; | 265 break; |
266 t++; | 266 t++; |
267 | 267 |
268 } | 268 } |
269 } else if (c != cpy && !strncasecmp(c, "@", 1)) { | 269 } else if (c != cpy && !g_strncasecmp(c, "@", 1)) { |
270 char *tmp; | 270 char *tmp; |
271 int flag; | 271 int flag; |
272 int len = 0; | 272 int len = 0; |
273 char illegal_chars[] = "!@#$%^&*()[]{}/\\<>\":;\0"; | 273 char illegal_chars[] = "!@#$%^&*()[]{}/\\<>\":;\0"; |
274 url_buf[0] = 0; | 274 url_buf[0] = 0; |