diff options
| author | Even Rouault <even.rouault@spatialys.com> | 2021-01-05 16:49:21 +0100 |
|---|---|---|
| committer | Even Rouault <even.rouault@spatialys.com> | 2021-01-05 16:49:56 +0100 |
| commit | 93d8fccd51a704c4accd535743a963ad0ca5a274 (patch) | |
| tree | 5b4868ad6804afdc8f7a616c04c096bbf61bd0f3 /src | |
| parent | 367771f4bae20698c0740c7dd469a5b10bc28673 (diff) | |
| download | PROJ-93d8fccd51a704c4accd535743a963ad0ca5a274.tar.gz PROJ-93d8fccd51a704c4accd535743a963ad0ca5a274.zip | |
createFromUserInput(): accept leading white space (fixes #2498)
Diffstat (limited to 'src')
| -rw-r--r-- | src/iso19111/io.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/iso19111/io.cpp b/src/iso19111/io.cpp index dc51c5d9..c0844608 100644 --- a/src/iso19111/io.cpp +++ b/src/iso19111/io.cpp @@ -6132,6 +6132,12 @@ static BaseObjectNNPtr createFromUserInput(const std::string &text, const DatabaseContextPtr &dbContext, bool usePROJ4InitRules, PJ_CONTEXT *ctx) { + std::size_t idxFirstCharNotSpace = text.find_first_not_of(" \t\r\n"); + if (idxFirstCharNotSpace > 0 && idxFirstCharNotSpace != std::string::npos) { + return createFromUserInput(text.substr(idxFirstCharNotSpace), dbContext, + usePROJ4InitRules, ctx); + } + if (!text.empty() && text[0] == '{') { json j; try { |
