|
diff --git a/parsing.c b/parsing.c index c8f3048..f3f3b15 100644 --- a/ parsing.c+++ b/ parsing.c |
|
@@ -87,38 +87,42 @@ char *parse_user(char *t, char **name, char **email, unsigned long *date) |
87 | } else if (mode == 3 && isdigit(*p)) { |
87 | } else if (mode == 3 && isdigit(*p)) { |
88 | *date = atol(p); |
88 | *date = atol(p); |
89 | mode++; |
89 | mode++; |
90 | } else if (*p == '\n') { |
90 | } else if (*p == '\n') { |
91 | p++; |
91 | p++; |
92 | break; |
92 | break; |
93 | } |
93 | } |
94 | p++; |
94 | p++; |
95 | } |
95 | } |
96 | return p; |
96 | return p; |
97 | } |
97 | } |
98 | |
98 | |
| |
99 | #ifdef NO_ICONV |
| |
100 | #define reencode(a, b, c) |
| |
101 | #else |
99 | const char *reencode(char **txt, const char *src_enc, const char *dst_enc) |
102 | const char *reencode(char **txt, const char *src_enc, const char *dst_enc) |
100 | { |
103 | { |
101 | char *tmp; |
104 | char *tmp; |
102 | |
105 | |
103 | if (!txt || !*txt || !src_enc || !dst_enc) |
106 | if (!txt || !*txt || !src_enc || !dst_enc) |
104 | return *txt; |
107 | return *txt; |
105 | |
108 | |
106 | tmp = reencode_string(*txt, src_enc, dst_enc); |
109 | tmp = reencode_string(*txt, src_enc, dst_enc); |
107 | if (tmp) { |
110 | if (tmp) { |
108 | free(*txt); |
111 | free(*txt); |
109 | *txt = tmp; |
112 | *txt = tmp; |
110 | } |
113 | } |
111 | return *txt; |
114 | return *txt; |
112 | } |
115 | } |
| |
116 | #endif |
113 | |
117 | |
114 | struct commitinfo *cgit_parse_commit(struct commit *commit) |
118 | struct commitinfo *cgit_parse_commit(struct commit *commit) |
115 | { |
119 | { |
116 | struct commitinfo *ret; |
120 | struct commitinfo *ret; |
117 | char *p = commit->buffer, *t = commit->buffer; |
121 | char *p = commit->buffer, *t = commit->buffer; |
118 | |
122 | |
119 | ret = xmalloc(sizeof(*ret)); |
123 | ret = xmalloc(sizeof(*ret)); |
120 | ret->commit = commit; |
124 | ret->commit = commit; |
121 | ret->author = NULL; |
125 | ret->author = NULL; |
122 | ret->author_email = NULL; |
126 | ret->author_email = NULL; |
123 | ret->committer = NULL; |
127 | ret->committer = NULL; |
124 | ret->committer_email = NULL; |
128 | ret->committer_email = NULL; |
|