From 12aa7dea805dff04b10b466504f4a8f71cf7820a Mon Sep 17 00:00:00 2001 From: Patrick Donnelly Date: Tue, 1 Jul 2025 15:37:53 -0400 Subject: [PATCH] common/options: chomp whitespace If there are trailing newlines in a string (like long_desc), then the generated C++ code is invalid (because the newline will not be escaped). Signed-off-by: Patrick Donnelly (cherry picked from commit 73792b78b4b520bcbfac254528f79a80b4d331c5) --- src/common/options/y2c.py | 1 + 1 file changed, 1 insertion(+) diff --git a/src/common/options/y2c.py b/src/common/options/y2c.py index 0b64bec58ec..9f7975af3bd 100755 --- a/src/common/options/y2c.py +++ b/src/common/options/y2c.py @@ -19,6 +19,7 @@ def level_to_cxx(lv): def eval_str(v): if v == "": return v + v = v.strip() v = v.strip('"').replace('"', '\\"') return f'"{v}"' -- 2.39.5