Changeset 1234

Show
Ignore:
Timestamp:
07/15/08 23:51:16 (4 months ago)
Author:
ahu
Message:

fix two more Shawn bugs: don't trip up over a line consisting of nothing but comments and leading whitespace, plus deal with "$ORIGIN ." correctly

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/pdns/pdns/misc.hh

    r1094 r1234  
    385385  string ret=domain; 
    386386  ret.append(1,'.'); 
    387   ret.append(zone); 
     387  if(!zone.empty() && zone[0]!='.') 
     388    ret.append(zone); 
    388389  return ret; 
    389390} 
  • trunk/pdns/pdns/zoneparser-tng.cc

    r1165 r1234  
    11/* 
    22    PowerDNS Versatile Database Driven Nameserver 
    3     Copyright (C) 2005 - 2007  PowerDNS.COM BV 
     3    Copyright (C) 2005 - 2008  PowerDNS.COM BV 
    44 
    55    This program is free software; you can redistribute it and/or modify 
     
    235235    goto retry; 
    236236 
     237  if(parts[0].first != parts[0].second && makeString(d_line, parts[0])[0]==';') // line consisting of nothing but comments 
     238    goto retry; 
     239 
    237240  if(d_line[0]=='$') {  
    238241    string command=makeString(d_line, parts[0]); 
     
    331334  } 
    332335  if(!haveQTYPE)  
    333     throw exception("Malformed line '"+d_line+"'"); 
     336    throw exception("Malformed line "+lexical_cast<string>(d_filestates.top().d_lineno)+" of '"+d_filestates.top().d_filename+"': "+d_line+"'"); 
    334337 
    335338  rr.content=d_line.substr(range.first); 
     
    344347    if(!findAndElide(rr.content, ')')) { 
    345348      while(getLine()) { 
    346         chomp(d_line,"\r\n "); 
     349        chomp(d_line,"\t\r\n "); 
    347350        chopComment(d_line); 
    348351        trim(d_line);