From 32f32e45b6a851f309167db4184e03e5d3f863d1 Mon Sep 17 00:00:00 2001
From: Eric Fischer <enf@pobox.com>
Date: Wed, 21 Sep 2016 12:32:03 -0700
Subject: [PATCH] Trim whitespace after commas in tile-join .csv input

---
 CHANGELOG.md                         | 4 ++++
 tests/join-population/population.csv | 6 +++---
 tile-join.cpp                        | 4 ++++
 version.hpp                          | 2 +-
 4 files changed, 12 insertions(+), 4 deletions(-)

diff --git a/CHANGELOG.md b/CHANGELOG.md
index 3a41ca4..bbdfc7f 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,3 +1,7 @@
+## 1.14.1
+
+* Whitespace after commas in tile-join .csv input is no longer significant
+
 ## 1.14.0
 
 * Tile-join is multithreaded and can merge multiple vector mbtiles files together
diff --git a/tests/join-population/population.csv b/tests/join-population/population.csv
index 38870f3..993b68b 100644
--- a/tests/join-population/population.csv
+++ b/tests/join-population/population.csv
@@ -1,7 +1,7 @@
-GEOID10,population
+GEOID10, population
 "060014201001000",16
-"060014201001001",21
-"060014201001002",31
+"060014201001001",  21
+"060014201001002", 31
 "060014201001004",9
 "060014201001007",87
 "060014201001008",37
diff --git a/tile-join.cpp b/tile-join.cpp
index ab4a300..29bd001 100644
--- a/tile-join.cpp
+++ b/tile-join.cpp
@@ -566,6 +566,10 @@ std::vector<std::string> split(char *s) {
 
 		if (*s == ',') {
 			s++;
+
+			while (*s && isspace(*s)) {
+				s++;
+			}
 		}
 	}
 
diff --git a/version.hpp b/version.hpp
index cea7591..99bed7e 100644
--- a/version.hpp
+++ b/version.hpp
@@ -1 +1 @@
-#define VERSION "tippecanoe v1.14.0\n"
+#define VERSION "tippecanoe v1.14.1\n"