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

Function put_space

src/fmt.c:1039–1060  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1037/* Output to stdout SPACE spaces, or equivalent tabs. */
1038
1039static void
1040put_space (int space)
1041{
1042 int space_target, tab_target;
1043
1044 space_target = out_column + space;
1045 if (tabs)
1046 {
1047 tab_target = space_target / TABWIDTH * TABWIDTH;
1048 if (out_column + 1 < tab_target)
1049 while (out_column < tab_target)
1050 {
1051 putchar ('\t');
1052 out_column = (out_column / TABWIDTH + 1) * TABWIDTH;
1053 }
1054 }
1055 while (out_column < space_target)
1056 {
1057 putchar (' ');
1058 out_column++;
1059 }
1060}

Callers 2

copy_restFunction · 0.85
put_lineFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected