revised proposed time zone abbreviation changes

Robert Elz kre at munnari.OZ.AU
Tue Jun 7 09:46:25 UTC 2005


    Date:        Mon, 6 Jun 2005 11:22:42 -0400 (EDT)
    From:        Arthur David Olson <olsona at lecserver.nci.nih.gov>
    Message-ID:  <200506061522.j56FMgr3022894 at lecserver.nci.nih.gov>

  | However, since the data files generated
  | by zic might end up being used on systems with stricter requirements,
  | it seems prudent to issue warnings (note: not errors) regarding short
  | and long abbreviations.

That's fine, but (including both before and after in the diff,
the first time, just to show this is something that didn't just alter)...

  | ***************
  | *** 753,760 ****
  |   			stdlen = (sizeof sp->chars) - 1;
  |   		stdoffset = 0;
  |   	} else {
  | ! 		name = getzname(name);
  | ! 		stdlen = name - stdname;
  |   		if (stdlen < 3)
  |   			return -1;
  |   		if (*name == '\0')
  | --- 806,823 ----
  |   			stdlen = (sizeof sp->chars) - 1;
  |   		stdoffset = 0;
  |   	} else {
  | ! 		if (*name == '<') {
  | ! 			name++;
  | ! 			stdname = name;
  | ! 			name = getqzname(name, '>');
  | ! 			if (*name != '>')
  | ! 				return (-1);
  | ! 			stdlen = name - stdname;
  | ! 			name++;
  | ! 		} else {
  | ! 			name = getzname(name);
  | ! 			stdlen = name - stdname;
  | ! 		}
  |   		if (stdlen < 3)
  |   			return -1;
  |   		if (*name == '\0')

That "stdlen < 3" remains, I'd make it just be "if (stdlen == 0)"
(for the error return).   < 0 is impossible the way the code is
written, so there's no need to test that.   Anything > 0 in that
context should be OK.

And

  |   		if (dstlen < 3)
  |   			return -1;

The same there of course.

kre




More information about the tz mailing list