aboutsummaryrefslogtreecommitdiffstats
path: root/sysutils/xdu
diff options
context:
space:
mode:
authorarved <arved@FreeBSD.org>2004-08-16 01:33:42 +0800
committerarved <arved@FreeBSD.org>2004-08-16 01:33:42 +0800
commit10173b55904620bc37a9faa236c9d2b994fd115b (patch)
tree7bc8196c2b46a179e2202c59c674807846c4e2ae /sysutils/xdu
parent99662ce181a4ebd9929d0128893d365d5ad94521 (diff)
downloadfreebsd-ports-graphics-10173b55904620bc37a9faa236c9d2b994fd115b.tar.gz
freebsd-ports-graphics-10173b55904620bc37a9faa236c9d2b994fd115b.tar.zst
freebsd-ports-graphics-10173b55904620bc37a9faa236c9d2b994fd115b.zip
Use strdup(3) from string.h instead of own, fixes build with gcc 3.4
Add a few missing includes to silence warnings while i am here.
Diffstat (limited to 'sysutils/xdu')
-rw-r--r--sysutils/xdu/files/patch-aa46
1 files changed, 39 insertions, 7 deletions
diff --git a/sysutils/xdu/files/patch-aa b/sysutils/xdu/files/patch-aa
index 84a506215fa..95380a6360a 100644
--- a/sysutils/xdu/files/patch-aa
+++ b/sysutils/xdu/files/patch-aa
@@ -1,6 +1,20 @@
---- xdu.c.orig Mon Jun 6 04:29:23 1994
-+++ xdu.c Fri Mar 16 07:20:49 2001
-@@ -235,6 +235,7 @@
+--- xdu.c.orig Sun Jun 5 21:29:23 1994
++++ xdu.c Sun Aug 15 19:31:01 2004
+@@ -20,9 +20,12 @@
+ * the party supplying this software to the X Consortium.
+ */
+ #include <stdio.h>
++#include <string.h>
++#include <stdlib.h>
++#include <unistd.h>
++#include <ctype.h>
+ #include "version.h"
+
+-extern char *malloc(), *calloc();
+
+ #define MAXDEPTH 80 /* max elements in a path */
+ #define MAXNAME 1024 /* max pathname element length */
+@@ -235,6 +238,7 @@
char name[4096];
int size;
FILE *fp;
@@ -8,7 +22,7 @@
if (strcmp(filename, "-") == 0) {
fp = stdin;
-@@ -244,11 +245,21 @@
+@@ -244,11 +248,21 @@
exit(1);
}
}
@@ -31,7 +45,7 @@
fclose(fp);
}
-@@ -269,7 +280,7 @@
+@@ -269,7 +283,7 @@
length = strlen(name);
if ((length > 0) && (name[length-1] == '/')) {
/* strip off trailing / (e.g. GNU du) */
@@ -40,7 +54,7 @@
}
arg = 0; indx = 0;
-@@ -289,8 +300,10 @@
+@@ -289,8 +303,10 @@
}
name++;
}
@@ -53,7 +67,7 @@
path[arg] = NULL;
addtree(&top,path,size);
-@@ -399,15 +412,15 @@
+@@ -399,15 +415,15 @@
/*printf("addtree(\"%s\",\"%s\",%d)\n", top->name, path[0], size);*/
@@ -75,3 +89,21 @@
/* recurse */
addtree(np,&path[1],size);
return;
+@@ -621,7 +637,7 @@
+ printf("%s %d (%.2f%%)\n", path, topp->size,
+ 100.0*topp->size/rootp->size);
+ }
+-
++/*
+ char *
+ strdup(s)
+ char *s;
+@@ -635,7 +651,7 @@
+
+ return cp;
+ }
+-
++*/
+ /**************** External Entry Points ****************/
+
+ int