static void handle_filter(struct mailinfo *mi, struct strbuf *line) { switch (mi->filter_stage) { case 0: if (!handle_commit_msg(mi, line)) break; mi->filter_stage++; case 1: handle_patch(mi, line); break; } }
static void handle_filter(struct strbuf *line) { static int filter = 0; /* filter tells us which part we left off on */ switch (filter) { case 0: if (!handle_commit_msg(line)) break; filter++; case 1: handle_patch(line); break; } }
static int handle_filter(char *line, unsigned linesize) { static int filter = 0; /* filter tells us which part we left off on * a non-zero return indicates we hit a filter point */ switch (filter) { case 0: if (!handle_commit_msg(line, linesize)) break; filter++; case 1: if (!handle_patch(line)) break; filter++; default: return 1; } return 0; }