[master] 9f50c4b Fix gensequences for BusyBox awk

guillaume quintard gquintard at users.noreply.github.com
Sun Apr 29 17:32:25 UTC 2018


commit 9f50c4bd12303674890ca742ce6b9592a29e3ba9
Author: Guillaume Quintard <guillaume at varnish-software.com>
Date:   Thu Apr 26 21:59:41 2018 +0200

    Fix gensequences for BusyBox awk
    
    I never thought that I'd have to fix a string concatenation problem in
    a BusyBox awk program to generate VT100 code in a container, but here we
    are:
    
    echo | awk 'END {print "foo" "" ++a, "foo" ++a}'
    
    should output "foo0 foo1", and for all the ?awk I tested, it does,
    except for BusyBox awk who thought funny to output "0 foo1", breaking the
    teken_state.h file.

diff --git a/bin/varnishtest/gensequences b/bin/varnishtest/gensequences
index 83a3d10..8c2299a 100644
--- a/bin/varnishtest/gensequences
+++ b/bin/varnishtest/gensequences
@@ -61,7 +61,7 @@ while (getline > 0) {
 		l_prefix_parent[n] = prefix;
 		l_prefix_suffix[n] = sequence[i];
 		if (!l_prefix_name[n])
-			l_prefix_name[n] = "teken_state_" ++npr;
+			l_prefix_name[n] = "teken_state_" "" ++npr;
 		prefix = n;
 	}
 


More information about the varnish-commit mailing list