2015-08-23  Juan Manuel Guerrero  <juan.guerrero@gmx.de>

	* Makefile.in:  Remove all dots from revision string and PACKAGE_TARNAME
	to make valid SFNs.

	* contrib/eqn2graph/eqn2graph.sh:  Allow short file names as temporary names.

	* contrib/eqn2graph/grap2graph.sh:  Allow short file names as temporary names.

	* contrib/eqn2graph/pic2graph.sh:  Allow short file names as temporary names.

	* doc/groff.texinfo:  Some format issue fixed.

	* src/include/nonposix.h [_MSC_VER, __MINGW32__]:  Define P_WAIT as
	_P_WAIT and P_NOWAIT as _P_NOWAIT.

	* src/preproc/refer/Makefile.sub: Replace refer by $(PROG) as dependecy
	of install_data target.

	* src/roff/groff/pipeline.c (system_shell_name):  Use P_WAIT instead
	of _P_WAIT.
	(run_pipeline):  Use P_NOWAIT instead of _P_NOWAIT.
	Check for TMP as licit environment variable too.






diff -aprNU5 groff-1.22.3.orig/contrib/eqn2graph/eqn2graph.sh groff-1.22.3/contrib/eqn2graph/eqn2graph.sh
--- groff-1.22.3.orig/contrib/eqn2graph/eqn2graph.sh	2014-11-04 09:38:34 +0100
+++ groff-1.22.3/contrib/eqn2graph/eqn2graph.sh	2015-08-24 01:06:08 +0200
@@ -56,18 +56,24 @@ do
     shift
 done
 
 # create temporary directory
 tmp=
+filename=
+if [ "x${DJGPP}" == "x" ]; then
+filename=eqn2graph-
+else
+filename=e2g
+endif
 for d in "$GROFF_TMPDIR" "$TMPDIR" "$TMP" "$TEMP" /tmp; do
     test -z "$d" && continue
 
-    tmp=`(umask 077 && mktemp -d -q "$d/eqn2graph-XXXXXX") 2> /dev/null` \
+    tmp=`(umask 077 && mktemp -d -q "$d/${filename}XXXXXX") 2> /dev/null` \
     && test -n "$tmp" && test -d "$tmp" \
     && break
 
-    tmp=$d/eqn2graph$$-$RANDOM
+    tmp=$d/${filename}$RANDOM
     (umask 077 && mkdir $tmp) 2> /dev/null && break
 done;
 if test -z "$tmp"; then
     echo "$0: cannot create temporary directory" >&2
     { (exit 1); exit 1; }
diff -aprNU5 groff-1.22.3.orig/contrib/grap2graph/grap2graph.sh groff-1.22.3/contrib/grap2graph/grap2graph.sh
--- groff-1.22.3.orig/contrib/grap2graph/grap2graph.sh	2014-11-04 09:38:34 +0100
+++ groff-1.22.3/contrib/grap2graph/grap2graph.sh	2015-08-24 01:06:08 +0200
@@ -52,18 +52,24 @@ do
     shift
 done
 
 # create temporary directory
 tmp=
+filename=
+if [ "x${DJGPP}" == "x" ]; then
+filename=grap2graph-
+else
+filename=g2g
+endif
 for d in "$GROFF_TMPDIR" "$TMPDIR" "$TMP" "$TEMP" /tmp; do
     test -z "$d" && continue
 
-    tmp=`(umask 077 && mktemp -d -q "$d/grap2graph-XXXXXX") 2> /dev/null` \
+    tmp=`(umask 077 && mktemp -d -q "$d/${filename}XXXXXX") 2> /dev/null` \
     && test -n "$tmp" && test -d "$tmp" \
     && break
 
-    tmp=$d/grap2graph$$-$RANDOM
+    tmp=$d/${filename}$RANDOM
     (umask 077 && mkdir $tmp) 2> /dev/null && break
 done;
 if test -z "$tmp"; then
     echo "$0: cannot create temporary directory" >&2
     { (exit 1); exit 1; }
