提交 82d00098 编写于 作者: G Glenn Randers-Pehrson

[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.
上级 baed0e32
#!/bin/sh #!/bin/sh
# reindent inputabsize outputabsize inputcontinuestring outputcontinuestring # reindent a libpng C source
# eg, to change libpng coding style from 3-space indentation to 4-space
# # COPYRIGHT: Written by Glenn Randers-Pehrson, 2016.
# reindent 3 4 " " " " < example.c.orig > example.c # 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 # Assumes that continued lines begin with indentation plus one space, and
# that continued comments begin with indentation plus " *". # 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/}" | \ sed -e "/^ $3[^\*]/{s/ $3/ $4/}" | \
expand -t $2 expand -t $2
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册