diff -acrpNC5 sharutils-4.2.2.orig/acinclude.m4 sharutils-4.2.2.djgpp/acinclude.m4
*** sharutils-4.2.2.orig/acinclude.m4	Thu Jan  1 00:00:00 1970
--- sharutils-4.2.2.djgpp/acinclude.m4	Sun Oct  1 23:38:28 2000
***************
*** 0 ****
--- 1,376 ----
+ # Do all the work for Automake.  This macro actually does too much --
+ # some checks are only needed if your package does certain things.
+ # But this isn't really a big deal.
+ 
+ # serial 1
+ 
+ dnl Usage:
+ dnl AM_INIT_AUTOMAKE(package,version)
+ 
+ AC_DEFUN(AM_INIT_AUTOMAKE,
+ [AC_REQUIRE([AC_PROG_INSTALL])
+ PACKAGE=[$1]
+ AC_SUBST(PACKAGE)
+ VERSION=[$2]
+ AC_SUBST(VERSION)
+ dnl test to see if srcdir already configured
+ if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
+   AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
+ fi
+ ifelse([$3],,
+ AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
+ AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package]))
+ AC_REQUIRE([AM_SANITY_CHECK])
+ AC_REQUIRE([AC_ARG_PROGRAM])
+ dnl FIXME This is truly gross.
+ missing_dir=`cd $ac_aux_dir && pwd`
+ AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir)
+ AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir)
+ AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir)
+ AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir)
+ AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir)
+ AC_REQUIRE([AC_PROG_MAKE_SET])])
+ 
+ 
+ # Macro to add for using GNU gettext.
+ # Ulrich Drepper <drepper@cygnus.com>, 1995.
+ #
+ # This file can be copied and used freely without restrictions.  It can
+ # be used in projects which are not available under the GNU Public License
+ # but which still want to provide support for the GNU gettext functionality.
+ # Please note that the actual code is *not* freely available.
+ # This is from the DJGPP port of gettext-0.10.35.
+ 
+ # serial 5
+ 
+ AC_DEFUN(AM_WITH_NLS,
+   [AC_MSG_CHECKING([whether NLS is requested])
+     dnl Default is enabled NLS
+     AC_ARG_ENABLE(nls,
+       [  --disable-nls           do not use Native Language Support],
+       USE_NLS=$enableval, USE_NLS=yes)
+     AC_MSG_RESULT($USE_NLS)
+     AC_SUBST(USE_NLS)
+ 
+     USE_INCLUDED_LIBINTL=no
+ 
+     dnl If we use NLS figure out what method
+     if test "$USE_NLS" = "yes"; then
+       AC_DEFINE(ENABLE_NLS)
+       AC_MSG_CHECKING([whether included gettext is requested])
+       AC_ARG_WITH(included-gettext,
+         [  --with-included-gettext use the GNU gettext library included here],
+         nls_cv_force_use_gnu_gettext=$withval,
+         nls_cv_force_use_gnu_gettext=no)
+       AC_MSG_RESULT($nls_cv_force_use_gnu_gettext)
+ 
+       nls_cv_use_gnu_gettext="$nls_cv_force_use_gnu_gettext"
+       if test "$nls_cv_force_use_gnu_gettext" != "yes"; then
+         dnl User does not insist on using GNU NLS library.  Figure out what
+         dnl to use.  If gettext or catgets are available (in this order) we
+         dnl use this.  Else we have to fall back to GNU NLS library.
+ 	dnl catgets is only used if permitted by option --with-catgets.
+ 	nls_cv_header_intl=
+ 	nls_cv_header_libgt=
+ 	CATOBJEXT=NONE
+ 
+ 	AC_CHECK_HEADER(libintl.h,
+ 	  [AC_CACHE_CHECK([for gettext in libc], gt_cv_func_gettext_libc,
+ 	    [AC_TRY_LINK([#include <libintl.h>], [return (int) gettext ("")],
+ 	       gt_cv_func_gettext_libc=yes, gt_cv_func_gettext_libc=no)])
+ 
+ 	   if test "$gt_cv_func_gettext_libc" != "yes"; then
+ 	     AC_CHECK_LIB(intl, bindtextdomain,
+ 	       [AC_CACHE_CHECK([for gettext in libintl],
+ 		 gt_cv_func_gettext_libintl,
+ 		 [AC_CHECK_LIB(intl, gettext,
+ 		  gt_cv_func_gettext_libintl=yes,
+ 		  gt_cv_func_gettext_libintl=no)],
+ 		 gt_cv_func_gettext_libintl=no)])
+ 
+ 	      if test "$gt_cv_func_gettext_libintl" = yes; then
+ 	        LIBS="$LIBS -lintl"
+ 	      fi
+ 
+ 	   fi
+ 
+ 	   if test "$gt_cv_func_gettext_libc" = "yes" \
+ 	      || test "$gt_cv_func_gettext_libintl" = "yes"; then
+ 	      AC_DEFINE(HAVE_GETTEXT)
+ 	      AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
+ 		[test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"], no)dnl
+ 	      if test "$MSGFMT" != "no"; then
+ 		AC_CHECK_FUNCS(dcgettext)
+ 		AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
+ 		AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
+ 		  [test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :)
+ 		AC_TRY_LINK(, [extern int _nl_msg_cat_cntr;
+ 			       return _nl_msg_cat_cntr],
+ 		  [CATOBJEXT=.gmo
+ 		   DATADIRNAME=share],
+ 		  [CATOBJEXT=.mo
+ 		   DATADIRNAME=lib])
+ 		INSTOBJEXT=.mo
+ 	      fi
+ 	    fi
+ 	])
+ 
+         if test "$CATOBJEXT" = "NONE"; then
+ 	  AC_MSG_CHECKING([whether catgets can be used])
+ 	  AC_ARG_WITH(catgets,
+ 	    [  --with-catgets          use catgets functions if available],
+ 	    nls_cv_use_catgets=$withval, nls_cv_use_catgets=no)
+ 	  AC_MSG_RESULT($nls_cv_use_catgets)
+ 
+ 	  if test "$nls_cv_use_catgets" = "yes"; then
+ 	    dnl No gettext in C library.  Try catgets next.
+ 	    AC_CHECK_LIB(i, main)
+ 	    AC_CHECK_FUNC(catgets,
+ 	      [AC_DEFINE(HAVE_CATGETS)
+ 	       INTLOBJS="\$(CATOBJS)"
+ 	       AC_PATH_PROG(GENCAT, gencat, no)dnl
+ 	       if test "$GENCAT" != "no"; then
+ 		 AC_PATH_PROG(GMSGFMT, gmsgfmt, no)
+ 		 if test "$GMSGFMT" = "no"; then
+ 		   AM_PATH_PROG_WITH_TEST(GMSGFMT, msgfmt,
+ 		    [test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"], no)
+ 		 fi
+ 		 AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
+ 		   [test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :)
+ 		 USE_INCLUDED_LIBINTL=yes
+ 		 CATOBJEXT=.cat
+ 		 INSTOBJEXT=.cat
+ 		 DATADIRNAME=lib
+ 		 INTLDEPS='$(top_builddir)/intl/libintl.a'
+ 		 INTLLIBS=$INTLDEPS
+ 		 LIBS=`echo $LIBS | sed -e 's/-lintl//'`
+ 		 nls_cv_header_intl=intl/libintl.h
+ 		 nls_cv_header_libgt=intl/libgettext.h
+ 	       fi])
+ 	  fi
+         fi
+ 
+         if test "$CATOBJEXT" = "NONE"; then
+ 	  dnl Neither gettext nor catgets in included in the C library.
+ 	  dnl Fall back on GNU gettext library.
+ 	  nls_cv_use_gnu_gettext=yes
+         fi
+       fi
+ 
+       if test "$nls_cv_use_gnu_gettext" = "yes"; then
+         dnl Mark actions used to generate GNU NLS library.
+         INTLOBJS="\$(GETTOBJS)"
+         AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
+ 	  [test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"], msgfmt)
+         AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
+         AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
+ 	  [test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :)
+         AC_SUBST(MSGFMT)
+ 	USE_INCLUDED_LIBINTL=yes
+         CATOBJEXT=.gmo
+         INSTOBJEXT=.mo
+         DATADIRNAME=share
+ 	INTLDEPS='$(top_builddir)/intl/libintl.a'
+ 	INTLLIBS=$INTLDEPS
+ 	LIBS=`echo $LIBS | sed -e 's/-lintl//'`
+         nls_cv_header_intl=intl/libintl.h
+         nls_cv_header_libgt=intl/libgettext.h
+       fi
+ 
+       dnl Test whether we really found GNU xgettext.
+       if test "$XGETTEXT" != ":"; then
+ 	dnl If it is no GNU xgettext we define it as : so that the
+ 	dnl Makefiles still can work.
+ 	if $XGETTEXT --omit-header /dev/null 2> /dev/null; then
+ 	  : ;
+ 	else
+ 	  AC_MSG_RESULT(
+ 	    [found xgettext program is not GNU xgettext; ignore it])
+ 	  XGETTEXT=":"
+ 	fi
+       fi
+ 
+       # We need to process the po/ directory.
+       POSUB=po
+     else
+       DATADIRNAME=share
+       nls_cv_header_intl=intl/libintl.h
+       nls_cv_header_libgt=intl/libgettext.h
+     fi
+     AC_LINK_FILES($nls_cv_header_libgt, $nls_cv_header_intl)
+     AC_OUTPUT_COMMANDS(
+      [case "$CONFIG_FILES" in *po/Makefile.in*)
+         sed -e "/POTFILES =/r po/POTFILES" po/Makefile.in > po/Makefile
+       esac])
+ 
+ 
+     # If this is used in GNU gettext we have to set USE_NLS to `yes'
+     # because some of the sources are only built for this goal.
+     if test "$PACKAGE" = gettext; then
+       USE_NLS=yes
+       USE_INCLUDED_LIBINTL=yes
+     fi
+ 
+     dnl These rules are solely for the distribution goal.  While doing this
+     dnl we only have to keep exactly one list of the available catalogs
+     dnl in configure.in.
+     for lang in $ALL_LINGUAS; do
+       GMOFILES="$GMOFILES $lang.gmo"
+       POFILES="$POFILES $lang.po"
+     done
+ 
+     dnl Make all variables we use known to autoconf.
+     AC_SUBST(USE_INCLUDED_LIBINTL)
+     AC_SUBST(CATALOGS)
+     AC_SUBST(CATOBJEXT)
+     AC_SUBST(DATADIRNAME)
+     AC_SUBST(GMOFILES)
+     AC_SUBST(INSTOBJEXT)
+     AC_SUBST(INTLDEPS)
+     AC_SUBST(INTLLIBS)
+     AC_SUBST(INTLOBJS)
+     AC_SUBST(POFILES)
+     AC_SUBST(POSUB)
+   ])
+ 
+ AC_DEFUN(AM_GNU_GETTEXT,
+   [AC_REQUIRE([AC_PROG_MAKE_SET])dnl
+    AC_REQUIRE([AC_PROG_CC])dnl
+    AC_REQUIRE([AC_PROG_RANLIB])dnl
+    AC_REQUIRE([AC_ISC_POSIX])dnl
+    AC_REQUIRE([AC_HEADER_STDC])dnl
+    AC_REQUIRE([AC_C_CONST])dnl
+    AC_REQUIRE([AC_C_INLINE])dnl
+    AC_REQUIRE([AC_TYPE_OFF_T])dnl
+    AC_REQUIRE([AC_TYPE_SIZE_T])dnl
+    AC_REQUIRE([AC_FUNC_ALLOCA])dnl
+    AC_REQUIRE([AC_FUNC_MMAP])dnl
+ 
+    AC_CHECK_HEADERS([argz.h limits.h locale.h nl_types.h malloc.h string.h \
+ unistd.h sys/param.h])
+    AC_CHECK_FUNCS([getcwd munmap putenv setenv setlocale strchr strcasecmp \
+ strdup __argz_count __argz_stringify __argz_next])
+ 
+    if test "${ac_cv_func_stpcpy+set}" != "set"; then
+      AC_CHECK_FUNCS(stpcpy)
+    fi
+    if test "${ac_cv_func_stpcpy}" = "yes"; then
+      AC_DEFINE(HAVE_STPCPY)
+    fi
+ 
+    AM_LC_MESSAGES
+    AM_WITH_NLS
+ 
+    if test "x$CATOBJEXT" != "x"; then
+      if test "x$ALL_LINGUAS" = "x"; then
+        LINGUAS=
+      else
+        AC_MSG_CHECKING(for catalogs to be installed)
+        NEW_LINGUAS=
+        for lang in ${LINGUAS=$ALL_LINGUAS}; do
+          case "$ALL_LINGUAS" in
+           *$lang*) NEW_LINGUAS="$NEW_LINGUAS $lang" ;;
+          esac
+        done
+        LINGUAS=$NEW_LINGUAS
+        AC_MSG_RESULT($LINGUAS)
+      fi
+ 
+      dnl Construct list of names of catalog files to be constructed.
+      if test -n "$LINGUAS"; then
+        for lang in $LINGUAS; do CATALOGS="$CATALOGS $lang$CATOBJEXT"; done
+      fi
+    fi
+ 
+    dnl The reference to <locale.h> in the installed <libintl.h> file
+    dnl must be resolved because we cannot expect the users of this
+    dnl to define HAVE_LOCALE_H.
+    if test $ac_cv_header_locale_h = yes; then
+      INCLUDE_LOCALE_H="#include <locale.h>"
+    else
+      INCLUDE_LOCALE_H="\
+ /* The system does not provide the header <locale.h>.  Take care yourself.  */"
+    fi
+    AC_SUBST(INCLUDE_LOCALE_H)
+ 
+    dnl Determine which catalog format we have (if any is needed)
+    dnl For now we know about two different formats:
+    dnl   Linux libc-5 and the normal X/Open format
+    test -d intl || mkdir intl
+    if test "$CATOBJEXT" = ".cat"; then
+      AC_CHECK_HEADER(linux/version.h, msgformat=linux, msgformat=xopen)
+ 
+      dnl Transform the SED scripts while copying because some dumb SEDs
+      dnl cannot handle comments.
+      sed -e '/^#/d' $srcdir/intl/$msgformat-msg.sed > intl/po2msg.sed
+    fi
+    dnl po2tbl.sed is always needed.
+    sed -e '/^#.*[^\\]$/d' -e '/^#$/d' \
+      $srcdir/intl/po2tbl.sed.in > intl/po2tbl.sed
+ 
+    dnl In the intl/Makefile.in we have a special dependency which makes
+    dnl only sense for gettext.  We comment this out for non-gettext
+    dnl packages.
+    if test "$PACKAGE" = "gettext"; then
+      GT_NO="#NO#"
+      GT_YES=
+    else
+      GT_NO=
+      GT_YES="#YES#"
+    fi
+    AC_SUBST(GT_NO)
+    AC_SUBST(GT_YES)
+ 
+    dnl If the AC_CONFIG_AUX_DIR macro for autoconf is used we possibly
+    dnl find the mkinstalldirs script in another subdir but ($top_srcdir).
+    dnl Try to locate is.
+    MKINSTALLDIRS=
+    if test -n "$ac_aux_dir"; then
+      MKINSTALLDIRS="$ac_aux_dir/mkinstalldirs"
+    fi
+    if test -z "$MKINSTALLDIRS"; then
+      MKINSTALLDIRS="\$(top_srcdir)/mkinstalldirs"
+    fi
+    AC_SUBST(MKINSTALLDIRS)
+ 
+    dnl *** For now the libtool support in intl/Makefile is not for real.
+    l=
+    AC_SUBST(l)
+ 
+    dnl Generate list of files to be processed by xgettext which will
+    dnl be included in po/Makefile.
+    test -d po || mkdir po
+    if test "x$srcdir" != "x."; then
+      if test "x`echo $srcdir | sed 's@/.*@@'`" = "x"; then
+        posrcprefix="$srcdir/"
+      else
+        posrcprefix="../$srcdir/"
+      fi
+    else
+      posrcprefix="../"
+    fi
+    rm -f po/POTFILES
+    sed -e "/^#/d" -e "/^\$/d" -e "s,.*,	$posrcprefix& \\\\," -e "\$s/\(.*\) \\\\/\1/" \
+ 	< $srcdir/po/POTFILES.in > po/POTFILES
+   ])
+ 
+ 
+ # Check whether LC_MESSAGES is available in <locale.h>.
+ # Ulrich Drepper <drepper@cygnus.com>, 1995.
+ #
+ # This file can be copied and used freely without restrictions.  It can
+ # be used in projects which are not available under the GNU Public License
+ # but which still want to provide support for the GNU gettext functionality.
+ # Please note that the actual code is *not* freely available.
+ 
+ # serial 1
+ 
+ AC_DEFUN(AM_LC_MESSAGES,
+   [if test $ac_cv_header_locale_h = yes; then
+     AC_CACHE_CHECK([for LC_MESSAGES], am_cv_val_LC_MESSAGES,
+       [AC_TRY_LINK([#include <locale.h>], [return LC_MESSAGES],
+        am_cv_val_LC_MESSAGES=yes, am_cv_val_LC_MESSAGES=no)])
+     if test $am_cv_val_LC_MESSAGES = yes; then
+       AC_DEFINE(HAVE_LC_MESSAGES)
+     fi
+   fi])
diff -acrpNC5 sharutils-4.2.2.orig/configure.in sharutils-4.2.2.djgpp/configure.in
*** sharutils-4.2.2.orig/configure.in	Tue Dec  3 15:38:34 1996
--- sharutils-4.2.2.djgpp/configure.in	Mon Oct  2 14:17:22 2000
***************
*** 5,26 ****
  # FIXME: AC_HAVE_HEADERS(sys/time.h)
  # FIXME: AC_HAVE_FUNCS(gethostname getwd)
  
  AC_INIT(src/shar.c)
  AM_INIT_AUTOMAKE(sharutils,4.2c)
! AC_CONFIG_HEADER(config.h)
  
  changequote(,)dnl
  case $VERSION in
    [0-9]*.[0-9]*.[0-9]*) DIST_ALPHA="README-alpha";;
    *) DIST_ALPHA=;;
  esac
  changequote([, ])dnl
  AC_SUBST(DIST_ALPHA)
  
  dnl Set of available languages.
! ALL_LINGUAS="de fr ja_JP.EUC nl no no@nynorsk pt sv"
  
  AC_ARG_PROGRAM
  
  ADD_PROG=
  ADD_SCRIPT="mail-files mailshar"
--- 5,26 ----
  # FIXME: AC_HAVE_HEADERS(sys/time.h)
  # FIXME: AC_HAVE_FUNCS(gethostname getwd)
  
  AC_INIT(src/shar.c)
  AM_INIT_AUTOMAKE(sharutils,4.2c)
! AM_CONFIG_HEADER(config.h:config.h-in)
  
  changequote(,)dnl
  case $VERSION in
    [0-9]*.[0-9]*.[0-9]*) DIST_ALPHA="README-alpha";;
    *) DIST_ALPHA=;;
  esac
  changequote([, ])dnl
  AC_SUBST(DIST_ALPHA)
  
  dnl Set of available languages.
! ALL_LINGUAS="de fr ja_JP_EUC nl no no@nynorsk pt sv"
  
  AC_ARG_PROGRAM
  
  ADD_PROG=
  ADD_SCRIPT="mail-files mailshar"
*************** AC_SUBST(ADD_PROG)
*** 30,40 ****
  AC_SUBST(ADD_SCRIPT)
  AC_SUBST(MAN1PAGES)
  AC_SUBST(MAN5PAGES)
  
  AC_PROG_CC
! AM_PROG_INSTALL
  AC_PROG_MAKE_SET
  AC_PROG_RANLIB
  
  dnl FIXME: Check that it is GNU diff indeed.
  # Carefully avoid gdiff for X as found on SGI systems.
--- 30,40 ----
  AC_SUBST(ADD_SCRIPT)
  AC_SUBST(MAN1PAGES)
  AC_SUBST(MAN5PAGES)
  
  AC_PROG_CC
! AC_PROG_INSTALL
  AC_PROG_MAKE_SET
  AC_PROG_RANLIB
  
  dnl FIXME: Check that it is GNU diff indeed.
  # Carefully avoid gdiff for X as found on SGI systems.
*************** if test $cross_compiling = no; then
*** 68,78 ****
  fi
  AC_C_CONST
  AC_C_INLINE
  AC_C_BIGENDIAN
  
! AC_CHECK_HEADERS(limits.h locale.h memory.h string.h sys/wait.h unistd.h)
  AC_HEADER_DIRENT
  AC_HEADER_STAT
  AC_HEADER_STDC
  AC_STRUCT_TIMEZONE
  AC_TYPE_SIZE_T
--- 68,78 ----
  fi
  AC_C_CONST
  AC_C_INLINE
  AC_C_BIGENDIAN
  
! AC_CHECK_HEADERS(limits.h locale.h memory.h string.h sys/wait.h unistd.h fcntl.h sys/fcntl.h)
  AC_HEADER_DIRENT
  AC_HEADER_STAT
  AC_HEADER_STDC
  AC_STRUCT_TIMEZONE
  AC_TYPE_SIZE_T
*************** fi], [
*** 111,133 ****
  ])
  
  AM_GNU_GETTEXT
  AM_WITH_DMALLOC
  
- # sharutils is somewhat special about internationalization in that it
- # always requires the GNU .mo files installed.
- if test "x$CATOBJEXT" = "x.mo" || test "x$CATOBJEXT" = "x.cat"; then
-   new_CATALOGS=""
-   for cat in $CATALOGS; do
-     lang=`echo $cat | sed "s/\(.*\)\..*/\1/"`
-     new_CATALOGS="$new_CATALOGS $cat $lang.gmo"
-   done
-   CATALOGS="$new_CATALOGS"
- fi
- 
- AC_LINK_FILES($nls_cv_header_libgt, $nls_cv_header_intl)
- 
  AC_OUTPUT([Makefile src/mail-files src/mailshar src/remsync contrib/Makefile \
  	   lib/Makefile intl/Makefile intl/po2tbl.sed src/Makefile \
  	   po/Makefile.in doc/Makefile tests/Makefile],
  [sed -e "/POTFILES =/r po/POTFILES" po/Makefile.in > po/Makefile; \
   test -z "$CONFIG_HEADERS" || echo timestamp > stamp-h])
--- 111,120 ----
diff -acrpNC5 sharutils-4.2.2.orig/doc/Makefile.am sharutils-4.2.2.djgpp/doc/Makefile.am
*** sharutils-4.2.2.orig/doc/Makefile.am	Tue Dec  3 14:45:34 1996
--- sharutils-4.2.2.djgpp/doc/Makefile.am	Mon Oct  9 00:16:52 2000
***************
*** 19,34 ****
  
  info_TEXINFOS = sharutils.texi
  
  DISTCLEANFILES = uudecode.1
  
! mandir = $(prefix)/man
! man1dir = $(mandir)/man1
! man5dir = $(mandir)/man5
! 
  man1_MANS = shar.1 unshar.1 @MAN1PAGES@
