From 82d00098855abd06d8a5975656cb94c65a0423bd Mon Sep 17 00:00:00 2001 From: Glenn Randers-Pehrson Date: Thu, 14 Jul 2016 17:38:35 -0500 Subject: [PATCH] [libpng16] Add PD license to new "reindent" tool; remove unused environment var I didn't intend to distribute this but it leaked into the libpng16 source, so here it is. --- contrib/tools/reindent | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/contrib/tools/reindent b/contrib/tools/reindent index 1bc827f3a..f9f580a81 100644 --- a/contrib/tools/reindent +++ b/contrib/tools/reindent @@ -1,13 +1,22 @@ #!/bin/sh -# reindent inputabsize outputabsize inputcontinuestring outputcontinuestring -# eg, to change libpng coding style from 3-space indentation to 4-space -# -# reindent 3 4 " " " " < example.c.orig > example.c +# reindent a libpng C source + +# COPYRIGHT: Written by Glenn Randers-Pehrson, 2016. +# To the extent possible under law, the author has waived all copyright and +# related or neighboring rights to this work. This work is published from: +# United States. + +# Usage: +# reindent inputtabsize outputtabsize inputcontinuestring outputcontinuestring # # Assumes that continued lines begin with indentation plus one space, and # that continued comments begin with indentation plus " *". +# +# eg, to change libpng coding style from 3-space indentation to 4-space +# +# reindent 3 4 " " " " < example.c > example.c_reindented -unexpand --first-only --t $inputtabsize $1 | \ +unexpand --first-only --t $1 | \ sed -e "/^ $3[^\*]/{s/ $3/ $4/}" | \ expand -t $2