pkgsrc-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[pkgsrc/trunk]: pkgsrc/misc/mmv Use POSIX NAME_MAX if available, fall back to...
details: https://anonhg.NetBSD.org/pkgsrc/rev/50dfc0ea9555
branches: trunk
changeset: 502910:50dfc0ea9555
user: joerg <joerg%pkgsrc.org@localhost>
date: Thu Nov 10 18:10:36 2005 +0000
description:
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:
misc/mmv/distinfo | 4 ++--
misc/mmv/patches/patch-ab | 43 ++++++++++++++++++++++++++++++++++++-------
2 files changed, 38 insertions(+), 9 deletions(-)
diffs (97 lines):
diff -r 2804710c6dd5 -r 50dfc0ea9555 misc/mmv/distinfo
--- a/misc/mmv/distinfo Thu Nov 10 18:03:21 2005 +0000
+++ b/misc/mmv/distinfo Thu Nov 10 18:10:36 2005 +0000
@@ -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 -r 2804710c6dd5 -r 50dfc0ea9555 misc/mmv/patches/patch-ab
--- a/misc/mmv/patches/patch-ab Thu Nov 10 18:03:21 2005 +0000
+++ b/misc/mmv/patches/patch-ab Thu Nov 10 18:10:36 2005 +0000
@@ -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 @@
#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 @@
/* 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 @@
#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 @@
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) ||
(
Home |
Main Index |
Thread Index |
Old Index