diff options
| author | Junio C Hamano <gitster@pobox.com> | 2025-02-25 14:19:35 -0800 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2025-02-25 14:19:35 -0800 |
| commit | a8a5bb1f7813ceb42199ef2bcf9d925da007f047 (patch) | |
| tree | dcea38f52ccbe9319804bcc33c47fc42be4e5c60 /diff.c | |
| parent | Merge branch 'tb/new-make-fix' (diff) | |
| parent | diff: don't crash with empty argument to -G or -S (diff) | |
| download | git-a8a5bb1f7813ceb42199ef2bcf9d925da007f047.tar.gz git-a8a5bb1f7813ceb42199ef2bcf9d925da007f047.zip | |
Merge branch 'bc/diff-reject-empty-arg-to-pickaxe'
The -G/-S options to the "diff" family of commands caused us to hit
a BUG() when they get no values; they have been corrected.
* bc/diff-reject-empty-arg-to-pickaxe:
diff: don't crash with empty argument to -G or -S
Diffstat (limited to 'diff.c')
| -rw-r--r-- | diff.c | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -5493,6 +5493,8 @@ static int diff_opt_pickaxe_regex(const struct option *opt, BUG_ON_OPT_NEG(unset); options->pickaxe = arg; options->pickaxe_opts |= DIFF_PICKAXE_KIND_G; + if (arg && !*arg) + return error(_("-G requires a non-empty argument")); return 0; } @@ -5504,6 +5506,8 @@ static int diff_opt_pickaxe_string(const struct option *opt, BUG_ON_OPT_NEG(unset); options->pickaxe = arg; options->pickaxe_opts |= DIFF_PICKAXE_KIND_S; + if (arg && !*arg) + return error(_("-S requires a non-empty argument")); return 0; } |
