Changeset b70d24f for zephyr.c


Ignore:
Timestamp:
Feb 19, 2008, 1:23:14 AM (16 years ago)
Author:
Alejandro R. Sedeño <asedeno@mit.edu>
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:
07bfbc2
Parents:
5f3168a (diff), 2f69081 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:
Merged revisions 951-954 via svnmerge from 
file:///afs/sipb.mit.edu/project/barnowl/src/svn/trunk

........
  r954 | asedeno | 2008-02-19 01:22:48 -0500 (Tue, 19 Feb 2008) | 1 line
  
  Fixing AIM post select()
........
File:
1 edited

Legend:

Unmodified
Added
Removed
  • zephyr.c

    r9c7a701 r5f3168a  
    353353  return(owl_strdup(""));
    354354}
     355
     356char *owl_zephyr_get_field_as_utf8(ZNotice_t *n, int j)
     357{
     358  int i, count, save;
     359
     360  /* If there's no message here, just run along now */
     361  if (n->z_message_len == 0)
     362    return(owl_strdup(""));
     363
     364  count=save=0;
     365  for (i = 0; i < n->z_message_len; i++) {
     366    if (n->z_message[i]=='\0') {
     367      count++;
     368      if (count == j) {
     369        /* just found the end of the field we're looking for */
     370        return(owl_validate_or_convert(n->z_message + save));
     371      } else {
     372        save = i + 1;
     373      }
     374    }
     375  }
     376  /* catch the last field, which might not be null terminated */
     377  if (count == j - 1) {
     378    char *tmp, *out;
     379    tmp = owl_malloc(n->z_message_len-save+5);
     380    memcpy(tmp, n->z_message+save, n->z_message_len-save);
     381    tmp[n->z_message_len-save]='\0';
     382    out = owl_validate_or_convert(tmp);
     383    owl_free(tmp);
     384    return out;
     385  }
     386
     387  return(owl_strdup(""));
     388}
    355389#else
    356390char *owl_zephyr_get_field(void *n, int j)
    357391{
    358392  return(owl_strdup(""));
     393}
     394char *owl_zephyr_get_field_as_utf8(ZNotice_t *n, int j)
     395{
     396  return owl_zephyr_get_field(n, j);
    359397}
    360398#endif
Note: See TracChangeset for help on using the changeset viewer.