comparison src/util.c @ 7804:622c9149609c

[gaim-migrate @ 8451] robot101 claims this is better committer: Tailor Script <tailor@pidgin.im>
author Nathan Walp <nwalp@pidgin.im>
date Mon, 08 Dec 2003 03:51:33 +0000
parents db1542e84ee6
children 8e60ddc28a22
comparison
equal deleted inserted replaced
7803:ec291c2cad6a 7804:622c9149609c
436 char *name = NULL; 436 char *name = NULL;
437 gboolean found = FALSE; 437 gboolean found = FALSE;
438 gboolean in_tag = FALSE; 438 gboolean in_tag = FALSE;
439 gboolean in_attr = FALSE; 439 gboolean in_attr = FALSE;
440 const char *in_quotes = NULL; 440 const char *in_quotes = NULL;
441 size_t needlelen = strlen(needle); 441 size_t needlelen;
442 442
443 g_return_val_if_fail( needle != NULL, FALSE);
444 g_return_val_if_fail( *needle != '\0', FALSE);
445 g_return_val_if_fail( haystack != NULL, FALSE);
446 g_return_val_if_fail( *haystack != '\0', FALSE);
447 g_return_val_if_fail( start != NULL, FALSE);
448 g_return_val_if_fail( end != NULL, FALSE);
449 g_return_val_if_fail(attributes != NULL, FALSE);
450
451 needlelen = strlen(needle);
443 g_datalist_init(&attribs); 452 g_datalist_init(&attribs);
444 453
445 while (*cur && !found) { 454 while (*cur && !found) {
446 if (in_tag) { 455 if (in_tag) {
447 if (in_quotes) { 456 if (in_quotes) {
535 * we're not, we've found a longer tag, so we need to skip to the * 544 * we're not, we've found a longer tag, so we need to skip to the *
536 * >, but not being distracted by >s inside quotes. */ 545 * >, but not being distracted by >s inside quotes. */
537 if (*cur == ' ' || *cur == '>') { 546 if (*cur == ' ' || *cur == '>') {
538 in_tag = TRUE; 547 in_tag = TRUE;
539 } else { 548 } else {
540 while (*cur && *cur != '"' && *cur != '>') { 549 while (*cur && *cur != '"' && *cur != '\'' && *cur != '>') {
541 if (*cur == '"') { 550 if (*cur == '"') {
542 cur++; 551 cur++;
543 while (*cur && *cur != '"') 552 while (*cur && *cur != '"')
553 cur++;
554 } else if (*cur == '\'') {
555 cur++;
556 while (*cur && *cur != '\'')
544 cur++; 557 cur++;
545 } else { 558 } else {
546 cur++; 559 cur++;
547 } 560 }
548 } 561 }