[PATCH] scanner: stop adding trailing whitespace to copyright

Jon A. Cruz jonc at osg.samsung.com
Sun Oct 25 19:50:32 PDT 2015


Generated code was unconditionally adding a space to lines
in comments for copyright blocks even if the line was blank.
Updated to not add trailing whitespace for blank lines.

Signed-off-by: Jon A. Cruz <jonc at osg.samsung.com>
---
 src/scanner.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/scanner.c b/src/scanner.c
index f456aa5..b231d02 100644
--- a/src/scanner.c
+++ b/src/scanner.c
@@ -1141,8 +1141,9 @@ format_copyright(const char *copyright)
 		}
 
 		if (copyright[i] == '\n' || copyright[i] == '\0') {
-			printf("%s %.*s\n",
+			printf("%s%s%.*s\n",
 			       i == 0 ? "/*" : " *",
+			       i > start ? " " : "",
 			       i - start, copyright + start);
 			bol = 1;
 		}
-- 
2.1.4



More information about the wayland-devel mailing list