MCPcopy Create free account
hub / github.com/coreutils/coreutils / adjust_resolution

Function adjust_resolution

src/date.c:316–336  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

314 the current platform. If no "%-N" appears, return NULL. */
315
316static char *
317adjust_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

Callers 1

mainFunction · 0.85

Calls 1

res_widthFunction · 0.85

Tested by

no test coverage detected