From: Date: Thu, 27 Sep 2007 22:28:41 +0000 (-0700) Subject: Adding support for spaces in configure options. X-Git-Tag: 0.3~20 X-Git-Url: https://git.m6w6.name/?a=commitdiff_plain;h=dd654699e3e087744272784a5695e24db9e4b0bc;p=awesomized%2Flibmemcached Adding support for spaces in configure options. Fixed issue with wrong pointer leading to connecting to wrong server! --- diff --git a/src/utilities.c b/src/utilities.c index eeec1688..4f5b4526 100644 --- a/src/utilities.c +++ b/src/utilities.c @@ -1,3 +1,4 @@ +#include #include void parse_opt_servers(memcached_st *memc, @@ -29,9 +30,8 @@ void parse_opt_servers(memcached_st *memc, } else { - size_t length= strlen(server_strings); + size_t length= strlen(begin_ptr); memcpy(buffer, begin_ptr, length); - string= server_strings+length; begin_ptr= end_ptr; } @@ -47,5 +47,8 @@ void parse_opt_servers(memcached_st *memc, } memcached_server_add(memc, buffer, port); + + if (isspace(*begin_ptr)) + begin_ptr++; } }