src/server/config/conf.c

changeset 39
de4bc3cd2d36
parent 38
d07810b02147
child 44
3da1f7b6847f
equal deleted inserted replaced
38:d07810b02147 39:de4bc3cd2d36
227 } 227 }
228 } else if(!quote && c < 33) { 228 } else if(!quote && c < 33) {
229 break; // end of value 229 break; // end of value
230 } 230 }
231 } 231 }
232 value->length = i - name->length - 2; 232
233 i++; 233 if(quote) {
234 // if the value is quoted, i points to the last quote char
235 value->length = i - name->length - 2; // subtract the quotes
236 i++; // set i behind the last quote
237 } else {
238 // i points to a white space char, which must be subtraced
239 value->length = i - name->length - 1;
240 }
234 241
235 if(value->length <= 0) { 242 if(value->length <= 0) {
236 value->length = 0; 243 value->length = 0;
237 value->ptr = NULL; 244 value->ptr = NULL;
238 } 245 }
331 for(;;) { 338 for(;;) {
332 param_str = cfg_param(param_str, &pname, &pvalue); 339 param_str = cfg_param(param_str, &pname, &pvalue);
333 if(pname.length <= 0) { 340 if(pname.length <= 0) {
334 break; 341 break;
335 } 342 }
336
337 343
338 // create param object 344 // create param object
339 ConfigParam *param = OBJ_NEW(mp, ConfigParam); 345 ConfigParam *param = OBJ_NEW(mp, ConfigParam);
340 param->name = sstrdup_mp(mp, pname); 346 param->name = sstrdup_mp(mp, pname);
341 347

mercurial