Changeset 7d2ce9a
- Timestamp:
- 2012-06-03T23:31:01Z (12 years ago)
- Branches:
- master
- Children:
- 1a0b734, 5ffa4f7, c43f488
- Parents:
- 7a2a486
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
protocols/twitter/twitter_lib.c
r7a2a486 r7d2ce9a 501 501 struct xt_node *urls, *url; 502 502 503 urls = xt_find_path(node, "entities/urls"); 504 for (url = urls ? urls->children : NULL; url; url = url->next) { 505 /* "short" is a reserved word. :-P */ 506 struct xt_node *kort = xt_find_node(url->children, "url"); 507 struct xt_node *disp = xt_find_node(url->children, "display_url"); 508 char *pos, *new; 509 510 if (!kort || !kort->text || !disp || !disp->text || 511 !(pos = strstr(txs->text, kort->text))) 503 urls = xt_find_path(node, "entities"); 504 if (urls != NULL) 505 urls = urls->children; 506 for (; urls; urls = urls->next) { 507 if (strcmp(urls->name, "urls") != 0 && strcmp(urls->name, "media") != 0) 512 508 continue; 513 509 514 *pos = '\0'; 515 new = g_strdup_printf("%s%s <%s>%s", txs->text, kort->text, 516 disp->text, pos + strlen(kort->text)); 517 518 g_free(txs->text); 519 txs->text = new; 510 for (url = urls ? urls->children : NULL; url; url = url->next) { 511 /* "short" is a reserved word. :-P */ 512 struct xt_node *kort = xt_find_node(url->children, "url"); 513 struct xt_node *disp = xt_find_node(url->children, "display_url"); 514 char *pos, *new; 515 516 if (!kort || !kort->text || !disp || !disp->text || 517 !(pos = strstr(txs->text, kort->text))) 518 continue; 519 520 *pos = '\0'; 521 new = g_strdup_printf("%s%s <%s>%s", txs->text, kort->text, 522 disp->text, pos + strlen(kort->text)); 523 524 g_free(txs->text); 525 txs->text = new; 526 } 520 527 } 521 528 }
Note: See TracChangeset
for help on using the changeset viewer.