Thread (1 message) 1 message, 1 author, 2016-06-15

Re: [PATCH 06/26] mailinfo: always pass "line" as an argument

From: Junio C Hamano <hidden>
Date: 2016-06-15 23:06:52

Stefan Beller [off-list ref] writes:
quoted
@@ -1019,10 +1019,10 @@ static int mailinfo(FILE *in, FILE *out, const char *msg, const char *patch)
        ungetc(peek, in);

        /* process the email header */
-       while (read_one_header_line(&line, fin))
-               check_header(&line, p_hdr_data, 1);
+       while (read_one_header_line(&line_global, fin))
+               check_header(&line_global, p_hdr_data, 1);
This is the only function to use line_global if I see correctly.
The function is called only once, so no need to preserve state
outside the function. Would it make sense to remove line_global
completely and have a local variable in this function instead?
That is exactly the step that comes after it does, but if you squash
06 and 07 into one patch (i.e. take diff between the state after 05
and after 07), that realization will not easily come (well, at least
it didn't come to me and I wasn't convinced that the conversion is
correct myself until I split 06 and 07 into two separate steps).
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help