MCPcopy Create free account
hub / github.com/coreutils/coreutils / get_prefix

Function get_prefix

src/fmt.c:742–766  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

740 character, or first non-blank character after the prefix. */
741
742static int
743get_prefix (FILE *f)
744{
745 int c;
746
747 in_column = 0;
748 c = get_space (f, getc (f));
749 if (prefix_length == 0)
750 next_prefix_indent = prefix_lead_space < in_column ?
751 prefix_lead_space : in_column;
752 else
753 {
754 next_prefix_indent = in_column;
755 for (char const *p = prefix; *p != '\0'; p++)
756 {
757 unsigned char pc = *p;
758 if (c != pc)
759 return c;
760 in_column++;
761 c = getc (f);
762 }
763 c = get_space (f, c);
764 }
765 return c;
766}
767
768/* Read blank characters from input file F, starting with C, and keeping
769 in_column up-to-date. Return first non-blank character. */

Callers 3

fmtFunction · 0.85
get_paragraphFunction · 0.85
get_lineFunction · 0.85

Calls 1

get_spaceFunction · 0.85

Tested by

no test coverage detected