- noinst_MANS = uuencode.1 uuencode.5
  # Is this the only way I can prevent uudecode.1 from being shipped?
  man1_SCRIPTS = uudecode.1
  man5_MANS = @MAN5PAGES@
  
  uudecode.1: Makefile
--- 19,30 ----
  
  info_TEXINFOS = sharutils.texi
  
  DISTCLEANFILES = uudecode.1
  
! man_MANS = $(man1_MANS) $(man5_MANS)
  man1_MANS = shar.1 unshar.1 @MAN1PAGES@
  # Is this the only way I can prevent uudecode.1 from being shipped?
  man1_SCRIPTS = uudecode.1
  man5_MANS = @MAN5PAGES@
  
  uudecode.1: Makefile
diff -acrpNC5 sharutils-4.2.2.orig/doc/shar.1 sharutils-4.2.2.djgpp/doc/shar.1
*** sharutils-4.2.2.orig/doc/shar.1	Thu Jan  1 00:00:00 1970
--- sharutils-4.2.2.djgpp/doc/shar.1	Wed Sep 27 21:20:22 2000
***************
*** 0 ****
--- 1,243 ----
+ .TH SHAR 1 "September 10, 1995"
+ .SH NAME
+ shar \- create shell archives
+ .SH SYNOPSIS
+ .nf
+ shar [ options ] file ...
+ shar \-S [ options ]
+ .fi
+ .SH DESCRIPTION
+ Shar
+ creates "shell archives" (or shar files) which are in text format
+ and can be mailed.  These files may be unpacked later by executing them
+ with /bin/sh.  The resulting archive is sent to standard out unless the
+ \f2\-o\f1 option is given.  A wide range of features provide extensive
+ flexibility in manufacturing shars and in specifying shar "smartness".
+ Archives may be "vanilla" or comprehensive.
+ .SH OPTIONS
+ .PP
+ Options have a one letter version starting with \- or a long version starting
+ with \-\-.  The exception is \f2\-\-help\f1, \f2\-\-version\f1,
+ \f2\-\-no-i18n\f1 and \f2\-\-print-text-domain-dir\f1 which does not
+ have short versions.
+ Mandatory arguments to long options are mandatory for short options too.
+ Options can be given in any order.  Some options depend on each other:
+ .nf
+ 	The \f2\-o\f1 option is required if the \f2\-l\f1 or \f2\-L\f1 option is used.
+ 	The \f2\-n\f1 option is required if the \f2\-a\f1 option is used.
+ 	See \f2\-V\f1 below.
+ .fi
+ .SS "Giving feedback:"
+ .IP "\f2\-\-help\f1"
+ Print a help summary on standard output, then immediately exits.
+ .IP "\f2\-\-version\f1"
+ Print the version number of the program on standard output,
+ then immediately exits.
+ .IP "\f2\-q\f1 \f2\-\-quiet\f1 \f2\-\-silent\f1"
+ Do not output verbose messages locally when producing the archive.
+ .SS "Selecting files:"
+ .IP "\f2\-p\f1  \f2\-\-intermix-type\f1"
+ Allow positional parameter options.  The options \f2\-B\f1, \f2\-T\f1,
+ \f2-z\f1 and \f2\-Z\f1 may be embedded, and files to the right of the
+ option will be processed in the specified mode.
+ .IP "\f2\-S\f1  \f2\-\-stdin-file-list\f1"
+ Read list of files to be packed from the standard input rather
+ than from the command line.  Input must be in a form similar to
+ that generated by the find command, one filename per line.  This
+ switch is especially useful when the command line will not hold
+ the list of files to be packed.  For example:
+ .nf
+ 
+ find . \-type f \-print | sort | shar \-S \-Z \-L50 \-o /tmp/big
+ 
+ .fi
+ If \f2\-p\f1 is specified on the command line, then the options
+ \f2\-B\f1, \f2\-T\f1, \f2\-z\f1 and \f2\-Z\f1 may be
+ included in the standard input (on a line separate from filenames).
+ The maximum number of lines of standard input, file names and
+ options, may not exceed 1024.
+ .SS "Splitting output:"
+ .IP "\f2\-o\f1 XXX  \f2\-\-output-prefix=\f1XXX"
+ Save the archive to files XXX.01 thru XXX.nn instead of sending it to
+ standard out.
+ Must be used when the \f2\-l\f1 or the \f2\-L\f1 switches are used.
+ .IP "\f2\-l\f1 XX  \f2\-\-whole-size-limit=\f1XX"
+ Limit the output file size to XXk bytes but don't split input files.
+ .IP "\f2\-L\f1 XX  \f2\-\-split-size-limit=\f1XX"
+ Limit output file size to XXk bytes and split files if necessary.  The archive
+ parts created with this option must be unpacked in correct order.
+ .SS "Controlling the shar headers:"
+ .IP "\f2\-n\f1 name  \f2\-\-archive-name=\f1name"
+ Name of archive to be included in the header of the shar files.
+ See the \f2\-a\f1 switch.
+ .IP "\f2\-s\f1 who@where  \f2\-\-submitter=\f1who@where"
+ Override automatically determined submitter name.
+ .IP "\f2\-a\f1  \f2\-\-net-headers\f1"
+ Allows automatic generation of headers:
+ .nf
+ 	Submitted-by: who@where
+ 	Archive-name: <name>/part##
+ .fi
+ The <name> must be given with the \f2\-n\f1 switch.
+ If name includes a '/' "/part" isn't used.  Thus:
+ .RS 10m
+ .nf
+ .ta 30n
+ \-n xyzzy	produces:
+ 	xyzzy/part01
+ 	xyzzy/part02
+ 
+ \-n xyzzy/patch	produces:
+ 	xyzzy/patch01
+ 	xyzzy/patch02
+ 
+ \-n xyzzy/patch01.	produces:
+ 	xyzzy/patch01.01
+ 	xyzzy/patch01.02
+ .RE
+ .fi
+ .IP ""
+ The who@where can be
+ explicitly stated with the \f2\-s\f1 switch if the default isn't appropriate.
+ Who@where is essentially built as `whoami`@`uname`.
+ .IP "\f2\-c\f1  \f2\-\-cut-mark\f1"
+ Start the shar with a cut line.  A line saying 'Cut here' is placed at the
+ start of each output file.
+ .SS "Selecting how files are stocked:"
+ .IP "\f2\-M\f1  \f2\-\-mixed-uuencode\f1"
+ Mixed mode.  Determine if the files are text or binary and archive
+ correctly (default).  Files found to be binary are uudecoded prior to packing
+ (USE OF UUENCODE IS NOT APPRECIATED BY MANY ON THE NET).
+ .IP "\f2\-T\f1  \f2\-\-text-files\f1"
+ Treat all files as text.
+ .IP "\f2\-B\f1  \f2\-\-uuencode\f1"
+ Treat all files as binary, use uuencode prior to packing.  This increases the
+ size of the archive.  The recipient must have uudecode in order to unpack.
+ (USE OF UUENCODE IS NOT APPRECIATED BY MANY ON THE NET).
+ .IP "\f2\-z\f1  \f2\-\-gzip\f1"
+ Gzip and uuencode all files prior to packing.  The recipient must have
+ uudecode and gzip in order to unpack
+ (USE OF UUENCODE AND GZIP IS NOT APPRECIATED BY MANY ON THE NET).
+ .IP "\f2\-g\f1 LEVEL  \f2\-\-level-for-gzip=\f1LEVEL"
+ When doing compression, use '\-LEVEL' as a parameter to gzip.  Default is 9.
+ The \f2\-g\f1 option turns on the \f2\-z\f1 option by default.
+ .IP "\f2\-Z\f1  \f2\-\-compress\f1"
+ Compress and uuencode all files prior to packing.  The recipient must have
+ uudecode and compress in order to unpack
+ (USE OF UUENCODE AND COMPRESS IS NOT APPRECIATED BY MANY ON THE NET).
+ Option \f2\-C\f1 is synonymous to \f2\-Z\f1, but is being deprecated.
+ .IP "\f2\-b\f1 BITS  \f2\-\-bits-per-code=\f1BITS"
+ When doing compression, use '\-bBITS' as a parameter to compress.
+ The \f2\-B\f1 option turns on the \f2\-Z\f1 option by default.  Default value
+ is 12.
+ .SS "Protecting against transmission errors:"
+ .IP "\f2\-w\f1  \f2\-\-no-character-count\f1"
+ Do NOT check each file with 'wc \-c' after unpack.  The default is to check.
+ .IP "\f2\-D\f1  \f2\-\-no-md5-digest\f1"
+ Do NOT use 'md5sum' digest to verify the unpacked files. The default is to
+ check.
+ .IP "\f2\-F\f1  \f2\-\-force-prefix\f1"
+ Forces the prefix character (normally 'X' unless the parameter to the \f2\-d\f1
+ option starts with 'X') to be prepended to every line even if
+ not required.  This option may slightly increase the size of the archive,
+ especially if \f2\-B\f1 or \f2\-Z\f1 is used.
+ .IP "\f2\-d\f1 XXX  \f2\-\-here-delimiter=\f1XXX"
+ Use XXX to delimit the files in the shar instead of SHAR_EOF.
+ This is for those who want to personalize their shar files.
+ .SS "Producing different kinds of shars:"
+ .IP "\f2\-V\f1  \f2\-\-vanilla-operation\f1"
+ Produce "vanilla" shars which rely only upon the existence of sed and
+ echo in the unsharing environment.  In addition, "if test" must also
+ be supported unless the \f2\-x\f1 option is used.  The \f2\-V\f1 silently
+ disables options offensive to the "network cop" (or "brown shirt"),
+ but does warn you if it is specified with \f2\-B\f1, \f2-z\f1,
+ \f2\-Z\f1, \f2\-p\f1 or \f2\-M\f1 (any of which does or might
+ require uudecode, gzip or compress in the unsharing environment).
+ .IP "\f2\-P\f1  \f2\-\-no-piping\f1"
+ Use temporary files instead of pipes in the shar file.
+ .IP "\f2\-x\f1  \f2\-\-no-check-existing\f1"
+ Overwrite existing files without checking.
+ If neither \f2\-x\f1 nor \f2\-X\f1 is specified, the unpack will
+ check for and not overwrite existing files when unpacking the archive.
+ If \f2\-c\f1 is passed as a parameter to the script when unpacking:
+ 
+ .RS 10m
+ sh archive -c
+ .RE
+ .IP ""
+ then existing files will be overwritten unconditionally.
+ .IP "\f2\-X\f1  \f2\-\-query-user\f1"
+ When unpacking, interactively ask the user if files should be overwritten.
+ (DO NOT USE FOR SHARS SUBMITTED TO THE NET).
+ .IP "\f2\-m\f1  \f2\-\-no-timestamp\f1"
+ Avoid generating 'touch' commands to restore the file modification
+ dates when unpacking files from the archive.
+ .IP "\f2\-Q\f1  \f2\-\-quiet-unshar\f1"
+ Verbose OFF.  Disables the inclusion of comments to be output when the archive
+ is unpacked.
+ .IP "\f2\-f\f1  \f2\-\-basename\f1"
+ Restore by filename only, rather than path.  This option causes only file
+ names to be used, which is useful when building a shar from several
+ directories, or another directory.  Note that if a directory name is passed
+ to shar, the substructure of that directory will be restored whether \f2\-f\f1
+ is specified or not.
+ .SS "Internationalization:"
+ .IP "\f2\-\-no-i18n\f1"
+ Do not produce internationalized shell archives, use default english messages.
+ By default, shar produces archives that will try to output messages in
+ the unpackers preferred language (as determined by the LANG/LC_MESSAGES
+ environmental variables) when they are unpacked.
+ If no message file for the unpackers language is found at unpack time,
+ messages will be in english.
+ .IP "\f2\-\-print-text-domain-dir\f1"
+ Prints the directory shar looks in to find messages files for different
+ languages, then immediately exits.
+ .SH EXAMPLES
+ .nf
+ .ta 37n
+ shar *.c > cprog.shar	# all C prog sources
+ shar \-Q *.[ch] > cprog.shar	# non-verbose, .c and .h files
+ shar \-B \-l28 \-oarc.sh *.arc	# all binary .arc files, into
+ 	# files arc.sh.01 thru arc.sh.NN
+ shar \-f /lcl/src/u*.c > u.sh	# use only the filenames
+ .ta
+ .fi
+ .SH WARNINGS
+ .PP
+ No chmod or touch is ever generated for directories created when unpacking.
+ Thus, if a directory is given to shar, the protection and
+ modification dates of corresponding unpacked directory
+ may not match those of the original.
+ .PP
+ If a directory is passed to shar, it may be scanned more than once.  Therefore,
+ one should be careful not change the directory while shar is running.
+ .PP
+ Be careful that the output file(s) are not included in the inputs or shar
+ may loop until the disk fills up.  Be particularly careful when a directory
+ is passed to shar that the output files are not in that directory
+ (or a subdirectory of that directory).
+ .PP
+ Use of the \f2\-B\f1, \f2\-z\f1 or \f2\-Z\f1, and especially
+ \f2\-M\f1, may slow the archive process considerably, depending on
+ the number of files.
+ .PP
+ Use of \f2\-X\f1 produces shars which \f2WILL\f1 cause problems
+ with many unshar procedures.  Use this feature only for archives
+ to be passed among agreeable parties.  Certainly, \f2\-X\f1 is NOT
+ for shell archives which are to be submitted to Usenet.  Usage of
+ \f2\-B\f1, \f2\-z\f1 or \f2\-Z\f1 in net shars will cause you to
+ be flamed off the earth.  Not using \f2\-m\f1 or not using \f2\-F\f1
+ may also get you occasional complaints.
+ .SH SEE ALSO
+ .PP 
+ unshar(1)
+ .SH DIAGNOSTICS
+ .PP
+ Error messages for illegal or incompatible options,
+ for non-regular, missing or inaccessible files or for (unlikely)
+ memory allocation failure.
+ .SH AUTHORS
+ The shar and unshar programs is the collective work of many authors.
+ Many people contributed by reporting problems, suggesting
+ various improvements or submitting actual code.  A list of
+ these people is in the THANKS file in the sharutils distribution.
diff -acrpNC5 sharutils-4.2.2.orig/doc/sharutils.texi sharutils-4.2.2.djgpp/doc/sharutils.texi
*** sharutils-4.2.2.orig/doc/sharutils.texi	Sat Mar 23 20:53:30 1996
--- sharutils-4.2.2.djgpp/doc/sharutils.texi	Sun Oct  8 18:09:42 2000
*************** the archives.  This option inhibits thes
*** 266,276 ****
  @itemx --intermix-type
  Allow positional parameter options.  The options @code{-M}, @code{-B},
  @code{-T}, @code{-z} and @code{-Z} may be embedded, and files to
  the right of the option will be processed in the specified mode.
  Without the @code{-p} option, embedded options would be interpreted
