| 2360 | } |
| 2361 | |
| 2362 | static void |
| 2363 | inleap(char **fields, int nfields) |
| 2364 | { |
| 2365 | if (nfields != LEAP_FIELDS) |
| 2366 | error(N_("wrong number of fields on Leap line")); |
| 2367 | else { |
| 2368 | zic_t t = getleapdatetime(fields, false); |
| 2369 | if (0 <= t) { |
| 2370 | struct lookup const *lp = byword(fields[LP_ROLL], leap_types); |
| 2371 | if (!lp) |
| 2372 | error(N_("invalid Rolling/Stationary field on Leap line")); |
| 2373 | else { |
| 2374 | int correction = 0; |
| 2375 | if (!fields[LP_CORR][0]) /* infile() turns "-" into "". */ |
| 2376 | correction = -1; |
| 2377 | else if (strcmp(fields[LP_CORR], "+") == 0) |
| 2378 | correction = 1; |
| 2379 | else |
| 2380 | error(N_("invalid CORRECTION field on Leap line")); |
| 2381 | if (correction) |
| 2382 | leapadd(t, correction, lp->l_value); |
| 2383 | } |
| 2384 | } |
| 2385 | } |
| 2386 | } |
| 2387 | |
| 2388 | static void |
| 2389 | inexpires(char **fields, int nfields) |
no test coverage detected