aboutsummaryrefslogtreecommitdiffstats
path: root/shared.c
diff options
context:
space:
mode:
Diffstat (limited to 'shared.c')
-rw-r--r--shared.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/shared.c b/shared.c
index 01800b6..e732064 100644
--- a/shared.c
+++ b/shared.c
@@ -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;