diff mbox

[v2,6/8] tools: moveconfig: fix cleanup of defines across multiple lines

Message ID 1469441729-5817-7-git-send-email-yamada.masahiro@socionext.com
State New
Headers show

Commit Message

Masahiro Yamada July 25, 2016, 10:15 a.m. UTC
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@socionext.com>

---

Changes in v2: None

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

-- 
1.9.1

_______________________________________________
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot
diff mbox

Patch

diff --git a/tools/moveconfig.py b/tools/moveconfig.py
index 4edcb6c..5b1fa92 100755
--- a/tools/moveconfig.py
+++ b/tools/moveconfig.py
@@ -408,6 +408,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)