libc: ignore '?' in date format strings
Ignoring '?' when formatting date strings allows the format strings to be reused for parsing. This is convenient, since we don't need to duplicate the format strings.
This commit is contained in:
parent
77c3cb50fb
commit
9f8d62ab64
2 changed files with 7 additions and 3 deletions
|
@ -428,6 +428,9 @@ static int
|
|||
switch(c0){
|
||||
case 0:
|
||||
break;
|
||||
/* Ignore '?' so we can share parse and format strings */
|
||||
case '?':
|
||||
continue;
|
||||
case 'Y':
|
||||
switch(w){
|
||||
case 1: n += fmtprint(f, "%*d", pad, tm->year + 1900); break;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue