~ecs/tm

0a0d14288e5c96805f835cda544043c246e49263 — Ember Sawady 3 years ago 0c962e1
Clear $IFS before read(1)
2 files changed, 2 insertions(+), 2 deletions(-)

M lib.sh
M tm-commit-tree
M lib.sh => lib.sh +1 -1
@@ 29,7 29,7 @@ isignored() {

postfix() {
	len="$(printf "%s" "$1" | wc -c)"
	while read -r "line"; do
	IFS= while read -r "line"; do
		linelen="$(printf "%s" "$line" | wc -c)"
		post="$(printf "%s" "$line" | cut -c"$((linelen - len + 1))-" 2>/dev/null || true)"
		[ "z$post" = "z$1" ] && printf "%s\n" "$line"

M tm-commit-tree => tm-commit-tree +1 -1
@@ 42,7 42,7 @@ printf 'author %s\n' "$TM_AUTHOR" >>"$tmp"
printf 'committer %s\n' "$TM_COMMITTER" >>"$tmp"
printf 'date %s\n' "$TM_DATE" >>"$tmp"
tty >/dev/null && printf 'Commit subject:\n' >&2
read -r "subject"
IFS= read -r "subject"
[ "$(printf "%s" "$subject" | wc -c)" -gt 72 ] \
	&& abort "error: subject is longer than 72 chars"
[ "$(printf "%s" "$subject" | wc -c)" -gt 50 ] \