aboutsummaryrefslogtreecommitdiffstats
path: root/shared.c
diff options
context:
space:
mode:
Diffstat (limited to 'shared.c')
-rw-r--r--shared.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/shared.c b/shared.c
index 0967f92..01800b6 100644
--- a/shared.c
+++ b/shared.c
@@ -28,8 +28,8 @@ int chk_positive(int result, char *msg)
28 28
29int chk_non_negative(int result, char *msg) 29int chk_non_negative(int result, char *msg)
30{ 30{
31 if (result < 0) 31 if (result < 0)
32 die("%s: %s",msg, strerror(errno)); 32 die("%s: %s", msg, strerror(errno));
33 return result; 33 return result;
34} 34}
35 35
@@ -80,7 +80,7 @@ struct cgit_repo *cgit_get_repoinfo(const char *url)
80 int i; 80 int i;
81 struct cgit_repo *repo; 81 struct cgit_repo *repo;
82 82
83 for (i=0; i<cgit_repolist.count; i++) { 83 for (i = 0; i < cgit_repolist.count; i++) {
84 repo = &cgit_repolist.repos[i]; 84 repo = &cgit_repolist.repos[i];
85 if (!strcmp(repo->url, url)) 85 if (!strcmp(repo->url, url))
86 return repo; 86 return repo;
@@ -207,7 +207,7 @@ static int load_mmfile(mmfile_t *file, const unsigned char *sha1)
207 file->ptr = (char *)""; 207 file->ptr = (char *)"";
208 file->size = 0; 208 file->size = 0;
209 } else { 209 } else {
210 file->ptr = read_sha1_file(sha1, &type, 210 file->ptr = read_sha1_file(sha1, &type,
211 (unsigned long *)&file->size); 211 (unsigned long *)&file->size);
212 } 212 }
213 return 1; 213 return 1;
@@ -354,14 +354,14 @@ int cgit_parse_snapshots_mask(const char *str)
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;
367 } 367 }