head 1.5; access; symbols pkgsrc-2013Q2:1.5.0.2 pkgsrc-2013Q2-base:1.5 pkgsrc-2013Q1:1.4.0.30 pkgsrc-2013Q1-base:1.4 pkgsrc-2012Q4:1.4.0.28 pkgsrc-2012Q4-base:1.4 pkgsrc-2012Q3:1.4.0.26 pkgsrc-2012Q3-base:1.4 pkgsrc-2012Q2:1.4.0.24 pkgsrc-2012Q2-base:1.4 pkgsrc-2012Q1:1.4.0.22 pkgsrc-2012Q1-base:1.4 pkgsrc-2011Q4:1.4.0.20 pkgsrc-2011Q4-base:1.4 pkgsrc-2011Q3:1.4.0.18 pkgsrc-2011Q3-base:1.4 pkgsrc-2011Q2:1.4.0.16 pkgsrc-2011Q2-base:1.4 pkgsrc-2011Q1:1.4.0.14 pkgsrc-2011Q1-base:1.4 pkgsrc-2010Q4:1.4.0.12 pkgsrc-2010Q4-base:1.4 pkgsrc-2010Q3:1.4.0.10 pkgsrc-2010Q3-base:1.4 pkgsrc-2010Q2:1.4.0.8 pkgsrc-2010Q2-base:1.4 pkgsrc-2010Q1:1.4.0.6 pkgsrc-2010Q1-base:1.4 pkgsrc-2009Q4:1.4.0.4 pkgsrc-2009Q4-base:1.4 pkgsrc-2009Q3:1.4.0.2 pkgsrc-2009Q3-base:1.4 pkgsrc-2009Q2:1.3.0.18 pkgsrc-2009Q2-base:1.3 pkgsrc-2009Q1:1.3.0.16 pkgsrc-2009Q1-base:1.3 pkgsrc-2008Q4:1.3.0.14 pkgsrc-2008Q4-base:1.3 pkgsrc-2008Q3:1.3.0.12 pkgsrc-2008Q3-base:1.3 cube-native-xorg:1.3.0.10 cube-native-xorg-base:1.3 pkgsrc-2008Q2:1.3.0.8 pkgsrc-2008Q2-base:1.3 cwrapper:1.3.0.6 pkgsrc-2008Q1:1.3.0.4 pkgsrc-2008Q1-base:1.3 pkgsrc-2007Q4:1.3.0.2 pkgsrc-2007Q4-base:1.3; locks; strict; comment @# @; 1.5 date 2013.04.10.10.46.26; author wiz; state dead; branches; next 1.4; 1.4 date 2009.08.08.05.20.02; author tnn; state Exp; branches; next 1.3; 1.3 date 2007.10.28.10.27.34; author heinz; state Exp; branches; next 1.2; 1.2 date 2007.10.24.23.25.12; author wiz; state Exp; branches; next 1.1; 1.1 date 2007.10.17.06.48.40; author cjs; state Exp; branches; next ; desc @@ 1.5 log @Updat to 1.6.0: Version 1.6.0 - Re-org of code into multiple files, split HTML and Unix listdir() into separate functions, various code cleanups and optimizations. - Fixed a memory leak in listdir() when memory was allocated early and not freed before function exit. - Fixed possible buffer overflow where symbolic links are followed. - Fixed links printing "argetm" before the name of the link when the LINK setting for DIR_COLORS is set to target (Markus Schnalke ) - More fully support dir colors -- added support for su, sg, tw, ow, & st options (and "do" in theory). - Use the environment variable "TREE_COLORS" instead of "LS_COLORS" for color information if it exists. - Added --si flag to print filesizes in SI (powers of 1000) units (Ulrich Eckhardt) - Added -Q to quote filenames in double quotes. Does not override -N or -q. - Control characters are no longer printed in carrot notation, but as backslashed octal, ala ls, except for codes 7-13 which are printed as \a, \b, \t, \n, \v, \f and \r respectively. Spaces and backslashes are also now backslashed as per ls, for better input to scripts unless -Q is in use (where "'s are backslashed.) (Ujjwal Kumar) - Added -U for unsorted listings (directory order). - Added -c for sorting by last status change (ala ls -c). - --dirsfirst is now a meta-sort and does not override -c, -v, -r or -t, but is disabled by -U. - After many requests, added the ability to process the entire tree before emitting output. Used for the new options --du, which works like the du command: sums the amount of space under each directory and prints a total amount used in the report and the --prune option which will prune all empty directories from the output (makes the -P option output much more readable.) It should be noted that this will be slow to output when processing large directory trees and can consume copious amounts of memory, use at your own peril. - Added -X option to emit the directory tree in XML format (turns colorization off always.) - Added --timefmt option to specify the format of time display (implies -D). Uses the strftime format. Version 1.5.3 - Properly quote directories for the system command when tree is relaunched using the -R option. - Fixed possible indentation problem if dirs[*] is not properly zeroed (Martin Nagy). - Use strcoll() instead of strcmp() to sort files based on locale if set. - Change "const static" to "static const" to remove some compiler warnings for Solaris (Kamaraju Kusumanchi). - Actually use TREE_CHARSET if it's defined. - Automatically select UTF-8 charset if TREE_CHARSET is not set, and the locale is set to *UTF-8 (overridden with --charset option.) Version 1.5.2.2 - Set locale before checking MB_CUR_MAX. - Added HP-NonStop platform support (Craig McDaniel ) - Fixed to support 32 bit UID/GIDs. - Added Solaris build options to Makefile (edit and uncomment to use). Provided by Wang Quanhong Version 1.5.2.1 - Added strverscmp.c file for os's without strverscmp. Source file is attributed to: Jean-Franois Bignolles - Try different approach to MB_CUR_MAX problem. - Changed the argument to printit() to be signed char to avoid warnings. Version 1.5.2 - Added --filelimit X option to not descend directories that have more than X number of files in them. - Added -v option for version sorting (also called natural sorting) ala ls. Version 1.5.1.2 - Fixed compile issues related to MB_CUR_MAX on non-linux machines. - Removed unecessary features.h @ text @$NetBSD: patch-aa,v 1.4 2009/08/08 05:20:02 tnn Exp $ --- tree.c.orig 2007-06-11 22:22:06.000000000 +0900 +++ tree.c @@@@ -17,7 +17,9 @@@@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#if defined(__linux__) #include +#endif #include #include #include @@@@ -179,10 +181,12 @@@@ char *sLevel, *curdir, *outfilename = NU FILE *outfile; int *dirs, maxdirs; -#ifdef CYGWIN +#ifndef MB_CUR_MAX +# ifdef CYGWIN extern int MB_CUR_MAX; -#else +# else extern size_t MB_CUR_MAX; +# endif #endif int main(int argc, char **argv) @@@@ -619,7 +623,7 @@@@ void listdir(char *d, int *dt, int *ft, if (!noindent) indent(); path[0] = 0; -#ifdef __USE_FILE_OFFSET64 +#if defined(__linux__) && defined(__USE_FILE_OFFSET64) if (inodeflag) sprintf(path," %7lld",(*dir)->inode); #else if (inodeflag) sprintf(path," %7ld",(*dir)->inode); @ 1.4 log @merge patch (build fix for some platform where MB_CUR_MAX is not defined?) from wip/tree to allow that package to go away. @ text @d1 1 a1 1 $NetBSD: patch-aa,v 1.3 2007/10/28 10:27:34 heinz Exp $ @ 1.3 log @Instead of removing the unportable inclusion of features.h marked it as specific to Linux. @ text @d1 1 a1 1 $NetBSD: patch-aa,v 1.2 2007/10/24 23:25:12 wiz Exp $ d3 1 a3 1 --- tree.c.orig 2007-06-11 15:22:06.000000000 +0200 d15 16 a30 1 @@@@ -619,7 +621,7 @@@@ void listdir(char *d, int *dt, int *ft, @ 1.2 log @Fix installation. Fill in PLIST. Bump PKGREVISION. @ text @d1 1 a1 1 $NetBSD: patch-aa,v 1.1 2007/10/17 06:48:40 cjs Exp $ d3 1 a3 1 --- tree.c.orig 2007-06-11 13:22:06.000000000 +0000 d5 1 a5 1 @@@@ -17,7 +17,6 @@@@ d9 3 a11 1 -#include d15 9 @ 1.1 log @Tree is a recursive directory listing program that produces a depth indented listing of files, which is colorized ala dircolors if the LS_COLORS environment variable is set and output is to tty. Tree has various options for changing the information printed (size, permissions, etc.) As well as plain text output, it is capable of producing HTML output that includes links with an appropriate prefix. @ text @d1 1 a1 1 $NetBSD$ d3 2 a4 2 --- tree.c.orig 2007-10-17 15:28:44.000000000 +0900 +++ tree.c 2007-10-17 15:28:59.000000000 +0900 @