Changeset 2b02617 for protocols


Ignore:
Timestamp:
2010-08-11T20:41:23Z (14 years ago)
Author:
Wilmer van der Gaast <wilmer@…>
Branches:
master
Children:
4ffd757
Parents:
72176c1
Message:

strptime() on FreeBSD (and possibly other non-glibc platforms) %z is not
supported, so just insert the literal timezone there - let's hope Twitter
won't ever change that.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • protocols/twitter/twitter_lib.c

    r72176c1 r2b02617  
    357357}
    358358
     359#ifdef __GLIBC__
     360#define TWITTER_TIME_FORMAT "%a %b %d %H:%M:%S %z %Y"
     361#else
     362#define TWITTER_TIME_FORMAT "%a %b %d %H:%M:%S +0000 %Y"
     363#endif
    359364
    360365/**
     
    393398                           this field. :-( Also assumes the timezone used
    394399                           is UTC since C time handling functions suck. */
    395                         if( strptime( child->text, "%a %b %d %H:%M:%S %z %Y", &parsed ) != NULL )
     400                        if( strptime( child->text, TWITTER_TIME_FORMAT, &parsed ) != NULL )
    396401                                txs->created_at = mktime_utc( &parsed );
    397402                }
Note: See TracChangeset for help on using the changeset viewer.