Changeset 989
- Timestamp:
- 03/25/07 14:19:15 (6 years ago)
- Files:
-
- 1 modified
-
trunk/pdns/pdns/zoneparser-tng.cc (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/pdns/pdns/zoneparser-tng.cc
r979 r989 163 163 } 164 164 165 void chopComment(string& line) 166 { 167 string::size_type pos, len = line.length(); 168 bool inQuote=false; 169 for(pos = 0 ; pos < len; ++pos) { 170 if(line[pos]=='\\') 171 pos++; 172 else if(line[pos]=='"') 173 inQuote=!inQuote; 174 else if(line[pos]==';' && !inQuote) 175 break; 176 } 177 if(pos != len) 178 line.resize(pos); 179 } 180 165 181 bool ZoneParserTNG::get(DNSResourceRecord& rr) 166 182 { … … 274 290 rr.content=d_line.substr(range.first); 275 291 276 string::size_type pos=rr.content.rfind(';'); 277 if(pos!=string::npos) 278 rr.content.resize(pos); 292 chopComment(rr.content); 293 string::size_type pos; 279 294 280 295 if(rr.qtype.getCode()!=QType::TXT && (pos=rr.content.find('('))!=string::npos) { … … 283 298 while(getLine()) { 284 299 chomp(d_line,"\r\n "); 285 pos=d_line.rfind(';'); 286 if(pos!=string::npos) 287 d_line.resize(pos); 300 chopComment(d_line); 288 301 289 302 trim(d_line);