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

Function validate_tab_stops

src/expand-common.c:241–257  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

239 contains only nonzero, ascending values. */
240
241static void
242validate_tab_stops (colno const *tabs, idx_t entries)
243{
244 colno prev_tab = 0;
245
246 for (idx_t i = 0; i < entries; i++)
247 {
248 if (tabs[i] == 0)
249 error (EXIT_FAILURE, 0, _("tab size cannot be 0"));
250 if (tabs[i] <= prev_tab)
251 error (EXIT_FAILURE, 0, _("tab sizes must be ascending"));
252 prev_tab = tabs[i];
253 }
254
255 if (increment_size && extend_size)
256 error (EXIT_FAILURE, 0, _("'/' specifier is mutually exclusive with '+'"));
257}
258
259/* Called after all command-line options have been parsed,
260 and add_tab_stop/parse_tab_stops have been called.

Callers 1

finalize_tab_stopsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected