Source-Changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

CVS commit: src/lib/libutil



Module Name:    src
Committed By:   apb
Date:           Tue Oct  7 22:27:14 UTC 2014

Modified Files:
        src/lib/libutil: parsedate.y

Log Message:
Some years don't need the "maybe add 1900 or 2000" adjustment
that was designed for handling two-digit abbreviated years.
For example, "1/2/70" still refers to the year 1970, as before,
but "70-01-02" now refers to the year 70.

* Add a new yyHaveFullYear member to struct dateinfo, to record whether
  or not the year needs to be adjusted.
* Code that parses years sets yyHaveFullYear=1 if they know that the
  year should not be adjusted (as is the case for ISO 8601 dates), or if
  they perform their own adjustment (as is the case for CVS timestamps).
* Move the year adjustment code into a new function, AdjustYear,
  instead of inline in Convert().
* Make Convert() assume the year doesn't need to be adjusted,
  and make Convert's callers first call AdjustYear() if appropriate.


To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.17 src/lib/libutil/parsedate.y

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.




Home | Main Index | Thread Index | Old Index