Skip to content

Commit

Permalink
Merge branch 'jc/diff-ws-error-highlight'
Browse files Browse the repository at this point in the history
A hotfix to a new feature in 2.5.0-rc.

* jc/diff-ws-error-highlight:
  diff: parse ws-error-highlight option more strictly
  • Loading branch information
Junio C Hamano committed Jul 15, 2015
2 parents 961abca + 3f4f17b commit abecdde
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion diff.c
Original file line number Diff line number Diff line change
Expand Up @@ -3653,7 +3653,12 @@ static void enable_patch_output(int *fmt) {

static int parse_one_token(const char **arg, const char *token)
{
return skip_prefix(*arg, token, arg) && (!**arg || **arg == ',');
const char *rest;
if (skip_prefix(*arg, token, &rest) && (!*rest || *rest == ',')) {
*arg = rest;
return 1;
}
return 0;
}

static int parse_ws_error_highlight(struct diff_options *opt, const char *arg)
Expand Down

0 comments on commit abecdde

Please sign in to comment.