diff --git a/builtin-grep.c b/builtin-grep.c
index 3a51662a35878ae6b5965c90abb747b5b27c5493..624f86e287cf6304d122850f8258444c5f916702 100644 (file)
--- a/builtin-grep.c
+++ b/builtin-grep.c
push_arg("-l");
if (opt->unmatch_name_only)
push_arg("-L");
push_arg("-l");
if (opt->unmatch_name_only)
push_arg("-L");
+ if (opt->null_following_name)
+ /* in GNU grep git's "-z" translates to "-Z" */
+ push_arg("-Z");
if (opt->count)
push_arg("-c");
if (opt->post_context || opt->pre_context) {
if (opt->count)
push_arg("-c");
if (opt->post_context || opt->pre_context) {
opt.unmatch_name_only = 1;
continue;
}
opt.unmatch_name_only = 1;
continue;
}
+ if (!strcmp("-z", arg) ||
+ !strcmp("--null", arg)) {
+ opt.null_following_name = 1;
+ continue;
+ }
if (!strcmp("-c", arg) ||
!strcmp("--count", arg)) {
opt.count = 1;
if (!strcmp("-c", arg) ||
!strcmp("--count", arg)) {
opt.count = 1;