static int option_parse_whitespace(const struct option *opt,
const char *arg, int unset)
{
static int option_parse_whitespace(const struct option *opt,
const char *arg, int unset)
{
struct option builtin_apply_options[] = {
{ OPTION_CALLBACK, 0, "exclude", &state, N_("path"),
N_("don't apply changes matching the given path"),
struct option builtin_apply_options[] = {
{ OPTION_CALLBACK, 0, "exclude", &state, N_("path"),
N_("don't apply changes matching the given path"),
N_("paths are separated with NUL character"), '\0'),
OPT_INTEGER('C', NULL, &state.p_context,
N_("ensure at least <n> lines of context match")),
N_("paths are separated with NUL character"), '\0'),
OPT_INTEGER('C', NULL, &state.p_context,
N_("ensure at least <n> lines of context match")),
- { OPTION_CALLBACK, 0, "whitespace", &whitespace_option, N_("action"),
+ { OPTION_CALLBACK, 0, "whitespace", &state, N_("action"),
N_("detect new or modified lines that have whitespace errors"),
0, option_parse_whitespace },
{ OPTION_CALLBACK, 0, "ignore-space-change", NULL, NULL,
N_("detect new or modified lines that have whitespace errors"),
0, option_parse_whitespace },
{ OPTION_CALLBACK, 0, "ignore-space-change", NULL, NULL,
errs |= apply_patch(&state, fd, arg, options);
close(fd);
}
errs |= apply_patch(&state, fd, arg, options);
close(fd);
}
if (read_stdin)
errs |= apply_patch(&state, 0, "<stdin>", options);
if (state.whitespace_error) {
if (read_stdin)
errs |= apply_patch(&state, 0, "<stdin>", options);
if (state.whitespace_error) {