summaryrefslogtreecommitdiff
path: root/misc/mmv
diff options
context:
space:
mode:
authorjoerg <joerg>2005-11-10 18:10:36 +0000
committerjoerg <joerg>2005-11-10 18:10:36 +0000
commit7cb4c669e43257d1cf44ac3cc4ee495b8f5339e7 (patch)
tree4a96da5d1369beb7128d95bf9b84d67ec50e2d06 /misc/mmv
parent7e251b4f7a2c1ce5bedec64695e5c9bafcc39c03 (diff)
downloadpkgsrc-7cb4c669e43257d1cf44ac3cc4ee495b8f5339e7.tar.gz
Use POSIX NAME_MAX if available, fall back to MAXNAMLEN otherwise.
Don't use stdout for initialisation of a global variable, do it in main.
Diffstat (limited to 'misc/mmv')
-rw-r--r--misc/mmv/distinfo4
-rw-r--r--misc/mmv/patches/patch-ab43
2 files changed, 38 insertions, 9 deletions
diff --git a/misc/mmv/distinfo b/misc/mmv/distinfo
index 22533cd51e7..7a9ed10bc7f 100644
--- a/misc/mmv/distinfo
+++ b/misc/mmv/distinfo
@@ -1,7 +1,7 @@
-$NetBSD: distinfo,v 1.5 2005/11/08 03:03:44 tv Exp $
+$NetBSD: distinfo,v 1.6 2005/11/10 18:10:36 joerg Exp $
SHA1 (mmv_1.01b.orig.tar.gz) = 538a26b1d7e8b9bc286843e6aa2d8d959d8914bb
RMD160 (mmv_1.01b.orig.tar.gz) = b268bd5ec5149a4628b73844221f6f60b026e80b
Size (mmv_1.01b.orig.tar.gz) = 25656 bytes
SHA1 (patch-aa) = eb97c23ee711b1650d4e36ba61258ee704fd6766
-SHA1 (patch-ab) = 6580809b6bcb2ff8ab814ce31c22d5bd9461bacd
+SHA1 (patch-ab) = 29fa2b73314e2aeb851a3b87745825d78e61ca9b
diff --git a/misc/mmv/patches/patch-ab b/misc/mmv/patches/patch-ab
index 7b43b99d70a..58ab1336143 100644
--- a/misc/mmv/patches/patch-ab
+++ b/misc/mmv/patches/patch-ab
@@ -1,12 +1,13 @@
-$NetBSD: patch-ab,v 1.3 2005/11/08 03:03:44 tv Exp $
+$NetBSD: patch-ab,v 1.4 2005/11/10 18:10:36 joerg Exp $
---- mmv.c.orig 1993-10-25 06:29:39.000000000 -0400
+--- mmv.c.orig 1993-10-25 10:29:39.000000000 +0000
+++ mmv.c
-@@ -123,10 +123,13 @@ extern unsigned _stklen = 10000;
+@@ -123,10 +123,14 @@ extern unsigned _stklen = 10000;
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/file.h>
+#include <sys/param.h>
++#include <limits.h>
+#if !(defined(BSD) && BSD >= 199306)
extern char *getenv();
@@ -16,7 +17,7 @@ $NetBSD: patch-ab,v 1.3 2005/11/08 03:03:44 tv Exp $
#ifdef HAS_DIRENT
#include <dirent.h>
-@@ -188,7 +191,7 @@ extern char *strcpy(), *strchr();
+@@ -188,7 +192,7 @@ extern char *strcpy(), *strchr();
#include <fcntl.h>
#endif
@@ -25,7 +26,7 @@ $NetBSD: patch-ab,v 1.3 2005/11/08 03:03:44 tv Exp $
/* for System V and Version 7*/
struct utimbuf {
-@@ -197,6 +200,9 @@ struct utimbuf {
+@@ -197,6 +201,9 @@ struct utimbuf {
};
#define utimes(f, t) utime((f), &(t))
@@ -35,7 +36,35 @@ $NetBSD: patch-ab,v 1.3 2005/11/08 03:03:44 tv Exp $
#ifndef HAS_RENAME
#ifndef MV_DIR
# define MV_DIR "/usr/lib/mv_dir"
-@@ -2631,7 +2637,7 @@ static int copy(ff, len)
+@@ -436,7 +443,7 @@ static CHUNK *freechunks = NULL;
+ static SLICER slicer[2] = {{NULL, NULL, 0}, {NULL, NULL, 0}};
+
+ static int badreps = 0, paterr = 0, direrr, failed = 0, gotsig = 0, repbad;
+-static FILE *outfile = stdout;
++static FILE *outfile;
+
+ static char IDF[] = "$$mmvdid.";
+ static char TEMP[] = "$$mmvtmp.";
+@@ -497,6 +504,8 @@ int main(argc, argv)
+ {
+ char *frompat, *topat;
+
++ outfile = stdout;
++
+ init();
+ procargs(argc, argv, &frompat, &topat);
+ domatch(frompat, topat);
+@@ -1415,6 +1424,9 @@ static int badname(s)
+ (*ext == '.' && strchr(ext + 1, '.') != NULL) ||
+ strlen(ext) >= MAXEXT ||
+ strncmp(s, IDF, STRLEN(IDF)) == 0
++#elif defined(NAME_MAX)
++ (*s == '.' && (s[1] == '\0' || strcmp(s, "..") == 0)) ||
++ strlen(s) > NAME_MAX
+ #else
+ (*s == '.' && (s[1] == '\0' || strcmp(s, "..") == 0)) ||
+ strlen(s) > MAXNAMLEN
+@@ -2631,7 +2643,7 @@ static int copy(ff, len)
#ifdef IS_MSDOS
struct ftime tim;
#else
@@ -44,7 +73,7 @@ $NetBSD: patch-ab,v 1.3 2005/11/08 03:03:44 tv Exp $
struct utimbuf tim;
#else
struct timeval tim[2];
-@@ -2706,7 +2712,7 @@ static int copy(ff, len)
+@@ -2706,7 +2718,7 @@ static int copy(ff, len)
#else
stat(pathbuf, &fstat) ||
(