- Timestamp:
- Dec 28, 2007, 5:04:34 PM (16 years ago)
- Branches:
- master, barnowl_perlaim, debian, release-1.10, release-1.4, release-1.5, release-1.6, release-1.7, release-1.8, release-1.9
- Children:
- 6201646
- Parents:
- 925e122
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
zephyr.c
r50e29e3 r5376a95 354 354 return(owl_strdup("")); 355 355 } 356 357 char *owl_zephyr_get_field_as_utf8(ZNotice_t *n, int j) 358 { 359 int i, count, save; 360 361 /* If there's no message here, just run along now */ 362 if (n->z_message_len == 0) 363 return(owl_strdup("")); 364 365 count=save=0; 366 for (i = 0; i < n->z_message_len; i++) { 367 if (n->z_message[i]=='\0') { 368 count++; 369 if (count == j) { 370 /* just found the end of the field we're looking for */ 371 return(owl_validate_or_convert(n->z_message + save, -1)); 372 } else { 373 save = i + 1; 374 } 375 } 376 } 377 /* catch the last field, which might not be null terminated */ 378 if (count == j - 1) { 379 return owl_validate_or_convert(n->z_message + save, n->z_message_len - save); 380 } 381 382 return(owl_strdup("")); 383 } 356 384 #else 357 385 char *owl_zephyr_get_field(void *n, int j) 358 386 { 359 387 return(owl_strdup("")); 388 } 389 char *owl_zephyr_get_field_as_utf8(ZNotice_t *n, int j) 390 { 391 return owl_zephyr_get_field(n, j); 360 392 } 361 393 #endif
Note: See TracChangeset
for help on using the changeset viewer.