Changeset 1237

Show
Ignore:
Timestamp:
07/20/08 20:39:38 (4 months ago)
Author:
ahu
Message:

remove use of possibly buggy 'chomp' from arguments.cc and move to trim_right(). Solves issue reported by Tyler Hall

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/pdns/pdns/arguments.cc

    r822 r1237  
    11/* 
    22    PowerDNS Versatile Database Driven Nameserver 
    3     Copyright (C) 2002 - 2006  PowerDNS.COM BV 
     3    Copyright (C) 2002 - 2008  PowerDNS.COM BV 
    44 
    55    This program is free software; you can redistribute it and/or modify 
     
    1616    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA 
    1717*/ 
    18  
    19  
    20  
    2118#include "arguments.hh" 
     19#include <boost/algorithm/string.hpp> 
     20using namespace boost; 
    2221 
    2322const ArgvMap::param_t::const_iterator ArgvMap::begin() 
     
    260259 
    261260  while(getline(f,pline)) { 
    262     chomp(pline," \t\r\n");   // strip trailing white spaces 
    263  
     261    trim_right(pline); 
     262     
    264263    if(pline[pline.size()-1]=='\\') { 
    265264      line+=pline.substr(0,pline.length()-1); 
     
    274273 
    275274    // strip trailing spaces 
    276     chomp(line," \t"); 
     275    trim_right(line); 
    277276 
    278277    // strip leading spaces 
     
    302301 
    303302  while(getline(f,pline)) { 
    304     chomp(pline," \t\r\n");   // strip trailing white spaces 
     303    trim_right(pline); 
    305304    if(pline.empty()) 
    306305      continue; 
     
    319318 
    320319    // strip trailing spaces 
    321     chomp(line," \t"); 
    322  
     320    trim_right(line); 
    323321    // strip leading spaces 
    324322    if((pos=line.find_first_not_of(" \t\r\n"))!=string::npos)