From 78bcb8d3de0292fe05dfa74f5ee905956f22a7bc Mon Sep 17 00:00:00 2001 From: Werner Almesberger Date: Wed, 23 May 2012 00:50:19 -0300 Subject: [PATCH] schhist/schhist2web: correct handling of deferred columns This fixes two bugs: - the last column could leave td=true, causing an extra column to be erroneously inserted at the beginning of the next row - a deferred at the end of the row would be output before $s, placing it right after the last thumbnail instead of the end of the thumbnail section Also combines flushing of "td" for all code paths that produce a difference image. --- schhist/schhist2web | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/schhist/schhist2web b/schhist/schhist2web index 2dcadaf..5db1b6f 100755 --- a/schhist/schhist2web +++ b/schhist/schhist2web @@ -385,11 +385,11 @@ EOF next="$head" -td=false for n in `cd "$dir" && git rev-list $first..HEAD~1` $first; do [ -d "$cache/$n/ppm0" ] || continue empty=true s="" + td=false mkdir -p "$out/$next/"{diff,thumb,html,pdf} while read m; do a0="$cache/$n/ppm0/$m.ppm" @@ -418,21 +418,15 @@ for n in `cd "$dir" && git rev-list $first..HEAD~1` $first; do s="$s" continue fi - $td && s="$s" - td=false pngdiff shrink "$thumb" -f $THUMB_OPTS "$a2" "$b2" "$a0" "$b0" || exit schps2pdf -T BEFORE -T AFTER -o "$pdf" "$aps" "$bps" || exit elif [ -f "$a0" ]; then - $td && s="$s" - td=false pngdiff cat "$diff" -f -c 1,0,0 "$a1" "$a1" || exit pngdiff shrink "$thumb" -f $THUMB_OPTS -c 1,0,0 "$a2" "$a2" || exit schps2pdf -T DELETED -o "$pdf" "$aps" || exit elif [ -f "$b0" ]; then - $td && s="$s" - td=false pngdiff cat "$diff" -f -c 0,1,0 "$b1" "$b1" || exit pngdiff shrink "$thumb" -f $THUMB_OPTS -c 0,1,0 "$b2" "$b2" || exit @@ -440,13 +434,15 @@ for n in `cd "$dir" && git rev-list $first..HEAD~1` $first; do else continue fi + $td && s="$s" + td=false echo "$s" s= wrapped_png "$out" "$next" "$m" empty=false done < <(ordered_names) - $td && echo "" if ! $empty; then + $td && s="$s" echo "$s" commit_entry "$dir" $next fi