Skip to content

Commit

Permalink
Merge branch 'mc/maint-zoneparse' into maint
Browse files Browse the repository at this point in the history
* mc/maint-zoneparse:
  Add "Z" as an alias for the timezone "UTC"
  • Loading branch information
Junio C Hamano committed Jun 21, 2010
2 parents 7a0d54f + 75b37e7 commit e7e1bf0
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion date.c
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,7 @@ static const struct {

{ "GMT", 0, 0, }, /* Greenwich Mean */
{ "UTC", 0, 0, }, /* Universal (Coordinated) */
{ "Z", 0, 0, }, /* Zulu, alias for UTC */

{ "WET", 0, 0, }, /* Western European */
{ "BST", 0, 1, }, /* British Summer */
Expand Down Expand Up @@ -305,7 +306,7 @@ static int match_alpha(const char *date, struct tm *tm, int *offset)

for (i = 0; i < ARRAY_SIZE(timezone_names); i++) {
int match = match_string(date, timezone_names[i].name);
if (match >= 3) {
if (match >= 3 || match == strlen(timezone_names[i].name)) {
int off = timezone_names[i].offset;

/* This is bogus, but we like summer */
Expand Down

0 comments on commit e7e1bf0

Please sign in to comment.