diff options
author | joerg <joerg@pkgsrc.org> | 2006-06-08 15:39:25 +0000 |
---|---|---|
committer | joerg <joerg@pkgsrc.org> | 2006-06-08 15:39:25 +0000 |
commit | b56b61d10205e61c05defe73e4c9a8038b509ac9 (patch) | |
tree | 215dad15d08d5392f5c54389c9ef46b23e005e02 | |
parent | 594efc421065fdea960af103d2d8813c91d6bc31 (diff) | |
download | pkgsrc-b56b61d10205e61c05defe73e4c9a8038b509ac9.tar.gz |
Kill local strdup completely and also remove the malloc and calloc
definitions. ANSI C is portable enough for us.
-rw-r--r-- | sysutils/xdu/distinfo | 4 | ||||
-rw-r--r-- | sysutils/xdu/patches/patch-aa | 49 |
2 files changed, 25 insertions, 28 deletions
diff --git a/sysutils/xdu/distinfo b/sysutils/xdu/distinfo index 223adb1524a..30f52ee0d72 100644 --- a/sysutils/xdu/distinfo +++ b/sysutils/xdu/distinfo @@ -1,4 +1,4 @@ -$NetBSD: distinfo,v 1.6 2005/07/12 20:16:00 hubertf Exp $ +$NetBSD: distinfo,v 1.7 2006/06/08 15:39:25 joerg Exp $ SHA1 (xdu-3.0.tar.Z) = 196e2ba03253fd6b8a88fafe6b00e40632183d0c RMD160 (xdu-3.0.tar.Z) = 0c95ad79aaeb6e58433add71d852cc0b2312a5f9 @@ -9,4 +9,4 @@ Size (xdu-3.0.dirname.patch) = 1672 bytes SHA1 (xdu-3.0.i18n.patch) = 6f14b5458111b7c9776d15760d1876d242f0dabd RMD160 (xdu-3.0.i18n.patch) = a1ada2ae69331010dd7f3c0e77cb4410065a7254 Size (xdu-3.0.i18n.patch) = 2760 bytes -SHA1 (patch-aa) = 8296ae806d36d6e7e679c58b9694012a98176d6f +SHA1 (patch-aa) = abb9683db2646ae98f943693dfcb7f634ab0cb23 diff --git a/sysutils/xdu/patches/patch-aa b/sysutils/xdu/patches/patch-aa index 5ab96cb614d..fe53abcf0dc 100644 --- a/sysutils/xdu/patches/patch-aa +++ b/sysutils/xdu/patches/patch-aa @@ -1,8 +1,8 @@ -$NetBSD: patch-aa,v 1.4 2005/07/12 20:16:00 hubertf Exp $ +$NetBSD: patch-aa,v 1.5 2006/06/08 15:39:25 joerg Exp $ ---- xdu.c.orig 2005-07-11 23:15:31.000000000 +0200 -+++ xdu.c 2005-07-11 23:19:59.000000000 +0200 -@@ -19,13 +19,15 @@ +--- xdu.c.orig 2006-06-08 15:35:16.000000000 +0000 ++++ xdu.c +@@ -19,13 +19,13 @@ * limitation a license to do the foregoing actions under any patents of * the party supplying this software to the X Consortium. */ @@ -11,8 +11,8 @@ $NetBSD: patch-aa,v 1.4 2005/07/12 20:16:00 hubertf Exp $ +#include <string.h> #include "version.h" - extern char *malloc(), *calloc(); - +-extern char *malloc(), *calloc(); +- -#define MAXDEPTH 80 /* max elements in a path */ -#define MAXNAME 1024 /* max pathname element length */ +#define MAXDEPTH 1024 /* max elements in a path */ @@ -20,7 +20,7 @@ $NetBSD: patch-aa,v 1.4 2005/07/12 20:16:00 hubertf Exp $ #define MAXPATH 4096 /* max total pathname length */ #define NCOLS 5 /* default number of columns in display */ -@@ -96,6 +98,10 @@ +@@ -96,6 +96,10 @@ int size; struct node *np; np = (struct node *)calloc(1,sizeof(struct node)); @@ -31,27 +31,24 @@ $NetBSD: patch-aa,v 1.4 2005/07/12 20:16:00 hubertf Exp $ np->name = strdup(name); np->size = size; np->num = nnodes; -@@ -610,6 +616,7 @@ +@@ -610,20 +614,6 @@ pwd() 100.0*topp->size/rootp->size); } -+#if !defined(__NetBSD__) && !defined(SVR4) /* == Solaris etc. */ - char * - strdup(s) - char *s; -@@ -619,10 +626,15 @@ - - n = strlen(s); - cp = malloc(n+1); -+ if (cp == NULL) { -+ fprintf(stderr, "Out of memory! (#2)\n"); -+ exit(1); -+ } - strcpy(cp,s); - - return cp; - } -+#endif /* __NetBSD__ */ - +-char * +-strdup(s) +-char *s; +-{ +- int n; +- char *cp; +- +- n = strlen(s); +- cp = malloc(n+1); +- strcpy(cp,s); +- +- return cp; +-} +- /**************** External Entry Points ****************/ + int |