File groff_1.20.1-10.debian.diff of Package gxditview.import4718

Description: Use mktemp in groffer to eliminate a race condition
 This was forwarded in
 http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=278265#12 and addressed
 differently, but it would still be much better to use mktemp if available.
Origin: vendor, https://bugzilla.redhat.com/show_bug.cgi?id=136313
Author: Mark Cox <mjc@redhat.com>
Author: Colin Watson <cjwatson@debian.org>
Bug-Debian: http://bugs.debian.org/278265
Forwarded: no
Last-Update: 2010-03-01

Index: b/contrib/groffer/shell/groffer2.sh
===================================================================
--- a/contrib/groffer/shell/groffer2.sh
+++ b/contrib/groffer/shell/groffer2.sh
@@ -5222,28 +5222,7 @@
       _TMP_DIR="${mi_dir}"'/';
       ;;
     esac;
-    _TMP_DIR="${_TMP_DIR}groffer${_PROCESS_ID}";
-    if obj _TMP_DIR rm_tree
-    then
-      :
-    else
-      mi_tdir_="${_TMP_DIR}"_;
-      mi_n=1;
-      mi_tdir_n="${mi_tdir_}${mi_n}";
-### main_init()
-      while obj mi_tdir_n is_existing
-      do
-        if obj mi_tdir_n rm_tree
-        then
-          # directory could not be removed
-          mi_n="$(expr "${mi_n}" + 1)";
-          mi_tdir_n="${mi_tdir_}${mi_n}";
-          continue;
-        fi;
-      done;
-      _TMP_DIR="${mi_tdir_n}";
-    fi;
-    eval mkdir "${_TMP_DIR}";
+    _TMP_DIR="$(mktemp -d "${_TMP_DIR}groffer.XXXXXX")";
     if is_not_equal "$?" 0
     then
       obj _TMP_DIR rm_tree;
Description: Fix temporary file handling vulnerabilities in pdfroff
Origin: vendor, http://cvsweb.openwall.com/cgi/cvsweb.cgi/Owl/packages/groff/groff-1.20.1-owl-tmp.diff
Bug-Debian: http://bugs.debian.org/538330
Forwarded: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=538330#8
Last-Update: 2010-03-01

Index: b/contrib/pdfmark/pdfroff.man
===================================================================
--- a/contrib/pdfmark/pdfroff.man
+++ b/contrib/pdfmark/pdfroff.man
@@ -529,7 +529,7 @@
 .B GROFF_TMPDIR
 Identifies the directory in which
 .B pdfroff
-should create temporary files.
+should create a subdirectory for its temporary files.
 If
 .B \%GROFF_TMPDIR
 is
@@ -541,7 +541,8 @@
 .B TEMP
 are considered in turn, as possible temporary file repositories.
 If none of these are set, then temporary files are created
-in the current directory.
+in a subdirectory of
+.BR /tmp .
 .
 .TP
 .B GROFF_GHOSTSCRIPT_INTERPRETER
Index: b/contrib/pdfmark/pdfroff.sh
===================================================================
--- a/contrib/pdfmark/pdfroff.sh
+++ b/contrib/pdfmark/pdfroff.sh
@@ -137,7 +137,15 @@
 #
 # Set up temporary/intermediate file locations.
 #
-  WRKFILE=${GROFF_TMPDIR=${TMPDIR-${TMP-${TEMP-"."}}}}/pdf$$.tmp
+  MYTMPDIR=${GROFF_TMPDIR-${TMPDIR-${TMP-${TEMP-"/tmp"}}}}
+  WRKDIR="`unset TMPDIR && mktemp -dp "$MYTMPDIR" groff-pdfroff.XXXXXXXXXX`" || exit
+
+  trap 'rm -rf -- "$WRKDIR"' EXIT
+  trap 'trap - EXIT; rm -rf -- "$WRKDIR"; exit 1' HUP INT QUIT PIPE TERM
+
+  GROFF_TMPDIR=${WRKDIR}
+
+  WRKFILE=${GROFF_TMPDIR}/pdf$$.tmp
 #
   REFCOPY=${GROFF_TMPDIR}/pdf$$.cmp
   REFFILE=${GROFF_TMPDIR}/pdf$$.ref
@@ -146,11 +154,6 @@
   TC_DATA=${GROFF_TMPDIR}/pdf$$.tc
   BD_DATA=${GROFF_TMPDIR}/pdf$$.ps
 #
-# Set a trap, to delete temporary files on exit.
-# (FIXME: may want to include other signals, in released version).
-#
-  trap "rm -f ${GROFF_TMPDIR}/pdf$$.*" 0
-#
 # Initialise 'groff' format control settings,
 # to discriminate table of contents and document body formatting passes.
 #
Description: Use -dSAFER when calling gs from pdfroff
Author: Colin Watson <cjwatson@debian.org>
Bug-Debian: http://bugs.debian.org/538338
Forwarded: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=538338#8
Last-Update: 2010-03-01