! as file names.  @xref{Stocking} for more information on these options.
  
  @item -S
  @itemx --stdin-file-list
  Read list of files to be packed from the standard input rather
  than from the command line.  Input must be one file name per line.
--- 266,276 ----
  @itemx --intermix-type
  Allow positional parameter options.  The options @code{-M}, @code{-B},
  @code{-T}, @code{-z} and @code{-Z} may be embedded, and files to
  the right of the option will be processed in the specified mode.
  Without the @code{-p} option, embedded options would be interpreted
! as file names.  @xref{Stocking}, for more information on these options.
  
  @item -S
  @itemx --stdin-file-list
  Read list of files to be packed from the standard input rather
  than from the command line.  Input must be one file name per line.
*************** to packing.  This option is selected by 
*** 414,425 ****
  For a file is considered to be a text file, instead of a binary file,
  all the following should be true simultaneously:
  @enumerate
  @item
  The file does not contain any ASCII control character besides @key{BS}
! (backspace), @key{HT} (horizontal tab), @key{LF} (new line) or @key{FF}
! (form feed).
  @item
  The file does not contains a @key{DEL} (delete).
  @item
  The file contains no character with its eighth-bit set.
  @item
--- 414,426 ----
  For a file is considered to be a text file, instead of a binary file,
  all the following should be true simultaneously:
  @enumerate
  @item
  The file does not contain any ASCII control character besides @key{BS}
! (backspace), @key{HT} (horizontal tab), @key{LF} (new line), @key{FF}
! (form feed) or @key{CR} (carriage return). The last check is needed on
! MSDOS systems.
  @item
  The file does not contains a @key{DEL} (delete).
  @item
  The file contains no character with its eighth-bit set.
  @item
