chiark / gitweb /
Line breaking.
[chiark-utils.git] / scripts / named-conf
index a6d7df8ca2fbcdbeaa056da584715ff917f33fb1..694ab940adff6fdf84f0fa975127a2dd8d2beec5 100755 (executable)
@@ -117,13 +117,17 @@ sub read_config ($) {
     local ($_);
 
     $fh= new IO::File $if,'r' or cfg_fail("open $if:\n $!");
+    $before= '';
     for (;;) {
        if (!defined($_= <$fh>)) {
            cfg_fail("read config file $if:\n $!") if $fh->error();
            last;
        }
-       $where= "$if:$.";
        s/^\s+//; chomp; s/\s+$//;
+       if (m/\\$/) { $before.= $_; next; }
+       $_= $before.$_;
+       $before= '';
+       $where= "$if:$.";
        next if m/^\#/;
        last if m/^end$/;
        next unless m/\S/;