return a pointer to the n'th column of buf */
| 557 | |
| 558 | /* return a pointer to the n'th column of buf */ |
| 559 | static const char *column(const char *buf, int n) { |
| 560 | int i; |
| 561 | if (n <= 0) |
| 562 | return buf; |
| 563 | for (i = 0; i < n; i++) { |
| 564 | while (isspace(*buf)) |
| 565 | buf++; |
| 566 | if (i == n - 1) |
| 567 | break; |
| 568 | while ((0 != *buf) && !isspace(*buf)) |
| 569 | buf++; |
| 570 | } |
| 571 | return buf; |
| 572 | } |
| 573 | |
| 574 | static char *column(char *buf, int n) { |
| 575 | return const_cast<char *>(column(const_cast<const char *>(buf), n)); |