head 1.7; access; symbols pkgsrc-2026Q1:1.7.0.78 pkgsrc-2026Q1-base:1.7 pkgsrc-2025Q4:1.7.0.76 pkgsrc-2025Q4-base:1.7 pkgsrc-2025Q3:1.7.0.74 pkgsrc-2025Q3-base:1.7 pkgsrc-2025Q2:1.7.0.72 pkgsrc-2025Q2-base:1.7 pkgsrc-2025Q1:1.7.0.70 pkgsrc-2025Q1-base:1.7 pkgsrc-2024Q4:1.7.0.68 pkgsrc-2024Q4-base:1.7 pkgsrc-2024Q3:1.7.0.66 pkgsrc-2024Q3-base:1.7 pkgsrc-2024Q2:1.7.0.64 pkgsrc-2024Q2-base:1.7 pkgsrc-2024Q1:1.7.0.62 pkgsrc-2024Q1-base:1.7 pkgsrc-2023Q4:1.7.0.60 pkgsrc-2023Q4-base:1.7 pkgsrc-2023Q3:1.7.0.58 pkgsrc-2023Q3-base:1.7 pkgsrc-2023Q2:1.7.0.56 pkgsrc-2023Q2-base:1.7 pkgsrc-2023Q1:1.7.0.54 pkgsrc-2023Q1-base:1.7 pkgsrc-2022Q4:1.7.0.52 pkgsrc-2022Q4-base:1.7 pkgsrc-2022Q3:1.7.0.50 pkgsrc-2022Q3-base:1.7 pkgsrc-2022Q2:1.7.0.48 pkgsrc-2022Q2-base:1.7 pkgsrc-2022Q1:1.7.0.46 pkgsrc-2022Q1-base:1.7 pkgsrc-2021Q4:1.7.0.44 pkgsrc-2021Q4-base:1.7 pkgsrc-2021Q3:1.7.0.42 pkgsrc-2021Q3-base:1.7 pkgsrc-2021Q2:1.7.0.40 pkgsrc-2021Q2-base:1.7 pkgsrc-2021Q1:1.7.0.38 pkgsrc-2021Q1-base:1.7 pkgsrc-2020Q4:1.7.0.36 pkgsrc-2020Q4-base:1.7 pkgsrc-2020Q3:1.7.0.34 pkgsrc-2020Q3-base:1.7 pkgsrc-2020Q2:1.7.0.30 pkgsrc-2020Q2-base:1.7 pkgsrc-2020Q1:1.7.0.10 pkgsrc-2020Q1-base:1.7 pkgsrc-2019Q4:1.7.0.32 pkgsrc-2019Q4-base:1.7 pkgsrc-2019Q3:1.7.0.28 pkgsrc-2019Q3-base:1.7 pkgsrc-2019Q2:1.7.0.26 pkgsrc-2019Q2-base:1.7 pkgsrc-2019Q1:1.7.0.24 pkgsrc-2019Q1-base:1.7 pkgsrc-2018Q4:1.7.0.22 pkgsrc-2018Q4-base:1.7 pkgsrc-2018Q3:1.7.0.20 pkgsrc-2018Q3-base:1.7 pkgsrc-2018Q2:1.7.0.18 pkgsrc-2018Q2-base:1.7 pkgsrc-2018Q1:1.7.0.16 pkgsrc-2018Q1-base:1.7 pkgsrc-2017Q4:1.7.0.14 pkgsrc-2017Q4-base:1.7 pkgsrc-2017Q3:1.7.0.12 pkgsrc-2017Q3-base:1.7 pkgsrc-2017Q2:1.7.0.8 pkgsrc-2017Q2-base:1.7 pkgsrc-2017Q1:1.7.0.6 pkgsrc-2017Q1-base:1.7 pkgsrc-2016Q4:1.7.0.4 pkgsrc-2016Q4-base:1.7 pkgsrc-2016Q3:1.7.0.2 pkgsrc-2016Q3-base:1.7 pkgsrc-2016Q2:1.6.0.28 pkgsrc-2016Q2-base:1.6 pkgsrc-2016Q1:1.6.0.26 pkgsrc-2016Q1-base:1.6 pkgsrc-2015Q4:1.6.0.24 pkgsrc-2015Q4-base:1.6 pkgsrc-2015Q3:1.6.0.22 pkgsrc-2015Q3-base:1.6 pkgsrc-2015Q2:1.6.0.20 pkgsrc-2015Q2-base:1.6 pkgsrc-2015Q1:1.6.0.18 pkgsrc-2015Q1-base:1.6 pkgsrc-2014Q4:1.6.0.16 pkgsrc-2014Q4-base:1.6 pkgsrc-2014Q3:1.6.0.14 pkgsrc-2014Q3-base:1.6 pkgsrc-2014Q2:1.6.0.12 pkgsrc-2014Q2-base:1.6 pkgsrc-2014Q1:1.6.0.10 pkgsrc-2014Q1-base:1.6 pkgsrc-2013Q4:1.6.0.8 pkgsrc-2013Q4-base:1.6 pkgsrc-2013Q3:1.6.0.6 pkgsrc-2013Q3-base:1.6 pkgsrc-2013Q2:1.6.0.4 pkgsrc-2013Q2-base:1.6 pkgsrc-2013Q1:1.6.0.2 pkgsrc-2013Q1-base:1.6 pkgsrc-2012Q4:1.5.0.58 pkgsrc-2012Q4-base:1.5 pkgsrc-2012Q3:1.5.0.56 pkgsrc-2012Q3-base:1.5 pkgsrc-2012Q2:1.5.0.54 pkgsrc-2012Q2-base:1.5 pkgsrc-2012Q1:1.5.0.52 pkgsrc-2012Q1-base:1.5 pkgsrc-2011Q4:1.5.0.50 pkgsrc-2011Q4-base:1.5 pkgsrc-2011Q3:1.5.0.48 pkgsrc-2011Q3-base:1.5 pkgsrc-2011Q2:1.5.0.46 pkgsrc-2011Q2-base:1.5 pkgsrc-2011Q1:1.5.0.44 pkgsrc-2011Q1-base:1.5 pkgsrc-2010Q4:1.5.0.42 pkgsrc-2010Q4-base:1.5 pkgsrc-2010Q3:1.5.0.40 pkgsrc-2010Q3-base:1.5 pkgsrc-2010Q2:1.5.0.38 pkgsrc-2010Q2-base:1.5 pkgsrc-2010Q1:1.5.0.36 pkgsrc-2010Q1-base:1.5 pkgsrc-2009Q4:1.5.0.34 pkgsrc-2009Q4-base:1.5 pkgsrc-2009Q3:1.5.0.32 pkgsrc-2009Q3-base:1.5 pkgsrc-2009Q2:1.5.0.30 pkgsrc-2009Q2-base:1.5 pkgsrc-2009Q1:1.5.0.28 pkgsrc-2009Q1-base:1.5 pkgsrc-2008Q4:1.5.0.26 pkgsrc-2008Q4-base:1.5 pkgsrc-2008Q3:1.5.0.24 pkgsrc-2008Q3-base:1.5 cube-native-xorg:1.5.0.22 cube-native-xorg-base:1.5 pkgsrc-2008Q2:1.5.0.20 pkgsrc-2008Q2-base:1.5 cwrapper:1.5.0.18 pkgsrc-2008Q1:1.5.0.16 pkgsrc-2008Q1-base:1.5 pkgsrc-2007Q4:1.5.0.14 pkgsrc-2007Q4-base:1.5 pkgsrc-2007Q3:1.5.0.12 pkgsrc-2007Q3-base:1.5 pkgsrc-2007Q2:1.5.0.10 pkgsrc-2007Q2-base:1.5 pkgsrc-2007Q1:1.5.0.8 pkgsrc-2007Q1-base:1.5 pkgsrc-2006Q4:1.5.0.6 pkgsrc-2006Q4-base:1.5 pkgsrc-2006Q3:1.5.0.4 pkgsrc-2006Q3-base:1.5 pkgsrc-2006Q2:1.5.0.2 pkgsrc-2006Q2-base:1.5 pkgsrc-2006Q1:1.4.0.6 pkgsrc-2006Q1-base:1.4 pkgsrc-2005Q4:1.4.0.4 pkgsrc-2005Q4-base:1.4 pkgsrc-2005Q3:1.4.0.2 pkgsrc-2005Q3-base:1.4 pkgsrc-2005Q2:1.3.0.22 pkgsrc-2005Q2-base:1.3 pkgsrc-2005Q1:1.3.0.20 pkgsrc-2005Q1-base:1.3 pkgsrc-2004Q4:1.3.0.18 pkgsrc-2004Q4-base:1.3 pkgsrc-2004Q3:1.3.0.16 pkgsrc-2004Q3-base:1.3 pkgsrc-2004Q2:1.3.0.14 pkgsrc-2004Q2-base:1.3 pkgsrc-2004Q1:1.3.0.12 pkgsrc-2004Q1-base:1.3 pkgsrc-2003Q4:1.3.0.10 pkgsrc-2003Q4-base:1.3 netbsd-1-6-1:1.3.0.6 netbsd-1-6-1-base:1.3 netbsd-1-6:1.3.0.8 netbsd-1-6-RELEASE-base:1.3 pkgviews:1.3.0.4 pkgviews-base:1.3 buildlink2:1.3.0.2 buildlink2-base:1.3 netbsd-1-5-PATCH003:1.3 netbsd-1-5-PATCH001:1.1; locks; strict; comment @# @; 1.7 date 2016.07.09.13.03.00; author rillig; state Exp; branches; next 1.6; commitid 1hmzPv4tRtBdbEdz; 1.6 date 2013.01.11.23.32.39; author joerg; state Exp; branches; next 1.5; 1.5 date 2006.06.08.15.39.25; author joerg; state Exp; branches; next 1.4; 1.4 date 2005.07.12.20.16.00; author hubertf; state Exp; branches; next 1.3; 1.3 date 2002.04.05.01.33.25; author hubertf; state Exp; branches; next 1.2; 1.2 date 2001.08.25.16.34.27; author hubertf; state Exp; branches; next 1.1; 1.1 date 2000.12.14.01.10.43; author hubertf; state Exp; branches; next ; desc @@ 1.7 log @Fixed some pkglint warnings. @ text @$NetBSD: patch-aa,v 1.6 2013/01/11 23:32:39 joerg Exp $ Allow longer pathnames. --- xdu.c.orig 2013-01-11 14:30:40.000000000 +0000 +++ xdu.c @@@@ -19,18 +19,19 @@@@ * limitation a license to do the foregoing actions under any patents of * the party supplying this software to the X Consortium. */ +#include #include +#include #include "version.h" -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 */ +#define MAXNAME 4096 /* max pathname element length */ #define MAXPATH 4096 /* max total pathname length */ #define NCOLS 5 /* default number of columns in display */ /* What we IMPORT from xwin.c */ -extern int xsetup(), xmainloop(), xdrawrect(), xrepaint(); +extern int xsetup(), xmainloop(), xrepaint(); +void xdrawrect(char *name, int size, int x, int y, int width, int height); /* What we EXPORT to xwin.c */ extern int press(), reset(), repaint(), setorder(), reorder(); @@@@ -96,6 +97,10 @@@@ int size; 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; @@@@ -610,20 +615,6 @@@@ pwd() 100.0*topp->size/rootp->size); } -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 @ 1.6 log @Use more void. @ text @d1 3 a3 1 $NetBSD: patch-aa,v 1.5 2006/06/08 15:39:25 joerg Exp $ @ 1.5 log @Kill local strdup completely and also remove the malloc and calloc definitions. ANSI C is portable enough for us. @ text @d1 1 a1 1 $NetBSD$ d3 1 a3 1 --- xdu.c.orig 2006-06-08 15:35:16.000000000 +0000 d5 1 a5 1 @@@@ -19,13 +19,13 @@@@ d23 8 a30 1 @@@@ -96,6 +96,10 @@@@ int size; d41 1 a41 1 @@@@ -610,20 +614,6 @@@@ pwd() @ 1.4 log @Update xdu to 3.0nb5. Changes: Add two patches by Nobuyuki Tsuchimura: * makes xdu possible to have white spaces in directory names * internationalization, which makes xdu possible to display any character Addresses PR pkg/30709 by soda@@NetBSD.org. @ text @d3 3 a5 3 --- 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 @@@@ d14 2 a15 2 extern char *malloc(), *calloc(); d23 1 a23 1 @@@@ -96,6 +98,10 @@@@ d34 1 a34 1 @@@@ -610,6 +616,7 @@@@ d38 14 a51 18 +#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__ */ d54 1 @ 1.3 log @Find another place where we can run out of memory, and print some proper error message (instead of dumping core later) @ text @d3 2 a4 2 --- xdu.c.orig Sun Jun 5 21:29:23 1994 +++ xdu.c d34 1 a34 39 @@@@ -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); } @@@@ -290,7 +298,12 @@@@ name++; } buf[indx] = 0; - path[arg++] = strdup(buf); + path[arg] = strdup(buf); + if (path[arg] == NULL) { + fprintf(stderr, "Out of memory! (#3)\n"); + exit(1); + } + arg++; path[arg] = NULL; addtree(&top,path,size); @@@@ -622,6 +635,7 @@@@ d38 1 a38 1 +#ifndef __NetBSD__ d42 1 a42 1 @@@@ -631,10 +645,15 @@@@ @ 1.2 log @ * 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 @ text @d58 15 a72 1 @@@@ -622,6 +630,7 @@@@ d80 1 a80 1 @@@@ -631,10 +640,15 @@@@ @ 1.1 log @Aparently a directory tree can only be 8 directories deep on VMS. It seems if you goof up enough it's no problem do ending with >80 on Unix. Make xdu deal with this properly. Bump version to 3.0nb1 @ text @d3 1 a3 1 --- xdu.c.orig Wed Dec 13 23:18:33 2000 d5 8 a12 1 @@@@ -24,8 +24,8 @@@@ d22 59 @