diff -acrpNC5 sharutils-4.2.2.orig/doc/unshar.1 sharutils-4.2.2.djgpp/doc/unshar.1
*** sharutils-4.2.2.orig/doc/unshar.1	Thu Jan  1 00:00:00 1970
--- sharutils-4.2.2.djgpp/doc/unshar.1	Wed Sep 27 21:20:22 2000
***************
*** 0 ****
--- 1,56 ----
+ .TH UNSHAR 1 "September 10, 1995"
+ .SH NAME
+ unshar \- unpack a shar file
+ .SH SYNOPSIS
+ unshar [ options ] [ file ... ]
+ .SH DESCRIPTION
+ .PP
+ Unshar scans mail messages looking for the start of a shell archive.  It
+ then passes the archive through a copy of the shell to unpack it.  It
+ will accept multiple files.  If no files are given, standard input is used.
+ .SH OPTIONS
+ .PP
+ Options have a one letter version starting with \- or a long version starting
+ with \-\-.  The exception is \f2\-\-help\f1 and \f2\-\-version\f1,
+ which does not have a short version.
+ .IP "\f2\-\-version\f1"
+ Print the version number of the program on standard output,
+ then immediately exits.
+ .IP "\f2\-\-help\f1"
+ Print a help summary on standard output, then immediately exits.
+ .IP "\f2\-d\f1 DIRECTORY  \f2\-\-directory=\f1DIRECTORY"
+ Change directory to DIRECTORY before unpacking any files.
+ .IP "\f2\-c\f1  \f2\-\-overwrite\f1"
+ Passed as an option to the shar file.  Many shell archive scripts
+ (including those produced by `shar' 3.40 and newer) accepts a \f2\-c\f1
+ argument to indicate that existing files should be overwritten.
+ .IP "\f2\-e\f1  \f2\-\-exit-0\f1"
+ This option exists mainly for people who collect many shell
+ archives into a single mail folder.  With this option, `unshar'
+ isolates each different shell archive from the others which have
+ been put in the same file, unpacking each in turn, from the
+ beginning of the file towards its end.  Its proper operation
+ relies on the fact that many shar files are terminated by a
+ `exit 0' at the beginning of a line.
+ 
+ Option \f2\-e\f1 is internally equivalent to \f2\-E\f1 "exit 0".
+ .IP "\f2\-E\f1 STRING  \f2\-\-split-at=\f1STRING"
+ This option works like \f2\-e\f1, but it allows you to specify the
+ string that separates archives if `exit 0' isn't appropriate.
+ 
+ For example, noticing that most `.signatures' have a `\-\-' on a
+ line right before them, one can sometimes use `\f2\-\-split-at\f1=\-\-' for
+ splitting shell archives which lack the `exit 0' line at end.  The
+ signature will then be skipped altogether with the headers of the
+ following message.
+ .IP "\f2\-f\f1  \f2\-\-force\f1"
+ The same as \f2\-c\f1.
+ .SH SEE ALSO
+ shar(1)
+ .SH DIAGNOSTICS
+ Any message from the shell may be displayed.
+ .SH AUTHORS
+ The shar and unshar programs is the collective work of many authors.
+ Many people contributed by reporting problems, suggesting
+ various improvements or submitting actual code.  A list of
+ these people is in the THANKS file in the sharutils distribution.
diff -acrpNC5 sharutils-4.2.2.orig/doc/uuencode.1 sharutils-4.2.2.djgpp/doc/uuencode.1
*** sharutils-4.2.2.orig/doc/uuencode.1	Thu Jan  1 00:00:00 1970
--- sharutils-4.2.2.djgpp/doc/uuencode.1	Wed Sep 27 21:20:22 2000
***************
*** 0 ****
--- 1,129 ----
+ '.\" Copyright (c) 1980, 1990 The Regents of the University of California.
+ '.\" All rights reserved.
+ '.\"
+ '.\" Redistribution and use in source and binary forms, with or without
+ '.\" modification, are permitted provided that the following conditions
+ '.\" are met:
+ '.\" 1. Redistributions of source code must retain the above copyright
+ '.\"    notice, this list of conditions and the following disclaimer.
+ '.\" 2. Redistributions in binary form must reproduce the above copyright
+ '.\"    notice, this list of conditions and the following disclaimer in the
+ '.\"    documentation and/or other materials provided with the distribution.
+ '.\" 3. All advertising materials mentioning features or use of this software
+ '.\"    must display the following acknowledgement:
+ '.\"	This product includes software developed by the University of
+ '.\"	California, Berkeley and its contributors.
+ '.\" 4. Neither the name of the University nor the names of its contributors
+ '.\"    may be used to endorse or promote products derived from this software
+ '.\"    without specific prior written permission.
+ '.\"
+ '.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ '.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ '.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ '.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ '.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ '.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ '.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ '.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ '.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ '.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ '.\" SUCH DAMAGE.
+ '.\"
+ '.\" Modified from
+ '.\"     @(#)uuencode.1	6.9 (Berkeley) 4/23/91
+ '.\"
+ .TH uuencode 1
+ .SH NAME
+ uuencode \- encode a binary file
+ .PP
+ uudecode \- decode a file created by uuencode
+ .SH SYNOPSIS
+ .B uuencode
+ [\-m] [ file ] name
+ .PP
+ .B uudecode
+ [-o outfile] [ file ]...
+ .SH DESCRIPTION
+ .I Uuencode
+ and
+ .I uudecode
+ are used to transmit binary files over transmission mediums
+ that do not support other than simple
+ ASCII
+ data.
+ .PP
+ .I Uuencode
+ reads
+ .I file
+ (or by default the standard input) and writes an encoded version
+ to the standard output.
+ The encoding uses only printing
+ ASCII
+ characters and includes the
+ mode of the file and the operand
+ .I name
+ for use by
+ .I uudecode.
+ If
+ .I name
+ is
+ .I /dev/stdout
+ the result will be written to standard output.  By default the standard
+ UU encoding format will be used.  If the option
+ .I \-m
+ is given on the command line
+ .B base64
+ encoding is used instead.
+ .PP
+ .I Uudecode
+ transforms
+ uuencoded
+ .I files
+ (or by default, the standard input) into the original form.
+ The resulting file is named
+ .I name
+ (or
+ .I outfile
+ if the \-o option is given)
+ and will have the mode of the original file except that setuid
+ and execute bits are not retained.  If
+ .I outfile
+ or
+ .I name
+ is /dev/stdout the result will be written to standard output.
+ .I Uudecode
+ ignores any leading and trailing lines.  The program can automatically decide
+ which of the both supported encoding schemes are used.
+ .SH EXAMPLES
+ The following example packages up a source tree, compresses it,
+ uuencodes it and mails it to a user on another system.
+ When
+ .I uudecode
+ is run on the target system, the file ``src_tree.tar.Z'' will be
+ created which may then be uncompressed and extracted into the original
+ tree.
+ .PP
+ .IP
+ .NF
+ tar cf \- src_tree \&| compress \&|
+ uuencode src_tree.tar.Z \&| mail sys1!sys2!user
+ .FI
+ .LP
+ .SH SEE ALSO
+ compress(1), mail(1), uucp(1), uuencode(5)
+ .SH STANDARDS
+ This implementation is compliant with P1003.2b/D11.
+ .SH BUGS
+ If more than one file is given to
+ .I uudecode
+ and the \-o option is given or more than one
+ .I name
+ in the encoded files are the same the result is probably not what is expected.
+ .PP
+ The encoded form of the file is expanded by 37% for UU encoding and by 35%
+ for base64 encoding (3 bytes become 4 plus control information).
+ .SH HISTORY
+ The
+ .I uuencode
+ command appeared in
+ BSD 4.0.
diff -acrpNC5 sharutils-4.2.2.orig/doc/uuencode.5 sharutils-4.2.2.djgpp/doc/uuencode.5
*** sharutils-4.2.2.orig/doc/uuencode.5	Thu Jan  1 00:00:00 1970
--- sharutils-4.2.2.djgpp/doc/uuencode.5	Wed Sep 27 21:20:22 2000
***************
*** 0 ****
--- 1,93 ----
+ '.\" Copyright (c) 1989, 1991 The Regents of the University of California.
+ '.\" All rights reserved.
+ '.\"
+ '.\" Redistribution and use in source and binary forms, with or without
+ '.\" modification, are permitted provided that the following conditions
+ '.\" are met:
+ '.\" 1. Redistributions of source code must retain the above copyright
+ '.\"    notice, this list of conditions and the following disclaimer.
+ '.\" 2. Redistributions in binary form must reproduce the above copyright
+ '.\"    notice, this list of conditions and the following disclaimer in the
+ '.\"    documentation and/or other materials provided with the distribution.
+ '.\" 3. All advertising materials mentioning features or use of this software
+ '.\"    must display the following acknowledgement:
+ '.\"	This product includes software developed by the University of
+ '.\"	California, Berkeley and its contributors.
+ '.\" 4. Neither the name of the University nor the names of its contributors
+ '.\"    may be used to endorse or promote products derived from this software
+ '.\"    without specific prior written permission.
+ '.\"
+ '.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ '.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ '.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ '.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ '.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ '.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ '.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ '.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ '.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ '.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ '.\" SUCH DAMAGE.
+ '.\"
+ '.\"     @(#)uuencode.format.5	6.4 (Berkeley) 5/10/91
+ '.\"
+ .TH UUENCODE 5
+ .SH NAME
+ uuencode \- format of an encoded uuencode file
+ .SH DESCRIPTION
+ Files output by
+ uuencode(1)
+ consist of a header line,
+ followed by a number of body lines,
+ and a trailer line.
+ The
+ uudecode(1)
+ command
+ will ignore any lines preceding the header or
+ following the trailer.
+ Lines preceding a header must not, of course,
+ look like a header.
+ .PP
+ The header line is distinguished by having the first
+ 6 characters
+ .I begin\ \&
+ The word
+ .I begin
+ is followed by a mode (in octal),
+ and a string which names the remote file.
+ A space separates the three items in the header line.
+ .PP
+ The body consists of a number of lines, each at most 62 characters
+ long (including the trailing newline).
+ These consist of a character count,
+ followed by encoded characters,
+ followed by a newline.
+ The character count is a single printing character,
+ and represents an integer, the number of bytes
+ the rest of the line represents.
+ Such integers are always in the range from 0 to 63 and can
+ be determined by subtracting the character space (octal 40)
+ from the character.
+ .PP
+ Groups of 3 bytes are stored in 4 characters, 6 bits per character.
+ All are offset by a space to make the characters printing.
+ The last line may be shorter than the normal 45 bytes.
+ If the size is not a multiple of 3, this fact can be determined
+ by the value of the count on the last line.
+ Extra garbage will be included to make the character count a multiple
+ of 4.
+ The body is terminated by a line with a count of zero.
+ This line consists of one
+ ASCII
+ space.
+ .PP
+ The trailer line consists of
+ .I end
+ on a line by itself.
+ .SH SEE ALSO
+ uuencode(1), uudecode(1), uusend(1), uucp(1), mail(1)
+ .SH HISTORY
+ The
+ .I uuencode
+ file format appeared in
+ BSD 4.0 .
diff -acrpNC5 sharutils-4.2.2.orig/lib/basename.c sharutils-4.2.2.djgpp/lib/basename.c
*** sharutils-4.2.2.orig/lib/basename.c	Mon Jul 15 03:47:24 1996
--- sharutils-4.2.2.djgpp/lib/basename.c	Wed Sep 27 21:28:38 2000
***************
*** 17,26 ****
--- 17,28 ----
  
  #ifdef HAVE_CONFIG_H
  # include <config.h>
  #endif
  
+ #include "system.h"
+ 
  /* Return NAME with any leading path stripped off.
     Don't use strrchr/rindex.  */
  
  char *
  basename (name)
*************** basename (name)
*** 28,38 ****
  {
    const char *base = name;
  
    while (*name)
      {
!       if (*name == '/')
  	base = name + 1;
        ++name;
      }
    return (char *) base;
  }
--- 30,40 ----
  {
    const char *base = name;
  
    while (*name)
      {
!       if (IS_DIR_SEPARATOR(*name))
  	base = name + 1;
        ++name;
      }
    return (char *) base;
  }
diff -acrpNC5 sharutils-4.2.2.orig/lib/Makefile.am sharutils-4.2.2.djgpp/lib/Makefile.am
*** sharutils-4.2.2.orig/lib/Makefile.am	Wed Jun  5 19:41:36 1996
--- sharutils-4.2.2.djgpp/lib/Makefile.am	Sun Oct  1 17:48:50 2000
***************
*** 15,31 ****
  ## along with this program; if not, write to the Free Software
  ## Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  
  ## Process this file with automake to produce Makefile.in.
  
! noinst_LIBRARIES = shar
  
  EXTRA_DIST = alloca.c basename.c md5.c memset.c mktime.c stpcpy.c strftime.c
  
! shar_SOURCES = error.c getopt.c getopt1.c md5.c whoami.c xgetcwd.c \
  xmalloc.c xstrdup.c
  
! shar_LIBADD = @ALLOCA@ @LIBOBJS@
  
  noinst_HEADERS = error.h getopt.h md5.h system.h pathmax.h
  
  INCLUDES = -I../intl
--- 15,33 ----
  ## along with this program; if not, write to the Free Software
  ## Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  
  ## Process this file with automake to produce Makefile.in.
  
! AUTOMAKE_OPTIONS = 1.4 gnits
! 
! noinst_LIBRARIES = libshar.a
  
  EXTRA_DIST = alloca.c basename.c md5.c memset.c mktime.c stpcpy.c strftime.c
  
! libshar_a_SOURCES = error.c getopt.c getopt1.c md5.c whoami.c xgetcwd.c \
  xmalloc.c xstrdup.c
  
! libshar_a_LIBADD = @ALLOCA@ @LIBOBJS@
  
  noinst_HEADERS = error.h getopt.h md5.h system.h pathmax.h
  
  INCLUDES = -I../intl
diff -acrpNC5 sharutils-4.2.2.orig/lib/system.h sharutils-4.2.2.djgpp/lib/system.h
*** sharutils-4.2.2.orig/lib/system.h	Fri Mar  1 20:49:28 1996
--- sharutils-4.2.2.djgpp/lib/system.h	Tue Oct 10 15:55:18 2000
*************** char *get_submitter __P ((char *));
*** 224,228 ****
--- 224,300 ----
  #if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 6)
  # define ATTRIBUTE(list) __attribute__ (list)
  #else
  # define ATTRIBUTE(list)
  #endif
+ 
+ /* MS-DOS and similar non-Posix systems have some peculiarities:
+     - they distinguish between binary and text files;
+     - they use both `/' and `\\' as directory separator in file names;
+     - they can have a drive letter X: prepended to a file name;
+     - they have a separate root directory on each drive;
+     - their filesystems are case-insensitive;
+     - directories in environment variables (like PATH) are separated
+       by `;' rather than `:';
+ 
+    These are all parameterized here. */
+ 
+ #ifndef O_RDONLY
+   /* Since <fcntl.h> is POSIX, prefer that to <sys/fcntl.h>. */
+ # ifdef HAVE_FCNTL_H
+    /* Include the O_BINARY and O_TEXT definitions. */
+ #  include <fcntl.h>
+ # else  /* not HAVE_FCNTL_H */
+ #  ifdef HAVE_SYS_FCNTL_H
+ #   include <sys/fcntl.h>
+ #  endif /* not HAVE_SYS_FCNTL_H */
+ # endif /* not HAVE_FCNTL_H */
+ #endif /* not O_RDONLY */
+ 
+ #ifndef O_BINARY
+ # ifdef _O_BINARY
+ #  define O_BINARY _O_BINARY
+ # else
+ #  define O_BINARY 0
+ # endif
+ #endif /* O_BINARY */
+ 
+ #if O_BINARY
+ # define FOPEN_READ             "rb"
+ # define FOPEN_WRITE            "wb"
+ # define FOPEN_READWRITE        "wb+"
+ # define FREOPEN_READ           "rb"
+ # define FREOPEN_WRITE          "wb"
+ # define POPEN_READ             "rb"
+ # define POPEN_WRITE            "wb"
+ # define IS_SLASH(path)         ((path) == '/' || (path) == '\\')
+ # define IS_DIR_SEPARATOR(path) (IS_SLASH(path) || (path) == ':')
+ # define IS_DEVICE(path)        (((path)[0]) && ((path)[1]) == ':')
+ # define IS_ABSOLUTE_PATH(path) (((path)[0]) == '/' || ((path)[0]) == '\\' || IS_DEVICE(path))
+ # define PATH_SEPARATOR         ';'
+ # define TEMP_NAME              tempnam(NULL, "unsh")
+ # define canonize_path(path)                                           \
+ /*  shar creates shell archives that are executed by an unix shell so it \
+     is usefull to translate all MSDOS-style paths into unix-style paths. \
+     This makes also the porting effort a little bit easier. */           \
+     do {                                                                 \
+       int i = -1;                                                        \
+       while (path[++i])                                                  \
+         if (path[i] == '\\')                                             \
+           path[i] = '/';                                                 \
+      } while (0)
+ 
+ #else  /* not O_BINARY */
+ # define FOPEN_READ             "r"
+ # define FOPEN_WRITE            "w"
+ # define FOPEN_READWRITE        "w+"
+ # define FREOPEN_READ           "r"
+ # define FREOPEN_WRITE          "w"
+ # define POPEN_READ             "r"
+ # define POPEN_WRITE            "w"
+ # define IS_DIR_SEPARATOR(path) ((path) == '/')
+ # define IS_DEVICE(path)        (0)
+ # define IS_ABSOLUTE_PATH(path) ((path)[0] == '/')
+ # define PATH_SEPARATOR         ':'
+ # define TEMP_NAME              "/tmp/unsh.%05d", (int) getpid ()
+ # define canonize_path(path)  /* empty */
+ #endif /* not O_BINARY */
diff -acrpNC5 sharutils-4.2.2.orig/src/mailshar.in sharutils-4.2.2.djgpp/src/mailshar.in
*** sharutils-4.2.2.orig/src/mailshar.in	Sat Mar 23 14:25:10 1996
--- sharutils-4.2.2.djgpp/src/mailshar.in	Sun Oct  1 15:12:46 2000
*************** version="@VERSION@"
*** 8,17 ****
--- 8,27 ----
  
  prefix='@prefix@'
  bindir="@exec_prefix@/bin"
  transform='@program_transform_name@'
  
+ # Find the correct TMPDIR value. Usually this is `/usr/tmp',
+ # but MSDOS has no default TMPDIR value at all.
+ if test "X${tempdir+set}" != Xset; then
+   UNAME=${UNAME-`uname 2>/dev/null`}
+   case X$UNAME in
+     *-DOS) tempdir=`echo "${TMPDIR-${TEMP-${TMP-/dev/env/DJDIR/tmp}}}" | sed 's%\\\\%/%g'` ;;
+     *)     tempdir='${TMPDIR-/usr/tmp}' ;;
+   esac
+ fi
+ 
  shar=$bindir/`echo shar | sed "$transform"`
  mail_files=$bindir/`echo mail-files | sed "$transform"`
  
  progname=`echo $0 | sed -e 's,.*/,,'`
  
