| 321 | } |
| 322 | |
| 323 | static void |
| 324 | abbrok(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 |