diff options
-rw-r--r-- | cache.c | 6 | ||||
-rw-r--r-- | cgit.c | 18 | ||||
-rw-r--r-- | configfile.c | 22 | ||||
-rw-r--r-- | html.c | 78 | ||||
-rw-r--r-- | scan-tree.c | 4 | ||||
-rw-r--r-- | shared.c | 14 | ||||
-rw-r--r-- | ui-blob.c | 10 | ||||
-rw-r--r-- | ui-commit.c | 4 | ||||
-rw-r--r-- | ui-refs.c | 4 | ||||
-rw-r--r-- | ui-repolist.c | 6 | ||||
-rw-r--r-- | ui-shared.c | 18 | ||||
-rw-r--r-- | ui-stats.c | 8 | ||||
-rw-r--r-- | ui-tag.c | 2 | ||||
-rw-r--r-- | ui-tree.c | 4 |
14 files changed, 99 insertions, 99 deletions
@@ -105,7 +105,7 @@ static int is_expired(struct cache_slot *slot) | |||
105 | if (slot->ttl < 0) | 105 | if (slot->ttl < 0) |
106 | return 0; | 106 | return 0; |
107 | else | 107 | else |
108 | return slot->cache_st.st_mtime + slot->ttl*60 < time(NULL); | 108 | return slot->cache_st.st_mtime + slot->ttl * 60 < time(NULL); |
109 | } | 109 | } |
110 | 110 | ||
111 | /* Check if the slot has been modified since we opened it. | 111 | /* Check if the slot has been modified since we opened it. |
@@ -141,8 +141,8 @@ static int close_lock(struct cache_slot *slot) | |||
141 | */ | 141 | */ |
142 | static int lock_slot(struct cache_slot *slot) | 142 | static int lock_slot(struct cache_slot *slot) |
143 | { | 143 | { |
144 | slot->lock_fd = open(slot->lock_name, O_RDWR|O_CREAT|O_EXCL, | 144 | slot->lock_fd = open(slot->lock_name, O_RDWR | O_CREAT | O_EXCL, |
145 | S_IRUSR|S_IWUSR); | 145 | S_IRUSR | S_IWUSR); |
146 | if (slot->lock_fd == -1) | 146 | if (slot->lock_fd == -1) |
147 | return errno; | 147 | return errno; |
148 | if (xwrite(slot->lock_fd, slot->key, slot->keylen + 1) < 0) | 148 | if (xwrite(slot->lock_fd, slot->key, slot->keylen + 1) < 0) |
@@ -741,7 +741,7 @@ static void cgit_parse_args(int argc, const char **argv) | |||
741 | 741 | ||
742 | for (i = 1; i < argc; i++) { | 742 | for (i = 1; i < argc; i++) { |
743 | if (!strncmp(argv[i], "--cache=", 8)) { | 743 | if (!strncmp(argv[i], "--cache=", 8)) { |
744 | ctx.cfg.cache_root = xstrdup(argv[i]+8); | 744 | ctx.cfg.cache_root = xstrdup(argv[i] + 8); |
745 | } | 745 | } |
746 | if (!strcmp(argv[i], "--nocache")) { | 746 | if (!strcmp(argv[i], "--nocache")) { |
747 | ctx.cfg.nocache = 1; | 747 | ctx.cfg.nocache = 1; |
@@ -750,24 +750,24 @@ static void cgit_parse_args(int argc, const char **argv) | |||
750 | ctx.env.no_http = "1"; | 750 | ctx.env.no_http = "1"; |
751 | } | 751 | } |
752 | if (!strncmp(argv[i], "--query=", 8)) { | 752 | if (!strncmp(argv[i], "--query=", 8)) { |
753 | ctx.qry.raw = xstrdup(argv[i]+8); | 753 | ctx.qry.raw = xstrdup(argv[i] + 8); |
754 | } | 754 | } |
755 | if (!strncmp(argv[i], "--repo=", 7)) { | 755 | if (!strncmp(argv[i], "--repo=", 7)) { |
756 | ctx.qry.repo = xstrdup(argv[i]+7); | 756 | ctx.qry.repo = xstrdup(argv[i] + 7); |
757 | } | 757 | } |
758 | if (!strncmp(argv[i], "--page=", 7)) { | 758 | if (!strncmp(argv[i], "--page=", 7)) { |
759 | ctx.qry.page = xstrdup(argv[i]+7); | 759 | ctx.qry.page = xstrdup(argv[i] + 7); |
760 | } | 760 | } |
761 | if (!strncmp(argv[i], "--head=", 7)) { | 761 | if (!strncmp(argv[i], "--head=", 7)) { |
762 | ctx.qry.head = xstrdup(argv[i]+7); | 762 | ctx.qry.head = xstrdup(argv[i] + 7); |
763 | ctx.qry.has_symref = 1; | 763 | ctx.qry.has_symref = 1; |
764 | } | 764 | } |
765 | if (!strncmp(argv[i], "--sha1=", 7)) { | 765 | if (!strncmp(argv[i], "--sha1=", 7)) { |
766 | ctx.qry.sha1 = xstrdup(argv[i]+7); | 766 | ctx.qry.sha1 = xstrdup(argv[i] + 7); |
767 | ctx.qry.has_sha1 = 1; | 767 | ctx.qry.has_sha1 = 1; |
768 | } | 768 | } |
769 | if (!strncmp(argv[i], "--ofs=", 6)) { | 769 | if (!strncmp(argv[i], "--ofs=", 6)) { |
770 | ctx.qry.ofs = atoi(argv[i]+6); | 770 | ctx.qry.ofs = atoi(argv[i] + 6); |
771 | } | 771 | } |
772 | if (!strncmp(argv[i], "--scan-tree=", 12) || | 772 | if (!strncmp(argv[i], "--scan-tree=", 12) || |
773 | !strncmp(argv[i], "--scan-path=", 12)) { | 773 | !strncmp(argv[i], "--scan-path=", 12)) { |
@@ -834,7 +834,7 @@ int main(int argc, const char **argv) | |||
834 | ctx.cfg.virtual_root = trim_end(ctx.cfg.script_name, '/'); | 834 | ctx.cfg.virtual_root = trim_end(ctx.cfg.script_name, '/'); |
835 | if (!ctx.cfg.virtual_root) | 835 | if (!ctx.cfg.virtual_root) |
836 | ctx.cfg.virtual_root = ""; | 836 | ctx.cfg.virtual_root = ""; |
837 | } | 837 | } |
838 | 838 | ||
839 | /* If no url parameter is specified on the querystring, lets | 839 | /* If no url parameter is specified on the querystring, lets |
840 | * use PATH_INFO as url. This allows cgit to work with virtual | 840 | * use PATH_INFO as url. This allows cgit to work with virtual |
@@ -856,7 +856,7 @@ int main(int argc, const char **argv) | |||
856 | } | 856 | } |
857 | 857 | ||
858 | ttl = calc_ttl(); | 858 | ttl = calc_ttl(); |
859 | ctx.page.expires += ttl*60; | 859 | ctx.page.expires += ttl * 60; |
860 | if (ctx.env.request_method && !strcmp(ctx.env.request_method, "HEAD")) | 860 | if (ctx.env.request_method && !strcmp(ctx.env.request_method, "HEAD")) |
861 | ctx.cfg.nocache = 1; | 861 | ctx.cfg.nocache = 1; |
862 | if (ctx.cfg.nocache) | 862 | if (ctx.cfg.nocache) |
diff --git a/configfile.c b/configfile.c index 4908058..fe5f9c5 100644 --- a/configfile.c +++ b/configfile.c | |||
@@ -13,9 +13,9 @@ | |||
13 | int next_char(FILE *f) | 13 | int next_char(FILE *f) |
14 | { | 14 | { |
15 | int c = fgetc(f); | 15 | int c = fgetc(f); |
16 | if (c=='\r') { | 16 | if (c == '\r') { |
17 | c = fgetc(f); | 17 | c = fgetc(f); |
18 | if (c!='\n') { | 18 | if (c != '\n') { |
19 | ungetc(c, f); | 19 | ungetc(c, f); |
20 | c = '\r'; | 20 | c = '\r'; |
21 | } | 21 | } |
@@ -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,31 +36,31 @@ 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); |
43 | continue; | 43 | continue; |
44 | } | 44 | } |
45 | if (!isname && isspace(c)) | 45 | if (!isname && isspace(c)) |
46 | continue; | 46 | continue; |
47 | 47 | ||
48 | if (c=='=' && !*value) { | 48 | if (c == '=' && !*value) { |
49 | line[i] = 0; | 49 | line[i] = 0; |
50 | *value = &line[i+1]; | 50 | *value = &line[i + 1]; |
51 | } else if (c=='\n' && !isname) { | 51 | } else if (c == '\n' && !isname) { |