8000 Still another try at automatically detecting the best match in the zic · postgres/postgres@e31c8cf · GitHub
[go: up one dir, main page]

Skip to content
{"payload":{"commit":{"oid":"e31c8cf20b941ac48cc067c8114351da7db682f3","url":"/postgres/postgres/commit/e31c8cf20b941ac48cc067c8114351da7db682f3","authoredDate":"2004-07-22T05:28:30.000Z","committedDate":"2004-07-22T05:28:30.000Z","shortMessage":null,"shortMessageMarkdown":"\u003cdiv\u003eStill another try at automatically detecting the best match in the zic\u003c/div\u003e","shortMessageMarkdownLink":null,"bodyMessageHtml":"timezone database for the system behavior we find ourselves in. Scan\nbackwards from current time and choose the zone that matches furthest\nback. As per discussion a week or so back.","authors":[{"login":"tglsfdc","displayName":"Tom Lane","avatarUrl":"https://avatars.githubusercontent.com/u/8755309?v=4","path":"/tglsfdc","isGitHub":false}],"committerAttribution":false,"committer":{"login":"tglsfdc","displayName":"Tom Lane","avatarUrl":"https://avatars.githubusercontent.com/u/8755309?v=4","path":"/tglsfdc","isGitHub":false},"parents":["664291107e9addbe24476a8a7961c85343bd3526"],"globalRelayId":"MDY6Q29tbWl0OTI3NDQyOmUzMWM4Y2YyMGI5NDFhYzQ4Y2MwNjdjODExNDM1MWRhN2RiNjgyZjM=","sha1":"664291107e9addbe24476a8a7961c85343bd3526","sha2":"e31c8cf20b941ac48cc067c8114351da7db682f3"},"currentUser":null,"repo":{"id":927442,"defaultBranch":"master","name":"postgres","ownerLogin":"postgres","currentUserCanPush":false,"isFork":false,"isEmpty":false,"createdAt":"2010-09-21T11:35:45.000Z","ownerAvatar":"https://avatars.githubusercontent.com/u/177543?v=4","public":true,"private":false,"isOrgOwned":true},"diffEntryData":[{"diffLines":[{"stylingDirective":null,"type":"HUNK","blobLineNumber":5,"text":"@@ -6,7 +6,7 @@","html":"@@ -6,7 +6,7 @@","displayNoNewLineWarning":false,"position":0,"left":5,"right":5},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":6,"text":" * Portions Copyright (c) 1996-2003, PostgreSQL Global Development Group","html":" \u003cspan class=pl-c\u003e * Portions Copyright (c) 1996-2003, PostgreSQL Global Development Group\u003c/span\u003e","displayNoNewLineWarning":false,"position":1,"left":6,"right":6},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":7,"text":" *","html":" \u003cspan class=pl-c\u003e *\u003c/span\u003e","displayNoNewLineWarning":false,"position":2,"left":7,"right":7},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":8,"text":" * IDENTIFICATION","html":" \u003cspan class=pl-c\u003e * IDENTIFICATION\u003c/span\u003e","displayNoNewLineWarning":false,"position":3,"left":8,"right":8},{"stylingDirective":null,"type":"DELETION","blobLineNumber":9,"text":"- *\t $PostgreSQL: pgsql/src/timezone/pgtz.c,v 1.18 2004/07/10 23:06:50 tgl Exp $","html":"-\u003cspan class=\"pl-c\"\u003e *\t $PostgreSQL: pgsql/src/timezone/pgtz.c,v 1.\u003cspan class=\"x x-first x-last\"\u003e18\u003c/span\u003e 2004/07/\u003cspan class=\"x x-first x-last\"\u003e10 23:06:50\u003c/span\u003e tgl Exp $\u003c/span\u003e","displayNoNewLineWarning":false,"position":4,"left":9,"right":8},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":9,"text":"+ *\t $PostgreSQL: pgsql/src/timezone/pgtz.c,v 1.19 2004/07/22 05:28:30 tgl Exp $","html":"+\u003cspan class=\"pl-c\"\u003e *\t $PostgreSQL: pgsql/src/timezone/pgtz.c,v 1.\u003cspan class=\"x x-first x-last\"\u003e19\u003c/span\u003e 2004/07/\u003cspan class=\"x x-first x-last\"\u003e22 05:28:30\u003c/span\u003e tgl Exp $\u003c/span\u003e","displayNoNewLineWarning":false,"position":5,"left":9,"right":9},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":10,"text":" *","html":" \u003cspan class=pl-c\u003e *\u003c/span\u003e","displayNoNewLineWarning":false,"position":6,"left":10,"right":10},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":11,"text":" *-------------------------------------------------------------------------","html":" \u003cspan class=pl-c\u003e *-------------------------------------------------------------------------\u003c/span\u003e","displayNoNewLineWarning":false,"position":7,"left":11,"right":11},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":12,"text":" */","html":" \u003cspan class=pl-c\u003e */\u003c/span\u003e","displayNoNewLineWarning":false,"position":8,"left":12,"right":12},{"stylingDirective":null,"type":"HUNK","blobLineNumber":31,"text":"@@ -32,7 +32,7 @@","html":"@@ -32,7 +32,7 @@","displayNoNewLineWarning":false,"position":9,"left":31,"right":31},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":32,"text":" #define T_WEEK ((time_t) (60*60*24*7))","html":" \u003cspan class=pl-k\u003e#define\u003c/span\u003e \u003cspan class=pl-c1\u003eT_WEEK\u003c/span\u003e ((time_t) (60*60*24*7))","displayNoNewLineWarning":false,"position":10,"left":32,"right":32},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":33,"text":" #define T_MONTH ((time_t) (60*60*24*31))","html":" \u003cspan class=pl-k\u003e#define\u003c/span\u003e \u003cspan class=pl-c1\u003eT_MONTH\u003c/span\u003e ((time_t) (60*60*24*31))","displayNoNewLineWarning":false,"position":11,"left":33,"right":33},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":34,"text":" ","html":"\u003cbr\u003e","displayNoNewLineWarning":false,"position":12,"left":34,"right":34},{"stylingDirective":null,"type":"DELETION","blobLineNumber":35,"text":"-#define MAX_TEST_TIMES (52*35)\t/* 35 years, or 1970..2004 */","html":"-\u003cspan class=\"pl-k\"\u003e#define\u003c/span\u003e \u003cspan class=\"pl-c1\"\u003eMAX_TEST_TIMES\u003c/span\u003e (52*\u003cspan class=\"x x-first x-last\"\u003e35\u003c/span\u003e)\t\u003cspan class=\"pl-c\"\u003e/* \u003cspan class=\"x x-first x-last\"\u003e35\u003c/span\u003e years, or \u003cspan class=\"x x-first x-last\"\u003e1970\u003c/span\u003e..2004 */\u003c/span\u003e","displayNoNewLineWarning":false,"position":13,"left":35,"right":34},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":35,"text":"+#define MAX_TEST_TIMES (52*40)\t/* 40 years, or 1964..2004 */","html":"+\u003cspan class=\"pl-k\"\u003e#define\u003c/span\u003e \u003cspan class=\"pl-c1\"\u003eMAX_TEST_TIMES\u003c/span\u003e (52*\u003cspan class=\"x x-first x-last\"\u003e40\u003c/span\u003e)\t\u003cspan class=\"pl-c\"\u003e/* \u003cspan class=\"x x-first x-last\"\u003e40\u003c/span\u003e years, or \u003cspan class=\"x x-first x-last\"\u003e1964\u003c/span\u003e..2004 */\u003c/span\u003e","displayNoNewLineWarning":false,"position":14,"left":35,"right":35},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":36,"text":" ","html":"\u003cbr\u003e","displayNoNewLineWarning":false,"position":15,"left":36,"right":36},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":37,"text":" struct tztry","html":" \u003cspan class=pl-k\u003estruct\u003c/span\u003e \u003cspan class=pl-smi\u003etztry\u003c/span\u003e","displayNoNewLineWarning":false,"position":16,"left":37,"right":37},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":38,"text":" {","html":" {","displayNoNewLineWarning":false,"position":17,"left":38,"right":38},{"stylingDirective":null,"type":"HUNK","blobLineNumber":42,"text":"@@ -43,8 +43,9 @@ struct tztry","html":"@@ -43,8 +43,9 @@ struct tztry","displayNoNewLineWarning":false,"position":18,"left":42,"right":42},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":43,"text":" static char tzdir[MAXPGPATH];","html":" \u003cspan class=pl-k\u003estatic\u003c/span\u003e \u003cspan class=pl-smi\u003echar\u003c/span\u003e \u003cspan class=pl-s1\u003etzdir\u003c/span\u003e[\u003cspan class=pl-c1\u003eMAXPGPATH\u003c/span\u003e];","displayNoNewLineWarning":false,"position":19,"left":43,"right":43},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":44,"text":" static int\tdone_tzdir = 0;","html":" \u003cspan class=pl-k\u003estatic\u003c/span\u003e \u003cspan class=pl-smi\u003eint\u003c/span\u003e\t\u003cspan class=pl-s1\u003edone_tzdir\u003c/span\u003e \u003cspan class=pl-c1\u003e=\u003c/span\u003e \u003cspan class=pl-c1\u003e0\u003c/span\u003e;","displayNoNewLineWarning":false,"position":20,"left":44,"right":44},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":45,"text":" ","html":"\u003cbr\u003e","displayNoNewLineWarning":false,"position":21,"left":45,"right":45},{"stylingDirective":null,"type":"DELETION","blobLineNumber":46,"text":"-static bool scan_available_timezones(char *tzdir, char *tzdirsub,","html":"-\u003cspan class=pl-k\u003estatic\u003c/span\u003e \u003cspan class=pl-smi\u003ebool\u003c/span\u003e \u003cspan class=pl-en\u003escan_available_timezones\u003c/span\u003e(\u003cspan class=pl-smi\u003echar\u003c/span\u003e \u003cspan class=pl-c1\u003e*\u003c/span\u003e\u003cspan class=pl-s1\u003etzdir\u003c/span\u003e, \u003cspan class=pl-smi\u003echar\u003c/span\u003e \u003cspan class=pl-c1\u003e*\u003c/span\u003e\u003cspan class=pl-s1\u003etzdirsub\u003c/span\u003e,","displayNoNewLineWarning":false,"position":22,"left":46,"right":45},{"stylingDirective":null,"type":"DELETION","blobLineNumber":47,"text":"-\t\t\t\t\t\t\t\t\t struct tztry *tt);","html":"-\t\t\t\t\t\t\t\t\t \u003cspan class=pl-k\u003estruct\u003c/span\u003e \u003cspan class=pl-smi\u003etztry\u003c/span\u003e \u003cspan class=pl-c1\u003e*\u003c/span\u003e\u003cspan class=pl-s1\u003ett\u003c/span\u003e);","displayNoNewLineWarning":false,"position":23,"left":47,"right":45},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":46,"text":"+static void scan_available_timezones(char *tzdir, char *tzdirsub,","html":"+\u003cspan class=pl-k\u003estatic\u003c/span\u003e \u003cspan class=pl-smi\u003evoid\u003c/span\u003e \u003cspan class=pl-en\u003escan_available_timezones\u003c/span\u003e(\u003cspan class=pl-smi\u003echar\u003c/span\u003e \u003cspan class=pl-c1\u003e*\u003c/span\u003e\u003cspan class=pl-s1\u003etzdir\u003c/span\u003e, \u003cspan class=pl-smi\u003echar\u003c/span\u003e \u003cspan class=pl-c1\u003e*\u003c/span\u003e\u003cspan class=pl-s1\u003etzdirsub\u003c/span\u003e,","displayNoNewLineWarning":false,"position":24,"left":47,"right":46},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":47,"text":"+\t\t\t\t\t\t\t\t\t struct tztry *tt,","html":"+\t\t\t\t\t\t\t\t\t \u003cspan class=pl-k\u003estruct\u003c/span\u003e \u003cspan class=pl-smi\u003etztry\u003c/span\u003e \u003cspan class=pl-c1\u003e*\u003c/span\u003e\u003cspan class=pl-s1\u003ett\u003c/span\u003e,","displayNoNewLineWarning":false,"position":25,"left":47,"right":47},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":48,"text":"+\t\t\t\t\t\t\t\t\t int *bestscore, char *bestzonename);","html":"+\t\t\t\t\t\t\t\t\t \u003cspan class=pl-smi\u003eint\u003c/span\u003e \u003cspan class=pl-c1\u003e*\u003c/span\u003e\u003cspan class=pl-s1\u003ebestscore\u003c/span\u003e, \u003cspan class=pl-smi\u003echar\u003c/span\u003e \u003cspan class=pl-c1\u003e*\u003c/span\u003e\u003cspan class=pl-s1\u003ebestzonename\u003c/span\u003e);","displayNoNewLineWarning":false,"position":26,"left":47,"right":48},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":49,"text":" ","html":"\u003cbr\u003e","displayNoNewLineWarning":false,"position":27,"left":48,"right":49},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":50,"text":" ","html":"\u003cbr\u003e","displayNoNewLineWarning":false,"position":28,"left":49,"right":50},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":51,"text":" /*","html":" \u003cspan class=pl-c\u003e/*\u003c/span\u003e","displayNoNewLineWarning":false,"position":29,"left":50,"right":51},{"stylingDirective":null,"type":"HUNK","blobLineNumber":144,"text":"@@ -144,10 +145,18 @@ compare_tm(struct tm *s, struct pg_tm *p)","html":"@@ -144,10 +145,18 @@ compare_tm(struct tm *s, struct pg_tm *p)","displayNoNewLineWarning":false,"position":30,"left":143,"right":144},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":145,"text":" }","html":" }","displayNoNewLineWarning":false,"position":31,"left":144,"right":145},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":146,"text":" ","html":"\u003cbr\u003e","displayNoNewLineWarning":false,"position":32,"left":145,"right":146},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":147,"text":" /*","html":" \u003cspan class=pl-c\u003e/*\u003c/span\u003e","displayNoNewLineWarning":false,"position":33,"left":146,"right":147},{"stylingDirective":null,"type":"DELETION","blobLineNumber":147,"text":"- * See if a specific timezone setting matches the system behavior","html":"-\u003cspan class=pl-c\u003e * See if a specific timezone setting matches the system behavior\u003c/span\u003e","displayNoNewLineWarning":false,"position":34,"left":147,"right":147},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":148,"text":"+ * See how well a specific timezone setting matches the system behavior","html":"+\u003cspan class=pl-c\u003e * See how well a specific timezone setting matches the system behavior\u003c/span\u003e","displayNoNewLineWarning":false,"position":35,"left":147,"right":148},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":149,"text":"+ *","html":"+\u003cspan class=pl-c\u003e *\u003c/span\u003e","displayNoNewLineWarning":false,"position":36,"left":147,"right":149},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":150,"text":"+ * We score a timezone setting according to the number of test times it","html":"+\u003cspan class=pl-c\u003e * We score a timezone setting according to the number of test times it\u003c/span\u003e","displayNoNewLineWarning":false,"position":37,"left":147,"right":150},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":151,"text":"+ * matches. (The test times are ordered later-to-earlier, but this routine","html":"+\u003cspan class=pl-c\u003e * matches. (The test times are ordered later-to-earlier, but this routine\u003c/span\u003e","displayNoNewLineWarning":false,"position":38,"left":147,"right":151},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":152,"text":"+ * doesn't actually know that; it just scans until the first non-match.)","html":"+\u003cspan class=pl-c\u003e * doesn\u0026#39;t actually know that; it just scans until the first non-match.)\u003c/span\u003e","displayNoNewLineWarning":false,"position":39,"left":147,"right":152},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":153,"text":"+ *","html":"+\u003cspan class=pl-c\u003e *\u003c/span\u003e","displayNoNewLineWarning":false,"position":40,"left":147,"right":153},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":154,"text":"+ * We return -1 for a completely unusable setting; this is worse than the","html":"+\u003cspan class=pl-c\u003e * We return -1 for a completely unusable setting; this is worse than the\u003c/span\u003e","displayNoNewLineWarning":false,"position":41,"left":147,"right":154},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":155,"text":"+ * score of zero for a setting that works but matches not even the first","html":"+\u003cspan class=pl-c\u003e * score of zero for a setting that works but matches not even the first\u003c/span\u003e","displayNoNewLineWarning":false,"position":42,"left":147,"right":155},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":156,"text":"+ * test time.","html":"+\u003cspan class=pl-c\u003e * test time.\u003c/span\u003e","displayNoNewLineWarning":false,"position":43,"left":147,"right":156},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":157,"text":" */","html":" \u003cspan class=pl-c\u003e */\u003c/span\u003e","displayNoNewLineWarning":false,"position":44,"left":148,"right":157},{"stylingDirective":null,"type":"DELETION","blobLineNumber":149,"text":"-static bool","html":"-\u003cspan class=\"pl-k\"\u003estatic\u003c/span\u003e \u003cspan class=\"pl-smi x x-first x-last\"\u003ebool\u003c/span\u003e","displayNoNewLineWarning":false,"position":45,"left":149,"right":157},{"stylingDirective":null,"type":"DELETION","blobLineNumber":150,"text":"-try_timezone(const char *tzname, struct tztry *tt)","html":"-\u003cspan class=\"pl-en x x-first x-last\"\u003etry_timezone\u003c/span\u003e(\u003cspan class=\"pl-k\"\u003econst\u003c/span\u003e \u003cspan class=\"pl-smi\"\u003echar\u003c/span\u003e \u003cspan class=\"pl-c1\"\u003e*\u003c/span\u003e\u003cspan class=\"pl-s1\"\u003etzname\u003c/span\u003e, \u003cspan class=\"pl-k\"\u003estruct\u003c/span\u003e \u003cspan class=\"pl-smi\"\u003etztry\u003c/span\u003e \u003cspan class=\"pl-c1\"\u003e*\u003c/span\u003e\u003cspan class=\"pl-s1\"\u003ett\u003c/span\u003e)","displayNoNewLineWarning":false,"position":46,"left":150,"right":157},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":158,"text":"+static int","html":"+\u003cspan class=\"pl-k\"\u003estatic\u003c/span\u003e \u003cspan class=\"pl-smi x x-first x-last\"\u003eint\u003c/span\u003e","displayNoNewLineWarning":false,"position":47,"left":150,"right":158},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":159,"text":"+score_timezone(const char *tzname, struct tztry *tt)","html":"+\u003cspan class=\"pl-en x x-first x-last\"\u003escore_timezone\u003c/span\u003e(\u003cspan class=\"pl-k\"\u003econst\u003c/span\u003e \u003cspan class=\"pl-smi\"\u003echar\u003c/span\u003e \u003cspan class=\"pl-c1\"\u003e*\u003c/span\u003e\u003cspan class=\"pl-s1\"\u003etzname\u003c/span\u003e, \u003cspan class=\"pl-k\"\u003estruct\u003c/span\u003e \u003cspan class=\"pl-smi\"\u003etztry\u003c/span\u003e \u003cspan class=\"pl-c1\"\u003e*\u003c/span\u003e\u003cspan class=\"pl-s1\"\u003ett\u003c/span\u003e)","displayNoNewLineWarning":false,"position":48,"left":150,"right":159},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":160,"text":" {","html":" {","displayNoNewLineWarning":false,"position":49,"left":151,"right":160},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":161,"text":" \tint\t\t\ti;","html":" \t\u003cspan class=pl-smi\u003eint\u003c/span\u003e\t\t\t\u003cspan class=pl-s1\u003ei\u003c/span\u003e;","displayNoNewLineWarning":false,"position":50,"left":152,"right":161},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":162,"text":" \tpg_time_t\tpgtt;","html":" \t\u003cspan class=pl-smi\u003epg_time_t\u003c/span\u003e\t\u003cspan class=pl-s1\u003epgtt\u003c/span\u003e;","displayNoNewLineWarning":false,"position":51,"left":153,"right":162},{"stylingDirective":null,"type":"HUNK","blobLineNumber":164,"text":"@@ -156,59 +165,59 @@ try_timezone(const char *tzname, struct tztry *tt)","html":"@@ -156,59 +165,59 @@ try_timezone(const char *tzname, struct tztry *tt)","displayNoNewLineWarning":false,"position":52,"left":155,"right":164},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":165,"text":" \tchar\t\tcbuf[TZ_STRLEN_MAX + 1];","html":" \t\u003cspan class=pl-smi\u003echar\u003c/span\u003e\t\t\u003cspan class=pl-s1\u003ecbuf\u003c/span\u003e[\u003cspan class=pl-c1\u003eTZ_STRLEN_MAX\u003c/span\u003e \u003cspan class=pl-c1\u003e+\u003c/span\u003e \u003cspan class=pl-c1\u003e1\u003c/span\u003e];","displayNoNewLineWarning":false,"position":53,"left":156,"right":165},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":166,"text":" ","html":"\u003cbr\u003e","displayNoNewLineWarning":false,"position":54,"left":157,"right":166},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":167,"text":" \tif (!pg_tzset(tzname))","html":" \t\u003cspan class=pl-k\u003eif\u003c/span\u003e (!\u003cspan class=pl-en\u003epg_tzset\u003c/span\u003e(\u003cspan class=pl-s1\u003etzname\u003c/span\u003e))","displayNoNewLineWarning":false,"position":55,"left":158,"right":167},{"stylingDirective":null,"type":"DELETION","blobLineNumber":159,"text":"-\t\treturn false;\t\t\t/* can't handle the TZ name at all */","html":"-\t\t\u003cspan class=pl-k\u003ereturn\u003c/span\u003e false;\t\t\t\u003cspan class=pl-c\u003e/* can\u0026#39;t handle the TZ name at all */\u003c/span\u003e","displayNoNewLineWarning":false,"position":56,"left":159,"right":167},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":168,"text":"+\t\treturn -1;\t\t\t\t/* can't handle the TZ name at all */","html":"+\t\t\u003cspan class=pl-k\u003ereturn\u003c/span\u003e \u003cspan class=pl-c1\u003e-1\u003c/span\u003e;\t\t\t\t\u003cspan class=pl-c\u003e/* can\u0026#39;t handle the TZ name at all */\u003c/span\u003e","displayNoNewLineWarning":false,"position":57,"left":159,"right":168},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":169,"text":"+","html":"+","displayNoNewLineWarning":false,"position":58,"left":159,"right":169},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":170,"text":"+\t/* Reject if leap seconds involved */","html":"+\t\u003cspan class=pl-c\u003e/* Reject if leap seconds involved */\u003c/span\u003e","displayNoNewLineWarning":false,"position":59,"left":159,"right":170},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":171,"text":"+\tif (!tz_acceptable())","html":"+\t\u003cspan class=pl-k\u003eif\u003c/span\u003e (!\u003cspan class=pl-en\u003etz_acceptable\u003c/span\u003e())","displayNoNewLineWarning":false,"position":60,"left":159,"right":171},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":172,"text":"+\t{","html":"+\t{","displayNoNewLineWarning":false,"position":61,"left":159,"right":172},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":173,"text":"+\t\telog(DEBUG4, \"Reject TZ \\\"%s\\\": uses leap seconds\", tzname);","html":"+\t\t\u003cspan class=pl-en\u003eelog\u003c/span\u003e(\u003cspan class=pl-c1\u003eDEBUG4\u003c/span\u003e, \u003cspan class=pl-s\u003e\u0026quot;Reject TZ \\\u0026quot;%s\\\u0026quot;: uses leap seconds\u0026quot;\u003c/span\u003e, \u003cspan class=pl-s1\u003etzname\u003c/span\u003e);","displayNoNewLineWarning":false,"position":62,"left":159,"right":173},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":174,"text":"+\t\treturn -1;","html":"+\t\t\u003cspan class=pl-k\u003ereturn\u003c/span\u003e \u003cspan class=pl-c1\u003e-1\u003c/span\u003e;","displayNoNewLineWarning":false,"position":63,"left":159,"right":174},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":175,"text":"+\t}","html":"+\t}","displayNoNewLineWarning":false,"position":64,"left":159,"right":175},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":176,"text":" ","html":"\u003cbr\u003e","displayNoNewLineWarning":false,"position":65,"left":160,"right":176},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":177,"text":" \t/* Check for match at all the test times */","html":" \t\u003cspan class=pl-c\u003e/* Check for match at all the test times */\u003c/span\u003e","displayNoNewLineWarning":false,"position":66,"left":161,"right":177},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":178,"text":" \tfor (i = 0; i \u003c tt-\u003en_test_times; i++)","html":" \t\u003cspan class=pl-k\u003efor\u003c/span\u003e (\u003cspan class=pl-s1\u003ei\u003c/span\u003e \u003cspan class=pl-c1\u003e=\u003c/span\u003e \u003cspan class=pl-c1\u003e0\u003c/span\u003e; \u003cspan class=pl-s1\u003ei\u003c/span\u003e \u003cspan class=pl-c1\u003e\u0026lt;\u003c/span\u003e \u003cspan class=pl-s1\u003ett\u003c/span\u003e\u003cspan class=pl-c1\u003e-\u0026gt;\u003c/span\u003e\u003cspan class=pl-c1\u003en_test_times\u003c/span\u003e; \u003cspan class=pl-s1\u003ei\u003c/span\u003e\u003cspan class=pl-c1\u003e++\u003c/span\u003e)","displayNoNewLineWarning":false,"position":67,"left":162,"right":178},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":179,"text":" \t{","html":" \t{","displayNoNewLineWarning":false,"position":68,"left":163,"right":179},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":180,"text":" \t\tpgtt = (pg_time_t) (tt-\u003etest_times[i]);","html":" \t\t\u003cspan class=pl-s1\u003epgtt\u003c/span\u003e \u003cspan class=pl-c1\u003e=\u003c/span\u003e (\u003cspan class=pl-s1\u003epg_time_t\u003c/span\u003e) (\u003cspan class=pl-s1\u003ett\u003c/span\u003e\u003cspan class=pl-c1\u003e-\u0026gt;\u003c/span\u003e\u003cspan class=pl-c1\u003etest_times\u003c/span\u003e[\u003cspan class=pl-s1\u003ei\u003c/span\u003e]);","displayNoNewLineWarning":false,"position":69,"left":164,"right":180},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":181,"text":" \t\tpgtm = pg_localtime(\u0026pgtt);","html":" \t\t\u003cspan class=pl-s1\u003epgtm\u003c/span\u003e \u003cspan class=pl-c1\u003e=\u003c/span\u003e \u003cspan class=pl-en\u003epg_localtime\u003c/span\u003e(\u003cspan class=pl-c1\u003e\u0026amp;\u003c/span\u003e\u003cspan class=pl-s1\u003epgtt\u003c/span\u003e);","displayNoNewLineWarning":false,"position":70,"left":165,"right":181},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":182,"text":" \t\tif (!pgtm)","html":" \t\t\u003cspan class=pl-k\u003eif\u003c/span\u003e (!\u003cspan class=pl-s1\u003epgtm\u003c/span\u003e)","displayNoNewLineWarning":false,"position":71,"left":166,"right":182},{"stylingDirective":null,"type":"DELETION","blobLineNumber":167,"text":"-\t\t\treturn false;\t\t/* probably shouldn't happen */","html":"-\t\t\t\u003cspan class=\"pl-k\"\u003ereturn\u003c/span\u003e \u003cspan class=\"x x-first x-last\"\u003efalse\u003c/span\u003e;\t\t\u003cspan class=\"pl-c\"\u003e/* probably shouldn't happen */\u003c/span\u003e","displayNoNewLineWarning":false,"position":72,"left":167,"right":182},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":183,"text":"+\t\t\treturn -1;\t\t/* probably shouldn't happen */","html":"+\t\t\t\u003cspan class=\"pl-k\"\u003ereturn\u003c/span\u003e \u003cspan class=\"pl-c1 x x-first x-last\"\u003e-1\u003c/span\u003e;\t\t\u003cspan class=\"pl-c\"\u003e/* probably shouldn't happen */\u003c/span\u003e","displayNoNewLineWarning":false,"position":73,"left":167,"right":183},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":184,"text":" \t\tsystm = localtime(\u0026(tt-\u003etest_times[i]));","html":" \t\t\u003cspan class=pl-s1\u003esystm\u003c/span\u003e \u003cspan class=pl-c1\u003e=\u003c/span\u003e \u003cspan class=pl-en\u003elocaltime\u003c/span\u003e(\u003cspan class=pl-c1\u003e\u0026amp;\u003c/span\u003e(\u003cspan class=pl-s1\u003ett\u003c/span\u003e\u003cspan class=pl-c1\u003e-\u0026gt;\u003c/span\u003e\u003cspan class=pl-c1\u003etest_times\u003c/span\u003e[\u003cspan class=pl-s1\u003ei\u003c/span\u003e]));","displayNoNewLineWarning":false,"position":74,"left":168,"right":184},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":185,"text":" \t\tif (!compare_tm(systm, pgtm))","html":" \t\t\u003cspan class=pl-k\u003eif\u003c/span\u003e (!\u003cspan class=pl-en\u003ecompare_tm\u003c/span\u003e(\u003cspan class=pl-s1\u003esystm\u003c/span\u003e, \u003cspan class=pl-s1\u003epgtm\u003c/span\u003e))","displayNoNewLineWarning":false,"position":75,"left":169,"right":185},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":186,"text":" \t\t{","html":" \t\t{","displayNoNewLineWarning":false,"position":76,"left":170,"right":186},{"stylingDirective":null,"type":"DELETION","blobLineNumber":171,"text":"-\t\t\telog(DEBUG4, \"Reject TZ \\\"%s\\\": at %ld %04d-%02d-%02d %02d:%02d:%02d %s versus %04d-%02d-%02d %02d:%02d:%02d %s\",","html":"-\t\t\t\u003cspan class=\"pl-en\"\u003eelog\u003c/span\u003e(\u003cspan class=\"pl-c1\"\u003eDEBUG4\u003c/span\u003e, \u003cspan class=\"pl-s\"\u003e\"\u003cspan class=\"x x-first x-last\"\u003eReject \u003c/span\u003eTZ \\\"%s\\\": at %ld %04d-%02d-%02d %02d:%02d:%02d %s versus %04d-%02d-%02d %02d:%02d:%02d %s\"\u003c/span\u003e,","displayNoNewLineWarning":false,"position":77,"left":171,"right":186},{"stylingDirective":null,"type":"DELETION","blobLineNumber":172,"text":"-\t\t\t\t tzname, (long) pgtt,","html":"-\t\t\t\t \u003cspan class=\"pl-s1\"\u003etzname\u003c/span\u003e, (\u003cspan class=\"pl-smi\"\u003elong\u003c/span\u003e) \u003cspan class=\"pl-s1\"\u003epgtt\u003c/span\u003e,","displayNoNewLineWarning":false,"position":78,"left":172,"right":186},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":187,"text":"+\t\t\telog(DEBUG4, \"TZ \\\"%s\\\" scores %d: at %ld %04d-%02d-%02d %02d:%02d:%02d %s versus %04d-%02d-%02d %02d:%02d:%02d %s\",","html":"+\t\t\t\u003cspan class=\"pl-en\"\u003eelog\u003c/span\u003e(\u003cspan class=\"pl-c1\"\u003eDEBUG4\u003c/span\u003e, \u003cspan class=\"pl-s\"\u003e\"TZ \\\"%s\\\"\u003cspan class=\"x x-first x-last\"\u003e scores %d\u003c/span\u003e: at %ld %04d-%02d-%02d %02d:%02d:%02d %s versus %04d-%02d-%02d %02d:%02d:%02d %s\"\u003c/span\u003e,","displayNoNewLineWarning":false,"position":79,"left":172,"right":187},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":188,"text":"+\t\t\t\t tzname, i, (long) pgtt,","html":"+\t\t\t\t \u003cspan class=\"pl-s1\"\u003etzname\u003c/span\u003e, \u003cspan class=\"pl-s1 x x-first\"\u003ei\u003c/span\u003e\u003cspan class=\"x x-last\"\u003e, \u003c/span\u003e(\u003cspan class=\"pl-smi\"\u003elong\u003c/span\u003e) \u003cspan class=\"pl-s1\"\u003epgtt\u003c/span\u003e,","displayNoNewLineWarning":false,"position":80,"left":172,"right":188},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":189,"text":" \t\t\t\t pgtm-\u003etm_year + 1900, pgtm-\u003etm_mon + 1, pgtm-\u003etm_mday,","html":" \t\t\t\t \u003cspan class=pl-s1\u003epgtm\u003c/span\u003e\u003cspan class=pl-c1\u003e-\u0026gt;\u003c/span\u003e\u003cspan class=pl-c1\u003etm_year\u003c/span\u003e \u003cspan class=pl-c1\u003e+\u003c/span\u003e \u003cspan class=pl-c1\u003e1900\u003c/span\u003e, \u003cspan class=pl-s1\u003epgtm\u003c/span\u003e\u003cspan class=pl-c1\u003e-\u0026gt;\u003c/span\u003e\u003cspan class=pl-c1\u003etm_mon\u003c/span\u003e \u003cspan class=pl-c1\u003e+\u003c/span\u003e \u003cspan class=pl-c1\u003e1\u003c/span\u003e, \u003cspan class=pl-s1\u003epgtm\u003c/span\u003e\u003cspan class=pl-c1\u003e-\u0026gt;\u003c/span\u003e\u003cspan class=pl-c1\u003etm_mday\u003c/span\u003e,","displayNoNewLineWarning":false,"position":81,"left":173,"right":189},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":190,"text":" \t\t\t\t pgtm-\u003etm_hour, pgtm-\u003etm_min, pgtm-\u003etm_sec,","html":" \t\t\t\t \u003cspan class=pl-s1\u003epgtm\u003c/span\u003e\u003cspan class=pl-c1\u003e-\u0026gt;\u003c/span\u003e\u003cspan class=pl-c1\u003etm_hour\u003c/span\u003e, \u003cspan class=pl-s1\u003epgtm\u003c/span\u003e\u003cspan class=pl-c1\u003e-\u0026gt;\u003c/span\u003e\u003cspan class=pl-c1\u003etm_min\u003c/span\u003e, \u003cspan class=pl-s1\u003epgtm\u003c/span\u003e\u003cspan class=pl-c1\u003e-\u0026gt;\u003c/span\u003e\u003cspan class=pl-c1\u003etm_sec\u003c/span\u003e,","displayNoNewLineWarning":false,"position":82,"left":174,"right":190},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":191,"text":" \t\t\t\t pgtm-\u003etm_isdst ? \"dst\" : \"std\",","html":" \t\t\t\t \u003cspan class=pl-s1\u003epgtm\u003c/span\u003e\u003cspan class=pl-c1\u003e-\u0026gt;\u003c/span\u003e\u003cspan class=pl-c1\u003etm_isdst\u003c/span\u003e ? \u003cspan class=pl-s\u003e\u0026quot;dst\u0026quot;\u003c/span\u003e : \u003cspan class=pl-s\u003e\u0026quot;std\u0026quot;\u003c/span\u003e,","displayNoNewLineWarning":false,"position":83,"left":175,"right":191},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":192,"text":" \t\t\t\t systm-\u003etm_year + 1900, systm-\u003etm_mon + 1, systm-\u003etm_mday,","html":" \t\t\t\t \u003cspan class=pl-s1\u003esystm\u003c/span\u003e\u003cspan class=pl-c1\u003e-\u0026gt;\u003c/span\u003e\u003cspan class=pl-c1\u003etm_year\u003c/span\u003e \u003cspan class=pl-c1\u003e+\u003c/span\u003e \u003cspan class=pl-c1\u003e1900\u003c/span\u003e, \u003cspan class=pl-s1\u003esystm\u003c/span\u003e\u003cspan class=pl-c1\u003e-\u0026gt;\u003c/span\u003e\u003cspan class=pl-c1\u003etm_mon\u003c/span\u003e \u003cspan class=pl-c1\u003e+\u003c/span\u003e \u003cspan class=pl-c1\u003e1\u003c/span\u003e, \u003cspan class=pl-s1\u003esystm\u003c/span\u003e\u003cspan class=pl-c1\u003e-\u0026gt;\u003c/span\u003e\u003cspan class=pl-c1\u003etm_mday\u003c/span\u003e,","displayNoNewLineWarning":false,"position":84,"left":176,"right":192},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":193,"text":" \t\t\t\t systm-\u003etm_hour, systm-\u003etm_min, systm-\u003etm_sec,","html":" \t\t\t\t \u003cspan class=pl-s1\u003esystm\u003c/span\u003e\u003cspan class=pl-c1\u003e-\u0026gt;\u003c/span\u003e\u003cspan class=pl-c1\u003etm_hour\u003c/span\u003e, \u003cspan class=pl-s1\u003esystm\u003c/span\u003e\u003cspan class=pl-c1\u003e-\u0026gt;\u003c/span\u003e\u003cspan class=pl-c1\u003etm_min\u003c/span\u003e, \u003cspan class=pl-s1\u003esystm\u003c/span\u003e\u003cspan class=pl-c1\u003e-\u0026gt;\u003c/span\u003e\u003cspan class=pl-c1\u003etm_sec\u003c/span\u003e,","displayNoNewLineWarning":false,"position":85,"left":177,"right":193},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":194,"text":" \t\t\t\t systm-\u003etm_isdst ? \"dst\" : \"std\");","h 8000 tml":" \t\t\t\t \u003cspan class=pl-s1\u003esystm\u003c/span\u003e\u003cspan class=pl-c1\u003e-\u0026gt;\u003c/span\u003e\u003cspan class=pl-c1\u003etm_isdst\u003c/span\u003e ? \u003cspan class=pl-s\u003e\u0026quot;dst\u0026quot;\u003c/span\u003e : \u003cspan class=pl-s\u003e\u0026quot;std\u0026quot;\u003c/span\u003e);","displayNoNewLineWarning":false,"position":86,"left":178,"right":194},{"stylingDirective":null,"type":"DELETION","blobLineNumber":179,"text":"-\t\t\treturn false;","html":"-\t\t\t\u003cspan class=\"pl-k\"\u003ereturn\u003c/span\u003e \u003cspan class=\"x x-first x-last\"\u003efalse\u003c/span\u003e;","displayNoNewLineWarning":false,"position":87,"left":179,"right":194},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":195,"text":"+\t\t\treturn i;","html":"+\t\t\t\u003cspan class=\"pl-k\"\u003ereturn\u003c/span\u003e \u003cspan class=\"pl-s1 x x-first x-last\"\u003ei\u003c/span\u003e;","displayNoNewLineWarning":false,"position":88,"left":179,"right":195},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":196,"text":" \t\t}","html":" \t\t}","displayNoNewLineWarning":false,"position":89,"left":180,"right":196},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":197,"text":" \t\tif (systm-\u003etm_isdst \u003e= 0)","html":" \t\t\u003cspan class=pl-k\u003eif\u003c/span\u003e (\u003cspan class=pl-s1\u003esystm\u003c/span\u003e\u003cspan class=pl-c1\u003e-\u0026gt;\u003c/span\u003e\u003cspan class=pl-c1\u003etm_isdst\u003c/span\u003e \u0026gt;= \u003cspan class=pl-c1\u003e0\u003c/span\u003e)","displayNoNewLineWarning":false,"position":90,"left":181,"right":197},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":198,"text":" \t\t{","html":" \t\t{","displayNoNewLineWarning":false,"position":91,"left":182,"right":198},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":199,"text":" \t\t\t/* Check match of zone names, too */","html":" \t\t\t\u003cspan class=pl-c\u003e/* Check match of zone names, too */\u003c/span\u003e","displayNoNewLineWarning":false,"position":92,"left":183,"right":199},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":200,"text":" \t\t\tif (pgtm-\u003etm_zone == NULL)","html":" \t\t\t\u003cspan class=pl-k\u003eif\u003c/span\u003e (\u003cspan class=pl-s1\u003epgtm\u003c/span\u003e\u003cspan class=pl-c1\u003e-\u0026gt;\u003c/span\u003e\u003cspan class=pl-c1\u003etm_zone\u003c/span\u003e \u003cspan class=pl-c1\u003e==\u003c/span\u003e \u003cspan class=pl-c1\u003eNULL\u003c/span\u003e)","displayNoNewLineWarning":false,"position":93,"left":184,"right":200},{"stylingDirective":null,"type":"DELETION","blobLineNumber":185,"text":"-\t\t\t\treturn false;","html":"-\t\t\t\t\u003cspan class=\"pl-k\"\u003ereturn\u003c/span\u003e \u003cspan class=\"x x-first x-last\"\u003efalse;\u003c/span\u003e","displayNoNewLineWarning":false,"position":94,"left":185,"right":200},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":201,"text":"+\t\t\t\treturn -1;\t\t/* probably shouldn't happen */","html":"+\t\t\t\t\u003cspan class=\"pl-k\"\u003ereturn\u003c/span\u003e \u003cspan class=\"pl-c1 x x-first\"\u003e-1\u003c/span\u003e\u003cspan class=\"x\"\u003e;\t\t\u003c/span\u003e\u003cspan class=\"pl-c x x-last\"\u003e/* probably shouldn't happen */\u003c/span\u003e","displayNoNewLineWarning":false,"position":95,"left":185,"right":201},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":202,"text":" \t\t\tmemset(cbuf, 0, sizeof(cbuf));","html":" \t\t\t\u003cspan class=pl-en\u003ememset\u003c/span\u003e(\u003cspan class=pl-s1\u003ecbuf\u003c/span\u003e, \u003cspan class=pl-c1\u003e0\u003c/span\u003e, \u003cspan class=pl-k\u003esizeof\u003c/span\u003e(\u003cspan class=pl-s1\u003ecbuf\u003c/span\u003e));","displayNoNewLineWarning":false,"position":96,"left":186,"right":202},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":203,"text":" \t\t\tstrftime(cbuf, sizeof(cbuf) - 1, \"%Z\", systm); /* zone abbr */","html":" \t\t\t\u003cspan class=pl-en\u003estrftime\u003c/span\u003e(\u003cspan class=pl-s1\u003ecbuf\u003c/span\u003e, \u003cspan class=pl-k\u003esizeof\u003c/span\u003e(\u003cspan class=pl-s1\u003ecbuf\u003c/span\u003e) \u003cspan class=pl-c1\u003e-\u003c/span\u003e \u003cspan class=pl-c1\u003e1\u003c/span\u003e, \u003cspan class=pl-s\u003e\u0026quot;%Z\u0026quot;\u003c/span\u003e, \u003cspan class=pl-s1\u003esystm\u003c/span\u003e); \u003cspan class=pl-c\u003e/* zone abbr */\u003c/span\u003e","displayNoNewLineWarning":false,"position":97,"left":187,"right":203},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":204,"text":" \t\t\tif (strcmp(TZABBREV(cbuf), pgtm-\u003etm_zone) != 0)","html":" \t\t\t\u003cspan class=pl-k\u003eif\u003c/span\u003e (\u003cspan class=pl-en\u003estrcmp\u003c/span\u003e(\u003cspan class=pl-en\u003eTZABBREV\u003c/span\u003e(\u003cspan class=pl-s1\u003ecbuf\u003c/span\u003e), \u003cspan class=pl-s1\u003epgtm\u003c/span\u003e\u003cspan class=pl-c1\u003e-\u0026gt;\u003c/span\u003e\u003cspan class=pl-c1\u003etm_zone\u003c/span\u003e) \u003cspan class=pl-c1\u003e!=\u003c/span\u003e \u003cspan class=pl-c1\u003e0\u003c/span\u003e)","displayNoNewLineWarning":false,"position":98,"left":188,"right":204},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":205,"text":" \t\t\t{","html":" \t\t\t{","displayNoNewLineWarning":false,"position":99,"left":189,"right":205},{"stylingDirective":null,"type":"DELETION","blobLineNumber":190,"text":"-\t\t\t\telog(DEBUG4, \"Reject TZ \\\"%s\\\": at %ld \\\"%s\\\" versus \\\"%s\\\"\",","html":"-\t\t\t\t\u003cspan class=\"pl-en\"\u003eelog\u003c/span\u003e(\u003cspan class=\"pl-c1\"\u003eDEBUG4\u003c/span\u003e, \u003cspan class=\"pl-s\"\u003e\"\u003cspan class=\"x x-first x-last\"\u003eReject \u003c/span\u003eTZ \\\"%s\\\": at %ld \\\"%s\\\" versus \\\"%s\\\"\"\u003c/span\u003e,","displayNoNewLineWarning":false,"position":100,"left":190,"right":205},{"stylingDirective":null,"type":"DELETION","blobLineNumber":191,"text":"-\t\t\t\t\t tzname, (long) pgtt,","html":"-\t\t\t\t\t \u003cspan class=\"pl-s1\"\u003etzname\u003c/span\u003e, (\u003cspan class=\"pl-smi\"\u003elong\u003c/span\u003e) \u003cspan class=\"pl-s1\"\u003epgtt\u003c/span\u003e,","displayNoNewLineWarning":false,"position":101,"left":191,"right":205},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":206,"text":"+\t\t\t\telog(DEBUG4, \"TZ \\\"%s\\\" scores %d: at %ld \\\"%s\\\" versus \\\"%s\\\"\",","html":"+\t\t\t\t\u003cspan class=\"pl-en\"\u003eelog\u003c/span\u003e(\u003cspan class=\"pl-c1\"\u003eDEBUG4\u003c/span\u003e, \u003cspan class=\"pl-s\"\u003e\"TZ \\\"%s\\\"\u003cspan class=\"x x-first x-last\"\u003e scores %d\u003c/span\u003e: at %ld \\\"%s\\\" versus \\\"%s\\\"\"\u003c/span\u003e,","displayNoNewLineWarning":false,"position":102,"left":191,"right":206},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":207,"text":"+\t\t\t\t\t tzname, i, (long) pgtt,","html":"+\t\t\t\t\t \u003cspan class=\"pl-s1\"\u003etzname\u003c/span\u003e, \u003cspan class=\"pl-s1 x x-first\"\u003ei\u003c/span\u003e\u003cspan class=\"x x-last\"\u003e, \u003c/span\u003e(\u003cspan class=\"pl-smi\"\u003elong\u003c/span\u003e) \u003cspan class=\"pl-s1\"\u003epgtt\u003c/span\u003e,","displayNoNewLineWarning":false,"position":103,"left":191,"right":207},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":208,"text":" \t\t\t\t\t pgtm-\u003etm_zone, cbuf);","html":" \t\t\t\t\t \u003cspan class=pl-s1\u003epgtm\u003c/span\u003e\u003cspan class=pl-c1\u003e-\u0026gt;\u003c/span\u003e\u003cspan class=pl-c1\u003etm_zone\u003c/span\u003e, \u003cspan class=pl-s1\u003ecbuf\u003c/span\u003e);","displayNoNewLineWarning":false,"position":104,"left":192,"right":208},{"stylingDirective":null,"type":"DELETION","blobLineNumber":193,"text":"-\t\t\t\treturn false;","html":"-\t\t\t\t\u003cspan class=\"pl-k\"\u003ereturn\u003c/span\u003e \u003cspan class=\"x x-first x-last\"\u003efalse\u003c/span\u003e;","displayNoNewLineWarning":false,"position":105,"left":193,"right":208},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":209,"text":"+\t\t\t\treturn i;","html":"+\t\t\t\t\u003cspan class=\"pl-k\"\u003ereturn\u003c/span\u003e \u003cspan class=\"pl-s1 x x-first x-last\"\u003ei\u003c/span\u003e;","displayNoNewLineWarning":false,"position":106,"left":193,"right":209},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":210,"text":" \t\t\t}","html":" \t\t\t}","displayNoNewLineWarning":false,"position":107,"left":194,"right":210},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":211,"text":" \t\t}","html":" \t\t}","displayNoNewLineWarning":false,"position":108,"left":195,"right":211},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":212,"text":" \t}","html":" \t}","displayNoNewLineWarning":false,"position":109,"left":196,"right":212},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":213,"text":" ","html":"\u003cbr\u003e","displayNoNewLineWarning":false,"position":110,"left":197,"right":213},{"stylingDirective":null,"type":"DELETION","blobLineNumber":198,"text":"-\t/* Reject if leap seconds involved */","html":"-\t\u003cspan class=pl-c\u003e/* Reject if leap seconds involved */\u003c/span\u003e","displayNoNewLineWarning":false,"position":111,"left":198,"right":213},{"stylingDirective":null,"type":"DELETION","blobLineNumber":199,"text":"-\tif (!tz_acceptable())","html":"-\t\u003cspan class=pl-k\u003eif\u003c/span\u003e (!\u003cspan class=pl-en\u003etz_acceptable\u003c/span\u003e())","displayNoNewLineWarning":false,"position":112,"left":199,"right":213},{"stylingDirective":null,"type":"DELETION","blobLineNumber":200,"text":"-\t{","html":"-\t{","displayNoNewLineWarning":false,"position":113,"left":200,"right":213},{"stylingDirective":null,"type":"DELETION","blobLineNumber":201,"text":"-\t\telog(DEBUG4, \"Reject TZ \\\"%s\\\": uses leap seconds\", tzname);","html":"-\t\t\u003cspan class=pl-en\u003eelog\u003c/span\u003e(\u003cspan class=pl-c1\u003eDEBUG4\u003c/span\u003e, \u003cspan class=pl-s\u003e\u0026quot;Reject TZ \\\u0026quot;%s\\\u0026quot;: uses leap seconds\u0026quot;\u003c/span\u003e, \u003cspan class=pl-s1\u003etzname\u003c/span\u003e);","displayNoNewLineWarning":false,"position":114,"left":201,"right":213},{"stylingDirective":null,"type":"DELETION","blobLineNumber":202,"text":"-\t\treturn false;","html":"-\t\t\u003cspan class=pl-k\u003ereturn\u003c/span\u003e false;","displayNoNewLineWarning":false,"position":115,"left":202,"right":213},{"stylingDirective":null,"type":"DELETION","blobLineNumber":203,"text":"-\t}","html":"-\t}","displayNoNewLineWarning":false,"position":116,"left":203,"right":213},{"stylingDirective":null,"type":"DELETION","blobLineNumber":204,"text":"-","html":"-","displayNoNewLineWarning":false,"position":117,"left":204,"right":213},{"stylingDirective":null,"type":"DELETION","blobLineNumber":205,"text":"-\telog(DEBUG4, \"Accept TZ \\\"%s\\\"\", tzname);","html":"-\t\u003cspan class=pl-en\u003eelog\u003c/span\u003e(\u003cspan class=pl-c1\u003eDEBUG4\u003c/span\u003e, \u003cspan class=pl-s\u003e\u0026quot;Accept TZ \\\u0026quot;%s\\\u0026quot;\u0026quot;\u003c/span\u003e, \u003cspan class=pl-s1\u003etzname\u003c/span\u003e);","displayNoNewLineWarning":false,"position":118,"left":205,"right":213},{"stylingDirective":null,"type":"DELETION","blobLineNumber":206,"text":"-\treturn true;","html":"-\t\u003cspan class=pl-k\u003ereturn\u003c/span\u003e true;","displayNoNewLineWarning":false,"position":119,"left":206,"right":213},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":214,"text":"+\telog(DEBUG4, \"TZ \\\"%s\\\" gets max score %d\", tzname, i);","html":"+\t\u003cspan class=pl-en\u003eelog\u003c/span\u003e(\u003cspan class=pl-c1\u003eDEBUG4\u003c/span\u003e, \u003cspan class=pl-s\u003e\u0026quot;TZ \\\u0026quot;%s\\\u0026quot; gets max score %d\u0026quot;\u003c/span\u003e, \u003cspan class=pl-s1\u003etzname\u003c/span\u003e, \u003cspan class=pl-s1\u003ei\u003c/span\u003e);","displayNoNewLineWarning":false,"position":120,"left":206,"right":214},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":215,"text":"+\treturn i;","html":"+\t\u003cspan class=pl-k\u003ereturn\u003c/span\u003e \u003cspan class=pl-s1\u003ei\u003c/span\u003e;","displayNoNewLineWarning":false,"position":121,"left":206,"right":215},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":216,"text":" }","html":" }","displayNoNewLineWarning":false,"position":122,"left":207,"right":216},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":217,"text":" ","html":"\u003cbr\u003e","displayNoNewLineWarning":false,"position":123,"left":208,"right":217},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":218,"text":" ","html":"\u003cbr\u003e","displayNoNewLineWarning":false,"position":124,"left":209,"right":218},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":219,"text":" /*","html":" \u003cspan class=pl-c\u003e/*\u003c/span\u003e","displayNoNewLineWarning":false,"position":125,"left":210,"right":219},{"stylingDirective":null,"type":"DELETION","blobLineNumber":211,"text":"- * Try to identify a timezone name (in our terminology) that matches the","html":"-\u003cspan class=\"pl-c\"\u003e * Try to identify a timezone name (in our terminology) that matches the\u003c/span\u003e","displayNoNewLineWarning":false,"position":126,"left":211,"right":219},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":220,"text":"+ * Try to identify a timezone name (in our terminology) that best matches the","html":"+\u003cspan class=\"pl-c\"\u003e * Try to identify a timezone name (in our terminology) that \u003cspan class=\"x x-first x-last\"\u003ebest \u003c/span\u003ematches the\u003c/span\u003e","displayNoNewLineWarning":false,"position":127,"left":211,"right":220},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":221,"text":" * observed behavior of the system timezone library. We cannot assume that","html":" \u003cspan class=pl-c\u003e * observed behavior of the system timezone library. We cannot assume that\u003c/span\u003e","displayNoNewLineWarning":false,"position":128,"left":212,"right":221},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":222,"text":" * the system TZ environment setting (if indeed there is one) matches our","html":" \u003cspan class=pl-c\u003e * the system TZ environment setting (if indeed there is one) matches our\u003c/span\u003e","displayNoNewLineWarning":false,"position":129,"left":213,"right":222},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":223,"text":" * terminology, so we ignore it and just look at what localtime() returns.","html":" \u003cspan class=pl-c\u003e * terminology, so we ignore it and just look at what localtime() returns.\u003c/span\u003e","displayNoNewLineWarning":false,"position":130,"left":214,"right":223},{"stylingDirective":null,"type":"HUNK","blobLineNumber":229,"text":"@@ -221,6 +230,7 @@ identify_system_timezone(void)","html":"@@ -221,6 +230,7 @@ identify_system_timezone(void)","displayNoNewLineWarning":false,"position":131,"left":220,"right":229},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":230,"text":" \ttime_t\t\tt;","html":" \t\u003cspan class=pl-smi\u003etime_t\u003c/span\u003e\t\t\u003cspan class=pl-s1\u003et\u003c/span\u003e;","displayNoNewLineWarning":false,"position":132,"left":221,"right":230},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":231,"text":" \tstruct tztry tt;","html":" \t\u003cspan class=pl-k\u003estruct\u003c/span\u003e \u003cspan class=pl-smi\u003etztry\u003c/span\u003e \u003cspan class=pl-s1\u003ett\u003c/span\u003e;","displayNoNewLineWarning":false,"position":133,"left":222,"right":231},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":232,"text":" \tstruct tm *tm;","html":" \t\u003cspan class=pl-k\u003estruct\u003c/span\u003e \u003cspan class=pl-smi\u003etm\u003c/span\u003e \u003cspan class=pl-c1\u003e*\u003c/span\u003e\u003cspan class=pl-s1\u003etm\u003c/span\u003e;","displayNoNewLineWarning":false,"position":134,"left":223,"right":232},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":233,"text":"+\tint\t\t\tbestscore;","html":"+\t\u003cspan class=pl-smi\u003eint\u003c/span\u003e\t\t\t\u003cspan class=pl-s1\u003ebestscore\u003c/span\u003e;","displayNoNewLineWarning":false,"position":135,"left":223,"right":233},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":234,"text":" \tchar\t\ttmptzdir[MAXPGPATH];","html":" \t\u003cspan class=pl-smi\u003echar\u003c/span\u003e\t\t\u003cspan class=pl-s1\u003etmptzdir\u003c/span\u003e[\u003cspan class=pl-c1\u003eMAXPGPATH\u003c/span\u003e];","displayNoNewLineWarning":false,"position":136,"left":224,"right":234},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":235,"text":" \tint\t\t\tstd_ofs;","html":" \t\u003cspan class=pl-smi\u003eint\u003c/span\u003e\t\t\t\u003cspan class=pl-s1\u003estd_ofs\u003c/span\u003e;","displayNoNewLineWarning":false,"position":137,"left":225,"right":235},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":236,"text":" \tchar\t\tstd_zone_name[TZ_STRLEN_MAX + 1],","html":" \t\u003cspan class=pl-smi\u003echar\u003c/span\u003e\t\t\u003cspan class=pl-s1\u003estd_zone_name\u003c/span\u003e[\u003cspan class=pl-c1\u003eTZ_STRLEN_MAX\u003c/span\u003e \u003cspan class=pl-c1\u003e+\u003c/span\u003e \u003cspan class=pl-c1\u003e1\u003c/span\u003e],","displayNoNewLineWarning":false,"position":138,"left":226,"right":236},{"stylingDirective":null,"type":"HUNK","blobLineNumber":240,"text":"@@ -231,36 +241,38 @@ identify_system_timezone(void)","html":"@@ -231,36 +241,38 @@ identify_system_timezone(void)","displayNoNewLineWarning":false,"position":139,"left":230,"right":240},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":241,"text":" \ttzset();","html":" \t\u003cspan class=pl-en\u003etzset\u003c/span\u003e();","displayNoNewLineWarning":false,"position":140,"left":231,"right":241},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":242,"text":" ","html":"\u003cbr\u003e","displayNoNewLineWarning":false,"position":141,"left":232,"right":242},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":243,"text":" \t/*","html":" \t\u003cspan class=pl-c\u003e/*\u003c/span\u003e","displayNoNewLineWarning":false,"position":142,"left":233,"right":243},{"stylingDirective":null,"type":"DELETION","blobLineNumber":234,"text":"-\t * Set up the list of dates to be probed to verify that our timezone","html":"-\u003cspan class=\"pl-c\"\u003e\t * Set up the list of dates to be probed to \u003cspan class=\"x x-first x-last\"\u003everify that\u003c/span\u003e our timezone\u003c/span\u003e","displayNoNewLineWarning":false,"position":143,"left":234,"right":243},{"stylingDirective":null,"type":"DELETION","blobLineNumber":235,"text":"-\t * matches the system zone. We first probe January and July of 1970;","html":"-\u003cspan class=\"pl-c\"\u003e\t * matches the system zone. We first probe January and July of \u003cspan class=\"x x-first x-last\"\u003e1970\u003c/span\u003e;\u003c/span\u003e","displayNoNewLineWarning":false,"position":144,"left":235,"right":243},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":244,"text":"+\t * Set up the list of dates to be probed to see how well our timezone","html":"+\u003cspan class=\"pl-c\"\u003e\t * Set up the list of dates to be probed to \u003cspan class=\"x x-first x-last\"\u003esee how well\u003c/span\u003e our timezone\u003c/span\u003e","displayNoNewLineWarning":false,"position":145,"left":235,"right":244},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":245,"text":"+\t * matches the system zone. We first probe January and July of 2004;","html":"+\u003cspan class=\"pl-c\"\u003e\t * matches the system zone. We first probe January and July of \u003cspan class=\"x x-first x-last\"\u003e2004\u003c/span\u003e;\u003c/span\u003e","displayNoNewLineWarning":false,"position":146,"left":235,"right":245},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":246,"text":" \t * this serves to quickly eliminate the vast majority of the TZ database","html":" \u003cspan class=pl-c\u003e\t * this serves to quickly eliminate the vast majority of the TZ database\u003c/span\u003e","displayNoNewLineWarning":false,"position":147,"left":236,"right":246},{"stylingDirective":null,"type":"DELETION","blobLineNumber":237,"text":"-\t * entries. If those dates match, we probe every week from 1970 to","html":"-\u003cspan class=pl-c\u003e\t * entries. If those dates match, we probe every week from 1970 to\u003c/span\u003e","displayNoNewLineWarning":false,"position":148,"left":237,"right":246},{"stylingDirective":null,"type":"DELETION","blobLineNumber":238,"text":"-\t * late 2004. This exhaustive test is intended to ensure that we have","html":"-\u003cspan class=pl-c\u003e\t * late 2004. This exhaustive test is intended to ensure that we have\u003c/span\u003e","displayNoNewLineWarning":false,"position":149,"left":238,"right":246},{"stylingDirective":null,"type":"DELETION","blobLineNumber":239,"text":"-\t * the same DST transition rules as the system timezone. (Note: we","html":"-\u003cspan class=pl-c\u003e\t * the same DST transition rules as the system timezone. (Note: we\u003c/span\u003e","displayNoNewLineWarning":false,"position":150,"left":239,"right":246},{"stylingDirective":null,"type":"DELETION","blobLineNumber":240,"text":"-\t * probe Thursdays, not Sundays, to avoid triggering DST-transition","html":"-\u003cspan class=pl-c\u003e\t * probe Thursdays, not Sundays, to avoid triggering DST-transition\u003c/span\u003e","displayNoNewLineWarning":false,"position":151,"left":240,"right":246},{"stylingDirective":null,"type":"DELETION","blobLineNumber":241,"text":"-\t * bugs in localtime itself.)","html":"-\u003cspan class=pl-c\u003e\t * bugs in localtime itself.)\u003c/span\u003e","displayNoNewLineWarning":false,"position":152,"left":241,"right":246},{"stylingDirective":null,"type":"DELETION","blobLineNumber":242,"text":"-\t *","html":"-\u003cspan class=pl-c\u003e\t *\u003c/span\u003e","displayNoNewLineWarning":false,"position":153,"left":242,"right":246},{"stylingDirective":null,"type":"DELETION","blobLineNumber":243,"text":"-\t * Ideally we'd probe some dates before 1970 too, but that is guaranteed","html":"-\u003cspan class=pl-c\u003e\t * Ideally we\u0026#39;d probe some dates before 1970 too, but that is guaranteed\u003c/span\u003e","displayNoNewLineWarning":false,"position":154,"left":243,"right":246},{"stylingDirective":null,"type":"DELETION","blobLineNumber":244,"text":"-\t * to fail if the system TZ library doesn't cope with DST before 1970.","html":"-\u003cspan class=pl-c\u003e\t * to fail if the system TZ library doesn\u0026#39;t cope with DST before 1970.\u003c/span\u003e","displayNoNewLineWarning":false,"position":155,"left":244,"right":246},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":247,"text":"+\t * entries. If those dates match, we probe every week from 2004 backwards","html":"+\u003cspan class=pl-c\u003e\t * entries. If those dates match, we probe every week from 2004 backwards\u003c/span\u003e","displayNoNewLineWarning":false,"position":156,"left":244,"right":247},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":248,"text":"+\t * to late 1964. (Weekly resolution is good enough to identify DST","html":"+\u003cspan class=pl-c\u003e\t * to late 1964. (Weekly resolution is good enough to identify DST\u003c/span\u003e","displayNoNewLineWarning":false,"position":157,"left":244,"right":248},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":249,"text":"+\t * transition rules, since everybody switches on Sundays.) The further","html":"+\u003cspan class=pl-c\u003e\t * transition rules, since everybody switches on Sundays.) The further\u003c/span\u003e","displayNoNewLineWarning":false,"position":158,"left":244,"right":249},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":250,"text":"+\t * back the zone matches, the better we score it. This may seem like","html":"+\u003cspan class=pl-c\u003e\t * back the zone matches, the better we score it. This may seem like\u003c/span\u003e","displayNoNewLineWarning":false,"position":159,"left":244,"right":250},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":251,"text":"+\t * a rather random way of doing things, but experience has shown that","html":"+\u003cspan class=pl-c\u003e\t * a rather random way of doing things, but experience has shown that\u003c/span\u003e","displayNoNewLineWarning":false,"position":160,"left":244,"right":251},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":252,"text":"+\t * system-supplied timezone definitions are likely to have DST behavior","html":"+\u003cspan class=pl-c\u003e\t * system-supplied timezone definitions are likely to have DST behavior\u003c/span\u003e","displayNoNewLineWarning":false,"position":161,"left":244,"right":252},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":253,"text":"+\t * that is right for the recent past and not so accurate further back.","html":"+\u003cspan class=pl-c\u003e\t * that is right for the recent past and not so accurate further back.\u003c/span\u003e","displayNoNewLineWarning":false,"position":162,"left":244,"right":253},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":254,"text":"+\t * Scoring in this way allows us to recognize zones that have some","html":"+\u003cspan class=pl-c\u003e\t * Scoring in this way allows us to recognize zones that have some\u003c/span\u003e","displayNoNewLineWarning":false,"position":163,"left":244,"right":254},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":255,"text":"+\t * commonality with the zic database, without insisting on exact match.","html":"+\u003cspan class=pl-c\u003e\t * commonality with the zic database, without insisting on exact match.\u003c/span\u003e","displayNoNewLineWarning":false,"position":164,"left":244,"right":255},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":256,"text":"+\t * (Note: we probe Thursdays, not Sundays, to avoid triggering","html":"+\u003cspan class=pl-c\u003e\t * (Note: we probe Thursdays, not Sundays, to avoid triggering\u003c/span\u003e","displayNoNewLineWarning":false,"position":165,"left":244,"right":256},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":257,"text":"+\t * DST-transition bugs in localtime itself.)","html":"+\u003cspan class=pl-c\u003e\t * DST-transition bugs in localtime itself.)\u003c/span\u003e","displayNoNewLineWarning":false,"position":166,"left":244,"right":257},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":258,"text":" \t */","html":" \u003cspan class=pl-c\u003e\t */\u003c/span\u003e","displayNoNewLineWarning":false,"position":167,"left":245,"right":258},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":259,"text":" \ttt.n_test_times = 0;","html":" \t\u003cspan class=pl-s1\u003ett\u003c/span\u003e.\u003cspan class=pl-c1\u003en_test_times\u003c/span\u003e \u003cspan class=pl-c1\u003e=\u003c/span\u003e \u003cspan class=pl-c1\u003e0\u003c/span\u003e;","displayNoNewLineWarning":false,"position":168,"left":246,"right":259},{"stylingDirective":null,"type":"DELETION","blobLineNumber":247,"text":"-\ttt.test_times[tt.n_test_times++] = t = build_time_t(1970, 1, 15);","html":"-\t\u003cspan class=\"pl-s1\"\u003ett\u003c/span\u003e.\u003cspan class=\"pl-c1\"\u003etest_times\u003c/span\u003e[\u003cspan class=\"pl-s1\"\u003ett\u003c/span\u003e.\u003cspan class=\"pl-c1\"\u003en_test_times\u003c/span\u003e\u003cspan class=\"pl-c1\"\u003e++\u003c/span\u003e] \u003cspan class=\"pl-c1\"\u003e=\u003c/span\u003e \u003cspan class=\"pl-s1 x x-first\"\u003et\u003c/span\u003e\u003cspan class=\"x\"\u003e \u003c/span\u003e\u003cspan class=\"pl-c1 x\"\u003e=\u003c/span\u003e\u003cspan class=\"x x-last\"\u003e \u003c/span\u003e\u003cspan class=\"pl-en\"\u003ebuild_time_t\u003c/span\u003e(\u003cspan class=\"pl-c1 x x-first x-last\"\u003e1970\u003c/span\u003e, \u003cspan class=\"pl-c1\"\u003e1\u003c/span\u003e, \u003cspan class=\"pl-c1\"\u003e15\u003c/span\u003e);","displayNoNewLineWarning":false,"position":169,"left":247,"right":259},{"stylingDirective":null,"type":"DELETION","blobLineNumber":248,"text":"-\ttt.test_times[tt.n_test_times++] = build_time_t(1970, 7, 15);","html":"-\t\u003cspan class=\"pl-s1\"\u003ett\u003c/span\u003e.\u003cspan class=\"pl-c1\"\u003etest_times\u003c/span\u003e[\u003cspan class=\"pl-s1\"\u003ett\u003c/span\u003e.\u003cspan class=\"pl-c1\"\u003en_test_times\u003c/span\u003e\u003cspan class=\"pl-c1\"\u003e++\u003c/span\u003e] \u003cspan class=\"pl-c1\"\u003e=\u003c/span\u003e \u003cspan class=\"pl-en\"\u003ebuild_time_t\u003c/span\u003e(\u003cspan class=\"pl-c1 x x-first x-last\"\u003e1970\u003c/span\u003e, \u003cspan class=\"pl-c1\"\u003e7\u003c/span\u003e, \u003cspan class=\"pl-c1\"\u003e15\u003c/span\u003e);","displayNoNewLineWarning":false,"position":170,"left":248,"right":259},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":260,"text":"+\ttt.test_times[tt.n_test_times++] = build_time_t(2004, 1, 15);","html":"+\t\u003cspan class=\"pl-s1\"\u003ett\u003c/span\u003e.\u003cspan class=\"pl-c1\"\u003etest_times\u003c/span\u003e[\u003cspan class=\"pl-s1\"\u003ett\u003c/span\u003e.\u003cspan class=\"pl-c1\"\u003en_test_times\u003c/span\u003e\u003cspan class=\"pl-c1\"\u003e++\u003c/span\u003e] \u003cspan class=\"pl-c1\"\u003e=\u003c/span\u003e \u003cspan class=\"pl-en\"\u003ebuild_time_t\u003c/span\u003e(\u003cspan class=\"pl-c1 x x-first x-last\"\u003e2004\u003c/span\u003e, \u003cspan class=\"pl-c1\"\u003e1\u003c/span\u003e, \u003cspan class=\"pl-c1\"\u003e15\u003c/span\u003e);","displayNoNewLineWarning":false,"position":171,"left":248,"right":260},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":261,"text":"+\ttt.test_times[tt.n_test_times++] = t = build_time_t(2004, 7, 15);","html":"+\t\u003cspan class=\"pl-s1\"\u003ett\u003c/span\u003e.\u003cspan class=\"pl-c1\"\u003etest_times\u003c/span\u003e[\u003cspan class=\"pl-s1\"\u003ett\u003c/span\u003e.\u003cspan class=\"pl-c1\"\u003en_test_times\u003c/span\u003e\u003cspan class=\"pl-c1\"\u003e++\u003c/span\u003e] \u003cspan class=\"pl-c1\"\u003e=\u003c/span\u003e \u003cspan class=\"pl-s1 x x-first\"\u003et\u003c/span\u003e\u003cspan class=\"x\"\u003e \u003c/span\u003e\u003cspan class=\"pl-c1 x\"\u003e=\u003c/span\u003e\u003cspan class=\"x x-last\"\u003e \u003c/span\u003e\u003cspan class=\"pl-en\"\u003ebuild_time_t\u003c/span\u003e(\u003cspan class=\"pl-c1 x x-first x-last\"\u003e2004\u003c/span\u003e, \u003cspan class=\"pl-c1\"\u003e7\u003c/span\u003e, \u003cspan class=\"pl-c1\"\u003e15\u003c/span\u003e);","displayNoNewLineWarning":false,"position":172,"left":248,"right":261},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":262,"text":" \twhile (tt.n_test_times \u003c MAX_TEST_TIMES)","html":" \t\u003cspan class=pl-k\u003ewhile\u003c/span\u003e (\u003cspan class=pl-s1\u003ett\u003c/span\u003e.\u003cspan class=pl-c1\u003en_test_times\u003c/span\u003e \u003cspan class=pl-c1\u003e\u0026lt;\u003c/span\u003e \u003cspan class=pl-c1\u003eMAX_TEST_TIMES\u003c/span\u003e)","displayNoNewLineWarning":false,"position":173,"left":249,"right":262},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":263,"text":" \t{","html":" \t{","displayNoNewLineWarning":false,"position":174,"left":250,"right":263},{"stylingDirective":null,"type":"DELETION","blobLineNumber":251,"text":"-\t\tt += T_WEEK;","html":"-\t\t\u003cspan class=\"pl-s1\"\u003et\u003c/span\u003e \u003cspan class=\"pl-c1\"\u003e\u003cspan class=\"x x-first x-last\"\u003e+\u003c/span\u003e=\u003c/span\u003e \u003cspan class=\"pl-c1\"\u003eT_WEEK\u003c/span\u003e;","displayNoNewLineWarning":false,"position":175,"left":251,"right":263},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":264,"text":"+\t\tt -= T_WEEK;","html":"+\t\t\u003cspan class=\"pl-s1\"\u003et\u003c/span\u003e \u003cspan class=\"pl-c1\"\u003e\u003cspan class=\"x x-first x-last\"\u003e-\u003c/span\u003e=\u003c/span\u003e \u003cspan class=\"pl-c1\"\u003eT_WEEK\u003c/span\u003e;","displayNoNewLineWarning":false,"position":176,"left":251,"right":264},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":265,"text":" \t\ttt.test_times[tt.n_test_times++] = t;","html":" \t\t\u003cspan class=pl-s1\u003ett\u003c/span\u003e.\u003cspan class=pl-c1\u003etest_times\u003c/span\u003e[\u003cspan class=pl-s1\u003ett\u003c/span\u003e.\u003cspan class=pl-c1\u003en_test_times\u003c/span\u003e\u003cspan class=pl-c1\u003e++\u003c/span\u003e] \u003cspan class=pl-c1\u003e=\u003c/span\u003e \u003cspan class=pl-s1\u003et\u003c/span\u003e;","displayNoNewLineWarning":false,"position":177,"left":252,"right":265},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":266,"text":" \t}","html":" \t}","display 8000 NoNewLineWarning":false,"position":178,"left":253,"right":266},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":267,"text":" ","html":"\u003cbr\u003e","displayNoNewLineWarning":false,"position":179,"left":254,"right":267},{"stylingDirective":null,"type":"DELETION","blobLineNumber":255,"text":"-\t/* Search for a matching timezone file */","html":"-\t\u003cspan class=\"pl-c\"\u003e/* Search for \u003cspan class=\"x x-first x-last\"\u003ea \u003c/span\u003ematching timezone file */\u003c/span\u003e","displayNoNewLineWarning":false,"position":180,"left":255,"right":267},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":268,"text":"+\t/* Search for the best-matching timezone file */","html":"+\t\u003cspan class=\"pl-c\"\u003e/* Search for \u003cspan class=\"x x-first x-last\"\u003ethe best-\u003c/span\u003ematching timezone file */\u003c/span\u003e","displayNoNewLineWarning":false,"position":181,"left":255,"right":268},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":269,"text":" \tstrcpy(tmptzdir, pg_TZDIR());","html":" \t\u003cspan class=pl-en\u003estrcpy\u003c/span\u003e(\u003cspan class=pl-s1\u003etmptzdir\u003c/span\u003e, \u003cspan class=pl-en\u003epg_TZDIR\u003c/span\u003e());","displayNoNewLineWarning":false,"position":182,"left":256,"right":269},{"stylingDirective":null,"type":"DELETION","blobLineNumber":257,"text":"-\tif (scan_available_timezones(tmptzdir,","html":"-\t\u003cspan class=\"pl-k x x-first\"\u003eif\u003c/span\u003e\u003cspan class=\"x\"\u003e (\u003c/span\u003e\u003cspan class=\"pl-en x\"\u003escan_available_timezones\u003c/span\u003e\u003cspan class=\"x\"\u003e(\u003c/span\u003e\u003cspan class=\"pl-s1 x\"\u003etmptzdir\u003c/span\u003e\u003cspan class=\"x x-last\"\u003e,\u003c/span\u003e","displayNoNewLineWarning":false,"position":183,"left":257,"right":269},{"stylingDirective":null,"type":"DELETION","blobLineNumber":258,"text":"-\t\t\t\t\t\t\t\t tmptzdir + strlen(tmptzdir) + 1,","html":"-\t\u003cspan class=\"x x-first x-last\"\u003e\t\t\t\t\t\t\t\u003c/span\u003e \u003cspan class=\"pl-s1\"\u003etmptzdir\u003c/span\u003e \u003cspan class=\"pl-c1\"\u003e+\u003c/span\u003e \u003cspan class=\"pl-en\"\u003estrlen\u003c/span\u003e(\u003cspan class=\"pl-s1\"\u003etmptzdir\u003c/span\u003e) \u003cspan class=\"pl-c1\"\u003e+\u003c/span\u003e \u003cspan class=\"pl-c1\"\u003e1\u003c/span\u003e,","displayNoNewLineWarning":false,"position":184,"left":258,"right":269},{"stylingDirective":null,"type":"DELETION","blobLineNumber":259,"text":"-\t\t\t\t\t\t\t\t \u0026tt))","html":"-\t\t\t\t\t\t\t\u003cspan class=\"x x-first x-last\"\u003e\t\u003c/span\u003e \u003cspan class=\"pl-c1\"\u003e\u0026amp;\u003c/span\u003e\u003cspan class=\"pl-s1\"\u003ett\u003c/span\u003e\u003cspan class=\"x x-first x-last\"\u003e))\u003c/span\u003e","displayNoNewLineWarning":false,"position":185,"left":259,"right":269},{"stylingDirective":null,"type":"DELETION","blobLineNumber":260,"text":"-\t{","html":"-\t\u003cspan class=\"x x-first x-last\"\u003e{\u003c/span\u003e","displayNoNewLineWarning":false,"position":186,"left":260,"right":269},{"stylingDirective":null,"type":"DELETION","blobLineNumber":261,"text":"-\t\tStrNCpy(resultbuf, pg_get_current_timezone(), sizeof(resultbuf));","html":"-\t\u003cspan class=\"x x-first\"\u003e\t\u003c/span\u003e\u003cspan class=\"pl-en x\"\u003eStrNCpy\u003c/span\u003e\u003cspan class=\"x\"\u003e(\u003c/span\u003e\u003cspan class=\"pl-s1 x\"\u003eresultbuf\u003c/span\u003e\u003cspan class=\"x\"\u003e, \u003c/span\u003e\u003cspan class=\"pl-en x\"\u003epg_get_current_timezone\u003c/span\u003e\u003cspan class=\"x\"\u003e(), \u003c/span\u003e\u003cspan class=\"pl-k x\"\u003esizeof\u003c/span\u003e\u003cspan class=\"x\"\u003e(\u003c/span\u003e\u003cspan class=\"pl-s1 x\"\u003eresultbuf\u003c/span\u003e\u003cspan class=\"x x-last\"\u003e));\u003c/span\u003e","displayNoNewLineWarning":false,"position":187,"left":261,"right":269},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":270,"text":"+\tbestscore = 0;","html":"+\t\u003cspan class=\"pl-s1 x x-first\"\u003ebestscore\u003c/span\u003e\u003cspan class=\"x\"\u003e \u003c/span\u003e\u003cspan class=\"pl-c1 x\"\u003e=\u003c/span\u003e\u003cspan class=\"x\"\u003e \u003c/span\u003e\u003cspan class=\"pl-c1 x\"\u003e0\u003c/span\u003e\u003cspan class=\"x x-last\"\u003e;\u003c/span\u003e","displayNoNewLineWarning":false,"position":188,"left":261,"right":270},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":271,"text":"+\tscan_available_timezones(tmptzdir, tmptzdir + strlen(tmptzdir) + 1,","html":"+\t\u003cspan class=\"pl-en x x-first\"\u003escan_available_timezones\u003c/span\u003e\u003cspan class=\"x\"\u003e(\u003c/span\u003e\u003cspan class=\"pl-s1 x\"\u003etmptzdir\u003c/span\u003e\u003cspan class=\"x x-last\"\u003e,\u003c/span\u003e \u003cspan class=\"pl-s1\"\u003etmptzdir\u003c/span\u003e \u003cspan class=\"pl-c1\"\u003e+\u003c/span\u003e \u003cspan class=\"pl-en\"\u003estrlen\u003c/span\u003e(\u003cspan class=\"pl-s1\"\u003etmptzdir\u003c/span\u003e) \u003cspan class=\"pl-c1\"\u003e+\u003c/span\u003e \u003cspan class=\"pl-c1\"\u003e1\u003c/span\u003e,","displayNoNewLineWarning":false,"position":189,"left":261,"right":271},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":272,"text":"+\t\t\t\t\t\t\t \u0026tt,","html":"+\t\t\t\t\t\t\t \u003cspan class=\"pl-c1\"\u003e\u0026amp;\u003c/span\u003e\u003cspan class=\"pl-s1\"\u003ett\u003c/span\u003e\u003cspan class=\"x x-first x-last\"\u003e,\u003c/span\u003e","displayNoNewLineWarning":false,"position":190,"left":261,"right":272},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":273,"text":"+\t\t\t\t\t\t\t \u0026bestscore, resultbuf);","html":"+\t\u003cspan class=\"x x-first\"\u003e\t\t\t\t\t\t \u003c/span\u003e\u003cspan class=\"pl-c1 x\"\u003e\u0026amp;\u003c/span\u003e\u003cspan class=\"pl-s1 x\"\u003ebestscore\u003c/span\u003e\u003cspan class=\"x\"\u003e, \u003c/span\u003e\u003cspan class=\"pl-s1 x\"\u003eresultbuf\u003c/span\u003e\u003cspan class=\"x x-last\"\u003e);\u003c/span\u003e","displayNoNewLineWarning":false,"position":191,"left":261,"right":273},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":274,"text":"+\tif (bestscore \u003e 0)","html":"+\t\u003cspan class=\"pl-k x x-first\"\u003eif\u003c/span\u003e\u003cspan class=\"x\"\u003e (\u003c/span\u003e\u003cspan class=\"pl-s1 x\"\u003ebestscore\u003c/span\u003e\u003cspan class=\"x\"\u003e \u003c/span\u003e\u003cspan class=\"pl-c1 x\"\u003e\u0026gt;\u003c/span\u003e\u003cspan class=\"x\"\u003e \u003c/span\u003e\u003cspan class=\"pl-c1 x\"\u003e0\u003c/span\u003e\u003cspan class=\"x x-last\"\u003e)\u003c/span\u003e","displayNoNewLineWarning":false,"position":192,"left":261,"right":274},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":275,"text":" \t\treturn resultbuf;","html":" \t\t\u003cspan class=pl-k\u003ereturn\u003c/span\u003e \u003cspan class=pl-s1\u003eresultbuf\u003c/span\u003e;","displayNoNewLineWarning":false,"position":193,"left":262,"right":275},{"stylingDirective":null,"type":"DELETION","blobLineNumber":263,"text":"-\t}","html":"-\t}","displayNoNewLineWarning":false,"position":194,"left":263,"right":275},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":276,"text":" ","html":"\u003cbr\u003e","displayNoNewLineWarning":false,"position":195,"left":264,"right":276},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":277,"text":" \t/*","html":" \t\u003cspan class=pl-c\u003e/*\u003c/span\u003e","displayNoNewLineWarning":false,"position":196,"left":265,"right":277},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":278,"text":" \t * Couldn't find a match in the database, so next we try constructed zone","html":" \u003cspan class=pl-c\u003e\t * Couldn\u0026#39;t find a match in the database, so next we try constructed zone\u003c/span\u003e","displayNoNewLineWarning":false,"position":197,"left":266,"right":278},{"stylingDirective":null,"type":"HUNK","blobLineNumber":337,"text":"@@ -326,19 +338,19 @@ identify_system_timezone(void)","html":"@@ -326,19 +338,19 @@ identify_system_timezone(void)","displayNoNewLineWarning":false,"position":198,"left":325,"right":337},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":338,"text":" \t{","html":" \t{","displayNoNewLineWarning":false,"position":199,"left":326,"right":338},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":339,"text":" \t\tsnprintf(resultbuf, sizeof(resultbuf), \"%s%d%s\",","html":" \t\t\u003cspan class=pl-en\u003esnprintf\u003c/span\u003e(\u003cspan class=pl-s1\u003eresultbuf\u003c/span\u003e, \u003cspan class=pl-k\u003esizeof\u003c/span\u003e(\u003cspan class=pl-s1\u003eresultbuf\u003c/span\u003e), \u003cspan class=pl-s\u003e\u0026quot;%s%d%s\u0026quot;\u003c/span\u003e,","displayNoNewLineWarning":false,"position":200,"left":327,"right":339},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":340,"text":" \t\t\t\t std_zone_name, -std_ofs / 3600, dst_zone_name);","html":" \t\t\t\t \u003cspan class=pl-s1\u003estd_zone_name\u003c/span\u003e, \u003cspan class=pl-c1\u003e-\u003c/span\u003e\u003cspan class=pl-s1\u003estd_ofs\u003c/span\u003e / \u003cspan class=pl-c1\u003e3600\u003c/span\u003e, \u003cspan class=pl-s1\u003edst_zone_name\u003c/span\u003e);","displayNoNewLineWarning":false,"position":201,"left":328,"right":340},{"stylingDirective":null,"type":"DELETION","blobLineNumber":329,"text":"-\t\tif (try_timezone(resultbuf, \u0026tt))","html":"-\t\t\u003cspan class=\"pl-k\"\u003eif\u003c/span\u003e (\u003cspan class=\"pl-en x x-first x-last\"\u003etry_timezone\u003c/span\u003e(\u003cspan class=\"pl-s1\"\u003eresultbuf\u003c/span\u003e, \u003cspan class=\"pl-c1\"\u003e\u0026amp;\u003c/span\u003e\u003cspan class=\"pl-s1\"\u003ett\u003c/span\u003e))","displayNoNewLineWarning":false,"position":202,"left":329,"right":340},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":341,"text":"+\t\tif (score_timezone(resultbuf, \u0026tt) \u003e 0)","html":"+\t\t\u003cspan class=\"pl-k\"\u003eif\u003c/span\u003e (\u003cspan class=\"pl-en x x-first x-last\"\u003escore_timezone\u003c/span\u003e(\u003cspan class=\"pl-s1\"\u003eresultbuf\u003c/span\u003e, \u003cspan class=\"pl-c1\"\u003e\u0026amp;\u003c/span\u003e\u003cspan class=\"pl-s1\"\u003ett\u003c/span\u003e)\u003cspan class=\"x x-first\"\u003e \u003c/span\u003e\u003cspan class=\"pl-c1 x\"\u003e\u0026gt;\u003c/span\u003e\u003cspan class=\"x\"\u003e \u003c/span\u003e\u003cspan class=\"pl-c1 x x-last\"\u003e0\u003c/span\u003e)","displayNoNewLineWarning":false,"position":203,"left":329,"right":341},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":342,"text":" \t\t\treturn resultbuf;","html":" \t\t\t\u003cspan class=pl-k\u003ereturn\u003c/span\u003e \u003cspan class=pl-s1\u003eresultbuf\u003c/span\u003e;","displayNoNewLineWarning":false,"position":204,"left":330,"right":342},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":343,"text":" \t}","html":" \t}","displayNoNewLineWarning":false,"position":205,"left":331,"right":343},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":344,"text":" ","html":"\u003cbr\u003e","displayNoNewLineWarning":false,"position":206,"left":332,"right":344},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":345,"text":" \t/* Try just the STD timezone (works for GMT at least) */","html":" \t\u003cspan class=pl-c\u003e/* Try just the STD timezone (works for GMT at least) */\u003c/span\u003e","displayNoNewLineWarning":false,"position":207,"left":333,"right":345},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":346,"text":" \tstrcpy(resultbuf, std_zone_name);","html":" \t\u003cspan class=pl-en\u003estrcpy\u003c/span\u003e(\u003cspan class=pl-s1\u003eresultbuf\u003c/span\u003e, \u003cspan class=pl-s1\u003estd_zone_name\u003c/span\u003e);","displayNoNewLineWarning":false,"position":208,"left":334,"right":346},{"stylingDirective":null,"type":"DELETION","blobLineNumber":335,"text":"-\tif (try_timezone(resultbuf, \u0026tt))","html":"-\t\u003cspan class=\"pl-k\"\u003eif\u003c/span\u003e (\u003cspan class=\"pl-en x x-first x-last\"\u003etry_timezone\u003c/span\u003e(\u003cspan class=\"pl-s1\"\u003eresultbuf\u003c/span\u003e, \u003cspan class=\"pl-c1\"\u003e\u0026amp;\u003c/span\u003e\u003cspan class=\"pl-s1\"\u003ett\u003c/span\u003e))","displayNoNewLineWarning":false,"position":209,"left":335,"right":346},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":347,"text":"+\tif (score_timezone(resultbuf, \u0026tt) \u003e 0)","html":"+\t\u003cspan class=\"pl-k\"\u003eif\u003c/span\u003e (\u003cspan class=\"pl-en x x-first x-last\"\u003escore_timezone\u003c/span\u003e(\u003cspan class=\"pl-s1\"\u003eresultbuf\u003c/span\u003e, \u003cspan class=\"pl-c1\"\u003e\u0026amp;\u003c/span\u003e\u003cspan class=\"pl-s1\"\u003ett\u003c/span\u003e)\u003cspan class=\"x x-first\"\u003e \u003c/span\u003e\u003cspan class=\"pl-c1 x\"\u003e\u0026gt;\u003c/span\u003e\u003cspan class=\"x\"\u003e \u003c/span\u003e\u003cspan class=\"pl-c1 x x-last\"\u003e0\u003c/span\u003e)","displayNoNewLineWarning":false,"position":210,"left":335,"right":347},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":348,"text":" \t\treturn resultbuf;","html":" \t\t\u003cspan class=pl-k\u003ereturn\u003c/span\u003e \u003cspan class=pl-s1\u003eresultbuf\u003c/span\u003e;","displayNoNewLineWarning":false,"position":211,"left":336,"right":348},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":349,"text":" ","html":"\u003cbr\u003e","displayNoNewLineWarning":false,"position":212,"left":337,"right":349},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":350,"text":" \t/* Try STD\u003cofs\u003e */","html":" \t\u003cspan class=pl-c\u003e/* Try STD\u0026lt;ofs\u0026gt; */\u003c/span\u003e","displayNoNewLineWarning":false,"position":213,"left":338,"right":350},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":351,"text":" \tsnprintf(resultbuf, sizeof(resultbuf), \"%s%d\",","html":" \t\u003cspan class=pl-en\u003esnprintf\u003c/span\u003e(\u003cspan class=pl-s1\u003eresultbuf\u003c/span\u003e, \u003cspan class=pl-k\u003esizeof\u003c/span\u003e(\u003cspan class=pl-s1\u003eresultbuf\u003c/span\u003e), \u003cspan class=pl-s\u003e\u0026quot;%s%d\u0026quot;\u003c/span\u003e,","displayNoNewLineWarning":false,"position":214,"left":339,"right":351},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":352,"text":" \t\t\t std_zone_name, -std_ofs / 3600);","html":" \t\t\t \u003cspan class=pl-s1\u003estd_zone_name\u003c/span\u003e, \u003cspan class=pl-c1\u003e-\u003c/span\u003e\u003cspan class=pl-s1\u003estd_ofs\u003c/span\u003e / \u003cspan class=pl-c1\u003e3600\u003c/span\u003e);","displayNoNewLineWarning":false,"position":215,"left":340,"right":352},{"stylingDirective":null,"type":"DELETION","blobLineNumber":341,"text":"-\tif (try_timezone(resultbuf, \u0026tt))","html":"-\t\u003cspan class=\"pl-k\"\u003eif\u003c/span\u003e (\u003cspan class=\"pl-en x x-first x-last\"\u003etry_timezone\u003c/span\u003e(\u003cspan class=\"pl-s1\"\u003eresultbuf\u003c/span\u003e, \u003cspan class=\"pl-c1\"\u003e\u0026amp;\u003c/span\u003e\u003cspan class=\"pl-s1\"\u003ett\u003c/span\u003e))","displayNoNewLineWarning":false,"position":216,"left":341,"right":352},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":353,"text":"+\tif (score_timezone(resultbuf, \u0026tt) \u003e 0)","html":"+\t\u003cspan class=\"pl-k\"\u003eif\u003c/span\u003e (\u003cspan class=\"pl-en x x-first x-last\"\u003escore_timezone\u003c/span\u003e(\u003cspan class=\"pl-s1\"\u003eresultbuf\u003c/span\u003e, \u003cspan class=\"pl-c1\"\u003e\u0026amp;\u003c/span\u003e\u003cspan class=\"pl-s1\"\u003ett\u003c/span\u003e)\u003cspan class=\"x x-first\"\u003e \u003c/span\u003e\u003cspan class=\"pl-c1 x\"\u003e\u0026gt;\u003c/span\u003e\u003cspan class=\"x\"\u003e \u003c/span\u003e\u003cspan class=\"pl-c1 x x-last\"\u003e0\u003c/span\u003e)","displayNoNewLineWarning":false,"position":217,"left":341,"right":353},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":354,"text":" \t\treturn resultbuf;","html":" \t\t\u003cspan class=pl-k\u003ereturn\u003c/span\u003e \u003cspan class=pl-s1\u003eresultbuf\u003c/span\u003e;","displayNoNewLineWarning":false,"position":218,"left":342,"right":354},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":355,"text":" ","html":"\u003cbr\u003e","displayNoNewLineWarning":false,"position":219,"left":343,"right":355},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":356,"text":" \t/*","html":" \t\u003cspan class=pl-c\u003e/*\u003c/span\u003e","displayNoNewLineWarning":false,"position":220,"left":344,"right":356},{"stylingDirective":null,"type":"HUNK","blobLineNumber":369,"text":"@@ -358,7 +370,7 @@ identify_system_timezone(void)","html":"@@ -358,7 +370,7 @@ identify_system_timezone(void)","displayNoNewLineWarning":false,"position":221,"left":357,"right":369},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":370,"text":" }","html":" }","displayNoNewLineWarning":false,"position":222,"left":358,"right":370},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":371,"text":" ","html":"\u003cbr\u003e","displayNoNewLineWarning":false,"position":223,"left":359,"right":371},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":372,"text":" /*","html":" \u003cspan class=pl-c\u003e/*\u003c/span\u003e","displayNoNewLineWarning":false,"position":224,"left":360,"right":372},{"stylingDirective":null,"type":"DELETION","blobLineNumber":361,"text":"- * Recursively scan the timezone database looking for a usable match to","html":"-\u003cspan class=\"pl-c\"\u003e * Recursively scan the timezone database looking for \u003cspan class=\"x x-first x-last\"\u003ea usable\u003c/span\u003e match to\u003c/span\u003e","displayNoNewLineWarning":false,"position":225,"left":361,"right":372},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":373,"text":"+ * Recursively scan the timezone database looking for the best match to","html":"+\u003cspan class=\"pl-c\"\u003e * Recursively scan the timezone database looking for \u003cspan class=\"x x-first x-last\"\u003ethe best\u003c/span\u003e match to\u003c/span\u003e","displayNoNewLineWarning":false,"position":226,"left":361,"right":373},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":374,"text":" * the system timezone behavior.","html":" \u003cspan class=pl-c\u003e * the system timezone behavior.\u003c/span\u003e","displayNoNewLineWarning":false,"position":227,"left":362,"right":374},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":375,"text":" *","html":" \u003cspan class=pl-c\u003e *\u003c/span\u003e","displayNoNewLineWarning":false,"position":228,"left":363,"right":375},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":376,"text":" * tzdir points to a buffer of size MAXPGPATH. On entry, it holds the","html":" \u003cspan class=pl-c\u003e * tzdir points to a buffer of size MAXPGPATH. On entry, it holds the\u003c/span\u003e","displayNoNewLineWarning":false,"position":229,"left":364,"right":376},{"stylingDirective":null,"type":"HUNK","blobLineNumber":383,"text":"@@ -372,14 +384,15 @@ identify_system_timezone(void)","html":"@@ -372,14 +384,15 @@ identify_system_timezone(void)","displayNoNewLineWarning":false,"position":230,"left":371,"right":383},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":384,"text":" *","html":" \u003cspan class=pl-c\u003e *\u003c/span\u003e","displayNoNewLineWarning":false,"position":231,"left":372,"right":384},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":385,"text":" * tt tells about the system timezone behavior we need to match.","html":" \u003cspan class=pl-c\u003e * tt tells about the system timezone behavior we need to match.\u003c/span\u003e","displayNoNewLineWarning":false,"position":232,"left":373,"right":385},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":386,"text":" *","html":" \u003cspan class=pl-c\u003e *\u003c/span\u003e","displayNoNewLineWarning":false,"position":233,"left":374,"right":386},{"stylingDirective":null,"type":"DELETION","blobLineNumber":375,"text":"- * On success, returns TRUE leaving the proper timezone selected.","html":"-\u003cspan class=pl-c\u003e * On success, returns TRUE leaving the proper timezone selected.\u003c/span\u003e","displayNoNewLineWarning":false,"position":234,"left":375,"right":386},{"stylingDirective":null,"type":"DELETION","blobLineNumber":376,"text":"- * On failure, returns FALSE with a random timezone selected.","html":"-\u003cspan class=pl-c\u003e * On failure, returns FALSE with a random timezone selected.\u003c/span\u003e","displayNoNewLineWarning":false,"position":235,"left":376,"right":386},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":387,"text":"+ * *bestscore and *bestzonename on entry hold the best score found so far","html":"+\u003cspan class=pl-c\u003e * *bestscore and *bestzonename on entry hold the best score found so far\u003c/span\u003e","displayNoNewLineWarning":false,"position":236,"left":376,"right":387},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":388,"text":"+ * and the name of the best zone. We overwrite them if we find a better","html":"+\u003cspan class=pl-c\u003e * and the name of the best zone. We overwrite them if we find a better\u003c/span\u003e","displayNoNewLineWarning":false,"position":237,"left":376,"right":388},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":389,"text":"+ * score. bestzonename must be a buffer of length TZ_STRLEN_MAX + 1.","html":"+\u003cspan class=pl-c\u003e * score. bestzonename must be a buffer of length TZ_STRLEN_MAX + 1.\u003c/span\u003e","displayNoNewLineWarning":false,"position":238,"left":376,"right":389},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":390,"text":" */","html":" \u003cspan class=pl-c\u003e */\u003c/span\u003e","displayNoNewLineWarning":false,"position":239,"left":377,"right":390},{"stylingDirective":null,"type":"DELETION","blobLineNumber":378,"text":"-static bool","html":"-\u003cspan class=pl-k\u003estatic\u003c/span\u003e \u003cspan class=pl-smi\u003ebool\u003c/span\u003e","displayNoNewLineWarning":false,"position":240,"left":378,"right":390},{"stylingDirective":null,"type":"DELETION","blobLineNumber":379,"text":"-scan_available_timezones(char *tzdir, char *tzdirsub, struct tztry *tt)","html":"-\u003cspan class=pl-en\u003escan_available_timezones\u003c/span\u003e(\u003cspan class=pl-smi\u003echar\u003c/span\u003e \u003cspan class=pl-c1\u003e*\u003c/span\u003e\u003cspan class=pl-s1\u003etzdir\u003c/span\u003e, \u003cspan class=pl-smi\u003echar\u003c/span\u003e \u003cspan class=pl-c1\u003e*\u003c/span\u003e\u003cspan class=pl-s1\u003etzdirsub\u003c/span\u003e, \u003cspan class=pl-k\u003estruct\u003c/span\u003e \u003cspan class=pl-smi\u003etztry\u003c/span\u003e \u003cspan class=pl-c1\u003e*\u003c/span\u003e\u003cspan class=pl-s1\u003ett\u003c/span\u003e)","displayNoNewLineWarning":false,"position":241,"left":379,"right":390},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":391,"text":"+static void","html":"+\u003cspan class=pl-k\u003estatic\u003c/span\u003e \u003cspan class=pl-smi\u003evoid\u003c/span\u003e","displayNoNewLineWarning":false,"position":242,"left":379,"right":391},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":392,"text":"+scan_available_timezones(char *tzdir, char *tzdirsub, struct tztry *tt,","html":"+\u003cspan class=pl-en\u003escan_available_timezones\u003c/span\u003e(\u003cspan class=pl-smi\u003echar\u003c/span\u003e \u003cspan class=pl-c1\u003e*\u003c/span\u003e\u003cspan class=pl-s1\u003etzdir\u003c/span\u003e, \u003cspan class=pl-smi\u003echar\u003c/span\u003e \u003cspan class=pl-c1\u003e*\u003c/span\u003e\u003cspan class=pl-s1\u003etzdirsub\u003c/span\u003e, \u003cspan class=pl-k\u003estruct\u003c/span\u003e \u003cspan class=pl-smi\u003etztry\u003c/span\u003e \u003cspan class=pl-c1\u003e*\u003c/span\u003e\u003cspan class=pl-s1\u003ett\u003c/span\u003e,","displayNoNewLineWarning":false,"position":243,"left":379,"right":392},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":393,"text":"+\t\t\t\t\t\t int *bestscore, char *bestzonename)","html":"+\t\t\t\t\t\t \u003cspan class=pl-smi\u003eint\u003c/span\u003e \u003cspan class=pl-c1\u003e*\u003c/span\u003e\u003cspan class=pl-s1\u003ebestscore\u003c/span\u003e, \u003cspan class=pl-smi\u003echar\u003c/span\u003e \u003cspan class=pl-c1\u003e*\u003c/span\u003e\u003cspan class=pl-s1\u003ebestzonename\u003c/span\u003e)","displayNoNewLineWarning":false,"position":244,"left":379,"right":393},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":394,"text":" {","html":" {","displayNoNewLineWarning":false,"position":245,"left":380,"right":394},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":395,"text":" \tint\t\t\ttzdir_orig_len = strlen(tzdir);","html":" \t\u003cspan class=pl-smi\u003eint\u003c/span\u003e\t\t\t\u003cspan class=pl-s1\u003etzdir_orig_len\u003c/span\u003e \u003cspan class=pl-c1\u003e=\u003c/span\u003e \u003cspan class=pl-en\u003estrlen\u003c/span\u003e(\u003cspan class=pl-s1\u003etzdir\u003c/span\u003e);","displayNoNewLineWarning":false,"position":246,"left":381,"right":395},{"stylingDirective":null,"type":"DELETION","blobLineNumber":382,"text":"-\tbool\t\tfound = false;","html":"-\t\u003cspan class=pl-smi\u003ebool\u003c/span\u003e\t\t\u003cspan class=pl-s1\u003efound\u003c/span\u003e \u003cspan class=pl-c1\u003e=\u003c/span\u003e false;","displayNoNewLineWarning":false,"position":247,"left":382,"right":395},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":396,"text":" \tDIR\t\t *dirdesc;","html":" \t\u003cspan class=pl-smi\u003eDIR\u003c/span\u003e\t\t \u003cspan class=pl-c1\u003e*\u003c/span\u003e\u003cspan class=pl-s1\u003edirdesc\u003c/span\u003e;","displayNoNewLineWarning":false,"position":248,"left":383,"right":396},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":397,"text":" ","html":"\u003cbr\u003e","displayNoNewLineWarning":false,"position":249,"left":384,"right":397},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":398,"text":" \tdirdesc = AllocateDir(tzdir);","html":" \t\u003cspan class=pl-s1\u003edirdesc\u003c/span\u003e \u003cspan class=pl-c1\u003e=\u003c/span\u003e \u003cspan class=pl-en\u003eAllocateDir\u003c/span\u003e(\u003cspan class=pl-s1\u003etzdir\u003c/span\u003e);","displayNoNewLineWarning":false,"position":250,"left":385,"right":398},{"stylingDirective":null,"type":"HUNK","blobLineNumber":400,"text":"@@ -388,7 +401,7 @@ scan_available_timezones(char *tzdir, char *tzdirsub, struct tztry *tt)","html":"@@ -388,7 +401,7 @@ scan_available_timezones(char *tzdir, char *tzdirsub, struct tztry *tt)","displayNoNewLineWarning":false,"position":251,"left":387,"right":400},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":401,"text":" \t\tereport(LOG,","html":" \t\t\u003cspan class=pl-en\u003eereport\u003c/span\u003e(\u003cspan class=pl-c1\u003eLOG\u003c/span\u003e,","displayNoNewLineWarning":false,"position":252,"left":388,"right":401},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":402,"text":" \t\t\t\t(errcode_for_file_access(),","html":" \t\t\t\t(\u003cspan class=pl-en\u003eerrcode_for_file_access\u003c/span\u003e(),","displayNoNewLineWarning":false,"position":253,"left":389,"right":402},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":403,"text":" \t\t\t\t errmsg(\"could not open directory \\\"%s\\\": %m\", tzdir)));","html":" \t\t\t\t \u003cspan class=pl-en\u003eerrmsg\u003c/span\u003e(\u003cspan class=pl-s\u003e\u0026quot;could not open directory \\\u0026quot;%s\\\u0026quot;: %m\u0026quot;\u003c/span\u003e, \u003cspan class=pl-s1\u003etzdir\u003c/span\u003e)));","displayNoNewLineWarning":false,"position":254,"left":390,"right":403},{"stylingDirective":null,"type":"DELETION","blobLineNumber":391,"text":"-\t\treturn false;","html":"-\t\t\u003cspan class=\"pl-k\"\u003ereturn\u003c/span\u003e\u003cspan class=\"x x-first x-last\"\u003e false\u003c/span\u003e;","displayNoNewLineWarning":false,"position":255,"left":391,"right":403},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":404,"text":"+\t\treturn;","html":"+\t\t\u003cspan class=\"pl-k\"\u003ereturn\u003c/span\u003e;","displayNoNewLineWarning":false,"position":256,"left":391,"right":404},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":405,"text":" \t}","html":" \t}","displayNoNewLineWarning":false,"position":257,"left":392,"right":405},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":406,"text":" ","html":"\u003cbr\u003e","displayNoNewLineWarning":false,"position":258,"left":393,"right":406},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":407,"text":" \tfor (;;)","html":" \t\u003cspan class=pl-k\u003efor\u003c/span\u003e (;;)","displayNoNewLineWarning":false,"position":259,"left":394,"right":407},{"stylingDirective":null,"type":"HUNK","blobLineNumber":444,"text":"@@ -432,25 +445,26 @@ scan_available_timezones(char *tzdir, char *tzdirsub, struct tztry *tt)","html":"@@ -432,25 +445,26 @@ scan_available_timezones(char *tzdir, char *tzdirsub, struct tztry *tt)","displayNoNewLineWarning":false,"position":260,"left":431,"right":444},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":445,"text":" \t\tif (S_ISDIR(statbuf.st_mode))","html":" \t\t\u003cspan class=pl-k\u003eif\u003c/span\u003e (\u003cspan class=pl-en\u003eS_ISDIR\u003c/span\u003e(\u003cspan class=pl-s1\u003estatbuf\u003c/span\u003e.\u003cspan class=pl-c1\u003est_mode\u003c/span\u003e))","displayNoNewLineWarning":false,"position":261,"left":432,"right":445},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":446,"text":" \t\t{","html":" \t\t{","displayNoNewLineWarning":false,"position":262,"left":433,"right":446},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":447,"text":" \t\t\t/* Recurse into subdirectory */","html":" \t\t\t\u003cspan class=pl-c\u003e/* Recurse into subdirectory */\u003c/span\u003e","displayNoNewLineWarning":false,"position":263,"left":434,"right":447},{"stylingDirective":null,"type":"DELETION","blobLineNumber":435,"text":"-\t\t\tfound = scan_available_timezones(tzdir, tzdirsub, tt);","html":"-\t\t\t\u003cspan class=pl-s1\u003efound\u003c/span\u003e \u003cspan class=pl-c1\u003e=\u003c/span\u003e \u003cspan class=pl-en\u003escan_available_timezones\u003c/span\u003e(\u003cspan class=pl-s1\u003etzdir\u003c/span\u003e, \u003cspan class=pl-s1\u003etzdirsub\u003c/span\u003e, \u003cspan class=pl-s1\u003ett\u003c/span\u003e);","displayNoNewLineWarning":false,"position":264,"left":435,"right":447},{"stylingDirective":null,"type":"DELETION","blobLineNumber":436,"text":"-\t\t\tif (found)","html":"-\t\t\t\u003cspan class=pl-k\u003eif\u003c/span\u003e (\u003cspan class=pl-s1\u003efound\u003c/span\u003e)","displayNoNewLineWarning":false,"position":265,"left":436,"right":447},{"stylingDirective":null,"type":"DELETION","blobLineNumber":437,"text":"-\t\t\t\tbreak;","html":"-\t\t\t\t\u003cspan class=pl-k\u003ebreak\u003c/span\u003e;","displayNoNewLineWarning":false,"position":266,"left":437,"right":447},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":448,"text":"+\t\t\tscan_available_timezones(tzdir, tzdirsub, tt,","html":"+\t\t\t\u003cspan class=pl-en\u003escan_available_timezones\u003c/span\u003e(\u003cspan class=pl-s1\u003etzdir\u003c/span\u003e, \u003cspan class=pl-s1\u003etzdirsub\u003c/span\u003e, \u003cspan class=pl-s1\u003ett\u003c/span\u003e,","displayNoNewLineWarning":false,"position":267,"left":437,"right":448},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":449,"text":"+\t\t\t\t\t\t\t\t\t bestscore, bestzonename);","html":"+\t\t\t\t\t\t\t\t\t \u003cspan class=pl-s1\u003ebestscore\u003c/span\u003e, \u003cspan class=pl-s1\u003ebestzonename\u003c/span\u003e);","displayNoNewLineWarning":false,"position":268,"left":437,"right":449},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":450,"text":" \t\t}","html":" \t\t}","displayNoNewLineWarning":false,"position":269,"left":438,"right":450},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":451,"text":" \t\telse","html":" \t\t\u003cspan class=pl-k\u003eelse\u003c/span\u003e","displayNoNewLineWarning":false,"position":270,"left":439,"right":451},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":452,"text":" \t\t{","html":" \t\t{","displayNoNewLineWarning":false,"position":271,"left":440,"right":452},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":453,"text":" \t\t\t/* Load and test this file */","html":" \t\t\t\u003cspan class=pl-c\u003e/* Load and test this file */\u003c/span\u003e","displayNoNewLineWarning":false,"position":272,"left":441,"right":453},{"stylingDirective":null,"type":"DELETION","blo 8000 bLineNumber":442,"text":"-\t\t\tfound = try_timezone(tzdirsub, tt);","html":"-\t\t\t\u003cspan class=pl-s1\u003efound\u003c/span\u003e \u003cspan class=pl-c1\u003e=\u003c/span\u003e \u003cspan class=pl-en\u003etry_timezone\u003c/span\u003e(\u003cspan class=pl-s1\u003etzdirsub\u003c/span\u003e, \u003cspan class=pl-s1\u003ett\u003c/span\u003e);","displayNoNewLineWarning":false,"position":273,"left":442,"right":453},{"stylingDirective":null,"type":"DELETION","blobLineNumber":443,"text":"-\t\t\tif (found)","html":"-\t\t\t\u003cspan class=pl-k\u003eif\u003c/span\u003e (\u003cspan class=pl-s1\u003efound\u003c/span\u003e)","displayNoNewLineWarning":false,"position":274,"left":443,"right":453},{"stylingDirective":null,"type":"DELETION","blobLineNumber":444,"text":"-\t\t\t\tbreak;","html":"-\t\t\t\t\u003cspan class=pl-k\u003ebreak\u003c/span\u003e;","displayNoNewLineWarning":false,"position":275,"left":444,"right":453},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":454,"text":"+\t\t\tint score = score_timezone(tzdirsub, tt);","html":"+\t\t\t\u003cspan class=pl-smi\u003eint\u003c/span\u003e \u003cspan class=pl-s1\u003escore\u003c/span\u003e \u003cspan class=pl-c1\u003e=\u003c/span\u003e \u003cspan class=pl-en\u003escore_timezone\u003c/span\u003e(\u003cspan class=pl-s1\u003etzdirsub\u003c/span\u003e, \u003cspan class=pl-s1\u003ett\u003c/span\u003e);","displayNoNewLineWarning":false,"position":276,"left":444,"right":454},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":455,"text":"+","html":"+","displayNoNewLineWarning":false,"position":277,"left":444,"right":455},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":456,"text":"+\t\t\tif (score \u003e *bestscore)","html":"+\t\t\t\u003cspan class=pl-k\u003eif\u003c/span\u003e (\u003cspan class=pl-s1\u003escore\u003c/span\u003e \u003cspan class=pl-c1\u003e\u0026gt;\u003c/span\u003e \u003cspan class=pl-c1\u003e*\u003c/span\u003e\u003cspan class=pl-s1\u003ebestscore\u003c/span\u003e)","displayNoNewLineWarning":false,"position":278,"left":444,"right":456},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":457,"text":"+\t\t\t{","html":"+\t\t\t{","displayNoNewLineWarning":false,"position":279,"left":444,"right":457},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":458,"text":"+\t\t\t\t*bestscore = score;","html":"+\t\t\t\t\u003cspan class=pl-c1\u003e*\u003c/span\u003e\u003cspan class=pl-s1\u003ebestscore\u003c/span\u003e \u003cspan class=pl-c1\u003e=\u003c/span\u003e \u003cspan class=pl-s1\u003escore\u003c/span\u003e;","displayNoNewLineWarning":false,"position":280,"left":444,"right":458},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":459,"text":"+\t\t\t\tStrNCpy(bestzonename, tzdirsub, TZ_STRLEN_MAX + 1);","html":"+\t\t\t\t\u003cspan class=pl-en\u003eStrNCpy\u003c/span\u003e(\u003cspan class=pl-s1\u003ebestzonename\u003c/span\u003e, \u003cspan class=pl-s1\u003etzdirsub\u003c/span\u003e, \u003cspan class=pl-c1\u003eTZ_STRLEN_MAX\u003c/span\u003e \u003cspan class=pl-c1\u003e+\u003c/span\u003e \u003cspan class=pl-c1\u003e1\u003c/span\u003e);","displayNoNewLineWarning":false,"position":281,"left":444,"right":459},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":460,"text":"+\t\t\t}","html":"+\t\t\t}","displayNoNewLineWarning":false,"position":282,"left":444,"right":460},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":461,"text":" \t\t}","html":" \t\t}","displayNoNewLineWarning":false,"position":283,"left":445,"right":461},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":462,"text":" \t}","html":" \t}","displayNoNewLineWarning":false,"position":284,"left":446,"right":462},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":463,"text":" ","html":"\u003cbr\u003e","displayNoNewLineWarning":false,"position":285,"left":447,"right":463},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":464,"text":" \tFreeDir(dirdesc);","html":" \t\u003cspan class=pl-en\u003eFreeDir\u003c/span\u003e(\u003cspan class=pl-s1\u003edirdesc\u003c/span\u003e);","displayNoNewLineWarning":false,"position":286,"left":448,"right":464},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":465,"text":" ","html":"\u003cbr\u003e","displayNoNewLineWarning":false,"position":287,"left":449,"right":465},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":466,"text":" \t/* Restore tzdir */","html":" \t\u003cspan class=pl-c\u003e/* Restore tzdir */\u003c/span\u003e","displayNoNewLineWarning":false,"position":288,"left":450,"right":466},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":467,"text":" \ttzdir[tzdir_orig_len] = '\\0';","html":" \t\u003cspan class=pl-s1\u003etzdir\u003c/span\u003e[\u003cspan class=pl-s1\u003etzdir_orig_len\u003c/span\u003e] \u003cspan class=pl-c1\u003e=\u003c/span\u003e \u003cspan class=pl-c1\u003e\u0026#39;\\0\u0026#39;\u003c/span\u003e;","displayNoNewLineWarning":false,"position":289,"left":451,"right":467},{"stylingDirective":null,"type":"DELETION","blobLineNumber":452,"text":"-","html":"-","displayNoNewLineWarning":false,"position":290,"left":452,"right":467},{"stylingDirective":null,"type":"DELETION","blobLineNumber":453,"text":"-\treturn found;","html":"-\t\u003cspan class=pl-k\u003ereturn\u003c/span\u003e \u003cspan class=pl-s1\u003efound\u003c/span\u003e;","displayNoNewLineWarning":false,"position":291,"left":453,"right":467},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":468,"text":" }","html":" }","displayNoNewLineWarning":false,"position":292,"left":454,"right":468},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":469,"text":" ","html":"\u003cbr\u003e","displayNoNewLineWarning":false,"position":293,"left":455,"right":469},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":470,"text":" ","html":"\u003cbr\u003e","displayNoNewLineWarning":false,"position":294,"left":456,"right":470}],"diffNumber":0,"diffSize":"0 Bytes","isBinary":false,"isTooBig":false,"collapsed":false,"isSubmodule":false,"lineCount":550,"linesChanged":142,"newTreeEntry":{"lineCount":550,"path":"src/timezone/pgtz.c","mode":100644,"isGenerated":false},"oldTreeEntry":{"lineCount":0,"path":"src/timezone/pgtz.c","mode":100644},"linesAdded":78,"linesDeleted":64,"path":"src/timezone/pgtz.c","pathDigest":"a89b72aa8bed539b278ee8a039d23c80b829444bea7e2ae44beabff7b51070c1","status":"MODIFIED","truncatedReason":null,"oldOid":"664291107e9addbe24476a8a7961c85343bd3526","newOid":"e31c8cf20b941ac48cc067c8114351da7db682f3","copilotChatReference":null,"deletedSha":"664291107e9addbe24476a8a7961c85343bd3526","canToggleRichDiff":false,"defaultToRichDiff":false,"proseDifffHtml":null,"renderInfo":null,"dependencyDiffPath":null,"submodule":null}],"splitViewPreference":"unified","ignoreWhitespace":false,"repoOwnerGlobalRelayId":"MDEyOk9yZ2FuaXphdGlvbjE3NzU0Mw==","commentsPreference":"visible","diffLineSpacingPreference":"relaxed","useMonospaceFont":false,"pasteUrlLinkAsPlainText":false,"userNotices":[],"path":"/postgres/postgres/commit/e31c8cf20b941ac48cc067c8114351da7db682f3","fileTreeExpanded":true,"headerInfo":{"additions":78,"deletions":64,"filesChanged":1,"filesChangedString":"1"},"moreDiffsToLoad":false,"asyncDiffLoadInfo":{"startIndex":1,"truncated":false,"byteCount":10071,"lineShownCount":295},"commentInfo":{"canComment":false,"locked":false,"canLock":false,"repoArchived":false},"csrf_tokens":{"/users/diffview?diff=split":{"post":"nJLj3Sl8xIxYqEnYI9XqGVsJ0Yh07r6w0MIuX-8rbP0cLHp3zgQ9dP_8Wj1AHYuEsTizAvEZyK0thMBHtkLC6g"},"/users/diffview?diff=unified":{"post":"rLp2DUpJwAO9VbxQWe0DcPTHeRHqVAUWasvMgv2zZ3UsBO-nrTE5-xoBr7U6JWLtHvYbm2-jcwuXjSKapNrJYg"},"/notifications/thread":{"post":"RPGS7zdgHsbncUIbkFXLB4_PHVrdZjDGcN41G5EdVS1AA540weu_mSG98aI8tSdc_CUlPLeO2LUtbfeL3D2f-Q"}}},"title":"Still another try at automatically detecting the best match in the zic · postgres/postgres@e31c8cf","appPayload":{"helpUrl":"https://docs.github.com","findInDiffWorkerPath":"/assets-cdn/worker/find-in-diff-worker-2bfe39677d14.js","enabled_features":{"diff_ux_refresh_beta":false,"diff_inline_comments":true,"diff_ux_refresh_ssr_five":false,"diff_ux_refresh_ssr_ten":false,"react_diff_line_type_character_correction":true}}}

