- braille: Warn when no text translation was selected in case
the user didn't notice. Thanks to Samuel Thibault for this
patch (Pull request #37).
+ - braille: Fix spurious spacing after last Form-Feed (Pull
+ request #45).
CHANGES IN V1.20.3
else
cat "$FILE"
fi | (
- while IFS=$'\n' read -r LINE
+ IFS=$'\n' read -r LINE
+ EOF=$?
+ while [ "$EOF" = 0 -o -n "$LINE" ]
do
# Strip CRs
LINE=${LINE//$'\015'}
tr "\000-\037\177\200-\377" " " | \
tr " \!\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ\\[\\\\\\]^_" "\\0V tSQW"$'\004'"gvAT@DP"$'\024'"d"$'\002\006'"\"bB&fF\$a\`Cw4q"$'\020\001\003\021'"1!"$'\023'"3#"$'\022'"2"$'\005\007\025'"5%"$'\027'"7'"$'\026'"6EGrUueRcs0p"
fi
- printf "\\r\\n"
+ if [ "$EOF" = 0 ]
+ then
+ printf "\\r\\n"
+ fi
+ IFS=$'\n' read -r LINE
+ EOF=$?
done
)
if [ $? != 0 ]
#!/bin/bash
#
-# Copyright (c) 2015-2017 Samuel Thibault <samuel.thibault@ens-lyon.org>
+# Copyright (c) 2015-2018 Samuel Thibault <samuel.thibault@ens-lyon.org>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
fi | (
P=1
DOPRINT=$(doprint $P)
- while IFS=$'\n' read -r LINE
+ IFS=$'\n' read -r LINE
+ EOF=$?
+ while [ "$EOF" = 0 -o -n "$LINE" ]
do
- while [ -z "${LINE/*$'\014'*}" ]
+ while [ -n "$LINE" -a -z "${LINE/*$'\014'*}" ]
do
# Possibly print before FF
HEAD=${LINE%%$'\014'*}
done
# Remainder of line
- [ $DOPRINT == 0 ] || printf "%s\n" "$LINE"
+ if [ "$EOF" = 0 ]
+ then
+ NL="\n"
+ else
+ NL=""
+ fi
+ [ $DOPRINT == 0 ] || printf "%s$NL" "$LINE"
+
+ IFS=$'\n' read -r LINE
+ EOF=$?
done
)
fi
echo -n "$NEWPAGE"
- exec sed -e "s/^\(\f\?\)/\1$LEFTSPACES/" \
- -e "s/\f/\f$NEWPAGESED/"
+ sed -e '$s/\f$//' \
+ -e "s/^\(\f\?\)\([^\r]\)/\1$LEFTSPACES\2/" \
+ -e "s/\f/\f$NEWPAGESED/"
+ echo -n "\f"
}
#