Mercurial > pidgin
comparison src/util.c @ 3330:af52fdf06166
[gaim-migrate @ 3348]
E-mail addresses are no longer truncated when there is a '.' at the end.
committer: Tailor Script <tailor@pidgin.im>
author | Christian Hammond <chipx86@chipx86.com> |
---|---|
date | Sat, 22 Jun 2002 00:40:47 +0000 |
parents | 86fdd015f40e |
children | 8f69ff64f0bf |
comparison
equal
deleted
inserted
replaced
3329:e099cf9a9586 | 3330:af52fdf06166 |
---|---|
250 } | 250 } |
251 } else if (c != cpy && !g_strncasecmp(c, "@", 1)) { | 251 } else if (c != cpy && !g_strncasecmp(c, "@", 1)) { |
252 char *tmp; | 252 char *tmp; |
253 int flag; | 253 int flag; |
254 int len = 0; | 254 int len = 0; |
255 char illegal_chars[] = "!@#$%^&*()[]{}/\\<>\":;\0"; | 255 char illegal_chars[] = "!@#$%^&*()[]{}/|\\<>\":;\0"; |
256 url_buf[0] = 0; | 256 url_buf[0] = 0; |
257 | 257 |
258 if (*(c - 1) == ' ' || *(c + 1) == ' ' || rindex(illegal_chars, *(c + 1)) | 258 if (*(c - 1) == ' ' || *(c + 1) == ' ' || rindex(illegal_chars, *(c + 1)) |
259 || *(c + 1) == 13 || *(c + 1) == 10) | 259 || *(c + 1) == 13 || *(c + 1) == 10) |
260 flag = 0; | 260 flag = 0; |
281 break; | 281 break; |
282 } | 282 } |
283 } | 283 } |
284 } | 284 } |
285 | 285 |
286 | |
287 t = c + 1; | 286 t = c + 1; |
288 | 287 |
289 while (flag) { | 288 while (flag) { |
290 if (badchar(*t)) { | 289 if (badchar(*t)) { |
291 if (*(t - 1) == '.') { | 290 while (*(t - 1) == '.') { |
292 url_buf[t-c] = '\0'; | 291 url_buf[t - cpy - 1] = '\0'; |
293 t--; | 292 t--; |
294 } | 293 } |
294 | |
295 cnt += g_snprintf(&text[cnt], 1024, | 295 cnt += g_snprintf(&text[cnt], 1024, |
296 "<A HREF=\"mailto:%s\">%s</A>", url_buf, | 296 "<A HREF=\"mailto:%s\">%s</A>", url_buf, |
297 url_buf); | 297 url_buf); |
298 text[cnt] = 0; | 298 text[cnt] = 0; |
299 | 299 |
306 len++; | 306 len++; |
307 url_buf[len] = 0; | 307 url_buf[len] = 0; |
308 } | 308 } |
309 | 309 |
310 t++; | 310 t++; |
311 | 311 } |
312 } | |
313 | |
314 | |
315 } | 312 } |
316 | 313 |
317 if (*c == 0) | 314 if (*c == 0) |
318 break; | 315 break; |
319 | 316 |