Skip to content

Commit 30f50c3

Browse files
committed
mailinfo: move cleanup_space() before its users
Signed-off-by: Junio C Hamano <[email protected]>
1 parent 4f0f9d4 commit 30f50c3

File tree

1 file changed

+11
-14
lines changed

1 file changed

+11
-14
lines changed

builtin/mailinfo.c

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,17 @@ static int use_inbody_headers = 1;
3131
#define MAX_HDR_PARSED 10
3232
#define MAX_BOUNDARIES 5
3333

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+
}
3645

3746
static void get_sane_name(struct strbuf *out, struct strbuf *name, struct strbuf *email)
3847
{
@@ -272,18 +281,6 @@ static void cleanup_subject(struct strbuf *subject)
272281
strbuf_trim(subject);
273282
}
274283

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-
287284
static const char *header[MAX_HDR_PARSED] = {
288285
"From","Subject","Date",
289286
};

0 commit comments

Comments
 (0)