--- ./lib/pdfopt 2002-04-23 14:58:36.000000000 +0300 +++ ./lib/pdfopt 2006-01-20 18:30:21.000000000 +0200 @@ -16,8 +16,9 @@ shift done -if [ $# -ne 2 ]; then - echo "Usage: `basename $0` input.pdf output.pdf" 1>&2 +if [ $# -lt 2 ] || [ "$1" = "$2" ]; then + echo "Usage: `basename $0` [ gs options ] input.pdf output.pdf" 1>&2 + echo " (input.pdf must be different from output.pdf to avoid corruption)" 1>&2 exit 1 fi --- ./man/pdfopt.1 2003-07-13 07:43:17.000000000 +0300 +++ ./man/pdfopt.1 2006-01-20 18:40:36.000000000 +0200 @@ -13,7 +13,7 @@ through a network. .PP Note: input.pdf and output.pdf must not be the same. If they are, the file -will probably be destroyed. \fBpdfopt\fR currently does not check for this. +will probably be destroyed. \fBpdfopt\fR checks for this. .SH FILES Run "\fBgs -h\fR" to find the location of Ghostscript documentation on your system, from which you can get more details.