Commit e31c8cf

Browse files
committed
Still another try at automatically detecting the best match in the zic
timezone database for the system behavior we find ourselves in. Scan backwards from current time and choose the zone that matches furthest back. As per discussion a week or so back.
1 parent 6642911 commit e31c8cf

File tree

1 file changed

+78
-64
lines changed

1 file changed

+78
-64
lines changed

src/timezone/pgtz.c

Lines changed: 78 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
* Portions Copyright (c) 1996-2003, PostgreSQL Global Development Group
77
*
88
* IDENTIFICATION
9-
* $PostgreSQL: pgsql/src/timezone/pgtz.c,v 1.18 2004/07/10 23:06:50 tgl Exp $
9+
* $PostgreSQL: pgsql/src/timezone/pgtz.c,v 1.19 2004/07/22 05:28:30 tgl Exp $
1010
*
1111
*-------------------------------------------------------------------------
1212
*/
@@ -32,7 +32,7 @@
3232
#define T_WEEK ((time_t) (60*60*24*7))
3333
#define T_MONTH ((time_t) (60*60*24*31))
3434

35-
#define MAX_TEST_TIMES (52*35) /* 35 years, or 1970..2004 */
35+
#define MAX_TEST_TIMES (52*40) /* 40 years, or 1964..2004 */
3636

