about summary refs log tree commit diff
path: root/seq.c
diff options
context:
space:
mode:
Diffstat (limited to 'seq.c')
-rw-r--r--seq.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/seq.c b/seq.c
index cfd8d6f..c1f0694 100644
--- a/seq.c
+++ b/seq.c
@@ -537,13 +537,18 @@ blaze822_loop(int argc, char *argv[], void (*cb)(char *))
 		return i;
 	}
 
-	char *map = blaze822_seq_open(0);
+	char *map = 0;
+	int map_opened = 0;
 	struct blaze822_seq_iter iter = { 0 };
 	int j = 0;
 	for (i = 0; i < argc; i++) {
 		if (strchr(argv[i], '/')) {  // a file name
 			j += iterdir(argv[i], cb);
 		} else {
+			if (!map_opened) {
+				map = blaze822_seq_open(0);
+				map_opened = 1;
+			}
 			while ((line = blaze822_seq_next(map, argv[i], &iter))) {
 				cb(line);
 				free(line);