summaryrefslogtreecommitdiff
path: root/sysutils
diff options
context:
space:
mode:
authorhubertf <hubertf@pkgsrc.org>2001-08-25 16:34:26 +0000
committerhubertf <hubertf@pkgsrc.org>2001-08-25 16:34:26 +0000
commitbd4ce42a80bcbb1092bd8b3050a4e6d139cf4abb (patch)
tree21e719d1b24b7999b20405c88a26cf23bb555480 /sysutils
parent0d2cd59e6c68142ced9a2e187134f1056626c254 (diff)
downloadpkgsrc-bd4ce42a80bcbb1092bd8b3050a4e6d139cf4abb.tar.gz
* merge all patches to xdu.c into one patch file
* silence a warning about missing prototype * when *alloc() fails to get some memory, print an error and exit, instead of crashing Bump version to 3.0nb2
Diffstat (limited to 'sysutils')
-rw-r--r--sysutils/xdu/Makefile4
-rw-r--r--sysutils/xdu/distinfo5
-rw-r--r--sysutils/xdu/patches/patch-aa72
-rw-r--r--sysutils/xdu/patches/patch-ab28
4 files changed, 73 insertions, 36 deletions
diff --git a/sysutils/xdu/Makefile b/sysutils/xdu/Makefile
index 98fcd3b13b6..073dd1967a3 100644
--- a/sysutils/xdu/Makefile
+++ b/sysutils/xdu/Makefile
@@ -1,8 +1,8 @@
-# $NetBSD: Makefile,v 1.4 2001/08/21 08:07:36 assar Exp $
+# $NetBSD: Makefile,v 1.5 2001/08/25 16:34:26 hubertf Exp $
#
DISTNAME= xdu-3.0
-PKGNAME= xdu-3.0nb1
+PKGNAME= xdu-3.0nb2
CATEGORIES= sysutils x11
MASTER_SITES= http://sd.wareonearth.com/~phil/xdu/ ftp://ftp.arl.mil/pub/
EXTRACT_SUFX= .tar.Z
diff --git a/sysutils/xdu/distinfo b/sysutils/xdu/distinfo
index 36339d9bf14..d56877d01f5 100644
--- a/sysutils/xdu/distinfo
+++ b/sysutils/xdu/distinfo
@@ -1,6 +1,5 @@
-$NetBSD: distinfo,v 1.2 2001/04/19 11:29:12 agc Exp $
+$NetBSD: distinfo,v 1.3 2001/08/25 16:34:26 hubertf Exp $
SHA1 (xdu-3.0.tar.Z) = 196e2ba03253fd6b8a88fafe6b00e40632183d0c
Size (xdu-3.0.tar.Z) = 20114 bytes
-SHA1 (patch-aa) = 150fd287c83c67b5f52dc1a4b05ce2be20e8ecae
-SHA1 (patch-ab) = 1fc896ffc82b9259f2cd92b0b461bb3d3af785bf
+SHA1 (patch-aa) = 6aa0a84e1f234e98356deaaf21fecc4f7ecd58e9
diff --git a/sysutils/xdu/patches/patch-aa b/sysutils/xdu/patches/patch-aa
index 150a2de7a6c..a9d59f4e5e5 100644
--- a/sysutils/xdu/patches/patch-aa
+++ b/sysutils/xdu/patches/patch-aa
@@ -1,8 +1,15 @@
-$NetBSD: patch-aa,v 1.1 2000/12/14 01:10:43 hubertf Exp $
+$NetBSD: patch-aa,v 1.2 2001/08/25 16:34:27 hubertf Exp $
---- xdu.c.orig Wed Dec 13 23:18:33 2000
+--- xdu.c.orig Sun Jun 5 21:29:23 1994
+++ xdu.c
-@@ -24,8 +24,8 @@
+@@ -19,13 +19,15 @@
+ * limitation a license to do the foregoing actions under any patents of
+ * the party supplying this software to the X Consortium.
+ */
++#include <assert.h>
+ #include <stdio.h>
++#include <string.h>
+ #include "version.h"
extern char *malloc(), *calloc();
@@ -13,3 +20,62 @@ $NetBSD: patch-aa,v 1.1 2000/12/14 01:10:43 hubertf Exp $
#define MAXPATH 4096 /* max total pathname length */
#define NCOLS 5 /* default number of columns in display */
+@@ -96,6 +98,10 @@
+ struct node *np;
+
+ np = (struct node *)calloc(1,sizeof(struct node));
++ if (np == NULL) {
++ fprintf(stderr, "Out of memory! (#1)\n");
++ exit(1);
++ }
+ np->name = strdup(name);
+ np->size = size;
+ np->num = nnodes;
+@@ -232,7 +238,6 @@
+ char *filename;
+ {
+ char buf[4096];
+- char name[4096];
+ int size;
+ FILE *fp;
+
+@@ -245,9 +250,12 @@
+ }
+ }
+ while (fgets(buf,sizeof(buf),fp) != NULL) {
+- sscanf(buf, "%d %s\n", &size, name);
+- /*printf("%d %s\n", size, name);*/
+- parse_entry(name,size);
++ char *p, *q = NULL;
++ p = strtok_r(buf, " \t", &q);
++ size = atoi(p);
++ p = strtok_r(NULL, "\r\n", &q);
++ /* printf("%d %s\n", size, p); */
++ parse_entry(p,size);
+ }
+ fclose(fp);
+ }
+@@ -622,6 +630,7 @@
+ 100.0*topp->size/rootp->size);
+ }
+
++#ifndef __NetBSD__
+ char *
+ strdup(s)
+ char *s;
+@@ -631,10 +640,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__ */
+
+ /**************** External Entry Points ****************/
+
diff --git a/sysutils/xdu/patches/patch-ab b/sysutils/xdu/patches/patch-ab
deleted file mode 100644
index 5d1180df889..00000000000
--- a/sysutils/xdu/patches/patch-ab
+++ /dev/null
@@ -1,28 +0,0 @@
-$NetBSD: patch-ab,v 1.1 2000/12/30 00:19:06 joda Exp $
-
---- xdu.c.orig Sun Jun 5 21:29:23 1994
-+++ xdu.c Sat Dec 30 00:51:35 2000
-@@ -232,7 +232,6 @@
- char *filename;
- {
- char buf[4096];
-- char name[4096];
- int size;
- FILE *fp;
-
-@@ -245,9 +244,12 @@
- }
- }
- while (fgets(buf,sizeof(buf),fp) != NULL) {
-- sscanf(buf, "%d %s\n", &size, name);
-- /*printf("%d %s\n", size, name);*/
-- parse_entry(name,size);
-+ char *p, *q = NULL;
-+ p = strtok_r(buf, " \t", &q);
-+ size = atoi(p);
-+ p = strtok_r(NULL, "\r\n", &q);
-+ /* printf("%d %s\n", size, p); */
-+ parse_entry(p,size);
- }
- fclose(fp);
- }