| 314 | the current platform. If no "%-N" appears, return NULL. */ |
| 315 | |
| 316 | static char * |
| 317 | adjust_resolution (char const *format) |
| 318 | { |
| 319 | char *copy = NULL; |
| 320 | |
| 321 | for (char const *f = format; *f; f++) |
| 322 | if (f[0] == '%') |
| 323 | { |
| 324 | if (f[1] == '-' && f[2] == 'N') |
| 325 | { |
| 326 | if (!copy) |
| 327 | copy = xstrdup (format); |
| 328 | copy[f + 1 - format] = '0' + res_width (gettime_res ()); |
| 329 | f += 2; |
| 330 | } |
| 331 | else |
| 332 | f += f[1] == '%'; |
| 333 | } |
| 334 | |
| 335 | return copy; |
| 336 | } |
| 337 | |
| 338 | /* Set the LC_TIME category of the current locale. |
| 339 | Return the previous value of the LC_TIME category, as a freshly allocated |