mailinfo: move cleanup_space() before its users

Signed-off-by: Junio C Hamano <gitster@pobox.com>

Junio C Hamano committed Oct 14, 2015 at 17:44 UTC 30f50c3426def6062b214d3f9cb0dd09776e4415
1 file changed +11 -14
builtin/mailinfo.c
+11 -14
@@ -31,8 +31,17 @@ static int use_inbody_headers = 1;
31 #define MAX_HDR_PARSED 10
32 #define MAX_BOUNDARIES 5
33
34 -static void cleanup_space(struct strbuf *sb);
35 -
34 +static void cleanup_space(struct strbuf *sb)
35 +{
36 + size_t pos, cnt;
37 + for (pos = 0; pos < sb->len; pos++) {
38 + if (isspace(sb->buf[pos])) {
39 + sb->buf[pos] = ' ';
40 + for (cnt = 0; isspace(sb->buf[pos + cnt + 1]); cnt++);
41 + strbuf_remove(sb, pos + 1, cnt);
42 + }
43 + }
44 +}
45
46 static void get_sane_name(struct strbuf *out, struct strbuf *name, struct strbuf *email)
47 {
@@ -272,18 +281,6 @@ static void cleanup_subject(struct strbuf *subject)
281 strbuf_trim(subject);
282 }
283
275 -static void cleanup_space(struct strbuf *sb)
276 -{
277 - size_t pos, cnt;
278 - for (pos = 0; pos < sb->len; pos++) {
279 - if (isspace(sb->buf[pos])) {
280 - sb->buf[pos] = ' ';
281 - for (cnt = 0; isspace(sb->buf[pos + cnt + 1]); cnt++);
282 - strbuf_remove(sb, pos + 1, cnt);
283 - }
284 - }
285 -}
286 -
284 static const char *header[MAX_HDR_PARSED] = {
285 "From","Subject","Date",
286 };