diff options
author | Lukas Fleischer <cgit@cryptocrack.de> | 2013-03-04 00:04:29 (JST) |
---|---|---|
committer | Lukas Fleischer <cgit@cryptocrack.de> | 2013-03-04 09:12:48 (JST) |
commit | 53bc747d311d18642fa3ad0cc0de34f3899ed1f4 (patch) | |
tree | 97e6fa2e4e7300f55a180917059b71e566c260fe /ui-shared.c | |
parent | 7f4e8c33aeb65bdc5695c9fd13ec1ceb100303c7 (diff) | |
download | cgit-53bc747d311d18642fa3ad0cc0de34f3899ed1f4.zip cgit-53bc747d311d18642fa3ad0cc0de34f3899ed1f4.tar.gz |
Fix several whitespace errors
* Remove whitespace at the end of lines.
* Replace space indentation by tabs.
* Add whitespace before/after several operators ("+", "-", "*", ...)
* Add whitespace to assignments ("foo = bar;").
* Fix whitespace in parameter lists ("foobar(foo, bar, 42)").
Signed-off-by: Lukas Fleischer <cgit@cryptocrack.de>
Diffstat (limited to 'ui-shared.c')
-rw-r--r-- | ui-shared.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/ui-shared.c b/ui-shared.c index c4fb437..1a28dce 100644 --- a/ui-shared.c +++ b/ui-shared.c | |||
@@ -23,7 +23,7 @@ static char *http_date(time_t t) | |||
23 | "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"}; | 23 | "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"}; |
24 | struct tm *tm = gmtime(&t); | 24 | struct tm *tm = gmtime(&t); |
25 | return fmt("%s, %02d %s %04d %02d:%02d:%02d GMT", day[tm->tm_wday], | 25 | return fmt("%s, %02d %s %04d %02d:%02d:%02d GMT", day[tm->tm_wday], |
26 | tm->tm_mday, month[tm->tm_mon], 1900+tm->tm_year, | 26 | tm->tm_mday, month[tm->tm_mon], 1900 + tm->tm_year, |
27 | tm->tm_hour, tm->tm_min, tm->tm_sec); | 27 | tm->tm_hour, tm->tm_min, tm->tm_sec); |
28 | } | 28 | } |
29 | 29 | ||
@@ -93,7 +93,7 @@ char *cgit_fileurl(const char *reponame, const char *pagename, | |||
93 | char *cgit_pageurl(const char *reponame, const char *pagename, | 93 | char *cgit_pageurl(const char *reponame, const char *pagename, |
94 | const char *query) | 94 | const char *query) |
95 | { | 95 | { |
96 | return cgit_fileurl(reponame,pagename,0,query); | 96 | return cgit_fileurl(reponame, pagename, 0, query); |
97 | } | 97 | } |
98 | 98 | ||
99 | const char *cgit_repobasename(const char *reponame) | 99 | const char *cgit_repobasename(const char *reponame) |
@@ -102,18 +102,18 @@ const char *cgit_repobasename(const char *reponame) | |||
102 | static char rvbuf[1024]; | 102 | static char rvbuf[1024]; |
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) |
@@ -499,7 +499,7 @@ void cgit_object_link(struct object *obj) | |||
499 | shortrev = xstrdup(fullrev); | 499 | shortrev = xstrdup(fullrev); |
500 | shortrev[10] = '\0'; | 500 | shortrev[10] = '\0'; |
501 | if (obj->type == OBJ_COMMIT) { | 501 | if (obj->type == OBJ_COMMIT) { |
502 | cgit_commit_link(fmt("commit %s...", shortrev), NULL, NULL, | 502 | cgit_commit_link(fmt("commit %s...", shortrev), NULL, NULL, |
503 | ctx.qry.head, fullrev, NULL, 0); | 503 | ctx.qry.head, fullrev, NULL, 0); |
504 | return; | 504 | return; |
505 | } else if (obj->type == OBJ_TREE) | 505 | } else if (obj->type == OBJ_TREE) |
@@ -736,7 +736,7 @@ int print_archive_ref(const char *refname, const unsigned char *sha1, | |||
736 | 736 | ||
737 | if (prefixcmp(refname, "refs/archives")) | 737 | if (prefixcmp(refname, "refs/archives")) |
738 | return 0; | 738 | return 0; |
739 | strncpy(buf, refname+14, sizeof(buf)); | 739 | strncpy(buf, refname + 14, sizeof(buf)); |
740 | obj = parse_object(sha1); | 740 | obj = parse_object(sha1); |
741 | if (!obj) | 741 | if (!obj) |
742 | return 1; | 742 | return 1; |
@@ -968,7 +968,7 @@ void cgit_print_snapshot_links(const char *repo, const char *head, | |||
968 | { | 968 | { |
969 | const struct cgit_snapshot_format* f; | 969 | const struct cgit_snapshot_format* f; |
970 | char *prefix; | 970 | char *prefix; |
971 | char *filename; | 971 | char *filename; |
972 | unsigned char sha1[20]; | 972 | unsigned char sha1[20]; |
973 | 973 | ||
974 | if (get_sha1(fmt("refs/tags/%s", hex), sha1) == 0 && | 974 | if (get_sha1(fmt("refs/tags/%s", hex), sha1) == 0 && |