瀏覽代碼

data.py: avoid double newlines at the end of functions in emit_var()

A newline is always appended to the function body when it's written
out, so strip any trailing newlines which may be there already.

Signed-off-by: Andre McCurdy <armccurdy@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Andre McCurdy 8 年之前
父節點
當前提交
8a3f509361
共有 1 個文件被更改,包括 1 次插入0 次删除
  1. 1 0
      lib/bb/data.py

+ 1 - 0
lib/bb/data.py

@@ -227,6 +227,7 @@ def emit_var(var, o=sys.__stdout__, d = init(), all=False):
 
     if func:
         # NOTE: should probably check for unbalanced {} within the var
+        val = val.rstrip('\n')
         o.write("%s() {\n%s\n}\n" % (varExpanded, val))
         return 1