[U-Boot] [PATCH 4/4] tools: moveconfig: fix cleanup of defines across multiple lines

Masahiro Yamada yamada.masahiro at socionext.com
Sun Jul 24 16:17:39 CEST 2016


Correct the clean-up of such defines that continue across multiple
lines, like follows:

  #define CONFIG_FOO "this continues to the next line " \
          "this line should be removed too" \
          "this line should be removed as well"

Signed-off-by: Masahiro Yamada <yamada.masahiro at socionext.com>
---

 tools/moveconfig.py | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/tools/moveconfig.py b/tools/moveconfig.py
index 69701d4..8f8e67b 100755
--- a/tools/moveconfig.py
+++ b/tools/moveconfig.py
@@ -370,6 +370,9 @@ def cleanup_one_header(header_path, patterns, options):
 
     matched = []
     for i, line in enumerate(lines):
+        if i - 1 in matched and lines[i - 1][-2:] == '\\\n':
+            matched.append(i)
+            continue
         for pattern in patterns:
             if pattern.search(line):
                 matched.append(i)
-- 
1.9.1



More information about the U-Boot mailing list