~chtsanti/squid/icap-max-connections

« back to all changes in this revision

Viewing changes to src/cache_cf.cc

  • Committer: Christos Tsantilas
  • Date: 2008-12-03 21:09:22 UTC
  • Revision ID: chtsanti@users.sourceforge.net-20081203210922-8jm4kszkeyf112ol
Add the ConfigParser::ParseOption(String *opt, String *val) method which 
parses a string in the form option=value.

Show diffs side-by-side

added added

removed removed

Lines of Context:
2426
2426
    var->reset(token);
2427
2427
}
2428
2428
 
 
2429
bool
 
2430
ConfigParser::ParseOption(String *opt, String *val)
 
2431
{
 
2432
    char *e;
 
2433
    char *token = strtok(NULL, w_space);
 
2434
    if (token == NULL)
 
2435
        return false;
 
2436
    if((e = strchr(token,'=')) != NULL) {
 
2437
        *e='\0';
 
2438
        e++;
 
2439
        val->reset(e);
 
2440
    }
 
2441
    else
 
2442
        val->clean();
 
2443
    opt->reset(token);
 
2444
    return true;
 
2445
}
 
2446
 
2429
2447
static void
2430
2448
free_string(char **var)
2431
2449
{