diff -aprNU5 groff-1.22.3.orig/contrib/pic2graph/pic2graph.sh groff-1.22.3/contrib/pic2graph/pic2graph.sh
--- groff-1.22.3.orig/contrib/pic2graph/pic2graph.sh	2014-11-04 09:38:34 +0100
+++ groff-1.22.3/contrib/pic2graph/pic2graph.sh	2015-08-24 01:06:08 +0200
@@ -66,18 +66,24 @@ then
     eqndelim="delim $eqndelim"
 fi
 
 # create temporary directory
 tmp=
+filename=
+if [ "x${DJGPP}" == "x" ]; then
+filename=pic2graph-
+else
+filename=p2g
+endif
 for d in "$GROFF_TMPDIR" "$TMPDIR" "$TMP" "$TEMP" /tmp; do
     test -z "$d" && continue
 
-    tmp=`(umask 077 && mktemp -d -q "$d/pic2graph-XXXXXX") 2> /dev/null` \
+    tmp=`(umask 077 && mktemp -d -q "$d/${filename}XXXXXX") 2> /dev/null` \
     && test -n "$tmp" && test -d "$tmp" \
     && break
 
-    tmp=$d/pic2graph$$-$RANDOM
+    tmp=$d/${filename}$RANDOM
     (umask 077 && mkdir $tmp) 2> /dev/null \
     && break
 done;
 if test -z "$tmp"; then
     echo "$0: cannot create temporary directory" >&2
diff -aprNU5 groff-1.22.3.orig/doc/groff.texinfo groff-1.22.3/doc/groff.texinfo
--- groff-1.22.3.orig/doc/groff.texinfo	2014-11-04 09:38:34 +0100
+++ groff-1.22.3/doc/groff.texinfo	2015-08-24 01:06:08 +0200
@@ -622,11 +622,11 @@ community.
 
 @code{groff} belongs to an older generation of document preparation
 systems, which operate more like compilers than the more recent
 interactive @acronym{WYSIWYG}@footnote{What You See Is What You Get}
 systems.  @code{groff} and its contemporary counterpart, @TeX{}, both
-work using a @dfn{batch} paradigm: The input (or @dfn{source}) files are
+work using a @dfn{batch} paradigm: the input (or @dfn{source}) files are
 normal text files with embedded formatting commands.  These files can
 then be processed by @code{groff} to produce a typeset document on a
 variety of devices.
 
 @code{groff} should not be confused with a @dfn{word processor}, an
@@ -765,11 +765,11 @@ A replacement for @code{ditroff} with ma
 
 @item
 The @code{soelim}, @code{pic}, @code{tbl}, and @code{eqn} preprocessors.
 
 @item
-Postprocessors for character devices, @sc{PostScript}, @TeX{} DVI, and
+Postprocessors for character devices, @acronym{PostScript}, @TeX{} DVI, and
 X@tie{}Windows.  GNU @code{troff} also eliminated the need for a
 separate @code{nroff} program with a postprocessor that would produce
 @acronym{ASCII} output.
 
 @item
@@ -930,11 +930,11 @@ mathematical pictures (@code{ideal}).
 @cindex output devices
 @cindex devices for output
 
 @code{groff} actually produces device independent code that may be fed
 into a postprocessor to produce output for a particular device.
-Currently, @code{groff} has postprocessors for @sc{PostScript} devices,
+Currently, @code{groff} has postprocessors for @acronym{PostScript} devices,
 character terminals, X@tie{}Windows (for previewing), @TeX{} DVI format,
 HP LaserJet@tie{}4 and Canon LBP printers (which use @acronym{CAPSL}),
 @acronym{HTML}, @acronym{XHTML}, and PDF.
 
 
@@ -1263,11 +1263,11 @@ Prepare output for device @var{dev}.  Th
 unless changed when @code{groff} was configured and built.  The
 following are the output devices currently available:
 
 @table @code
 @item ps
-For @sc{PostScript} printers and previewers.
+For @acronym{PostScript} printers and previewers.
 
 @item pdf
 For PDF viewers or printers.
 
 @item dvi