*************** with OPTION in:
*** 32,42 ****
    -x              trace script
  
  If none of -MTBzZ are given, -z is automatically selected if *none*
  of the FILEs have an .arc, .exz, .gif, .z, .gz, .Z, .zip or .zoo suffix."
  
! temp=/usr/tmp/$$.shar
  
  ### Decode the options.
  
  size=60
  
--- 42,52 ----
    -x              trace script
  
  If none of -MTBzZ are given, -z is automatically selected if *none*
  of the FILEs have an .arc, .exz, .gif, .z, .gz, .Z, .zip or .zoo suffix."
  
! temp=$tempdir/$$.shar
  
  ### Decode the options.
  
  size=60
  
diff -acrpNC5 sharutils-4.2.2.orig/src/remsync.in sharutils-4.2.2.djgpp/src/remsync.in
*** sharutils-4.2.2.orig/src/remsync.in	Thu Mar 14 10:00:20 1996
--- sharutils-4.2.2.djgpp/src/remsync.in	Wed Sep 27 21:20:22 2000
*************** $FORMAT = '1.3';		# version of format fo
*** 31,40 ****
--- 31,49 ----
  $CONFIG = '.remsync';		# file containing synchronization information
  $INVOICE = '.remsync.tar.gz';	# default file name of packed synchro. package
  $WORKDIR = '.remsync-work';	# directory name of unpacked synchro. package
  $ORDERS = 'orders';		# file name containaing synchro. directives
  
+ # MSDOS does not allow leading and/or
+ # multiple dots in a file name.
+ if ($^0 eq "dos")
+ {
+   $CONFIG = "_remsync";       # file containing synchronization information
+   $ARCHIVE = "_remsync.tgz";  # default file name of packed synchro. package
+   $WORKDIR = "_remsync-work"; # directory name of unpacked synchro. package
+ }
+ 
  $DIFF = '@DIFF@';		# GNU diff path
  $TAR = '@TAR@';			# GNU tar path
  $SH = '@SH@';			# Bash or sh path
  
  # Special constants.
diff -acrpNC5 sharutils-4.2.2.orig/src/shar.c sharutils-4.2.2.djgpp/src/shar.c
*** sharutils-4.2.2.orig/src/shar.c	Tue Dec  3 16:51:58 1996
--- sharutils-4.2.2.djgpp/src/shar.c	Tue Oct 10 15:58:14 2000
*************** static const char *cut_mark_line
*** 33,51 ****
--- 33,56 ----
  
  /* Shell command able to count characters from its standard input.  We
     have to take care for the locale setting because wc in multi-byte
     character environments get different results.  */
  #define CHARACTER_COUNT_COMMAND "LC_ALL=C wc -c <"
+ #define DOS_CHARACTER_COUNT_COMMAND "wc -c <"
  
  /* Command computing MD5 sumof specified file.  Because there is not
     official standard for this we have to restrict ourself to a few
     versions: GNU md5sum from GNU fileutils and the version by
     Plumb/Lankester.  */
  #define MD5SUM_COMMAND "md5sum"
  
  /* Maximum length for a text line before it is considered binary.  */
  #define MAXIMUM_NON_BINARY_LINE 200
+ 
+ /* On MSDOS systems, a path may start with a drive letter followed by a colon.
+    This information will not be stored. */
+ #define strip_device(path) ((IS_DEVICE(path)) ? (path) + 2 : (path))
  
  /* System related declarations.  */
  
  #include <ctype.h>
  
*************** struct tm *localtime ();
*** 69,79 ****
  
  #if !NO_WALKTREE
  
  /* Declare directory reading routines and structures.  */
  
! #ifdef __MSDOS__
  # include "msd_dir.h"
  # define NAMLEN(dirent) ((dirent)->d_namlen)
  #else
  # if HAVE_DIRENT_H
  #  include <dirent.h>
--- 74,84 ----
  
  #if !NO_WALKTREE
  
  /* Declare directory reading routines and structures.  */
  
! #if ((__MSDOS__) && !(__DJGPP__))
  # include "msd_dir.h"
  # define NAMLEN(dirent) ((dirent)->d_namlen)
  #else
  # if HAVE_DIRENT_H
  #  include <dirent.h>
*************** walktree (routine, local_name)
*** 380,389 ****
--- 385,395 ----
    /* Remove crumb at end.  */
  
    len = strlen (local_name);
    local_name_copy = (char *) alloca (len + 1);
    memcpy (local_name_copy, local_name, len + 1);
+   canonize_path (local_name_copy);
    cursor = local_name_copy + len - 1;
    while (*cursor == '/' && cursor > local_name_copy)
      *cursor-- = '\0';
  
    /* Remove crumb at beginning.  */
