chiark / gitweb /
make-secnet-sites: Do newline-trimming in pline()
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Tue, 10 Jul 2012 23:56:50 +0000 (00:56 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Thu, 12 Jul 2012 18:54:26 +0000 (19:54 +0100)
This will make life a little easier in a future patch.  While we're at
it, use rstrip rather than open-coding it.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
make-secnet-sites

index dc6ec78dd5ac5bcbb446e79ddecbbf5ef9d05d53..0c19a78c35815ee11519e98bd6e7131a1b8bcfa3 100755 (executable)
@@ -333,7 +333,7 @@ def set_property(obj,w):
 def pline(i,allow_include=False):
        "Process a configuration file line"
        global allow_defs, obstack, root
-       w=string.split(i)
+       w=string.split(i.rstrip('\n'))
        if len(w)==0: return
        keyword=w[0]
        current=obstack[len(obstack)-1]
@@ -407,7 +407,6 @@ def pfile(name,lines,allow_include=False):
        for i in lines:
                line=line+1
                if (i[0]=='#'): continue
-               if (i[len(i)-1]=='\n'): i=i[:len(i)-1] # strip trailing LF
                pline(i,allow_include=allow_include)
 
 def outputsites(w):