view ifndef_wrapper.sh @ 1593:c8c20fb57a9a

Don't read uninitialised value. From https://github.com/libtom/libtommath/commit/1d03522625f46214733e8e143a4765c01fc146f9
author Matt Johnston <matt@ucc.asn.au>
date Mon, 05 Mar 2018 16:50:24 +0800
parents 198e2ee0f4b1
children 0196f4f83fee
line wrap: on
line source

#!/bin/sh

# Wrap all "#define X Y" with a #ifndef X...#endif"

sed -E 's/^( *#define ([^ ]+) .*)/#ifndef \2\
\1\
#endif/'