MCPcopy Create free account
hub / github.com/eggert/tz / abbrok

Function abbrok

zdump.c:323–347  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

321}
322
323static void
324abbrok(const char *const abbrp, const char *const zone)
325{
326 register const char * cp;
327 register const char * wp;
328
329 if (warned)
330 return;
331 cp = abbrp;
332 while (is_alpha(*cp) || is_digit(*cp) || *cp == '-' || *cp == '+')
333 ++cp;
334 if (*cp)
335 wp = _("has characters other than ASCII alphanumerics, '-' or '+'");
336 else if (cp - abbrp < 3)
337 wp = _("has fewer than 3 characters");
338 else if (cp - abbrp > 6)
339 wp = _("has more than 6 characters");
340 else
341 return;
342 fflush(stdout);
343 fprintf(stderr,
344 _("%s: warning: zone \"%s\" abbreviation \"%s\" %s\n"),
345 progname, zone, abbrp, wp);
346 warned = errout = true;
347}
348
349/* Return a time zone abbreviation. If the abbreviation needs to be
350 saved, use *BUF (of size *BUFALLOC) to save it, and return the

Callers 1

showFunction · 0.85

Calls 2

is_alphaFunction · 0.70
is_digitFunction · 0.70

Tested by

no test coverage detected