[bitbake-devel] [PATCH] parse/ConfHandler: Fix multiline variable corruption

Richard Purdie richard.purdie at linuxfoundation.org
Wed Jul 20 21:51:23 UTC 2011


When parsing multiline variables in conf files, the last character can
be accidentally removed. s2 contains new data read from the file which
may or may not end with the continuation character. It makes sense to
let the next loop iteration strip this if needed.

We don't often use multiline expressions in .conf files which is why I'd
imagine we haven't noticed this before. Most variables are quoted and
its the closing quotation which often disappears.

Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>

--- a/lib/bb/parse/parse_py/ConfHandler.py	
+++ a/lib/bb/parse/parse_py/ConfHandler.py	
@@ -96,7 +96,7 @@ def handle(fn, data, include):
         s = s.rstrip()
         if s[0] == '#': continue    # skip comments
         while s[-1] == '\\':
-            s2 = f.readline()[:-1].strip()
+            s2 = f.readline().strip()
             lineno = lineno + 1
             s = s[:-1] + s2
         feeder(lineno, s, fn, statements)





More information about the bitbake-devel mailing list