| 747 | ****************************************************************************/ |
| 748 | |
| 749 | static char *kconfig_line(FILE *stream) |
| 750 | { |
| 751 | char *ptr; |
| 752 | |
| 753 | for (; ; ) |
| 754 | { |
| 755 | /* Read the next line from the Kconfig file */ |
| 756 | |
| 757 | /* Is there already valid data in the line buffer? This can happen |
| 758 | * while parsing help text and we read one line too far. |
| 759 | */ |
| 760 | |
| 761 | if (!g_preread) |
| 762 | { |
| 763 | /* Read the next line */ |
| 764 | |
| 765 | if (!read_line(stream)) |
| 766 | { |
| 767 | return NULL; |
| 768 | } |
| 769 | } |
| 770 | |
| 771 | g_preread = false; |
| 772 | |
| 773 | /* Replace all whitespace characters with spaces to simplify parsing */ |
| 774 | |
| 775 | for (ptr = g_line; *ptr; ptr++) |
| 776 | { |
| 777 | if (isspace(((int)*ptr))) |
| 778 | { |
| 779 | *ptr = ' '; |
| 780 | } |
| 781 | } |
| 782 | |
| 783 | /* Skip any leading whitespace. Ignore empty lines and lines that |
| 784 | * contain only comments. |
| 785 | */ |
| 786 | |
| 787 | ptr = skip_space(g_line); |
| 788 | if (*ptr && *ptr != '#' && *ptr != '\n') |
| 789 | { |
| 790 | g_lnptr = ptr; |
| 791 | return ptr; |
| 792 | } |
| 793 | } |
| 794 | } |
| 795 | |
| 796 | /**************************************************************************** |
| 797 | * Name: tokenize |
no test coverage detected