Skip to content

Commit

Permalink
seq: blaze822_loop: reinitialize iter for each command line argument
Browse files Browse the repository at this point in the history
  • Loading branch information
leahneukirchen committed Aug 11, 2020
1 parent 92bb41f commit b41d2ef
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion seq.c
Original file line number Diff line number Diff line change
Expand Up @@ -536,7 +536,6 @@ blaze822_loop(int argc, char *argv[], void (*cb)(char *))

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
Expand All @@ -554,6 +553,7 @@ blaze822_loop(int argc, char *argv[], void (*cb)(char *))
map = blaze822_seq_open(0);
map_opened = 1;
}
struct blaze822_seq_iter iter = { 0 };
while ((line = blaze822_seq_next(map, argv[i], &iter))) {
cb(line);
free(line);
Expand Down

0 comments on commit b41d2ef

Please sign in to comment.