All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] parse/ConfHandler: Fix multiline variable corruption
@ 2011-07-20 21:51 Richard Purdie
  0 siblings, 0 replies; only message in thread
From: Richard Purdie @ 2011-07-20 21:51 UTC (permalink / raw)
  To: bitbake-devel

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@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)




^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2011-07-20 21:55 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-07-20 21:51 [PATCH] parse/ConfHandler: Fix multiline variable corruption Richard Purdie

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.