3737
struct tztry
3838
{
@@ -43,8 +43,9 @@ struct tztry
4343
static char tzdir[MAXPGPATH];
4444
static int done_tzdir = 0;
4545

46-
static bool scan_available_timezones(char *tzdir, char *tzdirsub,
47-
struct tztry *tt);
46+
static void scan_available_timezones(char *tzdir, char *tzdirsub,
47+
struct tztry *tt,
48+
int *bestscore, char *bestzonename);
4849

4950

5051
/*
@@ -144,10 +145,18 @@ compare_tm(struct tm *s, struct pg_tm *p)
144145
}
145146

146147
/*
147-
* See if a specific timezone setting matches the system behavior
148+
* See how well a specific timezone setting matches the system behavior
149+
*
150+
* We score a timezone setting according to the number of test times it
151+
* matches. (The test times are ordered later-to-earlier, but this routine
152+
* doesn't actually know that; it just scans until the first non-match.)
153+
*
154+
* We return -1 for a completely unusable setting; this is worse than the
155+
* score of zero for a setting that works but matches not even the first
156+
* test time.
148157
*/
149-
static bool
150-
try_timezone(const char *tzname, struct tztry *tt)
158+
static int
159+
score_timezone(const char *tzname, struct tztry *tt)
151160
{
152161
int i;
153162
pg_time_t pgtt;
@@ -156,59 +165,59 @@ try_timezone(const char *tzname, struct tztry *tt)
156165
char cbuf[TZ_STRLEN_MAX + 1];
157166

158167
if (!pg_tzset(tzname))
159-
return false; /* can't handle the TZ name at all */
168+
return -1; /* can't handle the TZ name at all */
169+
170+
/* Reject if leap seconds involved */
171+
if (!tz_acceptable())
172+
{
173+
elog(DEBUG4, "Reject TZ \"%s\": uses leap seconds", tzname);
174+
return -1;
175+
}
160176

161177
/* Check for match at all the test times */
162178
for (i = 0; i < tt->n_test_times; i++)
163179
{
164180
pgtt = (pg_time_t) (tt->test_times[i]);
165181
pgtm = pg_localtime(&pgtt);
166182
if (!pgtm)
167-
return false; /* probably shouldn't happen */
183+
return -1; /* probably shouldn't happen */
168184
systm = localtime(&(tt->test_times[i]));
169185
if (!compare_tm(systm, pgtm))
170186
{
171-
elog(DEBUG4, "Reject TZ \"%s\": at %ld %04d-%02d-%02d %02d:%02d:%02d %s versus %04d-%02d-%02d %02d:%02d:%02d %s",
172-
tzname, (long) pgtt,
187+
elog(DEBUG4, "TZ \"%s\" scores %d: at %ld %04d-%02d-%02d %02d:%02d:%02d %s versus %04d-%02d-%02d %02d:%02d:%02d %s",
188+
tzname, i, (long) pgtt,
173189
pgtm->tm_year + 1900, pgtm->tm_mon + 1, pgtm->tm_mday,
174190
pgtm->tm_hour, pgtm->tm_min, pgtm->tm_sec,
175191
pgtm->tm_isdst ? "dst" : "std",
176192
systm->tm_year + 1900, systm->tm_mon + 1, systm->tm_mday,
177193
systm->tm_hour, systm->tm_min, systm->tm_sec,
178194
systm->tm_isdst ? "dst" : "std");
179-
return false;
195+
return i;
180196
}
181197
if (systm->tm_isdst >= 0)
182198
{
183199
/* Check match of zone names, too */
184200
if (pgtm->tm_zone == NULL)
185-
return false;
201+
return -1; /* probably shouldn't happen */
186202
memset(cbuf, 0, sizeof(cbuf));
187203
strftime(cbuf, sizeof(cbuf) - 1, "%Z", systm); /* zone abbr */
188204
if (strcmp(TZABBREV(cbuf), pgtm->tm_zone) != 0)
189205
{
190-
elog(DEBUG4, "Reject TZ \"%s\": at %ld \"%s\" versus \"%s\"",
191-
tzname, (long) pgtt,
206+
elog(DEBUG4, "TZ \"%s\" scores %d: at %ld \"%s\" versus \"%s\"",
207+
tzname, i, (long) pgtt,
192208
pgtm->tm_zone, cbuf);
193-
return false;
209+
return i;
194210
}
195211
}
196212
}
197213

198-
/* Reject if leap seconds involved */
199-
if (!tz_acceptable())
200-
{
201-
elog(DEBUG4, "Reject TZ \"%s\": uses leap seconds", tzname);
202-
return false;
203-
}
204-
205-
elog(DEBUG4, "Accept TZ \"%s\"", tzname);
206-
return true;
214+
elog(DEBUG4, "TZ \"%s\" gets max score %d", tzname, i);
215+
return i;
207216
}
208217

209218

210219
/*
211-
* Try to identify a timezone name (in our terminology) that matches the
220+
* Try to identify a timezone name (in our terminology) that best matches the
212221
* observed behavior of the system timezone library. We cannot assume that
213222
* the system TZ environment setting (if indeed there is one) matches our
214223
* terminology, so we ignore it and just look at what localtime() returns.
@@ -221,6 +230,7 @@ identify_system_timezone(void)
221230
time_t t;
222231
struct tztry tt;
223232
struct tm *tm;
233+
int bestscore;
224234
char tmptzdir[MAXPGPATH];
225235
int std_ofs;
226236
char std_zone_name[TZ_STRLEN_MAX + 1],
@@ -231,36 +241,38 @@ identify_system_timezone(void)
231241
tzset();
232242

233243
/*
234-
* Set up the list of dates to be probed to verify that our timezone
235-
* matches the system zone. We first probe January and July of 1970;
244+
* Set up the list of dates to be probed to see how well our timezone
245+
* matches the system zone. We first probe January and July of 2004;
236246
* this serves to quickly eliminate the vast majority of the TZ database
237-
* entries. If those dates match, we probe every week from 1970 to
238-
* late 2004. This exhaustive test is intended to ensure that we have
239-
* the same DST transition rules as the system timezone. (Note: we
240-
* probe Thursdays, not Sundays, to avoid triggering DST-transition
241-
* bugs in localtime itself.)
242-
*
243-
* Ideally we'd probe some dates before 1970 too, but that is guaranteed
244-
* to fail if the system TZ library doesn't cope with DST before 1970.
247+
* entries. If those dates match, we probe every week from 2004 backwards
248+
* to late 1964. (Weekly resolution is good enough to identify DST
249+
* transition rules, since everybody switches on Sundays.) The further
250+
* back the zone matches, the better we score it. This may seem like
251+
* a rather random way of doing things, but experience has shown that
252+
* system-supplied timezone definitions are likely to have DST behavior
253+
* that is right for the recent past and not so accurate further back.
254+
* Scoring in this way allows us to recognize zones that have some
255+
* commonality with the zic database, without insisting on exact match.
256+
* (Note: we probe Thursdays, not Sundays, to avoid triggering
257+
* DST-transition bugs in localtime itself.)
245258
*/
246259
tt.n_test_times = 0;
247-
tt.test_times[tt.n_test_times++] = t = build_time_t(1970, 1, 15);
248-
tt.test_times[tt.n_test_times++] = build_time_t(1970, 7, 15);
260+
tt.test_times[tt.n_test_times++] = build_time_t(2004, 1, 15);
261+
tt.test_times[tt.n_test_times++] = t = build_time_t(2004, 7, 15);
249262
while (tt.n_test_times < MAX_TEST_TIMES)
250263
{
251-
t += T_WEEK;
264+
t -= T_WEEK;
252265
tt.test_times[tt.n_test_times++] = t;
253266
}
254267

255-
/* Search for a matching timezone file */
268+
/* Search for the best-matching timezone file */
256269
strcpy(tmptzdir, pg_TZDIR());
257-
if (scan_available_timezones(tmptzdir,
258-
tmptzdir + strlen(tmptzdir) + 1,
259-
&tt))
260-
{
261-
StrNCpy(resultbuf, pg_get_current_timezone(), sizeof(resultbuf));
270+
bestscore = 0;
271+
scan_available_timezones(tmptzdir, tmptzdir + strlen(tmptzdir) + 1,
272+
&tt,
273+
&bestscore, resultbuf);
274+
if (bestscore > 0)
262275
return resultbuf;
263-
}
264276

265277
/*
266278
* Couldn't find a match in the database, so next we try constructed zone
@@ -326,19 +338,19 @@ identify_system_timezone(void)
326338
{
327339
snprintf(resultbuf, sizeof(resultbuf), "%s%d%s",
328340
std_zone_name, -std_ofs / 3600, dst_zone_name);
329-
if (try_timezone(resultbuf, &tt))
341+
if (score_timezone(resultbuf, &tt) > 0)
330342
return resultbuf;
331343
}
332344

333345
/* Try just the STD timezone (works for GMT at least) */
334346
strcpy(resultbuf, std_zone_name);
335-
if (try_timezone(resultbuf, &tt))
347+
if (score_timezone(resultbuf, &tt) > 0)
336348
return resultbuf;
337349

338350
/* Try STD<ofs> */
339351
snprintf(resultbuf, sizeof(resultbuf), "%s%d",
340352
std_zone_name, -std_ofs / 3600);
341-
if (try_timezone(resultbuf, &tt))
353+
if (score_timezone(resultbuf, &tt) > 0)
342354
return resultbuf;
343355

344356
/*
@@ -358,7 +370,7 @@ identify_system_timezone(void)
358370
}
359371

360372
/*
361-
* Recursively scan the timezone database looking for a usable match to
373+
* Recursively scan the timezone database looking for the best match to
362374
* the system timezone behavior.
363375
*
364376
* tzdir points to a buffer of size MAXPGPATH. On entry, it holds the
@@ -372,14 +384,15 @@ identify_system_timezone(void)
372384
*
373385
* tt tells about the system timezone behavior we need to match.
374386
*
375-
* On success, returns TRUE leaving the proper timezone selected.
376-
* On failure, returns FALSE with a random timezone selected.
387+
* *bestscore and *bestzonename on entry hold the best score found so far
388+
* and the name of the best zone. We overwrite them if we find a better
389+
* score. bestzonename must be a buffer of length TZ_STRLEN_MAX + 1.
377390
*/
378-
static bool
379-
scan_available_timezones(char *tzdir, char *tzdirsub, struct tztry *tt)
391+
static void
392+
scan_available_timezones(char *tzdir, char *tzdirsub, struct tztry *tt,
393+
int *bestscore, char *bestzonename)
380394
{
381395
int tzdir_orig_len = strlen(tzdir);
382-
bool found = false;
383396
DIR *dirdesc;
384397

385398
dirdesc = AllocateDir(tzdir);
@@ -388,7 +401,7 @@ scan_available_timezones(char *tzdir, char *tzdirsub, struct tztry *tt)
388401
ereport(LOG,
389402
(errcode_for_file_access(),
390403
errmsg("could not open directory \"%s\": %m", tzdir)));
391-
return false;
404+
return;
392405
}
393406

394407
for (;;)
@@ -432,25 +445,26 @@ scan_available_timezones(char *tzdir, char *tzdirsub, struct tztry *tt)
432445
if (S_ISDIR(statbuf.st_mode))
433446
{
434447
/* Recurse into subdirectory */
435-
found = scan_available_timezones(tzdir, tzdirsub, tt);
436-
if (found)
437-
break;
448+
scan_available_timezones(tzdir, tzdirsub, tt,
449+
bestscore, bestzonename);
438450
}
439451
else
440452
{
441453
/* Load and test this file */
442-
found = try_timezone(tzdirsub, tt);
443-
if (found)
444-
break;
454+
int score = score_timezone(tzdirsub, tt);
455+
456+
if (score > *bestscore)
457+
{
458+
*bestscore = score;
459+
StrNCpy(bestzonename, tzdirsub, TZ_STRLEN_MAX + 1);
460+
}
445461
}
446462
}
447463

448464
FreeDir(dirdesc);
449465

450466
/* Restore tzdir */
451467
tzdir[tzdir_orig_len] = '\0';
452-
453-
return found;
454468
}
455469

456470

0 commit comments

Comments
 (0)
0