@@ -1373,11 +1373,11 @@ execute it.
 @item -X
 Preview with @code{gxditview} instead of using the usual postprocessor.
 This is unlikely to produce good results except with @option{-Tps}.
 
 Note that this is not the same as using @option{-TX75} or
-@option{-TX100} to view a document with @code{gxditview}: The former
+@option{-TX100} to view a document with @code{gxditview}: the former
 uses the metrics of the specified device, whereas the latter uses
 X-specific fonts and metrics.
 
 @item -z
 Suppress output from @code{gtroff}.  Only error messages are printed.
@@ -1668,15 +1668,15 @@ groff -X -m me file
 @noindent
 Preview @file{file} with @code{gxditview}, using the @file{me} macro
 package.  Since no @option{-T} option is specified, use the default
 device (@samp{ps}).  Note that you can either say @w{@samp{-m me}} or
 @w{@samp{-me}}; the latter is an anachronism from the early days of
-@acronym{UNIX}.@footnote{The same is true for the other main macro
+@acronym{UNIX}@footnote{The same is true for the other main macro
 packages that come with @code{groff}: @file{man}, @file{mdoc},
 @file{ms}, @file{mm}, and @file{mandoc}.  This won't work in general;
 for example, to load @file{trace.tmac}, either @samp{-mtrace} or
-@w{@samp{-m trace}} must be used.}
+@w{@samp{-m trace}} must be used.}.
 
 @Example
 groff -man -rD1 -z file
 @endExample
 
@@ -1760,12 +1760,12 @@ macro package.
 @section Basics
 @cindex basics of macros
 @cindex macro basics
 
 This section covers some of the basic concepts necessary to understand
-how to use a macro package.@footnote{This section is derived from
-@cite{Writing Papers with nroff using -me} by Eric P.@tie{}Allman.}
+how to use a macro package@footnote{This section is derived from
+@cite{Writing Papers with nroff using -me} by Eric P.@tie{}Allman.}.
 References are made throughout to more detailed information, if desired.
 
 @code{gtroff} reads an input file prepared by the user and outputs a
 formatted document suitable for publication or framing.  The input
 consists of text, or words to be printed, and embedded commands
diff -aprNU5 groff-1.22.3.orig/Makefile.in groff-1.22.3/Makefile.in
--- groff-1.22.3.orig/Makefile.in	2014-11-04 09:38:34 +0100
+++ groff-1.22.3/Makefile.in	2015-08-24 01:06:08 +0200
@@ -790,10 +790,19 @@ ENVSETUP=\
 	   test -f $(srcdir)/Makefile.ccpg*; then \
 	  FNCASE=y; export FNCASE; \
 	else :; \
 	fi
 
+# For pure DOS environments there is a 8.3 file name restriction.
+# Adjust the version nummer that will become part of the path accordingly
+# by removing all dots.
+ifneq ($(DJGPP),)
+revision=`sed -e 's/^0$$//' -e 's/\\.//g' $(top_srcdir)/REVISION`
+SFN_PACKAGE_TARNAME=`echo $(PACKAGE_TARNAME) | sed -e 's/\\.//2g'`
+docdir=${datarootdir}/doc/${SFN_PACKAGE_TARNAME}
+endif
+
 do=all
 dodirs=$(ALLDIRS) $(OTHERDIRS) dot
 # Default target for subdir_Makefile
 subdir=src/roff/troff
 
diff -aprNU5 groff-1.22.3.orig/src/include/nonposix.h groff-1.22.3/src/include/nonposix.h
--- groff-1.22.3.orig/src/include/nonposix.h	2014-11-04 09:38:34 +0100
+++ groff-1.22.3/src/include/nonposix.h	2015-08-24 01:06:08 +0200
@@ -63,10 +63,12 @@ along with this program. If not, see <ht
 #  define dup(f)	_dup(f)
 #  define dup2(f1,f2)	_dup2(f1,f2)
 #  define close(f)	_close(f)
 #  define isatty(f)	_isatty(f)
 #  define access(p,m)	_access(p,m)
