merge
This commit is contained in:
commit
eb6b1e672c
2 changed files with 8 additions and 4 deletions
|
@ -134,8 +134,7 @@ For example,
|
||||||
will format to a width of 3. When parsing, this acts as whitespace.
|
will format to a width of 3. When parsing, this acts as whitespace.
|
||||||
.TP
|
.TP
|
||||||
.B ?
|
.B ?
|
||||||
When parsing, this makes the following argument match fuzzily.
|
When parsing, all formats of the following argument are tried from most to least specific.
|
||||||
Fuzzy matching means that all formats are tried, from most to least specific.
|
|
||||||
For example,
|
For example,
|
||||||
.I ?M
|
.I ?M
|
||||||
will match
|
will match
|
||||||
|
@ -144,7 +143,9 @@ will match
|
||||||
.IR 01 ,
|
.IR 01 ,
|
||||||
and
|
and
|
||||||
.IR 1 ,
|
.IR 1 ,
|
||||||
in that order of preference.
|
in that order. When formatting,
|
||||||
|
.B ?
|
||||||
|
is ignored.
|
||||||
.TP
|
.TP
|
||||||
.B ~
|
.B ~
|
||||||
When parsing a date, this slackens range enforcement, accepting
|
When parsing a date, this slackens range enforcement, accepting
|
||||||
|
|
|
@ -330,7 +330,7 @@ tmfill(Tm *tm, vlong abs, vlong nsec)
|
||||||
if(d < 0)
|
if(d < 0)
|
||||||
d += mdays[m - 1];
|
d += mdays[m - 1];
|
||||||
|
|
||||||
tm->yday = d;
|
tm->yday = d - 1;
|
||||||
for(i = 0; i < m - 1; i++)
|
for(i = 0; i < m - 1; i++)
|
||||||
tm->yday += mdays[i];
|
tm->yday += mdays[i];
|
||||||
if(m > 1 && isleap(y))
|
if(m > 1 && isleap(y))
|
||||||
|
@ -428,6 +428,9 @@ static int
|
||||||
switch(c0){
|
switch(c0){
|
||||||
case 0:
|
case 0:
|
||||||
break;
|
break;
|
||||||
|
/* Ignore '?' so we can share parse and format strings */
|
||||||
|
case '?':
|
||||||
|
continue;
|
||||||
case 'Y':
|
case 'Y':
|
||||||
switch(w){
|
switch(w){
|
||||||
case 1: n += fmtprint(f, "%*d", pad, tm->year + 1900); break;
|
case 1: n += fmtprint(f, "%*d", pad, tm->year + 1900); break;
|
||||||
|
|
Loading…
Reference in a new issue