--- - branch: MAIN date: Thu Feb 8 02:53:53 UTC 2024 files: - new: '1.5' old: '1.4' path: src/usr.bin/touch/Makefile pathrev: src/usr.bin/touch/Makefile@1.5 type: modified - new: '1.37' old: '1.36' path: src/usr.bin/touch/touch.c pathrev: src/usr.bin/touch/touch.c@1.37 type: modified id: 20240208T025353Z.9ee1759e2ec6daf8d0783578c1e7115a60e8e7e9 log: "Properly implement the POSIX format -d option.\n\nPreviously we have hacked that using parsedate(3) - but parsedate()\nreturns a time_t and consequently while it \"handles\" fractional seconds,\nall that meant (all it really can mean) is that they're ignored.\n\nThe POSIX spec expects that (at least if the filesystem supports them)\nfractional seconds can be set using the -d option.\n\nHandle that by first attempting to parse the -d arg as a posix format\ndate-time string (using a reasonably strict parser), and if that fails,\nthen fall back on parsedate(3) to parse the arg.\n\nIf the posix format parse succeeds, the result will be the same as\nparsedate(3) would return for the same string - except any fractional\nseconds will be handled properly. If it fails, then nothing changes\nfrom what we currently do.\n\nNote the POSIX string is\n\tYYYY-MM-DDThh:mm:ss[.frac][Z]\nwhere YYYY is (at least) 4 digits (leading 0's are acceptable if\nyou really must!) all the MM DD hh mm ss fields are exactly 2\ndigits, T is either 'T' or ' ', '.' is either itself, or ',',\nand 'frac' is one or more digits. Z (if given) is 'Z'. The\n[.,]frac and Z fields are optional. Specify a time in a\nslight shorthand like 2024-2-8T7:44:20 \ and the POSIX parse\nwill fail, leaving parsedate() to handle that (which it should).\nBut any fractional seconds which were given would be ignored.\n\nDoc update coming - note the doc will call the YYYY field CCYY\ninstead, that's just a convenience to make other parts of what\nis there make more sense - it is still one 4 (or more) digit field.\n\nThis should be an almost invisible change.\n" module: src subject: 'CVS commit: src/usr.bin/touch' unixtime: '1707360833' user: kre