Thread (181 messages) flat view 181 messages, 5 authors, 2019-03-13
STALE2752d

Revision v1 of 8 in this series.

Revisions (8)
  1. v1 current
  2. v2 [diff vs current]
  3. v3 [diff vs current]
  4. v4 [diff vs current]
  5. v5 [diff vs current]
  6. v6 [diff vs current]
  7. v7 [diff vs current]
  8. v8 [diff vs current]

[PATCH 01/15] sequencer: clear the number of items of a todo_list before parsing

From: Alban Gruin <hidden>
Date: 2018-10-07 20:00:13
Subsystem: the rest · Maintainer: Linus Torvalds

This clears the number of items of a todo_list before parsing it to
allow to parse the same list multiple times without issues.

As its items are not dynamically allocated, or don’t need to allocate
memory, no additionnal memory management is required here.

Signed-off-by: Alban Gruin <redacted>
---
 sequencer.c | 2 ++
 1 file changed, 2 insertions(+)
diff --git a/sequencer.c b/sequencer.c
index 0a3292d5c4..ed798b95d1 100644
--- a/sequencer.c
+++ b/sequencer.c
@@ -2063,6 +2063,8 @@ static int parse_insn_buffer(char *buf, struct todo_list *todo_list)
 	char *p = buf, *next_p;
 	int i, res = 0, fixup_okay = file_exists(rebase_path_done());
 
+	todo_list->current = todo_list->nr = 0;
+
 	for (i = 1; *p; i++, p = next_p) {
 		char *eol = strchrnul(p, '\n');
 
-- 
2.19.1
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help