[PATCH 7/9] make-secnet-sites: Do newline-trimming in pline()

Ian Jackson ijackson at chiark.greenend.org.uk
Wed Jul 11 01:10:04 BST 2012


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 at chiark.greenend.org.uk>
---
 make-secnet-sites |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/make-secnet-sites b/make-secnet-sites
index dc6ec78..0c19a78 100755
--- a/make-secnet-sites
+++ b/make-secnet-sites
@@ -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):
-- 
1.7.2.5




More information about the sgo-software-discuss mailing list