Index: b/contrib/pdfmark/pdfroff.man
===================================================================
--- a/contrib/pdfmark/pdfroff.man
+++ b/contrib/pdfmark/pdfroff.man
@@ -521,7 +521,7 @@
 .IP
 .I
 .ad l
-.NH gs \-dBATCH \-dQUIET \-dNOPAUSE \-sDEVICE=pdfwrite \-sOutputFile=\-
+.NH gs \-dBATCH \-dQUIET \-dNOPAUSE \-dSAFER \-sDEVICE=pdfwrite \-sOutputFile=\-
 .ad
 .RE
 .
Index: b/contrib/pdfmark/pdfroff.sh
===================================================================
--- a/contrib/pdfmark/pdfroff.sh
+++ b/contrib/pdfmark/pdfroff.sh
@@ -600,7 +600,7 @@
   $SAY >&2 $n "Writing PDF output ..$c"
   if test -z "$PDFROFF_POSTPROCESSOR_COMMAND"
   then
-    PDFROFF_POSTPROCESSOR_COMMAND="$GS -dQUIET -dBATCH -dNOPAUSE
+    PDFROFF_POSTPROCESSOR_COMMAND="$GS -dQUIET -dBATCH -dNOPAUSE -dSAFER
       -sDEVICE=pdfwrite -sOutputFile="${PDF_OUTPUT-"-"}
 
   elif test -n "$PDF_OUTPUT"
Description: Remove unnecessary bashisms from gdiffmk
Author: Colin Watson <cjwatson@debian.org>
Bug-Debian: http://bugs.debian.org/547750
Forwarded: http://lists.gnu.org/archive/html/bug-groff/2009-09/msg00003.html
Last-Update: 2010-03-01

Index: b/contrib/gdiffmk/gdiffmk.sh
===================================================================
--- a/contrib/gdiffmk/gdiffmk.sh
+++ b/contrib/gdiffmk/gdiffmk.sh
@@ -21,7 +21,7 @@
 
 cmd=$( basename $0 )
 