*************** generate_configure ()
*** 467,476 ****
--- 473,488 ----
    if (no_i18n)
      fputs ("echo=echo\n", output);
    else
      {
        fprintf (output, "\
+ # Some help for the DJGPP port of Bash.\n\
+ UNAME=${UNAME-`uname 2>/dev/null`}\n\
+ case X$UNAME in\n\
+   *-DOS) PATH_EXPAND=n\n\
+          TEST_FINDS_EXE=y\n\
+ esac\n\
  save_IFS=\"${IFS}\"\n\
  IFS=\"${IFS}:\"\n\
  gettext_dir=FAILED\n\
  locale_dir=FAILED\n\
  first_param=\"$1\"\n\
*************** static int
*** 699,709 ****
  generate_one_header_line (local_name, restore_name)
       const char *local_name;
       const char *restore_name;
  {
    fprintf (output, "# %6ld %s %s\n", struct_stat.st_size,
! 	   mode_string (struct_stat.st_mode), restore_name);
    return 0;
  }
  
  /*---.
  | ?  |
--- 711,721 ----
  generate_one_header_line (local_name, restore_name)
       const char *local_name;
       const char *restore_name;
  {
    fprintf (output, "# %6ld %s %s\n", struct_stat.st_size,
! 	   mode_string (struct_stat.st_mode), strip_device (restore_name));
    return 0;
  }
  
  /*---.
  | ?  |
*************** fi\n",
*** 887,908 ****
  /*---.
  | ?  |
  `---*/
  
  static int
! shar (local_name, restore_name)
       const char *local_name;
!      const char *restore_name;
  {
    char buffer[BUFSIZ];
    FILE *input;
    long current_size;
    long remaining_size;
    int split_flag = 0;		/* file split flag */
    const char *file_type;	/* text of binary */
    const char *file_type_remote;	/* text or binary, avoiding locale */
    struct tm *restore_time;
  
    /* Check to see that this is still a regular file and readable.  */
  
    if (!S_ISREG (struct_stat.st_mode & S_IFMT))
      {
--- 899,924 ----
  /*---.
  | ?  |
  `---*/
  
  static int
! shar (local_name, given_restore_name)
       const char *local_name;
!      const char *given_restore_name;
  {
    char buffer[BUFSIZ];
    FILE *input;
    long current_size;
    long remaining_size;
    int split_flag = 0;		/* file split flag */
    const char *file_type;	/* text of binary */
    const char *file_type_remote;	/* text or binary, avoiding locale */
+   const char *restore_name = strip_device (given_restore_name);
    struct tm *restore_time;
+ #ifdef __MSDOS__
+   char *filename;  /* Temporary file name for gzip/compress output. */
+ #endif
  
    /* Check to see that this is still a regular file and readable.  */
  
    if (!S_ISREG (struct_stat.st_mode & S_IFMT))
      {
*************** exit 0\n",
*** 1056,1065 ****
--- 1072,1150 ----
  	  if (line_length > 0)
  	    uuencoded_file_mode = 1;
  	}
  
        if (uuencoded_file_mode)
+ #ifdef __MSDOS__
+       {
+         /* MSDOS doesn't have `fork', so we need to simulate
+            the pipe by running the programs in sequence.
+            First compress or gzip, if needed, then uuencode the
+            result and associate it to the input file descriptor. */
+ 
+         FILE *temp_file;
+         char string[L_tmpnam];
+ 
+         filename = tmpnam(string);
+ 
+         file_type = (compressed_file_mode ? _("compressed")
+                     : gzipped_file_mode ? _("gzipped") : _("binary"));
+         file_type_remote = (compressed_file_mode ? N_("(compressed)")
+                            : gzipped_file_mode ? N_("(gzipped)")
+                            : N_("(binary)"));
+ 
+         if (compressed_file_mode)
+         {
+           sprintf (buffer, "compress -b%d < '%s'", bits_per_compressed_byte, local_name);
+           input = popen (buffer, POPEN_READ);
+           if (!input)
+             error (EXIT_FAILURE, errno, "Could not open pipe.");
+         }
+         else if (gzipped_file_mode)
+         {
+           sprintf (buffer, "gzip -%d < '%s'", gzip_compression_level, local_name);
+           input = popen (buffer, POPEN_READ);
+           if (!input)
+             error (EXIT_FAILURE, errno, "Could not open pipe.");
+         }
+         else
+         {
+           input = fopen (local_name, FOPEN_READ);
+           if (!input)
+           {
+             error (0, errno, _("File %s (%s)"), local_name, file_type);
+             return 1;
+           }
+         }
+ 
+         temp_file = fopen(filename, FOPEN_WRITE);
+         if (!temp_file)
+           error (EXIT_FAILURE, errno, "Could not open temporary file.");
+ 
+         fputs ("begin 600 ", temp_file);
+         if (compressed_file_mode)
+           fprintf (temp_file, "_sh%05d/cmp\n", sharpid);
+         else if (gzipped_file_mode)
+           fprintf (temp_file, "_sh%05d/gzi\n", sharpid);
+         else
+           fprintf (temp_file, "%s\n", restore_name);
+         copy_file_encoded (input, temp_file);
+         fprintf (temp_file, "end\n");
+         if (compressed_file_mode || gzipped_file_mode)
+           pclose (input);
+         else
+           fclose (input);
+ 
+         fclose(temp_file);
+         input = fopen(filename, FOPEN_READ);
+         if (!input)
+         {
+           error (0, errno, _("File %s (%s)"), local_name, file_type);
+           return 1;
+         }
+       }
+ #else /* not __MSDOS__ */
  	{
  	  static int pid, pipex[2];
  
  	  file_type = (compressed_file_mode ? _("compressed")
  		       : gzipped_file_mode ? _("gzipped") : _("binary"));
*************** exit 0\n",
*** 1125,1140 ****
  		fclose (input);
  
  	      exit (EXIT_SUCCESS);
  	    }
  	}
        else
  	{
  	  file_type = _("text");
  	  file_type_remote = N_("(text)");
  
! 	  input = fopen (local_name, "r");
  	  if (!input)
  	    {
  	      error (0, errno, _("File %s (%s)"), local_name, file_type);
  	      return 1;
  	    }
--- 1210,1226 ----
  		fclose (input);
  
  	      exit (EXIT_SUCCESS);
  	    }
  	}
+ #endif /* not __MSDOS__ */
        else
  	{
  	  file_type = _("text");
  	  file_type_remote = N_("(text)");
  
! 	  input = fopen (local_name, FOPEN_READ);
  	  if (!input)
  	    {
  	      error (0, errno, _("File %s (%s)"), local_name, file_type);
  	      return 1;
  	    }
*************** else\n",
*** 1303,1313 ****
  	      putc ('\n', output);
  	      remaining_size--;
  	    }
  
  	  if (split_file_mode
! #if MSDOS
  	      /* 1 extra for CR.  */
  	      && (remaining_size -= (int) strlen (buffer) + 1) < 0
  #else
  	      && (remaining_size -= (int) strlen (buffer)) < 0
  #endif
--- 1389,1399 ----
  	      putc ('\n', output);
  	      remaining_size--;
  	    }
  
  	  if (split_file_mode
! #if __MSDOS__
  	      /* 1 extra for CR.  */
  	      && (remaining_size -= (int) strlen (buffer) + 1) < 0
  #else
  	      && (remaining_size -= (int) strlen (buffer)) < 0
  #endif
*************** else\n",
*** 1443,1452 ****
--- 1529,1544 ----
  	      split_flag = 1;
  	    }
  	}
  
        fclose (input);
+ #ifdef __MSDOS__
+       /* Delete the temporary file containig the compress/gzip
+          output associated to the input file descriptor. */
+       if (uuencoded_file_mode)
+         unlink (filename);
+ #endif
        while (wait (NULL) >= 0)
  	;
  
        fprintf (output, "%s\n", here_delimiter);
        if (split_flag && !quiet_unshar_mode)
*************** else\n",
*** 1533,1543 ****
  
        fprintf (output, "\
    $echo '%s' '%s' '%s'\n",
  	       N_("restore of"), restore_name, N_("failed"));
  
!       if (md5_count_mode && (fp = fopen (local_name, "r")) != NULL
  	  && md5_stream (fp, md5buffer) == 0)
  	{
  	  /* Validate the transferred file using `md5sum' command.  */
  	  size_t cnt;
  	  did_md5 = 1;
--- 1625,1635 ----
  
        fprintf (output, "\
    $echo '%s' '%s' '%s'\n",
  	       N_("restore of"), restore_name, N_("failed"));
  
!       if (md5_count_mode && (fp = fopen (local_name, FOPEN_READ)) != NULL
  	  && md5_stream (fp, md5buffer) == 0)
  	{
  	  /* Validate the transferred file using `md5sum' command.  */
  	  size_t cnt;
  	  did_md5 = 1;
*************** else\n",
*** 1569,1580 ****
  	  /* Validate the transferred file using simple `wc' command.  */
  
  	  FILE *pfp;
  	  char command[BUFSIZ];
  
  	  sprintf (command, "%s '%s'", CHARACTER_COUNT_COMMAND, local_name);
! 	  if (pfp = popen (command, "r"), pfp)
  	    {
  	      char wc[BUFSIZ];
  	      const char *prefix = "";
  
  	      if (did_md5)
--- 1661,1676 ----
  	  /* Validate the transferred file using simple `wc' command.  */
  
  	  FILE *pfp;
  	  char command[BUFSIZ];
  
+ #ifdef __DJGPP__
+ 	  sprintf (command, "%s '%s'", DOS_CHARACTER_COUNT_COMMAND, local_name);
+ #else
  	  sprintf (command, "%s '%s'", CHARACTER_COUNT_COMMAND, local_name);
! #endif
! 	  if (pfp = popen (command, POPEN_READ), pfp)
  	    {
  	      char wc[BUFSIZ];
  	      const char *prefix = "";
  
  	      if (did_md5)
*************** set_file_mode (mode)
*** 1640,1650 ****
  
  static void
  open_output ()
  {
    sprintf (output_filename, output_base_name, ++part_number);
!   output = fopen (output_filename, "w");
    if (!output)
      error (EXIT_FAILURE, errno, _("Opening `%s'"), output_filename);
  }
  
  /*-----------------------------------------------.
--- 1736,1746 ----
  
  static void
  open_output ()
  {
    sprintf (output_filename, output_base_name, ++part_number);
!   output = fopen (output_filename, FOPEN_WRITE);
    if (!output)
      error (EXIT_FAILURE, errno, _("Opening `%s'"), output_filename);
  }
  
  /*-----------------------------------------------.
*************** main (argc, argv)
*** 1908,1921 ****
--- 2004,2019 ----
  	timestamp_mode = 0;
  	break;
  
        case 'n':
  	archive_name = optarg;
+ 	canonize_path (archive_name);
  	break;
  
        case 'o':
  	strcpy (output_base_name, optarg);
+ 	canonize_path (output_base_name);
  	if (!strchr (output_base_name, '%'))
  	  strcat (output_base_name, ".%02d");
  	part_number = 0;
  	open_output ();
  	break;
*************** main (argc, argv)
*** 1958,1971 ****
  
    if (show_version)
      {
        printf ("%s (GNU %s) %s\n", basename (program_name), PACKAGE, VERSION);
        /* xgettext: no-wrap */
!       printf (_("Copyright (C) %s Free Software Foundation, Inc.
! This is free software; see the source for copying conditions.  There is NO
! warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
! "),
  	      "1994, 1995, 1996");
        exit (EXIT_SUCCESS);
      }
  
    if (show_help)
--- 2056,2069 ----
  
    if (show_version)
      {
        printf ("%s (GNU %s) %s\n", basename (program_name), PACKAGE, VERSION);
        /* xgettext: no-wrap */
!       printf (_("Copyright (C) %s Free Software Foundation, Inc.\n"
! "This is free software; see the source for copying conditions.  There is NO\n"
! "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n"
! ),
  	      "1994, 1995, 1996");
        exit (EXIT_SUCCESS);
      }
  
    if (show_help)
*************** warranty; not even for MERCHANTABILITY o
*** 2036,2045 ****
--- 2134,2147 ----
    /* Maybe prepare to decide dynamically about file type.  */
  
    if (mixed_uuencoded_file_mode || intermixed_parameter_mode)
      {
        memset ((char *) byte_is_binary, 1, 256);
+ #if O_TEXT
+       /* Check for MSDOS-style EOL too. CRLF(\r\n) instead of LF(\n). */
+       byte_is_binary['\r'] = 0;
+ #endif
        byte_is_binary['\b'] = 0;
        byte_is_binary['\t'] = 0;
        byte_is_binary['\f'] = 0;
        memset ((char *) byte_is_binary + 32, 0, 127 - 32);
      }
*************** warranty; not even for MERCHANTABILITY o
*** 2061,2070 ****
--- 2163,2173 ----
  	  if (argc == max_argc)
  	    list = (char **) xrealloc (list,
  				       (max_argc *= 2) * sizeof (char *));
  	  if (stdin_buf[0] != '\0')
  	    stdin_buf[strlen (stdin_buf) - 1] = 0;
+ 	  canonize_path (stdin_buf);
  	  list[argc] = xstrdup (stdin_buf);
  	  ++argc;
  	  stdin_buf[0] = 0;
  	}
        argv = list;
diff -acrpNC5 sharutils-4.2.2.orig/src/unshar.c sharutils-4.2.2.djgpp/src/unshar.c
*** sharutils-4.2.2.orig/src/unshar.c	Tue Dec  3 16:52:08 1996
--- sharutils-4.2.2.djgpp/src/unshar.c	Sun Oct  1 15:29:44 2000
*************** unarchive_shar_file (name, file)
*** 251,261 ****
    char *more_to_read;
  
    while (find_archive (name, file, current_position))
      {
        printf ("%s:\n", name);
!       shell_process = popen (pass_c_flag ? "sh -s - -c" : "sh", "w");
        if (!shell_process)
  	error (EXIT_FAILURE, errno, _("Starting `sh' process"));
  
        if (!continue_reading)
  	{
--- 251,261 ----
    char *more_to_read;
  
    while (find_archive (name, file, current_position))
      {
        printf ("%s:\n", name);
!       shell_process = popen (pass_c_flag ? "sh -s - -c" : "sh", POPEN_WRITE);
        if (!shell_process)
  	error (EXIT_FAILURE, errno, _("Starting `sh' process"));
  
        if (!continue_reading)
  	{
*************** main (argc, argv)
*** 400,442 ****
  
    if (show_version)
      {
        printf ("%s (GNU %s) %s\n", basename (program_name), PACKAGE, VERSION);
        /* xgettext: no-wrap */
!       printf (_("Copyright (C) %s Free Software Foundation, Inc.
! This is free software; see the source for copying conditions.  There is NO
! warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
! "),
  	      "1994, 1995, 1996");
        exit (EXIT_SUCCESS);
      }
  
    if (show_help)
      usage (EXIT_SUCCESS);
  
    if (optind < argc)
      for (; optind < argc; optind++)
        {
! 	if (argv[optind][0] == '/')
  	  stpcpy (name_buffer, argv[optind]);
  	else
  	  {
  	    char *cp = stpcpy (name_buffer, current_directory);
  	    *cp++ = '/';
  	    stpcpy (cp, argv[optind]);
  	  }
! 	if (file = fopen (name_buffer, "r"), !file)
  	  error (EXIT_FAILURE, errno, name_buffer);
  	unarchive_shar_file (name_buffer, file);
  	fclose (file);
        }
    else
      {
!       sprintf (name_buffer, "/tmp/unsh.%05d", (int) getpid ());
        unlink (name_buffer);
  
!       if (file = fopen (name_buffer, "w+"), !file)
  	error (EXIT_FAILURE, errno, name_buffer);
  #ifndef __MSDOS__
        unlink (name_buffer);	/* will be deleted on fclose */
  #endif
  
--- 400,442 ----
  
    if (show_version)
      {
        printf ("%s (GNU %s) %s\n", basename (program_name), PACKAGE, VERSION);
        /* xgettext: no-wrap */
!       printf (_("Copyright (C) %s Free Software Foundation, Inc.\n"
! "This is free software; see the source for copying conditions.  There is NO\n"
! "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n"
! ),
  	      "1994, 1995, 1996");
        exit (EXIT_SUCCESS);
      }
  
    if (show_help)
      usage (EXIT_SUCCESS);
  
    if (optind < argc)
      for (; optind < argc; optind++)
        {
! 	if (IS_ABSOLUTE_PATH(argv[optind]))
  	  stpcpy (name_buffer, argv[optind]);
  	else
  	  {
  	    char *cp = stpcpy (name_buffer, current_directory);
  	    *cp++ = '/';
  	    stpcpy (cp, argv[optind]);
  	  }
! 	if (file = fopen (name_buffer, FOPEN_READ), !file)
  	  error (EXIT_FAILURE, errno, name_buffer);
  	unarchive_shar_file (name_buffer, file);
  	fclose (file);
        }
    else
      {
!       sprintf (name_buffer, TEMP_NAME);
        unlink (name_buffer);
  
!       if (file = fopen (name_buffer, FOPEN_READWRITE), !file)
  	error (EXIT_FAILURE, errno, name_buffer);
  #ifndef __MSDOS__
        unlink (name_buffer);	/* will be deleted on fclose */
  #endif
  
diff -acrpNC5 sharutils-4.2.2.orig/src/uudecode.c sharutils-4.2.2.djgpp/src/uudecode.c
*** sharutils-4.2.2.orig/src/uudecode.c	Tue Dec  3 20:33:02 1996
--- sharutils-4.2.2.djgpp/src/uudecode.c	Sun Oct  8 18:09:40 2000
*************** read_stduu (inname)
*** 133,144 ****
  		}
  	    }
  	}
      }
  
!   if (fgets (buf, sizeof(buf), stdin) == NULL
!       || strcmp (buf, "end\n"))
      {
        error (0, 0, _("%s: No `end' line"), inname);
        return 1;
      }
  
--- 133,147 ----
  		}
  	    }
  	}
      }
  
!   if (fgets (buf, sizeof(buf), stdin) == NULL ||
! #if O_TEXT   /* MSDOS-style EOL. */
!       strcmp (buf, "end\r\n") &&
! #endif
!       strcmp (buf, "end\n"))
      {
        error (0, 0, _("%s: No `end' line"), inname);
        return 1;
      }
  
*************** decode (inname, forced_outname)
*** 312,322 ****
        if (buf[0] != '~')
  	outname = buf;
        else
  	{
  	  p = buf + 1;
! 	  while (*p != '/')
  	    ++p;
  	  if (*p == '\0')
  	    {
  	      error (0, 0, _("%s: Illegal ~user"), inname);
  	      return 1;
--- 315,325 ----
        if (buf[0] != '~')
  	outname = buf;
        else
  	{
  	  p = buf + 1;
! 	  while (!IS_SLASH (*p))
  	    ++p;
  	  if (*p == '\0')
  	    {
  	      error (0, 0, _("%s: Illegal ~user"), inname);
  	      return 1;
*************** decode (inname, forced_outname)
*** 338,348 ****
      }
  
    /* Create output file and set mode.  */
  
    if (strcmp (outname, "/dev/stdout") != 0 && strcmp (outname, "-") != 0
!       && (freopen (outname, "w", stdout) == NULL
  #if HAVE_FCHMOD
  	  || fchmod (fileno (stdout), mode & (S_IRWXU | S_IRWXG | S_IRWXO))
  #else
  	  || chmod (outname, mode & (S_IRWXU | S_IRWXG | S_IRWXO))
  #endif
--- 341,351 ----
      }
  
    /* Create output file and set mode.  */
  
    if (strcmp (outname, "/dev/stdout") != 0 && strcmp (outname, "-") != 0
!       && (freopen (outname, FREOPEN_WRITE, stdout) == NULL
  #if HAVE_FCHMOD
  	  || fchmod (fileno (stdout), mode & (S_IRWXU | S_IRWXG | S_IRWXO))
  #else
  	  || chmod (outname, mode & (S_IRWXU | S_IRWXG | S_IRWXO))
  #endif
*************** main (argc, argv)
*** 413,426 ****
  
  	case 'v':
  	  printf ("%s (GNU %s) %s\n", basename (program_name),
  		  PACKAGE, VERSION);
  	  /* xgettext: no-wrap */
! 	  printf (_("Copyright (C) %s Free Software Foundation, Inc.
! This is free software; see the source for copying conditions.  There is NO
! warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
! "),
  		  "1994, 1995, 1996");
  	  exit (EXIT_SUCCESS);
  
  	case 0:
  	  break;
--- 416,429 ----
  
  	case 'v':
  	  printf ("%s (GNU %s) %s\n", basename (program_name),
  		  PACKAGE, VERSION);
  	  /* xgettext: no-wrap */
! 	  printf (_("Copyright (C) %s Free Software Foundation, Inc.\n"
! "This is free software; see the source for copying conditions.  There is NO\n"
! "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n"
! ),
  		  "1994, 1995, 1996");
  	  exit (EXIT_SUCCESS);
  
  	case 0:
  	  break;
*************** warranty; not even for MERCHANTABILITY o
*** 435,445 ****
    else
      {
        exit_status = EXIT_SUCCESS;
        do
  	{
! 	  if (freopen (argv[optind], "r", stdin) != NULL)
  	    {
  	      if (decode (argv[optind], outname) != 0)
  		exit_status = EXIT_FAILURE;
  	    }
  	  else
--- 438,448 ----
    else
      {
        exit_status = EXIT_SUCCESS;
        do
  	{
! 	  if (freopen (argv[optind], FREOPEN_READ, stdin) != NULL)
  	    {
  	      if (decode (argv[optind], outname) != 0)
  		exit_status = EXIT_FAILURE;
  	    }
  	  else
diff -acrpNC5 sharutils-4.2.2.orig/src/uuencode.c sharutils-4.2.2.djgpp/src/uuencode.c
*** sharutils-4.2.2.orig/src/uuencode.c	Tue Dec  3 16:52:24 1996
--- sharutils-4.2.2.djgpp/src/uuencode.c	Sat Sep 30 19:04:00 2000
*************** main (argc, argv)
*** 255,268 ****
  
  	case 'v':
  	  printf ("%s (GNU %s) %s\n", basename (program_name),
  		  PACKAGE, VERSION);
  	  /* xgettext: no-wrap */
! 	  printf (_("Copyright (C) %s Free Software Foundation, Inc.
! This is free software; see the source for copying conditions.  There is NO
! warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
! "),
  		  "1994, 1995, 1996");
  	  exit (EXIT_SUCCESS);
  
  	case 0:
  	  break;
--- 255,268 ----
  
  	case 'v':
  	  printf ("%s (GNU %s) %s\n", basename (program_name),
  		  PACKAGE, VERSION);
  	  /* xgettext: no-wrap */
! 	  printf (_("Copyright (C) %s Free Software Foundation, Inc.\n"
! "This is free software; see the source for copying conditions.  There is NO\n"
! "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n"
! ),
  		  "1994, 1995, 1996");
  	  exit (EXIT_SUCCESS);
  
  	case 0:
  	  break;
*************** warranty; not even for MERCHANTABILITY o
*** 276,286 ****
      {
      case 2:
  
        /* Optional first argument is input file.  */
  
!       if (!freopen (argv[optind], "r", stdin) || fstat (fileno (stdin), &sb))
  	error (EXIT_FAILURE, errno, "%s", argv[optind]);
        mode = sb.st_mode & (S_IRWXU | S_IRWXG | S_IRWXO);
        optind++;
        break;
  
--- 276,286 ----
      {
      case 2:
  
        /* Optional first argument is input file.  */
  
!       if (!freopen (argv[optind], FREOPEN_READ, stdin) || fstat (fileno (stdin), &sb))
  	error (EXIT_FAILURE, errno, "%s", argv[optind]);
        mode = sb.st_mode & (S_IRWXU | S_IRWXG | S_IRWXO);
        optind++;
        break;
  
diff -acrpNC5 sharutils-4.2.2.orig/tests/shar-1 sharutils-4.2.2.djgpp/tests/shar-1
*** sharutils-4.2.2.orig/tests/shar-1	Tue Dec  3 16:24:48 1996
--- sharutils-4.2.2.djgpp/tests/shar-1	Sun Oct  8 17:32:44 2000
*************** current_dir="`pwd`"
*** 7,16 ****
--- 7,19 ----
  
  trap 'rm -fr $tmpfiles' 1 2 3 15
  
  tmpfiles="shar-1.in shar-1.shar"
  echo "This is a test" > shar-1.in
+ if [ "x$OSTYPE" = "xmsdosdjgpp" ]; then
+   dtou shar-1.in
+ fi
  : ${SHAR=shar}
  ${SHAR} -f $current_dir/shar-1.in > shar-1.shar 2> /dev/null
  result=$?
  
  if test $result -eq 0; then
diff -acrpNC5 sharutils-4.2.2.orig/tests/shar-1.ok sharutils-4.2.2.djgpp/tests/shar-1.ok
*** sharutils-4.2.2.orig/tests/shar-1.ok	Tue Dec  3 16:19:48 1996
--- sharutils-4.2.2.djgpp/tests/shar-1.ok	Tue Oct 10 15:41:14 2000
***************
*** 6,15 ****
--- 6,21 ----
  # This shar contains:
  # length mode       name
  # ------ ---------- ------------------------------------------
  #     15 -rw-r--r-- shar-1.in
  #
+ # Some help for the DJGPP port of Bash.
+ UNAME=${UNAME-`uname 2>/dev/null`}
+ case X$UNAME in
+   *-DOS) PATH_EXPAND=n
+          TEST_FINDS_EXE=y
+ esac
  save_IFS="${IFS}"
  IFS="${IFS}:"
  gettext_dir=FAILED
  locale_dir=FAILED
  first_param="$1"
*************** if test -f 'shar-1.in' && test "$first_p
*** 76,86 ****
  else
    $echo 'x -' extracting 'shar-1.in' '(text)'
    sed 's/^X//' << 'SHAR_EOF' > 'shar-1.in' &&
  This is a test
  SHAR_EOF
!   $shar_touch  'shar-1.in' &&
    chmod 0644 'shar-1.in' ||
    $echo 'restore of' 'shar-1.in' 'failed'
    if ( md5sum --help </dev/null 2>&1 | grep 'sage: md5sum \[' ) >/dev/null 2>&1 \
    && ( md5sum --version </dev/null 2>&1 | grep -v 'textutils 1.12' ) >/dev/null; then
      md5sum -c << SHAR_EOF >/dev/null 2>&1 \
--- 82,92 ----
  else
    $echo 'x -' extracting 'shar-1.in' '(text)'
    sed 's/^X//' << 'SHAR_EOF' > 'shar-1.in' &&
  This is a test
  SHAR_EOF
!   $shar_touch 0 'shar-1.in' &&
    chmod 0644 'shar-1.in' ||
    $echo 'restore of' 'shar-1.in' 'failed'
    if ( md5sum --help </dev/null 2>&1 | grep 'sage: md5sum \[' ) >/dev/null 2>&1 \
    && ( md5sum --version </dev/null 2>&1 | grep -v 'textutils 1.12' ) >/dev/null; then
      md5sum -c << SHAR_EOF >/dev/null 2>&1 \
diff -acrpNC5 sharutils-4.2.2.orig/tests/testdata sharutils-4.2.2.djgpp/tests/testdata
*** sharutils-4.2.2.orig/tests/testdata	Tue Aug 15 18:15:16 1995
--- sharutils-4.2.2.djgpp/tests/testdata	Sun Oct  1 23:43:10 2000
***************
*** 1,6 ****
! begin 664 test.bin
  M``$"`P0%!@<("0H+#`T.#Q`1$A,4%187&!D:&QP='A\@(2(C)"4F)R@I*BLL
  M+2XO,#$R,S0U-C<X.3H[/#T^/T!!0D-$149'2$E*2TQ-3D]045)35%565UA9
  M6EM<75Y?8&%B8V1E9F=H:6IK;&UN;W!Q<G-T=79W>'EZ>WQ]?G^`@8*#A(6&
  MAXB)BHN,C8Z/D)&2DY25EI>8F9J;G)V>GZ"AHJ.DI::GJ*FJJZRMKJ^PL;*S
  MM+6VM[BYNKN\O;Z_P,'"P\3%QL?(R<K+S,W.S]#1TM/4U=;7V-G:V]S=WM_@
--- 1,6 ----
! begin 644 test.bin
  M``$"`P0%!@<("0H+#`T.#Q`1$A,4%187&!D:&QP='A\@(2(C)"4F)R@I*BLL
  M+2XO,#$R,S0U-C<X.3H[/#T^/T!!0D-$149'2$E*2TQ-3D]045)35%565UA9
  M6EM<75Y?8&%B8V1E9F=H:6IK;&UN;W!Q<G-T=79W>'EZ>WQ]?G^`@8*#A(6&
  MAXB)BHN,C8Z/D)&2DY25EI>8F9J;G)V>GZ"AHJ.DI::GJ*FJJZRMKJ^PL;*S
  MM+6VM[BYNKN\O;Z_P,'"P\3%QL?(R<K+S,W.S]#1TM/4U=;7V-G:V]S=WM_@
