about summary refs log tree commit diff
path: root/lr.c
diff options
context:
space:
mode:
authorChristian Neukirchen <chneukirchen@gmail.com>2015-10-23 15:05:44 +0200
committerChristian Neukirchen <chneukirchen@gmail.com>2015-10-23 15:05:44 +0200
commit179379ac197844800d3dca856e5af6390d78b078 (patch)
treed445f4052aa4f5aea7a6b9f3ff9640438f63d62c /lr.c
parentaaf0aede377ebf96a5acfd8f12aa0b5e48445b3e (diff)
downloadlr-179379ac197844800d3dca856e5af6390d78b078.tar.gz
lr-179379ac197844800d3dca856e5af6390d78b078.tar.xz
lr-179379ac197844800d3dca856e5af6390d78b078.zip
multiple -t are regarded as conjunction
Diffstat (limited to 'lr.c')
-rw-r--r--lr.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/lr.c b/lr.c
index 4bd1832..c61f13a 100644
--- a/lr.c
+++ b/lr.c
@@ -8,7 +8,6 @@ TODO:
 - %NNx formatting strings
 - error handling? keep going
 - avoid stat in recurse
-- multiple -t
 */
 
 #define _GNU_SOURCE
@@ -434,6 +433,8 @@ struct expr *
 chain(struct expr *e1, enum op op, struct expr *e2)
 {
 	struct expr *i, *j, *e;
+	if (!e1)
+		return e2;
 	for (j = 0, i = e1; i->op == op; j = i, i = i->b.expr)
 		;
 	if (!j) {
@@ -971,7 +972,7 @@ main(int argc, char *argv[])
 		case 'd': dflag++; break;
 		case 'f': format = optarg; break;
 		case 'o': ordering = optarg; break;
-		case 't': e = parse_expr(optarg); break;
+		case 't': e = chain(e, EXPR_AND, parse_expr(optarg)); break;
 		case 'x': xflag++; break;
 		case 'H': Hflag++; break;
 		case 'L': Lflag++; break;