about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorJosh Rickmar <jrick@devio.us>2012-10-30 08:58:15 -0400
committerJosh Rickmar <jrick@devio.us>2012-10-30 08:58:15 -0400
commitf43a052dee51a3269372782bb53b8fa3dadd7e95 (patch)
treeb09c6b9331b7112823d3588c25a12ee05bfe958e
parentac55cba61be84b022860c25ff937d5dda9013150 (diff)
downloadxombrero-f43a052dee51a3269372782bb53b8fa3dadd7e95.tar.gz
Kill whitespace in aliases. Fixes FS240.
This prevents displaying any extra whitespace between the comma and
the url in the alias definition from being displayed in the statusbar.

Found by Cody Write (writecode on Flyspray)
-rw-r--r--settings.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/settings.c b/settings.c
index 5ad06f3..3c69c3c 100644
--- a/settings.c
+++ b/settings.c
@@ -1299,6 +1299,10 @@ add_alias(struct settings *s, char *line)
 		show_oops(NULL, "add_alias: incomplete alias definition");
 		goto bad;
 	}
+
+	/* Remove additional leading whitespace */
+	l += (long)strspn(l, " \t");
+
 	if (strlen(alias) == 0 || strlen(l) == 0) {
 		show_oops(NULL, "add_alias: invalid alias definition");
 		goto bad;