mirror of
https://github.com/felt/tippecanoe.git
synced 2026-10-02 16:35:40 +02:00
Accept 0 as a feature ID in --use-attribute-for-id
strip_zeroes() removed every leading zero, so "0" became "" and never matched std::to_string(0). The ID was rejected as too large and the feature was left without an ID. Keep the final digit. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0172RxhnHkNgRZ3NBrsRJZYK
This commit is contained in:
+2
-1
@@ -382,7 +382,8 @@ static std::string strip_zeroes(std::string s) {
|
||||
// Doesn't do anything special with '-' followed by leading zeros
|
||||
// since integer IDs must be positive
|
||||
|
||||
while (s.size() > 0 && s[0] == '0') {
|
||||
// Keep the final digit so that an ID of 0 compares equal to "0"
|
||||
while (s.size() > 1 && s[0] == '0') {
|
||||
s.erase(s.begin());
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user