Index: gnats-4.1.0/Makefile.in
--- gnats-4.1.0/Makefile.in.orig	2005-02-24 21:35:55 +0100
+++ gnats-4.1.0/Makefile.in	2006-10-12 14:02:28 +0200
@@ -48,7 +48,7 @@
 	$(MAKE) INSTALL_PROGRAM='$(INSTALL_PROGRAM) -s' $@
 
 install-tools:
-	$(MAKE) INSTALL_PROGRAM='$(INSTALL_PROGRAM) -s' $@
+	for d in $(SUBDIRS); do $(MAKE) -C $$d $@; done
 
 uninstall:
 	for d in $(SUBDIRS); do $(MAKE) -C $$d $@; done
Index: gnats-4.1.0/doc/Makefile.in
--- gnats-4.1.0/doc/Makefile.in.orig	2004-11-19 05:57:37 +0100
+++ gnats-4.1.0/doc/Makefile.in	2006-10-12 14:02:55 +0200
@@ -101,9 +101,7 @@
 info: gnats.info gnats-faq.info
 
 gnats.info: $(GNATS_SOURCES)
-	$(MAKEINFO) -I $(srcdir) -o $@ $<
 gnats-faq.info: $(FAQ_SOURCES)
-	$(MAKEINFO) -I $(srcdir) -o $@ $<
 
 version.texi: Makefile
 	echo "@set VERSION $(VERSION)" > $@-t
Index: gnats-4.1.0/gnats/Makefile.in
--- gnats-4.1.0/gnats/Makefile.in.orig	2005-02-24 21:35:55 +0100
+++ gnats-4.1.0/gnats/Makefile.in	2006-10-12 14:02:28 +0200
@@ -93,7 +93,7 @@
 
 INSTALL = $(srcdir)/../install-sh -c
 INSTALL_PROGRAM = @INSTALL_PROGRAM@
-INSTALL_SCRIPT = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
 INSTALL_DATA = @INSTALL_DATA@
 
 SUB_INSTALL = `echo $(INSTALL) | sed 's,^\([^/]\),../\1,'`
@@ -391,7 +391,7 @@
 	$(INSTALL_SCRIPT) edit-pr $(DESTDIR)$(bindir)/edit-pr
 	$(INSTALL_SCRIPT) diff-prs $(DESTDIR)$(libexecdir)/gnats/diff-prs
 	$(INSTALL_SCRIPT) mail-agent $(DESTDIR)$(libexecdir)/gnats/mail-agent
-	$(INSTALL_PROGRAM) file-pr $(DESTDIR)$(libexecdir)/gnats/file-pr
+	$(INSTALL_SCRIPT) file-pr $(DESTDIR)$(libexecdir)/gnats/file-pr
 	$(INSTALL_PROGRAM) pr-age $(DESTDIR)$(libexecdir)/gnats/pr-age
 	$(INSTALL_PROGRAM) pr-edit $(DESTDIR)$(libexecdir)/gnats/pr-edit
 	@if [ `whoami` = root -o `whoami` = $(GNATS_USER) ] ; then \
Index: gnats-4.1.0/gnats/edit.c
--- gnats-4.1.0/gnats/edit.c.orig	2005-02-24 21:22:46 +0100
+++ gnats-4.1.0/gnats/edit.c	2006-10-12 14:02:28 +0200
@@ -134,79 +134,47 @@
 }
 
 static int
