head 1.5; access; symbols; locks; strict; comment @# @; 1.5 date 2009.04.11.21.28.05; author rse; state dead; branches; next 1.4; commitid FRwVpYAlqAmK1EJt; 1.4 date 2009.04.04.22.02.04; author rse; state Exp; branches; next 1.3; commitid yArU2u53OezlrKIt; 1.3 date 2009.04.04.22.00.23; author rse; state Exp; branches; next 1.2; commitid Dkxlxibit4AKqKIt; 1.2 date 2008.11.23.08.00.40; author rse; state dead; branches; next 1.1; commitid vHB6PLwXL5oL1Irt; 1.1 date 2008.07.04.14.18.12; author rse; state Exp; branches; next ; commitid wMQWzit5pKmgGu9t; desc @@ 1.5 log @upgrading package: libopkele 2.0.1 -> 2.0.2 @ text @Index: lib/discovery.cc --- lib/discovery.cc.orig 2008-06-29 20:45:44 +0200 +++ lib/discovery.cc 2009-04-04 23:53:20 +0200 @@@@ -453,25 +450,36 @@@@ --skipping; return; } if(is_qelement(n,NSURI_XRD "\tType")) { - assert(xrd); assert(xrd_service); assert(cdata==&cdata_buf); - xrd_service->types.insert(cdata_buf); + if(xrd && xrd_service) { + assert(cdata==&cdata_buf); + xrd_service->types.insert(cdata_buf); + } }else if(is_qelement(n,NSURI_XRD "\tService")) { - assert(xrd); assert(xrd_service); - assert(!pt_stack.empty()); - assert(pt_stack.back()==(NSURI_XRD "\tService")); - pt_stack.pop_back(); - xrd_service = 0; - }else if(is_qelement(n,NSURI_XRD "\tStatus")) { - assert(xrd); - if(is_qelement(pt_stack.back().c_str(),n)) { - assert(cdata==&status_string); + if(!(xrd && xrd_service)) { + skipping = -1; + }else{ + assert(!pt_stack.empty()); + assert(pt_stack.back()==(NSURI_XRD "\tService")); pt_stack.pop_back(); - if(status_code!=100) - skipping = -1; + xrd_service = 0; + } + }else if(is_qelement(n,NSURI_XRD "\tStatus")) { + if(!xrd) { + skipping=-1; + }else{ + if(is_qelement(pt_stack.back().c_str(),n)) { + assert(cdata==&status_string); + pt_stack.pop_back(); + if(status_code!=100) + skipping = -1; + } } }else if(is_qelement(n,NSURI_XRD "\tExpires")) { - assert(xrd); - xrd->expires = util::w3c_to_time(cdata_buf); + if(!xrd) { + skipping=-1; + }else{ + xrd->expires = util::w3c_to_time(cdata_buf); + } }else if((xmode&xmode_html) && is_element(n,"head")) { skipping = -1; } @ 1.4 log @reduce patch @ text @@ 1.3 log @more vendor fixes @ text @a0 12 Index: include/opkele/iterator.h --- include/opkele/iterator.h.orig 2008-09-22 22:14:18 +0200 +++ include/opkele/iterator.h 2009-04-04 23:53:20 +0200 @@@@ -103,7 +103,7 @@@@ ~forward_iterator_proxy() { delete I; } forward_iterator_proxy& operator=(const forward_iterator_proxy& x) { - delete I; I = x.I->dup(); return *this; } + delete I; I = x.I->dup(); } bool operator==(const forward_iterator_proxy& x) const { return (*I)==(*(x.I)); } a3 15 @@@@ -253,12 +253,9 @@@@ util::tidy_doc_t td = util::tidy_doc_t::create(); if(!td) throw exception_tidy(OPKELE_CP_ "failed to create htmltidy document"); -#ifdef NDEBUG - td.opt_set(TidyQuiet,true); - td.opt_set(TidyShowWarnings,false); -#else /* NDEBUG */ +#ifndef NDEBUG td.opt_set(TidyQuiet,false); - td.opt_set(TidyShowWarnings,true); + td.opt_set(TidyShowWarnings,false); #endif /* NDEBUG */ td.opt_set(TidyForceOutput,true); td.opt_set(TidyXhtmlOut,true); a55 19 Index: lib/util.cc --- lib/util.cc.orig 2008-09-22 22:14:18 +0200 +++ lib/util.cc 2009-04-04 23:53:20 +0200 @@@@ -210,7 +210,6 @@@@ string url_decode(const string& str) { string rv; back_insert_iterator ii(rv); - char tmp[3]; tmp[2] = 0; for(string::const_iterator i=str.begin(),ie=str.end(); i!=ie;++i) { switch(*i) { @@@@ -218,6 +217,7 @@@@ *(ii++) = ' '; break; case '%': ++i; + static char tmp[3] = {0,0,0}; if(i==ie) throw failed_conversion(OPKELE_CP_ "trailing percent in the url-encoded string"); tmp[0] = *(i++); @ 1.2 log @upgrading package: libopkele 2.0 -> 2.0.1 @ text @d1 5 a5 5 Index: configure.ac --- configure.ac +++ configure.ac @@@@ -10,6 +10,7 @@@@ AC_PROG_LIBTOOL PKG_PROG_PKG_CONFIG d7 3 a9 2 AC_HEADER_STDC +AC_CHECK_FUNCS([timegm]) d11 91 a101 41 AC_PATH_PROG([XSLTPROC],[xsltproc],[true]) Iindex: lib/util.cc --- lib/util.cc +++ lib/util.cc @@@@ -122,6 +122,21 @@@@ namespace opkele { return rv; } +#ifndef HAVE_TIMEGM + static time_t timegm(struct tm *t) { + char *tz = getenv("TZ"); + setenv("TZ","",1); tzset(); + time_t rv = mktime(t); + if(tz) + setenv("TZ",tz,1); + else + unsetenv("TZ"); + tzset(); + return rv; + } +# define timegm opkele::util::timegm +#endif /* HAVE_TIMEGM */ + time_t w3c_to_time(const string& w) { int fraction; struct tm tm_t; @@@@ -145,10 +160,10 @@@@ namespace opkele { throw failed_conversion(OPKELE_CP_ "failed to sscanf()"); tm_t.tm_mon--; tm_t.tm_year-=1900; - time_t rv = mktime(&tm_t); + time_t rv = timegm(&tm_t); if(rv==(time_t)-1) - throw failed_conversion(OPKELE_CP_ "failed to mktime()"); - return rv-timezone; + throw failed_conversion(OPKELE_CP_ "failed to gmtime()"); + return rv; } /* @ 1.1 log @new package: libopkele 2.0 (OpenID Protocol Library) @ text @@