-function Usage {
+Usage () {
 	if test "$#" -gt 0
 	then
 		echo >&2 "${cmd}:  $@"
@@ -60,7 +60,7 @@
 }
 
 
-function Exit {
+Exit () {
 	exitcode=$1
 	shift
 	for arg
@@ -75,7 +75,7 @@
 #
 #	Check for existence and readability of given file name.
 #	If not found or not readable, print message and exit with EXIT_CODE.
-function FileRead {
+FileRead () {
 	case "$2" in
 	-)
 		return
@@ -97,7 +97,7 @@
 #
 #	Create the given filename if it doesn't exist.
 #	If unable to create or write, print message and exit with EXIT_CODE.
-function FileCreate {
+FileCreate () {
 	case "$2" in
 	-)
 		return
@@ -115,7 +115,7 @@
 	fi
 }
 
-function WouldClobber {
+WouldClobber () {
 	case "$2" in
 	-)
 		return
@@ -136,7 +136,7 @@
 MARK1='[['
 MARK2=']]'
 
-function RequiresArgument {
+RequiresArgument () {
 	#	Process flags that take either concatenated or
 	#	separated values.
 	case "$1" in
Description: Use POSIX-compliant 'trap' arguments
Author: David Weinehall <tao@debian.org>
Author: Colin Watson <cjwatson@debian.org>
Forwarded: http://lists.gnu.org/archive/html/bug-groff/2010-02/msg00005.html
Last-Update: 2010-03-01

Index: b/contrib/eqn2graph/eqn2graph.sh
===================================================================
--- a/contrib/eqn2graph/eqn2graph.sh
+++ b/contrib/eqn2graph/eqn2graph.sh
@@ -75,7 +75,7 @@
     { (exit 1); exit 1; }
 fi
 
-trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0 2 15 
+trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' EXIT INT TERM
 
 # Here goes:
 # 1. Add .EQ/.EN.
Index: b/contrib/grap2graph/grap2graph.sh
===================================================================
--- a/contrib/grap2graph/grap2graph.sh
+++ b/contrib/grap2graph/grap2graph.sh
@@ -71,7 +71,7 @@
     { (exit 1); exit 1; }
 fi
 
-trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0 2 15 
+trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' EXIT INT TERM
 
 # Here goes:
 # 1. Add .G1/.G2.
Index: b/contrib/pic2graph/pic2graph.sh
===================================================================
--- a/contrib/pic2graph/pic2graph.sh
+++ b/contrib/pic2graph/pic2graph.sh
@@ -86,7 +86,7 @@
     { (exit 1); exit 1; }
 fi
 
-trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0 2 15 
+trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' EXIT INT TERM
 
 # Here goes:
 # 1. Wrap the input in dummy .PS/PE macros (and add possibly null .EQ/.EN)
Description: The *2graph scripts use $RANDOM, which is bash-specific
Author: Colin Watson <cjwatson@debian.org>
Forwarded: no
Last-Update: 2010-03-01

Index: b/contrib/eqn2graph/eqn2graph.sh
===================================================================
--- a/contrib/eqn2graph/eqn2graph.sh
+++ b/contrib/eqn2graph/eqn2graph.sh
@@ -1,4 +1,4 @@
-#! /bin/sh
+#! /bin/bash
 #
 # eqn2graph -- compile EQN equation descriptions to bitmap images
 #
Index: b/contrib/grap2graph/grap2graph.sh
===================================================================
--- a/contrib/grap2graph/grap2graph.sh
+++ b/contrib/grap2graph/grap2graph.sh
@@ -1,4 +1,4 @@
-#! /bin/sh
+#! /bin/bash
 #
 # grap2graph -- compile graph description descriptions to bitmap images
 #
Index: b/contrib/pic2graph/pic2graph.sh
===================================================================
--- a/contrib/pic2graph/pic2graph.sh
+++ b/contrib/pic2graph/pic2graph.sh
@@ -1,4 +1,4 @@
-#! /bin/sh
+#! /bin/bash
 #
 # pic2graph -- compile PIC image descriptions to bitmap images
 #
Description: Avoid relying on awk in mdate.sh
 The results were unpredictable on mips/mipsel.
Author: Florian Lohoff <flo@rfc822.org>
Bug-Debian: http://bugs.debian.org/62554
Forwarded: no
Last-Update: 2010-03-01

Index: b/mdate.sh
===================================================================
--- a/mdate.sh
+++ b/mdate.sh
@@ -20,41 +20,4 @@
 #
 # Print the modification date of $1 `nicely'.
 
-# Don't want foreign dates.
-
-LANGUAGE=
-LC_ALL=C; export LC_ALL
-
-
-(date;
-if ls -L /dev/null 1>/dev/null 2>&1; then ls -L -l $1; else ls -l $1; fi
-) | awk '
-BEGIN {
-	full["Jan"] = "January"; number["Jan"] = 1;
-	full["Feb"] = "February"; number["Feb"] = 2;
-	full["Mar"] = "March"; number["Mar"] = 3;
-	full["Apr"] = "April"; number["Apr"] = 4;
-	full["May"] = "May"; number["May"] = 5;
-	full["Jun"] = "June"; number["Jun"] = 6;
-	full["Jul"] = "July"; number["Jul"] = 7;
-	full["Aug"] = "August"; number["Aug"] = 8;
-	full["Sep"] = "September"; number["Sep"] = 9;
-	full["Oct"] = "October"; number["Oct"] = 10;
-	full["Nov"] = "November"; number["Nov"] = 11;
-	full["Dec"] = "December"; number["Dec"] = 12;
-}
-
-NR == 1 {
-	month = $2;
-	year = $NF;
-}
-
-NR == 2 {
-	if ($(NF-1) ~ /:/) {
-		if (number[$(NF-3)] > number[month])
-			year--;
-	}
-	else
-		year = $(NF-1);
-	print $(NF-2), full[$(NF-3)], year
-}'
+perl -MPOSIX -le 'print strftime("%d %B %Y", localtime((stat $ARGV[0])[9]))' $1
Description: Unset IFS at nroff startup
 It's questionable whether we should forward this; as noted in the bug
 trail, there's a decent argument that this is a dash bug.
Author: Colin Watson <cjwatson@debian.org>
Bug-Debian: http://bugs.debian.org/541621
Forwarded: no
Last-Update: 2010-03-01

Index: b/src/roff/nroff/nroff.sh
===================================================================
--- a/src/roff/nroff/nroff.sh
+++ b/src/roff/nroff/nroff.sh
@@ -22,6 +22,8 @@
 # You should have received a copy of the GNU General Public License
 # along with this program. If not, see <http://www.gnu.org/licenses/>.
 
+unset IFS
+
 prog="$0"
 
 # Default device.
Description: '+' isn't a regex metacharacter in sed by default
 Why are we only doing this for devascii?  Probably a bug one way or
 another, but needs review before forwarding.
Author: Fumitoshi UKAI <ukai@debian.or.jp>
Forwarded: no
Last-Update: 2010-03-01

Index: b/font/devascii/Makefile.sub
===================================================================
--- a/font/devascii/Makefile.sub
+++ b/font/devascii/Makefile.sub
@@ -12,8 +12,8 @@
 	@-rm -f $@
 	@(charwidth=`expr $(RES) / $(CPI)` ; \
  	 sed -e "s/^name [A-Z]*$$/name $@/" \
-	     -e "s/^\\([^	]*\\)	[0-9]+	/\\1	$$charwidth	/" \
-	     -e "s/^spacewidth [0-9]+$$/spacewidth $$charwidth/" \
+	     -e "s/^\\([^	]*\\)	[0-9][0-9]*	/\\1	$$charwidth	/" \
+	     -e "s/^spacewidth [0-9][0-9]*$$/spacewidth $$charwidth/" \
 	     -e "s/^internalname .*$$/internalname $@/" \
 	     -e "/^internalname/s/BI/3/" \
 	     -e "/^internalname/s/B/2/" \
Description: Adjust #! line of font/devlj4/generate/special.awk
 awk is in /usr/bin/awk on Debian, not /bin/awk.
Author: Colin Watson <cjwatson@debian.org>
Forwarded: no
Last-Update: 2010-03-01

Index: b/font/devlj4/generate/special.awk
===================================================================
--- a/font/devlj4/generate/special.awk
+++ b/font/devlj4/generate/special.awk
@@ -1,4 +1,4 @@
-#! /bin/awk -f
+#! /usr/bin/awk -f
 
 # Correct Intellifont-based height metrics for several glyphs in
 # special font for TrueType CG Times (LaserJet 4000 and later).
Description: Set appropriate papersize when calling gs from HTML preprocessor
 This patch seems fishy.  get_papersize was removed upstream in r335.1.348,
 so should we even be applying this any more?  Furthermore, we don't use
 gsPaper anywhere, and looking at devps/DESC here is just nasty.  Needs
 review.
Author: Colin Watson <cjwatson@debian.org>
Forwarded: no
Last-Update: 2010-03-01

Index: b/src/preproc/html/pre-html.cpp
===================================================================
--- a/src/preproc/html/pre-html.cpp
+++ b/src/preproc/html/pre-html.cpp
@@ -152,6 +152,10 @@
 #define DEFAULT_IMAGE_RES 100	// number of pixels per inch resolution
 #define IMAGE_BOARDER_PIXELS 0
 #define INLINE_LEADER_CHAR '\\'
+#define A4_LENGTH 841890	// taken from devps/Makefile.sub
+#define LETTER_LENGTH 792000	// taken from devps/Makefile.sub
+#define A4_OFFSET 0
+#define LETTER_OFFSET 50	// 50/72 of an inch
 
 // Don't use colour names here!  Otherwise there is a dependency on
 // a file called `rgb.txt' which maps names to colours.
@@ -199,6 +203,7 @@
 					// by -D
 static int troff_arg = 0;		// troff arg index
 static char *image_dir = NULL;		// user specified image directory
+static char *gsPaper = NULL;		// the paper size that gs must use
 static int textAlphaBits = MAX_ALPHA_BITS;
 static int graphicAlphaBits = MAX_ALPHA_BITS;
 static char *antiAlias = NULL;		// antialias arguments we pass to gs
@@ -312,6 +317,54 @@
 }
 
 /*
+ *  get_papersize - returns an integer determining the paper length from
+ *  devps/DESC
+ */
+
+static int get_papersize (void)
+{
+  char *pathp;
+  FILE *f;
+  int res;
+  f = font_path.open_file("devps/DESC", &pathp);
+  if (f == 0)
+    fatal("can't open devps/DESC");
+  while (get_line(f)) {
+    int n = sscanf(linebuf, "paperlength %d", &res);
+    if (n >= 1) {
+      fclose(f);
+      return res;
+    }
+    if (!strncmp(linebuf, "papersize", 9)) {
+      double length;
+      char *p = linebuf + 9;
+      while (*p == ' ' || *p == '\t')
+        p++;
+      for (p = strtok(p, " \t"); p; p = strtok(0, " \t")) {
+        if (font::scan_papersize(p, 0, &length, 0)) {
+          fclose(f);
+          return int(length * postscriptRes + 0.5);
+        }
+      }
+      fatal("bad argument to `papersize' keyword in devps/DESC");
+    }
+  }
+  fatal("can't find `papersize' or `paperlength' keyword in devps/DESC");
+  return 0;
+}
+
+/*
+ *  determine_vertical_offset - works out the default vertical offset from
+ *                              the page length
+ */
+
+static void determine_vertical_offset (void)
+{
+  vertical_offset = ((A4_LENGTH-get_papersize())*72)/postscriptRes;
+  gsPaper = "-sPAPERSIZE=a4";
+}
+
+/*
  *  html_system - A wrapper for system().
  */
 
@@ -1781,6 +1834,7 @@
   if (image_gen == NULL || (strcmp(image_gen, "") == 0))
     fatal("devhtml/DESC must set the image_generator field, exiting");
   postscriptRes = get_resolution();
+  determine_vertical_offset();
   i = scanArguments(argc, argv);
   setupAntiAlias();
   checkImageDir();
Description: Call `ec' before mapping characters
Origin: upstream, http://bazaar.launchpad.net/~vcs-imports/groff/main/revision/1822
Forwarded: yes
Last-Update: 2010-03-01

Index: b/tmac/doc.tmac
===================================================================
--- a/tmac/doc.tmac
+++ b/tmac/doc.tmac
@@ -6425,6 +6425,9 @@
 .blm doc-empty-line
 .
 .
+.ec
+.
+.
 .\" For UTF-8, map some characters conservatively for the sake
 .\" of easy cut and paste.
 .
@@ -6438,9 +6441,6 @@
 .\}
 .
 .
-.ec
-.
-.
 .\" load local modifications
 .mso mdoc.local
 .
Description: Update mdoc for newer FreeBSD and POSIX versions
Author: Colin Watson <cjwatson@debian.org>
Forwarded: http://lists.gnu.org/archive/html/bug-groff/2010-02/msg00007.html
Last-Update: 2010-03-01

Index: b/tmac/doc-common
===================================================================
--- a/tmac/doc-common
+++ b/tmac/doc-common
@@ -504,6 +504,9 @@
 .ds doc-operating-system-FreeBSD-6.4     6.4
 .ds doc-operating-system-FreeBSD-7.0     7.0
 .ds doc-operating-system-FreeBSD-7.1     7.1
+.ds doc-operating-system-FreeBSD-7.2     7.2
+.ds doc-operating-system-FreeBSD-7.3     7.3
+.ds doc-operating-system-FreeBSD-8.0     8.0
 .
 .ds doc-operating-system-Darwin-8.0.0  8.0.0
 .ds doc-operating-system-Darwin-8.1.0  8.1.0
Index: b/tmac/doc-syms
===================================================================
--- a/tmac/doc-syms
+++ b/tmac/doc-syms
@@ -637,6 +637,8 @@
 .as doc-str-St--p1003.1-2001   " (\*[Lq]\)\*[Px]\*[doc-str-St].1\*[Rq])
 .ds doc-str-St--p1003.1-2004   \*[doc-Tn-font-size]\%IEEE\*[doc-str-St] Std 1003.1-2004
 .as doc-str-St--p1003.1-2004   " (\*[Lq]\)\*[Px]\*[doc-str-St].1\*[Rq])
+.ds doc-str-St--p1003.1-2008   \*[doc-Tn-font-size]\%IEEE\*[doc-str-St] Std 1003.1-2008
+.as doc-str-St--p1003.1-2008   " (\*[Lq]\)\*[Px]\*[doc-str-St].1\*[Rq])
 .
 .\" POSIX Part 2: Shell and Utilities
 .ds doc-str-St--p1003.2        \*[doc-Tn-font-size]\%IEEE\*[doc-str-St] Std 1003.2
Index: b/tmac/groff_mdoc.man
===================================================================
--- a/tmac/groff_mdoc.man
+++ b/tmac/groff_mdoc.man
@@ -870,7 +870,7 @@
 1.0, 1.1, 1.1.5, 1.1.5.1, 2.0, 2.0.5, 2.1, 2.1.5, 2.1.6, 2.1.7, 2.2, 2.2.1,
 2.2.2, 2.2.5, 2.2.6, 2.2.7, 2.2.8, 3.0, 3.1, 3.2, 3.3, 3.4, 3.5, 4.0, 4.1,
 4.1.1, 4.2, 4.3, 4.4, 4.5, 4.6, 4.6.2, 4.7, 4.8, 4.9, 4.10, 4.11, 5.0, 5.1,
-5.2, 5.2.1, 5.3, 5.4, 5.5, 6.0, 6.1, 6.2, 6.3, 6.4, 7.0, 7.1
+5.2, 5.2.1, 5.3, 5.4, 5.5, 6.0, 6.1, 6.2, 6.3, 6.4, 7.0, 7.1, 7.2, 7.3, 8.0
 .It DragonFly
 1.0, 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.8, 1.8.1, 1.10, 1.12, 1.12.2, 2.0
 .It Darwin
@@ -1974,6 +1974,8 @@
 .St -p1003.1-2001
 .It Li \-p1003.1\-2004
 .St -p1003.1-2004
+.It Li \-p1003.1\-2008
+.St -p1003.1-2008
 .El
 .Pp
 .
Description: Add GFDL references to manual pages licensed under GFDL
Author: Colin Watson <cjwatson@debian.org>
Bug-Debian: http://bugs.debian.org/292229
Forwarded: not-needed
Last-Update: 2010-03-01

Index: b/contrib/mom/groff_mom.man
===================================================================
--- a/contrib/mom/groff_mom.man
+++ b/contrib/mom/groff_mom.man
@@ -14,6 +14,10 @@
 A copy of the Free Documentation License is included as a file called
 FDL in the main directory of the groff source package.
 ..
+.ig
+A copy of the GNU Free Documentation License is also available in this
+Debian package as /usr/share/doc/groff/copyright.
+..
 .
 .do nr groff_mom_C \n[.C]
 .cp 0
Index: b/man/ditroff.man
===================================================================
--- a/man/ditroff.man
+++ b/man/ditroff.man
@@ -17,6 +17,10 @@
 A copy of the Free Documentation License is included as a file called
 FDL in the main directory of the groff source package.
 ..
+.ig
+A copy of the GNU Free Documentation License is also available in this
+Debian package as /usr/share/doc/groff/copyright.
+..
 .
 .
 .\" --------------------------------------------------------------------
Index: b/man/groff.man
===================================================================
--- a/man/groff.man
+++ b/man/groff.man
@@ -19,6 +19,10 @@
 A copy of the Free Documentation License is included as a file called
 FDL in the main directory of the groff source package.
 ..
+.ig
+A copy of the GNU Free Documentation License is also available in this
+Debian package as /usr/share/doc/groff/copyright.
+..
 .
 .\" --------------------------------------------------------------------
 .\" Setup
Index: b/man/groff_char.man
===================================================================
--- a/man/groff_char.man
+++ b/man/groff_char.man
@@ -32,6 +32,10 @@
 A copy of the Free Documentation License is included as a file called
 FDL in the main directory of the groff source package.
 ..
+.ig
+A copy of the GNU Free Documentation License is also available in this
+Debian package as /usr/share/doc/groff/copyright.
+..
 .
 .\" --------------------------------------------------------------------
 .\" Setup Part 1
Index: b/man/groff_diff.man
===================================================================
--- a/man/groff_diff.man
+++ b/man/groff_diff.man
@@ -22,6 +22,10 @@
 A copy of the Free Documentation License is included as a file called
 FDL in the main directory of the groff source package.
 ..
+.ig
+A copy of the GNU Free Documentation License is also available in this
+Debian package as /usr/share/doc/groff/copyright.
+..
 .
 .
 .\" --------------------------------------------------------------------
Index: b/man/groff_out.man
===================================================================
--- a/man/groff_out.man
+++ b/man/groff_out.man
@@ -19,6 +19,10 @@
 A copy of the Free Documentation License is included as a file called
 FDL in the main directory of the groff source package.
 ..
+.ig
+A copy of the GNU Free Documentation License is also available in this
+Debian package as /usr/share/doc/groff/copyright.
+..
 .
 .\" --------------------------------------------------------------------
 .\" Setup
Index: b/man/groff_tmac.man
===================================================================
--- a/man/groff_tmac.man
+++ b/man/groff_tmac.man
@@ -19,6 +19,10 @@
 A copy of the Free Documentation License is included as a file called
 FDL in the main directory of the groff source package.
 ..
+.ig
+A copy of the GNU Free Documentation License is also available in this
+Debian package as /usr/share/doc/groff/copyright.
+..
 .ds Ellipsis \&.\|.\|.\&\"
 .
 .TH GROFF_TMAC @MAN5EXT@ "@MDATE@" "Groff Version @VERSION@"
Index: b/man/roff.man
===================================================================
--- a/man/roff.man
+++ b/man/roff.man
@@ -18,6 +18,10 @@
 A copy of the Free Documentation License is included as a file called
 FDL in the main directory of the groff source package.
 ..
+.ig
+A copy of the GNU Free Documentation License is also available in this
+Debian package as /usr/share/doc/groff/copyright.
+..
 .
 .
 .\" --------------------------------------------------------------------
Index: b/src/roff/groff/groff.man
===================================================================
--- a/src/roff/groff/groff.man
+++ b/src/roff/groff/groff.man
@@ -14,6 +14,10 @@
 A copy of the Free Documentation License is included as a file called
 FDL in the main directory of the groff source package.
 ..
+.ig
+A copy of the GNU Free Documentation License is also available in this
+Debian package as /usr/share/doc/groff-base/copyright.
+..
 .
 .
 .\" --------------------------------------------------------------------
Index: b/src/roff/troff/troff.man
===================================================================
--- a/src/roff/troff/troff.man
+++ b/src/roff/troff/troff.man
@@ -21,6 +21,10 @@
 A copy of the Free Documentation License is included as a file called
 FDL in the main directory of the groff source package.
 ..
+.ig
+A copy of the GNU Free Documentation License is also available in this
+Debian package as /usr/share/doc/groff-base/copyright.
+..
 .
 .\" --------------------------------------------------------------------
 .\" Title
Index: b/tmac/groff_trace.man
===================================================================
--- a/tmac/groff_trace.man
+++ b/tmac/groff_trace.man
@@ -21,6 +21,10 @@
 A copy of the Free Documentation License is included as a file called
 FDL in the main directory of the groff source package.
 ..
+.ig
+A copy of the GNU Free Documentation License is also available in this
+Debian package as /usr/share/doc/groff/copyright.
+..
 .
 .ds Ellipsis .\|.\|.\&\"
 .
Description: Adjust documentation references to account for compression
Author: Colin Watson <cjwatson@debian.org>
Bug-Debian: http://bugs.debian.org/498356
Forwarded: not-needed
Last-Update: 2010-03-01

Index: b/contrib/pdfmark/pdfroff.man
===================================================================
--- a/contrib/pdfmark/pdfroff.man
+++ b/contrib/pdfmark/pdfroff.man
@@ -783,7 +783,7 @@
 in PDF format, in the reference guide
 .BR "\*(lqPortable Document Format Publishing with GNU Troff\*(rq" ,
 included in the installed documentation set as
-.BR \%@PDFDOCDIR@/pdfmark.pdf .
+.BR \%@PDFDOCDIR@/pdfmark.pdf.gz .
 .
 .
 .\" --------------------------------------------------------------------
Index: b/src/preproc/pic/pic.man
===================================================================
--- a/src/preproc/pic/pic.man
+++ b/src/preproc/pic/pic.man
@@ -227,7 +227,7 @@
 A complete documentation is available in the file
 .LP
 .RS
-.B @DOCDIR@/pic.ms
+.B @DOCDIR@/pic.ms.gz
 .RE
 .
 .SS \*(tx mode
Description: Adjust default recursive make targets
 This has been in the groff packaging since records began, and the reason
 for it is unclear.  Needs investigation.
Author: unknown
Forwarded: no
Last-Update: 2010-03-01

Index: b/Makefile.in
===================================================================
--- a/Makefile.in
+++ b/Makefile.in
@@ -641,7 +641,7 @@
 	fi
 
 do=all
-dodirs=$(ALLDIRS) dot
+dodirs=$(DISTDIRS) 
 # Default target for subdir_Makefile
 subdir=src/roff/troff
 
Description: Inhibit -wmac warnings due to pic and eqn
 Define .PS and .PE to empty strings in pic output to inhibit -wmac
 warnings; similarly, define .EQ and .EN to empty strings in eqn output.
Author: Colin Watson <cjwatson@debian.org>
Bug-Debian: http://bugs.debian.org/495713
Forwarded: no
Last-Update: 2010-03-01

Index: b/src/preproc/eqn/main.cpp
===================================================================
--- a/src/preproc/eqn/main.cpp
+++ b/src/preproc/eqn/main.cpp
@@ -374,6 +374,8 @@
     }
   init_table(device);
   init_char_table();
+  printf(".if !dEQ .ds EQ\n"
+	 ".if !dEN .ds EN\n");
   if (output_format == troff) {
     printf(".if !'\\*(.T'%s' "
 	   ".if !'\\*(.T'html' "	// the html device uses `-Tps' to render
Index: b/src/preproc/pic/main.cpp
===================================================================
--- a/src/preproc/pic/main.cpp
+++ b/src/preproc/pic/main.cpp
@@ -612,7 +612,11 @@
     out = make_fig_output();
   else
 #endif
+  {
     out = make_troff_output();
+    printf(".if !dPS .ds PS\n"
+	   ".if !dPE .ds PE\n");
+  }
 #ifdef FIG_SUPPORT
   if (whole_file_flag) {
     if (optind >= argc)
Description: Handle ditroff command `Dt' without argument gracefully
 Without this patch, grotty goes into an infinite loop if it tries to
 process:
 .
  x T utf8
  x res 240 24 40
  x init
  p1
  Dt
Origin: upstream, http://bazaar.launchpad.net/~vcs-imports/groff/main/revision/1876
Forwarded: yes
Last-Update: 2010-05-09

Index: b/src/libs/libdriver/input.cpp
===================================================================
--- a/src/libs/libdriver/input.cpp
+++ b/src/libs/libdriver/input.cpp
@@ -3,13 +3,13 @@
 // <groff_src_dir>/src/libs/libdriver/input.cpp
 
 /* Copyright (C) 1989, 1990, 1991, 1992, 2001, 2002, 2003, 2004, 2005,
-                 2006, 2008, 2009
+                 2006, 2008, 2009, 2010
    Free Software Foundation, Inc.
 
    Written by James Clark (jjc@jclark.com)
    Major rewrite 2001 by Bernd Warken (bwarken@mayn.de)
 
-   Last update: 5 Jan 2009
+   Last update: 9 May 2010
 
    This file is part of groff, the GNU roff text processing system.
 
@@ -790,7 +790,7 @@
     c = get_char();
   }
   if (!isdigit((int) c))
-    error("integer argument expected");
+    fatal("integer argument expected");
   while (isdigit((int) c)) {
     buf.append(c);
     c = get_char();
@@ -879,6 +879,7 @@
       break;
     default:
       error("integer argument expected");
+      done = true;
       break;
     }
   }
@@ -946,7 +947,7 @@
     case '\n':
     case EOF:
       error("missing argument");
-      break;
+      return c;
     default:			// first essential character
       return c;
     }
Description: Allow adding a version-independent directory to the macro path
 This allows us to put /usr/share/groff/tmac at the end of groff's macro
 path in Debian.
Author: Colin Watson <cjwatson@debian.org>
Forwarded: no
Last-Update: 2010-03-01

Index: b/Makefile.in
===================================================================
--- a/Makefile.in
+++ b/Makefile.in
@@ -190,7 +190,11 @@
 # directory will be always added.
 # `troffrc' and `troffrc-end' (and `eqnrc') are searched neither in the
 # current nor in the home directory.
+ifeq (,$(extratmacdirs))
 tmacpath=$(systemtmacdir)$(RT_SEP)$(localtmacdir)$(RT_SEP)$(tmacdir)
+else
+tmacpath=$(systemtmacdir)$(RT_SEP)$(localtmacdir)$(RT_SEP)$(tmacdir)$(RT_SEP)$(extratmacdirs)
+endif
 
 # `sys_tmac_prefix' is prefix (if any) for system macro packages.
 sys_tmac_prefix=@sys_tmac_prefix@
Description: Use /etc/papersize in preference to configure-time selection
Author: Colin Watson <cjwatson@debian.org>
Forwarded: not-needed
Last-Update: 2010-03-01

Index: b/font/devdvi/Makefile.sub
===================================================================
--- a/font/devdvi/Makefile.sub
+++ b/font/devdvi/Makefile.sub
@@ -16,8 +16,8 @@
 DESC: DESC.in
 	cat $(srcdir)/DESC.in >DESC
 	if test "$(PAGE)" = A4; then \
-	  echo "papersize a4" >>DESC; \
+	  echo "papersize /etc/papersize a4" >>DESC; \
 	else \
-	  echo "papersize letter" >>DESC; \
+	  echo "papersize /etc/papersize letter" >>DESC; \
 	fi
 	test -z '$(DVIPRINT)' || echo print '$(DVIPRINT)' >>DESC
Index: b/font/devlbp/Makefile.sub
===================================================================
--- a/font/devlbp/Makefile.sub
+++ b/font/devlbp/Makefile.sub
@@ -13,9 +13,9 @@
 	-rm -f DESC
 	cat $(srcdir)/DESC.in >>DESC
 	if test "$(PAGE)" = A4; then \
-	  echo "papersize a4" >>DESC; \
+	  echo "papersize /etc/papersize a4" >>DESC; \
 	else \
-	  echo "papersize letter" >>DESC; \
+	  echo "papersize /etc/papersize letter" >>DESC; \
 	fi
 	test -z '$(LBPPRINT)' || echo print '$(LBPPRINT)' >>DESC
 
Index: b/font/devlj4/Makefile.sub
===================================================================
--- a/font/devlj4/Makefile.sub
+++ b/font/devlj4/Makefile.sub
@@ -30,9 +30,9 @@
 	echo "unitwidth `expr 7620000 / $(LJ4RES)`" >>DESC
 	cat $(srcdir)/DESC.in >>DESC
 	if test "$(PAGE)" = A4; then \
-	  echo "papersize a4" >>DESC; \
+	  echo "papersize /etc/papersize a4" >>DESC; \
 	else \
-	  echo "papersize letter" >>DESC; \
+	  echo "papersize /etc/papersize letter" >>DESC; \
 	fi
 	test -z '$(LJ4PRINT)' || echo print '$(LJ4PRINT)' >>DESC
 
Index: b/font/devps/Makefile.sub
===================================================================
--- a/font/devps/Makefile.sub
+++ b/font/devps/Makefile.sub
@@ -40,9 +40,9 @@
 	cat $(srcdir)/DESC.in >DESC
 	echo broken $(BROKEN_SPOOLER_FLAGS) >>DESC
 	if test "$(PAGE)" = A4; then \
-	  echo "papersize a4" >>DESC; \
+	  echo "papersize /etc/papersize a4" >>DESC; \
 	else \
-	  echo "papersize letter" >>DESC; \
+	  echo "papersize /etc/papersize letter" >>DESC; \
 	fi
 	test -z '$(PSPRINT)' ||	echo print '$(PSPRINT)' >>DESC
 
Description: Display more helpful output when failing to load a device
 If the device is known to be one of the devices in the groff binary package
 rather than groff-base, refer the user to that.
Author: Colin Watson <cjwatson@debian.org>
Forwarded: not-needed
Last-Update: 2010-03-01

Index: b/src/roff/groff/groff.cpp
===================================================================
--- a/src/roff/groff/groff.cpp
+++ b/src/roff/groff/groff.cpp
@@ -323,8 +323,16 @@
     commands[PIC_INDEX].append_arg("-U");
   }
   font::set_unknown_desc_command_handler(handle_unknown_desc_command);
-  if (!font::load_desc())
-    fatal("invalid device `%1'", device);
+  if (!font::load_desc()) {
+    if (strcmp(device, "X100") == 0 || strcmp(device, "X100-12") == 0 ||
+	strcmp(device, "X75") == 0 || strcmp(device, "X75-12") == 0 ||
+	strcmp(device, "dvi") == 0 || strcmp(device, "html") == 0 ||
+	strcmp(device, "lbp") == 0 || strcmp(device, "lj4") == 0)
+      fatal("invalid device `%1' (try installing the `groff' package?)",
+	    device);
+    else
+      fatal("invalid device `%1'", device);
+  }
   if (!postdriver)
     fatal("no `postpro' command in DESC file for device `%1'", device);
   if (predriver && !zflag) {