+#  define P_WAIT	_P_WAIT
+#  define P_NOWAIT	_P_NOWAIT
 # endif
 # define SET_BINARY(f)	do {if (!isatty(f)) setmode(f,O_BINARY);} while(0)
 # define FOPEN_RB	"rb"
 # define FOPEN_WB	"wb"
 # define FOPEN_RWB	"wb+"
diff -aprNU5 groff-1.22.3.orig/src/preproc/refer/Makefile.sub groff-1.22.3/src/preproc/refer/Makefile.sub
--- groff-1.22.3.orig/src/preproc/refer/Makefile.sub	2014-11-04 09:38:34 +0100
+++ groff-1.22.3/src/preproc/refer/Makefile.sub	2015-08-24 01:06:08 +0200
@@ -45,11 +45,11 @@ HDRS=\
 GRAM=$(srcdir)/label.y
 YTABC=label.cpp
 NAMEPREFIX=$(g)
 
 .PHONY: install_data
-install_data: refer
+install_data: $(PROG)
 	-test -d $(DESTDIR)$(referdir) \
 	  || $(mkinstalldirs) $(DESTDIR)$(referdir)
 
 .PHONY: uninstall_data
 uninstall_sub:
diff -aprNU5 groff-1.22.3.orig/src/roff/groff/pipeline.c groff-1.22.3/src/roff/groff/pipeline.c
--- groff-1.22.3.orig/src/roff/groff/pipeline.c	2014-11-04 09:38:34 +0100
+++ groff-1.22.3/src/roff/groff/pipeline.c	2015-08-24 01:07:54 +0200
@@ -145,15 +145,15 @@ char *system_shell_name(void)
      not, try cmd.exe; if that fails, default to command.com.
    */
 
   if ((shell_name = getenv("SHELL")) != NULL)
     ;
-  else if (spawnlp(_P_WAIT, sh, sh, "-c", ":", NULL) == 0)
+  else if (spawnlp(P_WAIT, sh, sh, "-c", ":", NULL) == 0)
     shell_name = sh;
   else if ((shell_name = getenv("COMSPEC")) != NULL)
     ;
-  else if (spawnlp(_P_WAIT, cmd, cmd, "/c", ";", NULL) == 0)
+  else if (spawnlp(P_WAIT, cmd, cmd, "/c", ";", NULL) == 0)
     shell_name = cmd;
   else
     shell_name = command;
 
   return sbasename(shell_name);
@@ -299,11 +299,11 @@ int run_pipeline(int ncommands, char ***
 	  sprintf(err_str, "%s: close(save_stdout)", commands[i][0]);
  	  sys_fatal(err_str);
  	}
       }
     }
-    if ((pid = spawnvp(_P_NOWAIT, commands[i][0], commands[i])) < 0) {
+    if ((pid = spawnvp(P_NOWAIT, commands[i][0], commands[i])) < 0) {
       error("couldn't exec %1: %2",
 	    commands[i][0], strerror(errno), (char *)0);
       fflush(stderr);			/* just in case error() doesn't */
       _exit(EXEC_FAILED_EXIT_STATUS);
     }
@@ -368,11 +368,12 @@ int run_pipeline(int ncommands, char ***
      if it exists; in case it doesn't, try the GROFF alternatives, or
      `getenv("TEMP")' as last resort -- at least one of these had better
      be set, since Microsoft's default has a high probability of failure. */
   char *tmpdir;
   if ((tmpdir = getenv("GROFF_TMPDIR")) == NULL
-      && (tmpdir = getenv("TMPDIR")) == NULL)
+      && (tmpdir = getenv("TMPDIR")) == NULL
+      && (tmpdir = getenv("TMP")) == NULL)
     tmpdir = getenv("TEMP");
 
   /* Don't use `tmpnam' here: Microsoft's implementation yields unusable
      file names if current directory is on network share with read-only
      root. */
