cgit

commit 53bc747d311d18642fa3ad0cc0de34f3899ed1f4

Author: Lukas Fleischer <cgit@cryptocrack.de>

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>

 cache.c | 6 ++--
 cgit.c | 18 ++++++------
 configfile.c | 22 +++++++-------
 html.c | 78 ++++++++++++++++++++++++++--------------------------
 scan-tree.c | 4 +-
 shared.c | 14 ++++----
 ui-blob.c | 10 +++---
 ui-commit.c | 4 +-
 ui-refs.c | 4 +-
 ui-repolist.c | 6 ++--
 ui-shared.c | 18 ++++++------
 ui-stats.c | 8 ++--
 ui-tag.c | 2 
 ui-tree.c | 4 +-


diff --git a/cache.c b/cache.c
index d7a8d5a913c72930a6c208246f7a8fea3300fe02..6427b69b8e06edc392aef83d6eecb15f6d9a725a 100644
--- a/cache.c
+++ b/cache.c
@@ -105,7 +105,7 @@ {
 	if (slot->ttl < 0)
 		return 0;
 	else
-		return slot->cache_st.st_mtime + slot->ttl*60 < time(NULL);
+		return slot->cache_st.st_mtime + slot->ttl * 60 < time(NULL);
 }
 
 /* Check if the slot has been modified since we opened it.
@@ -141,8 +141,8 @@  * Returns 0 on success and errno otherwise.
  */
 static int lock_slot(struct cache_slot *slot)
 {
-	slot->lock_fd = open(slot->lock_name, O_RDWR|O_CREAT|O_EXCL,
-			     S_IRUSR|S_IWUSR);
+	slot->lock_fd = open(slot->lock_name, O_RDWR | O_CREAT | O_EXCL,
+			     S_IRUSR | S_IWUSR);
 	if (slot->lock_fd == -1)
 		return errno;
 	if (xwrite(slot->lock_fd, slot->key, slot->keylen + 1) < 0)




diff --git a/cgit.c b/cgit.c
index d6153154211ef03883ab0166aa61cf1327dba309..080725848d764af19363d2b922f4b949d8524a2f 100644
--- a/cgit.c
+++ b/cgit.c
@@ -741,7 +741,7 @@ 	int scan = 0;
 
 	for (i = 1; i < argc; i++) {
 		if (!strncmp(argv[i], "--cache=", 8)) {
-			ctx.cfg.cache_root = xstrdup(argv[i]+8);
+			ctx.cfg.cache_root = xstrdup(argv[i] + 8);
 		}
 		if (!strcmp(argv[i], "--nocache")) {
 			ctx.cfg.nocache = 1;
@@ -750,24 +750,24 @@ 		if (!strcmp(argv[i], "--nohttp")) {
 			ctx.env.no_http = "1";
 		}
 		if (!strncmp(argv[i], "--query=", 8)) {
-			ctx.qry.raw = xstrdup(argv[i]+8);
+			ctx.qry.raw = xstrdup(argv[i] + 8);
 		}
 		if (!strncmp(argv[i], "--repo=", 7)) {
-			ctx.qry.repo = xstrdup(argv[i]+7);
+			ctx.qry.repo = xstrdup(argv[i] + 7);
 		}
 		if (!strncmp(argv[i], "--page=", 7)) {
-			ctx.qry.page = xstrdup(argv[i]+7);
+			ctx.qry.page = xstrdup(argv[i] + 7);
 		}
 		if (!strncmp(argv[i], "--head=", 7)) {
-			ctx.qry.head = xstrdup(argv[i]+7);
+			ctx.qry.head = xstrdup(argv[i] + 7);
 			ctx.qry.has_symref = 1;
 		}
 		if (!strncmp(argv[i], "--sha1=", 7)) {
-			ctx.qry.sha1 = xstrdup(argv[i]+7);
+			ctx.qry.sha1 = xstrdup(argv[i] + 7);
 			ctx.qry.has_sha1 = 1;
 		}
 		if (!strncmp(argv[i], "--ofs=", 6)) {
-			ctx.qry.ofs = atoi(argv[i]+6);
+			ctx.qry.ofs = atoi(argv[i] + 6);
 		}
 		if (!strncmp(argv[i], "--scan-tree=", 12) ||
 		    !strncmp(argv[i], "--scan-path=", 12)) {
@@ -834,7 +834,7 @@ 	if (!ctx.cfg.virtual_root && ctx.cfg.script_name) {
 		ctx.cfg.virtual_root = trim_end(ctx.cfg.script_name, '/');
 		if (!ctx.cfg.virtual_root)
 			ctx.cfg.virtual_root = "";
-        }
+	}
 
 	/* If no url parameter is specified on the querystring, lets
 	 * use PATH_INFO as url. This allows cgit to work with virtual
@@ -856,7 +856,7 @@ 		cgit_parse_url(ctx.qry.url);
 	}
 
 	ttl = calc_ttl();
-	ctx.page.expires += ttl*60;
+	ctx.page.expires += ttl * 60;
 	if (ctx.env.request_method && !strcmp(ctx.env.request_method, "HEAD"))
 		ctx.cfg.nocache = 1;
 	if (ctx.cfg.nocache)




diff --git a/configfile.c b/configfile.c
index 4908058ce994d546b3280d1f0c300686a8b55fd7..fe5f9c56df603f88f96816e8e4f128e7aedfd884 100644
--- a/configfile.c
+++ b/configfile.c
@@ -13,9 +13,9 @@
 int next_char(FILE *f)
 {
 	int c = fgetc(f);
-	if (c=='\r') {
+	if (c == '\r') {
 		c = fgetc(f);
-		if (c!='\n') {
+		if (c != '\n') {
 			ungetc(c, f);
 			c = '\r';
 		}
@@ -27,7 +27,7 @@ void skip_line(FILE *f)
 {
 	int c;
 
-	while((c=next_char(f)) && c!='\n' && c!=EOF)
+	while((c = next_char(f)) && c != '\n' && c != EOF)
 		;
 }
 
@@ -36,31 +36,31 @@ {
 	int i = 0, isname = 0;
 
 	*value = NULL;
-	while(i<bufsize-1) {
+	while(i < bufsize - 1) {
 		int c = next_char(f);
-		if (!isname && (c=='#' || c==';')) {
+		if (!isname && (c == '#' || c == ';')) {
 			skip_line(f);
 			continue;
 		}
 		if (!isname && isspace(c))
 			continue;
 
-		if (c=='=' && !*value) {
+		if (c == '=' && !*value) {
 			line[i] = 0;
-			*value = &line[i+1];
-		} else if (c=='\n' && !isname) {
+			*value = &line[i + 1];
+		} else if (c == '\n' && !isname) {
 			i = 0;
 			continue;
-		} else if (c=='\n' || c==EOF) {
+		} else if (c == '\n' || c == EOF) {
 			line[i] = 0;
 			break;
 		} else {
-			line[i]=c;
+			line[i] = c;
 		}
 		isname = 1;
 		i++;
 	}
-	line[i+1] = 0;
+	line[i + 1] = 0;
 	return i;
 }
 




diff --git a/html.c b/html.c
index 8f6e4f6e0358fa7e6a4cc1bc3ae5e5cdfe8ddbae..ed6cefcfea307f10e2fb72fe00b12f1e42b09c30 100644
--- a/html.c
+++ b/html.c
@@ -54,7 +54,7 @@
 	va_start(args, format);
 	len = vsnprintf(buf[bufidx], sizeof(buf[bufidx]), format, args);
 	va_end(args);
-	if (len>sizeof(buf[bufidx])) {
+	if (len > sizeof(buf[bufidx])) {
 		fprintf(stderr, "[html.c] string truncated: %s\n", format);
 		exit(1);
 	}
@@ -94,19 +94,19 @@ {
 	const char *t = txt;
 	while(t && *t){
 		int c = *t;
-		if (c=='<' || c=='>' || c=='&') {
+		if (c == '<' || c == '>' || c == '&') {
 			html_raw(txt, t - txt);
-			if (c=='>')
+			if (c == '>')
 				html("&gt;");
-			else if (c=='<')
+			else if (c == '<')
 				html("&lt;");
-			else if (c=='&')
+			else if (c == '&')
 				html("&amp;");
-			txt = t+1;
+			txt = t + 1;
 		}
 		t++;
 	}
-	if (t!=txt)
+	if (t != txt)
 		html(txt);
 }
 
@@ -115,21 +115,21 @@ {
 	const char *t = txt;
 	while(t && *t && len--){
 		int c = *t;
-		if (c=='<' || c=='>' || c=='&') {
+		if (c == '<' || c == '>' || c == '&') {
 			html_raw(txt, t - txt);
-			if (c=='>')
+			if (c == '>')
 				html("&gt;");
-			else if (c=='<')
+			else if (c == '<')
 				html("&lt;");
-			else if (c=='&')
+			else if (c == '&')
 				html("&amp;");
-			txt = t+1;
+			txt = t + 1;
 		}
 		t++;
 	}
-	if (t!=txt)
+	if (t != txt)
 		html_raw(txt, t - txt);
-	if (len<0)
+	if (len < 0)
 		html("...");
 }
 
@@ -138,23 +138,23 @@ {
 	const char *t = txt;
 	while(t && *t){
 		int c = *t;
-		if (c=='<' || c=='>' || c=='\'' || c=='\"' || c=='&') {
+		if (c == '<' || c == '>' || c == '\'' || c == '\"' || c == '&') {
 			html_raw(txt, t - txt);
-			if (c=='>')
+			if (c == '>')
 				html("&gt;");
-			else if (c=='<')
+			else if (c == '<')
 				html("&lt;");
-			else if (c=='\'')
+			else if (c == '\'')
 				html("&#x27;");
-			else if (c=='"')
+			else if (c == '"')
 				html("&quot;");
-			else if (c=='&')
+			else if (c == '&')
 				html("&amp;");
-			txt = t+1;
+			txt = t + 1;
 		}
 		t++;
 	}
-	if (t!=txt)
+	if (t != txt)
 		html(txt);
 }
 
@@ -164,14 +164,14 @@ 	const char *t = txt;
 	while(t && *t){
 		unsigned char c = *t;
 		const char *e = url_escape_table[c];
-		if (e && c!='+' && c!='&') {
+		if (e && c != '+' && c != '&') {
 			html_raw(txt, t - txt);
 			html(e);
-			txt = t+1;
+			txt = t + 1;
 		}
 		t++;
 	}
-	if (t!=txt)
+	if (t != txt)
 		html(txt);
 }
 
@@ -186,11 +186,11 @@ 			e = "+";
 		if (e) {
 			html_raw(txt, t - txt);
 			html(e);
-			txt = t+1;
+			txt = t + 1;
 		}
 		t++;
 	}
-	if (t!=txt)
+	if (t != txt)
 		html(txt);
 }
 
@@ -286,14 +286,14 @@ 	if (n < 3) {
 		*txt = '\0';
 		return txt-1;
 	}
-	d1 = hextoint(*(txt+1));
-	d2 = hextoint(*(txt+2));
-	if (d1<0 || d2<0) {
-		memmove(txt, txt+3, n-2);
+	d1 = hextoint(*(txt + 1));
+	d2 = hextoint(*(txt + 2));
+	if (d1 < 0 || d2 < 0) {
+		memmove(txt, txt + 3, n - 2);
 		return txt-1;
 	} else {
 		*txt = d1 * 16 + d2;
-		memmove(txt+1, txt+3, n-2);
+		memmove(txt + 1, txt + 3, n - 2);
 		return txt;
 	}
 }
@@ -311,22 +311,22 @@ 		printf("Out of memory\n");
 		exit(1);
 	}
 	while((c=*t) != '\0') {
-		if (c=='=') {
+		if (c == '=') {
 			*t = '\0';
-			value = t+1;
-		} else if (c=='+') {
+			value = t + 1;
+		} else if (c == '+') {
 			*t = ' ';
-		} else if (c=='%') {
+		} else if (c == '%') {
 			t = convert_query_hexchar(t);
-		} else if (c=='&') {
+		} else if (c == '&') {
 			*t = '\0';
 			(*fn)(txt, value);
-			txt = t+1;
+			txt = t + 1;
 			value = NULL;
 		}
 		t++;
 	}
-	if (t!=txt)
+	if (t != txt)
 		(*fn)(txt, value);
 	free(o);
 	return 0;




diff --git a/scan-tree.c b/scan-tree.c
index 6ce80365c5443af1eb954dc336381f0b6afce98f..98a99c91d99e94a2fe0407329e4ec91f102417d3 100644
--- a/scan-tree.c
+++ b/scan-tree.c
@@ -106,7 +106,7 @@ 	repo = cgit_add_repo(rel);
 	config_fn = fn;
 	if (ctx.cfg.enable_git_config)
 		git_config_from_file(gitconfig_config, fmt("%s/config", path), NULL);
-	
+
 	if (ctx.cfg.remove_suffix)
 		if ((p = strrchr(repo->url, '.')) && !strcmp(p, ".git"))
 			*p = '\0';
@@ -222,7 +222,7 @@ {
 	char line[MAX_PATH * 2], *z;
 	FILE *projects;
 	int err;
-	
+
 	projects = fopen(projectsfile, "r");
 	if (!projects) {
 		fprintf(stderr, "Error opening projectsfile %s: %s (%d)\n",




diff --git a/shared.c b/shared.c
index 0967f922de18c8b132d40577b89ae16c0722546c..01800b6a2ed6291efccf2a2e577d63a1829955e4 100644
--- a/shared.c
+++ b/shared.c
@@ -28,8 +28,8 @@ }
 
 int chk_non_negative(int result, char *msg)
 {
-    	if (result < 0)
-	    	die("%s: %s",msg, strerror(errno));
+	if (result < 0)
+		die("%s: %s", msg, strerror(errno));
 	return result;
 }
 
@@ -80,7 +80,7 @@ {
 	int i;
 	struct cgit_repo *repo;
 
-	for (i=0; i<cgit_repolist.count; i++) {
+	for (i = 0; i < cgit_repolist.count; i++) {
 		repo = &cgit_repolist.repos[i];
 		if (!strcmp(repo->url, url))
 			return repo;
@@ -207,7 +207,7 @@ 	if (is_null_sha1(sha1)) {
 		file->ptr = (char *)"";
 		file->size = 0;
 	} else {
-		file->ptr = read_sha1_file(sha1, &type, 
+		file->ptr = read_sha1_file(sha1, &type,
 		                           (unsigned long *)&file->size);
 	}
 	return 1;
@@ -354,14 +354,14 @@ 	/* favor legacy setting */
 	if(atoi(str))
 		return 1;
 	for(;;) {
-		str += strspn(str,delim);
-		tl = strcspn(str,delim);
+		str += strspn(str, delim);
+		tl = strcspn(str, delim);
 		if (!tl)
 			break;
 		for (f = cgit_snapshot_formats; f->suffix; f++) {
 			sl = strlen(f->suffix);
 			if((tl == sl && !strncmp(f->suffix, str, tl)) ||
-			   (tl == sl-1 && !strncmp(f->suffix+1, str, tl-1))) {
+			   (tl == sl - 1 && !strncmp(f->suffix + 1, str, tl - 1))) {
 				rv |= f->bit;
 				break;
 			}




diff --git a/ui-blob.c b/ui-blob.c
index 3de447362f094a1f17e57383d522248a6ada2122..6d529f1d2b2c88432008cdf920d7f20874a3e09d 100644
--- a/ui-blob.c
+++ b/ui-blob.c
@@ -15,12 +15,12 @@ static char *match_path;
 static unsigned char *matched_sha1;
 static int found_path;
 
-static int walk_tree(const unsigned char *sha1, const char *base,int baselen,
+static int walk_tree(const unsigned char *sha1, const char *base, int baselen,
 	const char *pathname, unsigned mode, int stage, void *cbdata) {
-	if(strncmp(base,match_path,baselen)
-		|| strcmp(match_path+baselen,pathname) )
+	if(strncmp(base, match_path, baselen)
+		|| strcmp(match_path + baselen, pathname))
 		return READ_TREE_RECURSIVE;
-	memmove(matched_sha1,sha1,20);
+	memmove(matched_sha1, sha1, 20);
 	found_path = 1;
 	return 0;
 }
@@ -85,7 +85,7 @@ 			cgit_print_error(fmt("Bad hex value: %s", hex));
 			return;
 		}
 	} else {
-		if (get_sha1(head,sha1)) {
+		if (get_sha1(head, sha1)) {
 			cgit_print_error(fmt("Bad ref: %s", head));
 			return;
 		}




diff --git a/ui-commit.c b/ui-commit.c
index 536a8e82d5486be05e98f59079ba1c7bfe536d75..74f37c8a0ff4222c13e410635fc0fac3d0ba9049 100644
--- a/ui-commit.c
+++ b/ui-commit.c
@@ -39,7 +39,7 @@
 	format_note(NULL, sha1, &notes, PAGE_ENCODING, 0);
 
 	load_ref_decorations(DECORATE_FULL_REFS);
-	
+
 	cgit_print_diff_ctrls();
 	html("<table summary='commit info' class='commit-info'>\n");
 	html("<tr><th>author</th><td>");
@@ -75,7 +75,7 @@ 		html(" /");
 		cgit_tree_link(prefix, NULL, NULL, ctx.qry.head, tmp, prefix);
 	}
 	html("</td></tr>\n");
-      	for (p = commit->parents; p ; p = p->next) {
+	for (p = commit->parents; p; p = p->next) {
 		parent = lookup_commit_reference(p->item->object.sha1);
 		if (!parent) {
 			html("<tr><td colspan='3'>");




diff --git a/ui-refs.c b/ui-refs.c
index caddfbc4fbdb3949b6c2424e21baa528e220ce7f..3827252f8120a8ceddd6877198e77d3aa8866876 100644
--- a/ui-refs.c
+++ b/ui-refs.c
@@ -200,7 +200,7 @@ 		qsort(list.refs, list.count, sizeof(*list.refs), cmp_branch_age);
 		qsort(list.refs, maxcount, sizeof(*list.refs), cmp_ref_name);
 	}
 
-	for(i=0; i<maxcount; i++)
+	for(i = 0; i < maxcount; i++)
 		print_branch(list.refs[i]);
 
 	if (maxcount < list.count)
@@ -224,7 +224,7 @@ 		maxcount = list.count;
 	else if (maxcount > list.count)
 		maxcount = list.count;
 	print_tag_header();
-	for(i=0; i<maxcount; i++)
+	for(i = 0; i < maxcount; i++)
 		print_tag(list.refs[i]);
 
 	if (maxcount < list.count)




diff --git a/ui-repolist.c b/ui-repolist.c
index 2a910bdc9f0d8ea35db73fec7a38fd6774d5df71..449478da2a38ce1d71e12cdfe43a5dbe6440dfea 100644
--- a/ui-repolist.c
+++ b/ui-repolist.c
@@ -131,8 +131,8 @@ 	char *class = NULL;
 	html("<div class='pager'>");
 	for(i = 0, ofs = 0; ofs < items; i++, ofs = i * pagelen) {
 		class = (ctx.qry.ofs == ofs) ? "current" : NULL;
-		cgit_index_link(fmt("[%d]", i+1), fmt("Page %d", i+1), class,
-				search, sort, ofs);
+		cgit_index_link(fmt("[%d]", i + 1), fmt("Page %d", i + 1),
+				class, search, sort, ofs);
 	}
 	html("</div>");
 }
@@ -264,7 +264,7 @@ 	else if (ctx.cfg.section_sort)
 		sort_repolist("section");
 
 	html("<table summary='repository list' class='list nowrap'>");
-	for (i=0; i<cgit_repolist.count; i++) {
+	for (i = 0; i < cgit_repolist.count; i++) {
 		ctx.repo = &cgit_repolist.repos[i];
 		if (!(is_match(ctx.repo) && is_in_url(ctx.repo)))
 			continue;




diff --git a/ui-shared.c b/ui-shared.c
index c4fb437e910bfca267019a057acf4ae9c2c9696b..1a28dce668ca67b30fb222ccb73e0f8e422eea0c 100644
--- a/ui-shared.c
+++ b/ui-shared.c
@@ -23,7 +23,7 @@ 		{"Jan", "Feb", "Mar", "Apr", "May", "Jun",
 		 "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"};
 	struct tm *tm = gmtime(&t);
 	return fmt("%s, %02d %s %04d %02d:%02d:%02d GMT", day[tm->tm_wday],
-		   tm->tm_mday, month[tm->tm_mon], 1900+tm->tm_year,
+		   tm->tm_mday, month[tm->tm_mon], 1900 + tm->tm_year,
 		   tm->tm_hour, tm->tm_min, tm->tm_sec);
 }
 
@@ -93,7 +93,7 @@
 char *cgit_pageurl(const char *reponame, const char *pagename,
 		   const char *query)
 {
-	return cgit_fileurl(reponame,pagename,0,query);
+	return cgit_fileurl(reponame, pagename, 0, query);
 }
 
 const char *cgit_repobasename(const char *reponame)
@@ -102,18 +102,18 @@ 	/* I assume we don't need to store more than one repo basename */
 	static char rvbuf[1024];
 	int p;
 	const char *rv;
-	strncpy(rvbuf,reponame,sizeof(rvbuf));
+	strncpy(rvbuf, reponame, sizeof(rvbuf));
 	if(rvbuf[sizeof(rvbuf)-1])
 		die("cgit_repobasename: truncated repository name '%s'", reponame);
 	p = strlen(rvbuf)-1;
 	/* strip trailing slashes */
-	while(p && rvbuf[p]=='/') rvbuf[p--]=0;
+	while(p && rvbuf[p] == '/') rvbuf[p--] = 0;
 	/* strip trailing .git */
-	if(p>=3 && !strncmp(&rvbuf[p-3],".git",4)) {
+	if(p >= 3 && !strncmp(&rvbuf[p-3], ".git", 4)) {
 		p -= 3; rvbuf[p--] = 0;
 	}
 	/* strip more trailing slashes if any */
-	while( p && rvbuf[p]=='/') rvbuf[p--]=0;
+	while( p && rvbuf[p] == '/') rvbuf[p--] = 0;
 	/* find last slash in the remaining string */
 	rv = strrchr(rvbuf,'/');
 	if(rv)
@@ -499,7 +499,7 @@ 	fullrev = sha1_to_hex(obj->sha1);
 	shortrev = xstrdup(fullrev);
 	shortrev[10] = '\0';
 	if (obj->type == OBJ_COMMIT) {
-                cgit_commit_link(fmt("commit %s...", shortrev), NULL, NULL,
+		cgit_commit_link(fmt("commit %s...", shortrev), NULL, NULL,
 				 ctx.qry.head, fullrev, NULL, 0);
 		return;
 	} else if (obj->type == OBJ_TREE)
@@ -736,7 +736,7 @@ 	int *header = (int *)cb_data;
 
 	if (prefixcmp(refname, "refs/archives"))
 		return 0;
-	strncpy(buf, refname+14, sizeof(buf));
+	strncpy(buf, refname + 14, sizeof(buf));
 	obj = parse_object(sha1);
 	if (!obj)
 		return 1;
@@ -968,7 +968,7 @@ 			       const char *hex, int snapshots)
 {
 	const struct cgit_snapshot_format* f;
 	char *prefix;
-    	char *filename;
+	char *filename;
 	unsigned char sha1[20];
 
 	if (get_sha1(fmt("refs/tags/%s", hex), sha1) == 0 &&




diff --git a/ui-stats.c b/ui-stats.c
index 51dd6a2e0d115039a93b57c7e997fcd2c3bac3dd..f74dc3337bb1cc47df376561dc97848bf93c7f7b 100644
--- a/ui-stats.c
+++ b/ui-stats.c
@@ -23,21 +23,21 @@ static void trunc_week(struct tm *tm)
 {
 	time_t t = timegm(tm);
 	t -= ((tm->tm_wday + 6) % 7) * DAY_SECS;
-	gmtime_r(&t, tm);	
+	gmtime_r(&t, tm);
 }
 
 static void dec_week(struct tm *tm)
 {
 	time_t t = timegm(tm);
 	t -= WEEK_SECS;
-	gmtime_r(&t, tm);	
+	gmtime_r(&t, tm);
 }
 
 static void inc_week(struct tm *tm)
 {
 	time_t t = timegm(tm);
 	t += WEEK_SECS;
-	gmtime_r(&t, tm);	
+	gmtime_r(&t, tm);
 }
 
 static char *pretty_week(struct tm *tm)
@@ -153,7 +153,7 @@ 	for (i = 0; i < sizeof(periods) / sizeof(periods[0]); i++)
 		if (periods[i].code == code || !strcmp(periods[i].name, expr)) {
 			if (period)
 				*period = &periods[i];
-			return i+1;
+			return i + 1;
 		}
 	return 0;
 }




diff --git a/ui-tag.c b/ui-tag.c
index 39e4cb82c5f66c6524962fe4be794cd5bab71782..cab96b1b988b19498f7dbb21e84d3f6d416ec7a7 100644
--- a/ui-tag.c
+++ b/ui-tag.c
@@ -99,6 +99,6 @@ 		html("\n");
 		if (ctx.repo->snapshots)
 			print_download_links(revname);
 		html("</table>\n");
-        }
+	}
 	return;
 }




diff --git a/ui-tree.c b/ui-tree.c
index b544440f4b65237ab515d9d6eaa3698a194f11cf..4d7b2617ed0c8ae924a860acd4ec4164b10d73d2 100644
--- a/ui-tree.c
+++ b/ui-tree.c
@@ -27,7 +27,7 @@ 	if (ctx.cfg.enable_tree_linenumbers) {
 		html("<tr><td class='linenumbers'><pre>");
 		idx = 0;
 		lineno = 0;
-	
+
 		if (size) {
 			htmlf(numberfmt, ++lineno);
 			while(idx < size - 1) { // skip absolute last newline
@@ -228,7 +228,7 @@ 	static char buffer[PATH_MAX];
 
 	if (state == 0) {
 		memcpy(buffer, base, baselen);
-		strcpy(buffer+baselen, pathname);
+		strcpy(buffer + baselen, pathname);
 		if (strcmp(match_path, buffer))
 			return READ_TREE_RECURSIVE;