From 53a8cbbec1a6c9c644b35da86bc26a33ff1279e0 Mon Sep 17 00:00:00 2001 From: Even Rouault Date: Sat, 19 Jan 2019 17:49:05 +0100 Subject: Add support for spaces in grid name parameters (fixes #1152) --- src/init.cpp | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) (limited to 'src/init.cpp') diff --git a/src/init.cpp b/src/init.cpp index 8af3d26c..482e398d 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -48,27 +48,19 @@ static paralist *string_to_paralist (PJ_CONTEXT *ctx, char *definition) { /*************************************************************************************** Convert a string (presumably originating from get_init_string) to a paralist. ***************************************************************************************/ - char *c = definition; + const char *c = definition; paralist *first = nullptr, *next = nullptr; while (*c) { - /* Find start of next substring */ - while (isspace (*c)) - c++; - /* Keep a handle to the start of the list, so we have something to return */ if (nullptr==first) - first = next = pj_mkparam_ws (c); + first = next = pj_mkparam_ws (c, &c); else - next = next->next = pj_mkparam_ws (c); + next = next->next = pj_mkparam_ws (c, &c); if (nullptr==next) { pj_dealloc_params (ctx, first, ENOMEM); return nullptr; } - - /* And skip to the end of the substring */ - while ((!isspace(*c)) && 0!=*c) - c++; } if( next == nullptr ) -- cgit v1.2.3