about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--NEWS.md3
-rw-r--r--lr.c4
2 files changed, 2 insertions, 5 deletions
diff --git a/NEWS.md b/NEWS.md
index c2b61f3..6b2968e 100644
--- a/NEWS.md
+++ b/NEWS.md
@@ -1,8 +1,5 @@
 ## HEAD
 
-* **Breaking change**: `prune` now evaluates to a false value.
-  The common find(1) idiom is now best written as `name = "x" ? prune : print`.
-
 * Feature: new option `-B` for breadth first traversal.
 * Feature: new syntax `? :` for ternary operator.
 * Significant speed-up as tsearch is not used anymore.
diff --git a/lr.c b/lr.c
index d5fff03..87aefb4 100644
--- a/lr.c
+++ b/lr.c
@@ -1273,7 +1273,7 @@ eval(struct expr *e, struct fileinfo *fi)
 		return !eval(e->a.expr, fi);
 	case EXPR_PRUNE:
 		prune = 1;
-		return 0;
+		return 1;
 	case EXPR_PRINT:
 		return 1;
 	case EXPR_COLOR:
@@ -2290,7 +2290,7 @@ main(int argc, char *argv[])
 	while ((c = getopt(argc, argv, "01ABC:DFGHLQST:UXde:f:lho:st:x")) != -1)
 		switch (c) {
 		case '0': format = zero_format; input_delim = 0; Qflag = 0; break;
-		case '1': expr = chain(parse_expr("depth > 0 && prune || print"), EXPR_AND, expr); break;
+		case '1': expr = chain(parse_expr("depth > 0 ? prune : print"), EXPR_AND, expr); break;
 		case 'A': expr = chain(expr, EXPR_AND, parse_expr("name =~ \"^\\.\" && path != \".\" ? prune : print")); break;
 		case 'B': Bflag++; Dflag = 0; Uflag = 0; need_stat++; break;
 		case 'C':