You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@spamassassin.apache.org by km...@apache.org on 2018/09/17 11:14:17 UTC

svn commit: r1841065 - in /spamassassin/branches/3.4/spamc: Makefile.win getopt.c

Author: kmcgrail
Date: Mon Sep 17 11:14:16 2018
New Revision: 1841065

URL: http://svn.apache.org/viewvc?rev=1841065&view=rev
Log:
spamc fixes to compile for windows - bug 7617

Modified:
    spamassassin/branches/3.4/spamc/Makefile.win
    spamassassin/branches/3.4/spamc/getopt.c

Modified: spamassassin/branches/3.4/spamc/Makefile.win
URL: http://svn.apache.org/viewvc/spamassassin/branches/3.4/spamc/Makefile.win?rev=1841065&r1=1841064&r2=1841065&view=diff
==============================================================================
--- spamassassin/branches/3.4/spamc/Makefile.win (original)
+++ spamassassin/branches/3.4/spamc/Makefile.win Mon Sep 17 11:14:16 2018
@@ -19,8 +19,11 @@ all: spamc$(EXEEXT)
 
 
 $(SRCDIR)/spamc$(EXEEXT):
-	cd $(SRCDIR)
-	$(MAKE) spamc$(EXEEXT)
+# Bug #7617: Both commands must be on the same line because for every
+#	line a new sub-shell is spawned. The change of directory would be
+#	"forgotten" before the next command is executed, if the commands
+#	were on different lines.
+	cd $(SRCDIR) && $(MAKE) spamc$(EXEEXT)
 
 
 spamc$(EXEEXT): $(SPAMC_FILES) $(LIBSPAMC_FILES)

Modified: spamassassin/branches/3.4/spamc/getopt.c
URL: http://svn.apache.org/viewvc/spamassassin/branches/3.4/spamc/getopt.c?rev=1841065&r1=1841064&r2=1841065&view=diff
==============================================================================
--- spamassassin/branches/3.4/spamc/getopt.c (original)
+++ spamassassin/branches/3.4/spamc/getopt.c Mon Sep 17 11:14:16 2018
@@ -21,7 +21,7 @@
 #include <string.h>
 #include <assert.h>
 #include <stdlib.h>
-#include <err.h>
+#include <errno.h>
 #include "getopt.h"
 
 #ifdef WIN32
@@ -246,7 +246,8 @@ spamc_getopt_long(int argc, char * const
       if((bp = strchr(longopt, '='))) {
          opt = strdup(bp+1);
          if (opt == NULL) {
-            err(1, NULL);
+            fprintf(stderr, "%s: %s\n", argv[0], strerror(errno));
+            exit(1);
          }  
          longoptlen -= strlen(bp);
       }