diff options
author | Jason A. Donenfeld <Jason@zx2c4.com> | 2013-03-04 13:21:33 (JST) |
---|---|---|
committer | Jason A. Donenfeld <Jason@zx2c4.com> | 2013-03-04 23:12:54 (JST) |
commit | bdae1d8a8d39206ac75ab86f8e9ef53b2f29432e (patch) | |
tree | 683306f79bd96a45566879acd21e5ff085120acd | |
parent | 53bc747d311d18642fa3ad0cc0de34f3899ed1f4 (diff) | |
download | cgit-bdae1d8a8d39206ac75ab86f8e9ef53b2f29432e.zip cgit-bdae1d8a8d39206ac75ab86f8e9ef53b2f29432e.tar.gz |
White space around control verbs.
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
-rw-r--r-- | cache.c | 6 | ||||
-rw-r--r-- | cgit.c | 4 | ||||
-rw-r--r-- | cmd.c | 2 | ||||
-rw-r--r-- | configfile.c | 6 | ||||
-rw-r--r-- | html.c | 14 | ||||
-rw-r--r-- | parsing.c | 4 | ||||
-rw-r--r-- | scan-tree.c | 2 | ||||
-rw-r--r-- | shared.c | 8 | ||||
-rw-r--r-- | ui-blob.c | 8 | ||||
-rw-r--r-- | ui-diff.c | 2 | ||||
-rw-r--r-- | ui-refs.c | 4 | ||||
-rw-r--r-- | ui-repolist.c | 4 | ||||
-rw-r--r-- | ui-shared.c | 12 | ||||
-rw-r--r-- | ui-snapshot.c | 4 | ||||
-rw-r--r-- | ui-stats.c | 2 | ||||
-rw-r--r-- | ui-tree.c | 2 |
16 files changed, 42 insertions, 42 deletions
@@ -214,7 +214,7 @@ unsigned long hash_str(const char *str) | |||
214 | if (!s) | 214 | if (!s) |
215 | return h; | 215 | return h; |
216 | 216 | ||
217 | while(*s) { | 217 | while (*s) { |
218 | h *= FNV_PRIME; | 218 | h *= FNV_PRIME; |
219 | h ^= *s++; | 219 | h ^= *s++; |
220 | } | 220 | } |
@@ -342,7 +342,7 @@ int cache_process(int size, const char *path, const char *key, int ttl, | |||
342 | strcpy(filename, path); | 342 | strcpy(filename, path); |
343 | if (filename[len - 1] != '/') | 343 | if (filename[len - 1] != '/') |
344 | filename[len++] = '/'; | 344 | filename[len++] = '/'; |
345 | for(i = 0; i < 8; i++) { | 345 | for (i = 0; i < 8; i++) { |
346 | sprintf(filename + len++, "%x", | 346 | sprintf(filename + len++, "%x", |
347 | (unsigned char)(hash & 0xf)); | 347 | (unsigned char)(hash & 0xf)); |
348 | hash >>= 4; | 348 | hash >>= 4; |
@@ -407,7 +407,7 @@ int cache_ls(const char *path) | |||
407 | *name = '\0'; | 407 | *name = '\0'; |
408 | } | 408 | } |
409 | slot.cache_name = fullname; | 409 | slot.cache_name = fullname; |
410 | while((ent = readdir(dir)) != NULL) { | 410 | while ((ent = readdir(dir)) != NULL) { |
411 | if (strlen(ent->d_name) != 8) | 411 | if (strlen(ent->d_name) != 8) |
412 | continue; | 412 | continue; |
413 | strcpy(name, ent->d_name); | 413 | strcpy(name, ent->d_name); |
@@ -315,7 +315,7 @@ static void querystring_cb(const char *name, const char *value) | |||
315 | ctx.qry.name = xstrdup(value); | 315 | ctx.qry.name = xstrdup(value); |
316 | } else if (!strcmp(name, "mimetype")) { | 316 | } else if (!strcmp(name, "mimetype")) { |
317 | ctx.qry.mimetype = xstrdup(value); | 317 | ctx.qry.mimetype = xstrdup(value); |
318 | } else if (!strcmp(name, "s")){ | 318 | } else if (!strcmp(name, "s")) { |
319 | ctx.qry.sort = xstrdup(value); | 319 | ctx.qry.sort = xstrdup(value); |
320 | } else if (!strcmp(name, "showmsg")) { | 320 | } else if (!strcmp(name, "showmsg")) { |
321 | ctx.qry.showmsg = atoi(value); | 321 | ctx.qry.showmsg = atoi(value); |
@@ -653,7 +653,7 @@ void print_repolist(FILE *f, struct cgit_repolist *list, int start) | |||
653 | { | 653 | { |
654 | int i; | 654 | int i; |
655 | 655 | ||
656 | for(i = start; i < list->count; i++) | 656 | for (i = start; i < list->count; i++) |
657 | print_repo(f, &list->repos[i]); | 657 | print_repo(f, &list->repos[i]); |
658 | } | 658 | } |
659 | 659 | ||
@@ -166,7 +166,7 @@ struct cgit_cmd *cgit_get_cmd(struct cgit_context *ctx) | |||
166 | ctx->qry.page = "repolist"; | 166 | ctx->qry.page = "repolist"; |
167 | } | 167 | } |
168 | 168 | ||
169 | for(i = 0; i < sizeof(cmds)/sizeof(*cmds); i++) | 169 | for (i = 0; i < sizeof(cmds)/sizeof(*cmds); i++) |
170 | if (!strcmp(ctx->qry.page, cmds[i].name)) | 170 | if (!strcmp(ctx->qry.page, cmds[i].name)) |
171 | return &cmds[i]; | 171 | return &cmds[i]; |
172 | return NULL; | 172 | return NULL; |
diff --git a/configfile.c b/configfile.c index fe5f9c5..3fa217f 100644 --- a/configfile.c +++ b/configfile.c | |||
@@ -27,7 +27,7 @@ void skip_line(FILE *f) | |||
27 | { | 27 | { |
28 | int c; | 28 | int c; |
29 | 29 | ||
30 | while((c = next_char(f)) && c != '\n' && c != EOF) | 30 | while ((c = next_char(f)) && c != '\n' && c != EOF) |
31 | ; | 31 | ; |
32 | } | 32 | } |
33 | 33 | ||
@@ -36,7 +36,7 @@ int read_config_line(FILE *f, char *line, const char **value, int bufsize) | |||
36 | int i = 0, isname = 0; | 36 | int i = 0, isname = 0; |
37 | 37 | ||
38 | *value = NULL; | 38 | *value = NULL; |
39 | while(i < bufsize - 1) { | 39 | while (i < bufsize - 1) { |
40 | int c = next_char(f); | 40 | int c = next_char(f); |
41 | if (!isname && (c == '#' || c == ';')) { | 41 | if (!isname && (c == '#' || c == ';')) { |
42 | skip_line(f); | 42 | skip_line(f); |
@@ -78,7 +78,7 @@ int parse_configfile(const char *filename, configfile_value_fn fn) | |||
78 | if (!(f = fopen(filename, "r"))) | 78 | if (!(f = fopen(filename, "r"))) |
79 | return -1; | 79 | return -1; |
80 | nesting++; | 80 | nesting++; |
81 | while((len = read_config_line(f, line, &value, sizeof(line))) > 0) | 81 | while ((len = read_config_line(f, line, &value, sizeof(line))) > 0) |
82 | fn(line, value); | 82 | fn(line, value); |
83 | nesting--; | 83 | nesting--; |
84 | fclose(f); | 84 | fclose(f); |
@@ -92,7 +92,7 @@ void html_status(int code, const char *msg, int more_headers) | |||
92 | void html_txt(const char *txt) | 92 | void html_txt(const char *txt) |
93 | { | 93 | { |
94 | const char *t = txt; | 94 | const char *t = txt; |
95 | while(t && *t){ | 95 | while (t && *t) { |
96 | int c = *t; | 96 | int c = *t; |
97 | if (c == '<' || c == '>' || c == '&') { | 97 | if (c == '<' || c == '>' || c == '&') { |
98 | html_raw(txt, t - txt); | 98 | html_raw(txt, t - txt); |
@@ -113,7 +113,7 @@ void html_txt(const char *txt) | |||
113 | void html_ntxt(int len, const char *txt) | 113 | void html_ntxt(int len, const char *txt) |
114 | { | 114 | { |
115 | const char *t = txt; | 115 | const char *t = txt; |
116 | while(t && *t && len--){ | 116 | while (t && *t && len--) { |
117 | int c = *t; | 117 | int c = *t; |
118 | if (c == '<' || c == '>' || c == '&') { | 118 | if (c == '<' || c == '>' || c == '&') { |
119 | html_raw(txt, t - txt); | 119 | html_raw(txt, t - txt); |
@@ -136,7 +136,7 @@ void html_ntxt(int len, const char *txt) | |||
136 | void html_attr(const char *txt) | 136 | void html_attr(const char *txt) |
137 | { | 137 | { |
138 | const char *t = txt; | 138 | const char *t = txt; |
139 | while(t && *t){ | 139 | while (t && *t) { |
140 | int c = *t; | 140 | int c = *t; |
141 | if (c == '<' || c == '>' || c == '\'' || c == '\"' || c == '&') { | 141 | if (c == '<' || c == '>' || c == '\'' || c == '\"' || c == '&') { |
142 | html_raw(txt, t - txt); | 142 | html_raw(txt, t - txt); |
@@ -161,7 +161,7 @@ void html_attr(const char *txt) | |||
161 | void html_url_path(const char *txt) | 161 | void html_url_path(const char *txt) |
162 | { | 162 | { |
163 | const char *t = txt; | 163 | const char *t = txt; |
164 | while(t && *t){ | 164 | while (t && *t) { |
165 | unsigned char c = *t; | 165 | unsigned char c = *t; |
166 | const char *e = url_escape_table[c]; | 166 | const char *e = url_escape_table[c]; |
167 | if (e && c != '+' && c != '&') { | 167 | if (e && c != '+' && c != '&') { |
@@ -178,7 +178,7 @@ void html_url_path(const char *txt) | |||
178 | void html_url_arg(const char *txt) | 178 | void html_url_arg(const char *txt) |
179 | { | 179 | { |
180 | const char *t = txt; | 180 | const char *t = txt; |
181 | while(t && *t){ | 181 | while (t && *t) { |
182 | unsigned char c = *t; | 182 | unsigned char c = *t; |
183 | const char *e = url_escape_table[c]; | 183 | const char *e = url_escape_table[c]; |
184 | if (c == ' ') | 184 | if (c == ' ') |
@@ -260,7 +260,7 @@ int html_include(const char *filename) | |||
260 | filename, strerror(errno), errno); | 260 | filename, strerror(errno), errno); |
261 | return -1; | 261 | return -1; |
262 | } | 262 | } |
263 | while((len = fread(buf, 1, 4096, f)) > 0) | 263 | while ((len = fread(buf, 1, 4096, f)) > 0) |
264 | html_raw(buf, len); | 264 | html_raw(buf, len); |
265 | fclose(f); | 265 | fclose(f); |
266 | return 0; | 266 | return 0; |
@@ -310,7 +310,7 @@ int http_parse_querystring(const char *txt_, void (*fn)(const char *name, const | |||
310 | printf("Out of memory\n"); | 310 | printf("Out of memory\n"); |
311 | exit(1); | 311 | exit(1); |
312 | } | 312 | } |
313 | while((c=*t) != '\0') { | 313 | while ((c=*t) != '\0') { |
314 | if (c == '=') { | 314 | if (c == '=') { |
315 | *t = '\0'; | 315 | *t = '\0'; |
316 | value = t + 1; | 316 | value = t + 1; |
@@ -112,7 +112,7 @@ const char *reencode(char **txt, const char *src_enc, const char *dst_enc) | |||
112 | return *txt; | 112 | return *txt; |
113 | 113 | ||
114 | /* no encoding needed if src_enc equals dst_enc */ | 114 | /* no encoding needed if src_enc equals dst_enc */ |
115 | if(!strcasecmp(src_enc, dst_enc)) | 115 | if (!strcasecmp(src_enc, dst_enc)) |
116 | return *txt; | 116 | return *txt; |
117 | 117 | ||
118 | tmp = reencode_string(*txt, dst_enc, src_enc); | 118 | tmp = reencode_string(*txt, dst_enc, src_enc); |
@@ -170,7 +170,7 @@ struct commitinfo *cgit_parse_commit(struct commit *commit) | |||
170 | } | 170 | } |
171 | 171 | ||
172 | /* if no special encoding is found, assume UTF-8 */ | 172 | /* if no special encoding is found, assume UTF-8 */ |
173 | if(!ret->msg_encoding) | 173 | if (!ret->msg_encoding) |
174 | ret->msg_encoding = xstrdup("UTF-8"); | 174 | ret->msg_encoding = xstrdup("UTF-8"); |
175 | 175 | ||
176 | // skip unknown header fields | 176 | // skip unknown header fields |
diff --git a/scan-tree.c b/scan-tree.c index 98a99c9..10d90f4 100644 --- a/scan-tree.c +++ b/scan-tree.c | |||
@@ -185,7 +185,7 @@ static void scan_path(const char *base, const char *path, repo_config_fn fn) | |||
185 | add_repo(base, fmt("%s/.git", path), fn); | 185 | add_repo(base, fmt("%s/.git", path), fn); |
186 | goto end; | 186 | goto end; |
187 | } | 187 | } |
188 | while((ent = readdir(dir)) != NULL) { | 188 | while ((ent = readdir(dir)) != NULL) { |
189 | if (ent->d_name[0] == '.') { | 189 | if (ent->d_name[0] == '.') { |
190 | if (ent->d_name[1] == '\0') | 190 | if (ent->d_name[1] == '\0') |
191 | continue; | 191 | continue; |
@@ -108,7 +108,7 @@ char *trim_end(const char *str, char c) | |||
108 | if (str == NULL) | 108 | if (str == NULL) |
109 | return NULL; | 109 | return NULL; |
110 | len = strlen(str); | 110 | len = strlen(str); |
111 | while(len > 0 && str[len - 1] == c) | 111 | while (len > 0 && str[len - 1] == c) |
112 | len--; | 112 | len--; |
113 | if (len == 0) | 113 | if (len == 0) |
114 | return NULL; | 114 | return NULL; |
@@ -351,16 +351,16 @@ int cgit_parse_snapshots_mask(const char *str) | |||
351 | int tl, sl, rv = 0; | 351 | int tl, sl, rv = 0; |
352 | 352 | ||
353 | /* favor legacy setting */ | 353 | /* favor legacy setting */ |
354 | if(atoi(str)) | 354 | if (atoi(str)) |
355 | return 1; | 355 | return 1; |
356 | for(;;) { | 356 | for (;;) { |
357 | str += strspn(str, delim); | 357 | str += strspn(str, delim); |
358 | tl = strcspn(str, delim); | 358 | tl = strcspn(str, delim); |
359 | if (!tl) | 359 | if (!tl) |
360 | break; | 360 | break; |
361 | for (f = cgit_snapshot_formats; f->suffix; f++) { | 361 | for (f = cgit_snapshot_formats; f->suffix; f++) { |
362 | sl = strlen(f->suffix); | 362 | sl = strlen(f->suffix); |
363 | if((tl == sl && !strncmp(f->suffix, str, tl)) || | 363 | if ((tl == sl && !strncmp(f->suffix, str, tl)) || |
364 | (tl == sl - 1 && !strncmp(f->suffix + 1, str, tl - 1))) { | 364 | (tl == sl - 1 && !strncmp(f->suffix + 1, str, tl - 1))) { |
365 | rv |= f->bit; | 365 | rv |= f->bit; |
366 | break; | 366 | break; |
@@ -17,7 +17,7 @@ static int found_path; | |||
17 | 17 | ||
18 | static int walk_tree(const unsigned char *sha1, const char *base, int baselen, | 18 | static int walk_tree(const unsigned char *sha1, const char *base, int baselen, |
19 | const char *pathname, unsigned mode, int stage, void *cbdata) { | 19 | const char *pathname, unsigned mode, int stage, void *cbdata) { |
20 | if(strncmp(base, match_path, baselen) | 20 | if (strncmp(base, match_path, baselen) |
21 | || strcmp(match_path + baselen, pathname)) | 21 | || strcmp(match_path + baselen, pathname)) |
22 | return READ_TREE_RECURSIVE; | 22 | return READ_TREE_RECURSIVE; |
23 | memmove(matched_sha1, sha1, 20); | 23 | memmove(matched_sha1, sha1, 20); |
@@ -43,7 +43,7 @@ int cgit_print_file(char *path, const char *head) | |||
43 | if (get_sha1(head, sha1)) | 43 | if (get_sha1(head, sha1)) |
44 | return -1; | 44 | return -1; |
45 | type = sha1_object_info(sha1, &size); | 45 | type = sha1_object_info(sha1, &size); |
46 | if(type == OBJ_COMMIT && path) { | 46 | if (type == OBJ_COMMIT && path) { |
47 | commit = lookup_commit_reference(sha1); | 47 | commit = lookup_commit_reference(sha1); |
48 | match_path = path; | 48 | match_path = path; |
49 | matched_sha1 = sha1; | 49 | matched_sha1 = sha1; |
@@ -80,7 +80,7 @@ void cgit_print_blob(const char *hex, char *path, const char *head) | |||
80 | }; | 80 | }; |
81 | 81 | ||
82 | if (hex) { | 82 | if (hex) { |
83 | if (get_sha1_hex(hex, sha1)){ | 83 | if (get_sha1_hex(hex, sha1)) { |
84 | cgit_print_error(fmt("Bad hex value: %s", hex)); | 84 | cgit_print_error(fmt("Bad hex value: %s", hex)); |
85 | return; | 85 | return; |
86 | } | 86 | } |
@@ -93,7 +93,7 @@ void cgit_print_blob(const char *hex, char *path, const char *head) | |||
93 | 93 | ||
94 | type = sha1_object_info(sha1, &size); | 94 | type = sha1_object_info(sha1, &size); |
95 | 95 | ||
96 | if((!hex) && type == OBJ_COMMIT && path) { | 96 | if ((!hex) && type == OBJ_COMMIT && path) { |
97 | commit = lookup_commit_reference(sha1); | 97 | commit = lookup_commit_reference(sha1); |
98 | match_path = path; | 98 | match_path = path; |
99 | matched_sha1 = sha1; | 99 | matched_sha1 = sha1; |
@@ -184,7 +184,7 @@ void cgit_print_diffstat(const unsigned char *old_sha1, | |||
184 | max_changes = 0; | 184 | max_changes = 0; |
185 | cgit_diff_tree(old_sha1, new_sha1, inspect_filepair, prefix, | 185 | cgit_diff_tree(old_sha1, new_sha1, inspect_filepair, prefix, |
186 | ctx.qry.ignorews); | 186 | ctx.qry.ignorews); |
187 | for(i = 0; i<files; i++) | 187 | for (i = 0; i<files; i++) |
188 | print_fileinfo(&items[i]); | 188 | print_fileinfo(&items[i]); |
189 | html("</table>"); | 189 | html("</table>"); |
190 | html("<div class='diffstat-summary'>"); | 190 | html("<div class='diffstat-summary'>"); |
@@ -200,7 +200,7 @@ void cgit_print_branches(int maxcount) | |||
200 | qsort(list.refs, maxcount, sizeof(*list.refs), cmp_ref_name); | 200 | qsort(list.refs, maxcount, sizeof(*list.refs), cmp_ref_name); |
201 | } | 201 | } |
202 | 202 | ||
203 | for(i = 0; i < maxcount; i++) | 203 | for (i = 0; i < maxcount; i++) |
204 | print_branch(list.refs[i]); | 204 | print_branch(list.refs[i]); |
205 | 205 | ||
206 | if (maxcount < list.count) | 206 | if (maxcount < list.count) |
@@ -224,7 +224,7 @@ void cgit_print_tags(int maxcount) | |||
224 | else if (maxcount > list.count) | 224 | else if (maxcount > list.count) |
225 | maxcount = list.count; | 225 | maxcount = list.count; |
226 | print_tag_header(); | 226 | print_tag_header(); |
227 | for(i = 0; i < maxcount; i++) | 227 | for (i = 0; i < maxcount; i++) |
228 | print_tag(list.refs[i]); | 228 | print_tag(list.refs[i]); |
229 | 229 | ||
230 | if (maxcount < list.count) | 230 | if (maxcount < list.count) |
diff --git a/ui-repolist.c b/ui-repolist.c index 449478d..1ae22aa 100644 --- a/ui-repolist.c +++ b/ui-repolist.c | |||
@@ -129,7 +129,7 @@ void print_pager(int items, int pagelen, char *search, char *sort) | |||
129 | int i, ofs; | 129 | int i, ofs; |
130 | char *class = NULL; | 130 | char *class = NULL; |
131 | html("<div class='pager'>"); | 131 | html("<div class='pager'>"); |
132 | for(i = 0, ofs = 0; ofs < items; i++, ofs = i * pagelen) { | 132 | for (i = 0, ofs = 0; ofs < items; i++, ofs = i * pagelen) { |
133 | class = (ctx.qry.ofs == ofs) ? "current" : NULL; | 133 | class = (ctx.qry.ofs == ofs) ? "current" : NULL; |
134 | cgit_index_link(fmt("[%d]", i + 1), fmt("Page %d", i + 1), | 134 | cgit_index_link(fmt("[%d]", i + 1), fmt("Page %d", i + 1), |
135 | class, search, sort, ofs); | 135 | class, search, sort, ofs); |
@@ -258,7 +258,7 @@ void cgit_print_repolist() | |||
258 | if (ctx.cfg.index_header) | 258 | if (ctx.cfg.index_header) |
259 | html_include(ctx.cfg.index_header); | 259 | html_include(ctx.cfg.index_header); |
260 | 260 | ||
261 | if(ctx.qry.sort) | 261 | if (ctx.qry.sort) |
262 | sorted = sort_repolist(ctx.qry.sort); | 262 | sorted = sort_repolist(ctx.qry.sort); |
263 | else if (ctx.cfg.section_sort) | 263 | else if (ctx.cfg.section_sort) |
264 | sort_repolist("section"); | 264 | sort_repolist("section"); |
diff --git a/ui-shared.c b/ui-shared.c index 1a28dce..af5310b 100644 --- a/ui-shared.c +++ b/ui-shared.c | |||
@@ -103,20 +103,20 @@ const char *cgit_repobasename(const char *reponame) | |||
103 | int p; | 103 | int p; |
104 | const char *rv; | 104 | const char *rv; |
105 | strncpy(rvbuf, reponame, sizeof(rvbuf)); | 105 | strncpy(rvbuf, reponame, sizeof(rvbuf)); |
106 | if(rvbuf[sizeof(rvbuf)-1]) | 106 | if (rvbuf[sizeof(rvbuf)-1]) |
107 | die("cgit_repobasename: truncated repository name '%s'", reponame); | 107 | die("cgit_repobasename: truncated repository name '%s'", reponame); |
108 | p = strlen(rvbuf)-1; | 108 | p = strlen(rvbuf)-1; |
109 | /* strip trailing slashes */ | 109 | /* strip trailing slashes */ |
110 | while(p && rvbuf[p] == '/') rvbuf[p--] = 0; | 110 | while (p && rvbuf[p] == '/') rvbuf[p--] = 0; |
111 | /* strip trailing .git */ | 111 | /* strip trailing .git */ |
112 | if(p >= 3 && !strncmp(&rvbuf[p-3], ".git", 4)) { | 112 | if (p >= 3 && !strncmp(&rvbuf[p-3], ".git", 4)) { |
113 | p -= 3; rvbuf[p--] = 0; | 113 | p -= 3; rvbuf[p--] = 0; |
114 | } | 114 | } |
115 | /* strip more trailing slashes if any */ | 115 | /* strip more trailing slashes if any */ |
116 | while( p && rvbuf[p] == '/') rvbuf[p--] = 0; | 116 | while ( p && rvbuf[p] == '/') rvbuf[p--] = 0; |
117 | /* find last slash in the remaining string */ | 117 | /* find last slash in the remaining string */ |
118 | rv = strrchr(rvbuf,'/'); | 118 | rv = strrchr(rvbuf,'/'); |
119 | if(rv) | 119 | if (rv) |
120 | return ++rv; | 120 | return ++rv; |
121 | return rvbuf; | 121 | return rvbuf; |
122 | } | 122 | } |
@@ -576,7 +576,7 @@ void cgit_print_date(time_t secs, const char *format, int local_time) | |||
576 | 576 | ||
577 | if (!secs) | 577 | if (!secs) |
578 | return; | 578 | return; |
579 | if(local_time) | 579 | if (local_time) |
580 | time = localtime(&secs); | 580 | time = localtime(&secs); |
581 | else | 581 | else |
582 | time = gmtime(&secs); | 582 | time = gmtime(&secs); |
diff --git a/ui-snapshot.c b/ui-snapshot.c index 7374d9d..281899d 100644 --- a/ui-snapshot.c +++ b/ui-snapshot.c | |||
@@ -72,7 +72,7 @@ const struct cgit_snapshot_format cgit_snapshot_formats[] = { | |||
72 | { ".tar.bz2", "application/x-bzip2", write_tar_bzip2_archive, 0x04 }, | 72 | { ".tar.bz2", "application/x-bzip2", write_tar_bzip2_archive, 0x04 }, |
73 | { ".tar", "application/x-tar", write_tar_archive, 0x08 }, | 73 | { ".tar", "application/x-tar", write_tar_archive, 0x08 }, |
74 | { ".tar.xz", "application/x-xz", write_tar_xz_archive, 0x10 }, | 74 | { ".tar.xz", "application/x-xz", write_tar_xz_archive, 0x10 }, |
75 | {} | 75 | { NULL } |
76 | }; | 76 | }; |
77 | 77 | ||
78 | static const struct cgit_snapshot_format *get_format(const char *filename) | 78 | static const struct cgit_snapshot_format *get_format(const char *filename) |
@@ -81,7 +81,7 @@ static const struct cgit_snapshot_format *get_format(const char *filename) | |||
81 | int fl, sl; | 81 | int fl, sl; |
82 | 82 | ||
83 | fl = strlen(filename); | 83 | fl = strlen(filename); |
84 | for(fmt = cgit_snapshot_formats; fmt->suffix; fmt++) { | 84 | for (fmt = cgit_snapshot_formats; fmt->suffix; fmt++) { |
85 | sl = strlen(fmt->suffix); | 85 | sl = strlen(fmt->suffix); |
86 | if (sl >= fl) | 86 | if (sl >= fl) |
87 | continue; | 87 | continue; |
@@ -83,7 +83,7 @@ static char *pretty_month(struct tm *tm) | |||
83 | static void trunc_quarter(struct tm *tm) | 83 | static void trunc_quarter(struct tm *tm) |
84 | { | 84 | { |
85 | trunc_month(tm); | 85 | trunc_month(tm); |
86 | while(tm->tm_mon % 3 != 0) | 86 | while (tm->tm_mon % 3 != 0) |
87 | dec_month(tm); | 87 | dec_month(tm); |
88 | } | 88 | } |
89 | 89 | ||
@@ -30,7 +30,7 @@ static void print_text_buffer(const char *name, char *buf, unsigned long size) | |||
30 | 30 | ||
31 | if (size) { | 31 | if (size) { |
32 | htmlf(numberfmt, ++lineno); | 32 | htmlf(numberfmt, ++lineno); |
33 | while(idx < size - 1) { // skip absolute last newline | 33 | while (idx < size - 1) { // skip absolute last newline |
34 | if (buf[idx] == '\n') | 34 | if (buf[idx] == '\n') |
35 | htmlf(numberfmt, ++lineno); | 35 | htmlf(numberfmt, ++lineno); |
36 | idx++; | 36 | idx++; |