From 8aef7c1f04aa836a164c3dff15665c2cfccd60eb Mon Sep 17 00:00:00 2001 From: Micah Cowan Date: Sun, 22 Jun 2008 11:39:13 -0700 Subject: [PATCH] version.c string token concatenation. --- src/ChangeLog | 7 +++++++ src/Makefile.am | 12 +++++++----- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index deee0232..c9da1c8e 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,10 @@ +2008-06-22 Micah Cowan + + * Makefile.am (version.c): Fixed version string invocation so it + once again can't result in unterminated strings, made all the + string vars pointers-to-const, and moved line lengths + below 80 (in Makefile.am, not in version.c). + 2008-06-16 Micah Cowan * http.c (http_loop): When hstat.len is higher than the diff --git a/src/Makefile.am b/src/Makefile.am index c8485cfd..56ba6108 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -55,12 +55,14 @@ version.c: $(wget_SOURCES) $(LDADD) $(srcdir)/Makefile.am echo '/* version.c */' > $@ echo '/* Autogenerated by Makefile - DO NOT EDIT */' >> $@ echo '' >> $@ - echo -n 'char* version_string = "@VERSION@ ' >> $@ - -hg log -r . --template=' ({node|short})"\n' 2>/dev/null >> $@ + echo -n 'const char *version_string = "@VERSION@"' >> $@ + -hg log -r . --template='" ({node|short})"\n' 2>/dev/null >> $@ echo ';' >> $@ - echo 'char* compilation_string = "'$(COMPILE)'";' | $(ESCAPEQUOTE) >> $@ - echo 'char* link_string = "'$(CCLD) $(AM_CFLAGS) $(CFLAGS) \ - $(AM_LDFLAGS) $(LDFLAGS) $(LIBS) $(wget_LDADD)'";' | $(ESCAPEQUOTE) >> $@ + echo 'const char *compilation_string = "'$(COMPILE)'";' \ + | $(ESCAPEQUOTE) >> $@ + echo 'const char *link_string = "'$(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(AM_LDFLAGS) $(LDFLAGS) $(LIBS) $(wget_LDADD)'";' \ + | $(ESCAPEQUOTE) >> $@ check_LIBRARIES = libunittest.a libunittest_a_SOURCES = $(wget_SOURCES) test.c test.h