-addAuditEntryP (const DatabaseInfo database, FieldIndex field,
-		ChangeActions actions)
+applyChangeActions (PR *pr, PR *oldPR, FieldIndex field,
+		    ChangeActions actions, ErrorDesc *err,
+		    FormatNamedParameter *params)
 {
-  while (actions != NULL)
-    {
-      if (actions->addAuditTrail)
-	{
-	  return 1;
-	}
-      actions = actions->next;
-    }
+  ChangeActions actionList = actions;
 
-  if (fieldDefForIndex (field)->datatype != MultiText)
+  while (actionList != NULL)
     {
-      ChangeActions globalActions = globalChangeActions (database);
-
-      while (globalActions != NULL)
+      if (actionList->expr == NULL
+	    || pr_matches_expr (pr, oldPR, actionList->expr, params))
 	{
-	  if (globalActions->addAuditTrail)
+	  if (applyChangeAction (actionList, pr, oldPR, field, err, params))
 	    {
 	      return 1;
 	    }
-	  globalActions = globalActions->next;
+
+          if (field != InvalidFieldIndex && actionList->addAuditTrail)
+	    {
+	      addAuditTrailEnt (pr, actionList->auditTrailFormat, params, err);
+	    }
 	}
+      actionList = actionList->next;
     }
-  return 0;
-}
-
-static int
-applyChangeActions (PR *pr, PR *oldPR, FieldIndex field, 
-		    ChangeActions actions, ErrorDesc *err,
-		    FormatNamedParameter *params)
-{
-  {
-    ChangeActions actionList = actions;
 
-    while (actionList != NULL)
-      {
-	if (actionList->expr == NULL
-	    || pr_matches_expr (pr, oldPR, actionList->expr, params))
-	  {
-	    if (applyChangeAction (actionList, pr, oldPR, field, err, params))
-	      {
-		return 1;
-	      }
-	  }
-	actionList = actionList->next;
-      }
-  }
-
-  if (field != InvalidFieldIndex && addAuditEntryP (pr->database, 
-						    field, actions))
+  if (field != InvalidFieldIndex)
     {
-      ChangeActions action = actions;
-      while (actions != NULL)
+      if (fieldDefForIndex (field)->datatype != MultiText)
 	{
-	  if (actions->addAuditTrail)
+	  ChangeActions globalActions = globalChangeActions (pr->database);
+
+	  while (globalActions != NULL)
 	    {
-	      break;
+	      if (globalActions->addAuditTrail)
+		{
+		  addAuditTrailEnt (pr, globalActions->auditTrailFormat,
+				    params, err);
+		}
+	      globalActions = globalActions->next;
 	    }
-	  actions = actions->next;
-	}
-
-      if (action != NULL)
-	{
-	  addAuditTrailEnt (pr, action->auditTrailFormat, params, err);
-	}
-      else
-	{
-	  addAuditTrailEnt (pr, NULL, params, err);
 	}
     }
-
   return 0;
 }
 
Index: gnats-4.1.0/gnats/mail-query.sh
--- gnats-4.1.0/gnats/mail-query.sh.orig	2001-12-09 15:38:21 +0100
+++ gnats-4.1.0/gnats/mail-query.sh	2006-10-12 14:02:28 +0200
@@ -19,12 +19,12 @@
 # along with GNU GNATS; see the file COPYING.  If not, write to
 # the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
 
-GNATS_ADMIN_ADDR="`query-pr --responsible-address gnats-admin`"
-LIBEXECDIR=xLIBEXECDIRx
-
 PATH=xBINDIRx:/bin:/sbin:/usr/bin:/usr/ucb:/usr/bsd:/usr/sbin
 export PATH
 
+GNATS_ADMIN_ADDR="`query-pr --responsible-address gnats-admin`"
+LIBEXECDIR=xLIBEXECDIRx
+
 # Don't expand globs for the arguments to query-pr.
 set -f
 
Index: gnats-4.1.0/send-pr/Makefile.in
--- gnats-4.1.0/send-pr/Makefile.in.orig	2005-02-24 19:49:23 +0100
+++ gnats-4.1.0/send-pr/Makefile.in	2006-10-12 14:02:28 +0200
@@ -55,7 +55,7 @@
 INSTALL = @INSTALL@
 INSTALL_PROGRAM = @INSTALL_PROGRAM@
 INSTALL_DATA = @INSTALL_DATA@
-INSTALL_SCRIPT = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
 
 CFLAGS = -g
 LDFLAGS = -g
Index: gnatsweb-4.00/gnatsweb.pl
--- gnatsweb-4.00/gnatsweb.pl.orig	2003-07-29 14:24:22 +0200
+++ gnatsweb-4.00/gnatsweb.pl	2006-10-12 14:02:28 +0200
@@ -1358,7 +1358,7 @@
 			      ',' . $fields{'Reply-To'});
   }
   my $subject = $q->escape("Re: $fields{$CATEGORY_FIELD}/$pr: $fields{$SYNOPSIS_FIELD}");
-  my $body    = $q->escape(get_viewpr_url($pr));
+  my $body    = get_viewpr_url($pr);
 
   # Netscape Navigator up to and including 4.x should get the URL in
   # the body encoded only once -- and so should Opera
