From 4791c4a8f3474ee58531b8c88bfbac622dcc286d Mon Sep 17 00:00:00 2001 From: Tavian Barnes Date: Thu, 11 May 2017 18:50:35 -0400 Subject: Don't make -quit disable the implicit -print --- parse.c | 2 +- tests.sh | 9 +++++++-- tests/test_quit_implicit_print.out | 1 + 3 files changed, 9 insertions(+), 3 deletions(-) create mode 100644 tests/test_quit_implicit_print.out diff --git a/parse.c b/parse.c index 4a7fbe0..6d15792 100644 --- a/parse.c +++ b/parse.c @@ -623,7 +623,7 @@ static struct expr *parse_unary_test(struct parser_state *state, eval_fn *eval) * Parse a single action. */ static struct expr *parse_action(struct parser_state *state, eval_fn *eval, size_t argc) { - if (eval != eval_nohidden && eval != eval_prune) { + if (eval != eval_nohidden && eval != eval_prune && eval != eval_quit) { state->implicit_print = false; } diff --git a/tests.sh b/tests.sh index d06c204..a07ae8a 100755 --- a/tests.sh +++ b/tests.sh @@ -219,11 +219,12 @@ bsd_tests=( test_quit_child test_quit_depth test_quit_depth_child + test_quit_after_print + test_quit_before_print + test_quit_implicit_print test_inum test_nogroup test_nouser - test_quit_after_print - test_quit_before_print ) gnu_tests=( @@ -977,6 +978,10 @@ function test_quit_before_print() { bfs_diff basic basic -quit -print } +function test_quit_implicit_print() { + bfs_diff basic -name basic -o -quit +} + function test_inum() { local inode="$(ls -id basic/k/foo/bar | cut -f1 -d' ')" bfs_diff basic -inum "$inode" diff --git a/tests/test_quit_implicit_print.out b/tests/test_quit_implicit_print.out new file mode 100644 index 0000000..15a13db --- /dev/null +++ b/tests/test_quit_implicit_print.out @@ -0,0 +1 @@ +basic -- cgit v1.2.3