head 1.7; access; symbols pkgsrc-2026Q1:1.7.0.86 pkgsrc-2026Q1-base:1.7 pkgsrc-2025Q4:1.7.0.84 pkgsrc-2025Q4-base:1.7 pkgsrc-2025Q3:1.7.0.82 pkgsrc-2025Q3-base:1.7 pkgsrc-2025Q2:1.7.0.80 pkgsrc-2025Q2-base:1.7 pkgsrc-2025Q1:1.7.0.78 pkgsrc-2025Q1-base:1.7 pkgsrc-2024Q4:1.7.0.76 pkgsrc-2024Q4-base:1.7 pkgsrc-2024Q3:1.7.0.74 pkgsrc-2024Q3-base:1.7 pkgsrc-2024Q2:1.7.0.72 pkgsrc-2024Q2-base:1.7 pkgsrc-2024Q1:1.7.0.70 pkgsrc-2024Q1-base:1.7 pkgsrc-2023Q4:1.7.0.68 pkgsrc-2023Q4-base:1.7 pkgsrc-2023Q3:1.7.0.66 pkgsrc-2023Q3-base:1.7 pkgsrc-2023Q2:1.7.0.64 pkgsrc-2023Q2-base:1.7 pkgsrc-2023Q1:1.7.0.62 pkgsrc-2023Q1-base:1.7 pkgsrc-2022Q4:1.7.0.60 pkgsrc-2022Q4-base:1.7 pkgsrc-2022Q3:1.7.0.58 pkgsrc-2022Q3-base:1.7 pkgsrc-2022Q2:1.7.0.56 pkgsrc-2022Q2-base:1.7 pkgsrc-2022Q1:1.7.0.54 pkgsrc-2022Q1-base:1.7 pkgsrc-2021Q4:1.7.0.52 pkgsrc-2021Q4-base:1.7 pkgsrc-2021Q3:1.7.0.50 pkgsrc-2021Q3-base:1.7 pkgsrc-2021Q2:1.7.0.48 pkgsrc-2021Q2-base:1.7 pkgsrc-2021Q1:1.7.0.46 pkgsrc-2021Q1-base:1.7 pkgsrc-2020Q4:1.7.0.44 pkgsrc-2020Q4-base:1.7 pkgsrc-2020Q3:1.7.0.42 pkgsrc-2020Q3-base:1.7 pkgsrc-2020Q2:1.7.0.38 pkgsrc-2020Q2-base:1.7 pkgsrc-2020Q1:1.7.0.18 pkgsrc-2020Q1-base:1.7 pkgsrc-2019Q4:1.7.0.40 pkgsrc-2019Q4-base:1.7 pkgsrc-2019Q3:1.7.0.36 pkgsrc-2019Q3-base:1.7 pkgsrc-2019Q2:1.7.0.34 pkgsrc-2019Q2-base:1.7 pkgsrc-2019Q1:1.7.0.32 pkgsrc-2019Q1-base:1.7 pkgsrc-2018Q4:1.7.0.30 pkgsrc-2018Q4-base:1.7 pkgsrc-2018Q3:1.7.0.28 pkgsrc-2018Q3-base:1.7 pkgsrc-2018Q2:1.7.0.26 pkgsrc-2018Q2-base:1.7 pkgsrc-2018Q1:1.7.0.24 pkgsrc-2018Q1-base:1.7 pkgsrc-2017Q4:1.7.0.22 pkgsrc-2017Q4-base:1.7 pkgsrc-2017Q3:1.7.0.20 pkgsrc-2017Q3-base:1.7 pkgsrc-2017Q2:1.7.0.16 pkgsrc-2017Q2-base:1.7 pkgsrc-2017Q1:1.7.0.14 pkgsrc-2017Q1-base:1.7 pkgsrc-2016Q4:1.7.0.12 pkgsrc-2016Q4-base:1.7 pkgsrc-2016Q3:1.7.0.10 pkgsrc-2016Q3-base:1.7 pkgsrc-2016Q2:1.7.0.8 pkgsrc-2016Q2-base:1.7 pkgsrc-2016Q1:1.7.0.6 pkgsrc-2016Q1-base:1.7 pkgsrc-2015Q4:1.7.0.4 pkgsrc-2015Q4-base:1.7 pkgsrc-2015Q3:1.7.0.2 pkgsrc-2015Q3-base:1.7 pkgsrc-2015Q2:1.6.0.16 pkgsrc-2015Q2-base:1.6 pkgsrc-2015Q1:1.6.0.14 pkgsrc-2015Q1-base:1.6 pkgsrc-2014Q4:1.6.0.12 pkgsrc-2014Q4-base:1.6 pkgsrc-2014Q3:1.6.0.10 pkgsrc-2014Q3-base:1.6 pkgsrc-2014Q2:1.6.0.8 pkgsrc-2014Q2-base:1.6 pkgsrc-2014Q1:1.6.0.6 pkgsrc-2014Q1-base:1.6 pkgsrc-2013Q4:1.6.0.4 pkgsrc-2013Q4-base:1.6 pkgsrc-2013Q3:1.6.0.2 pkgsrc-2013Q3-base:1.6 pkgsrc-2013Q2:1.5.0.12 pkgsrc-2013Q2-base:1.5 pkgsrc-2013Q1:1.5.0.10 pkgsrc-2013Q1-base:1.5 pkgsrc-2012Q4:1.5.0.8 pkgsrc-2012Q4-base:1.5 pkgsrc-2012Q3:1.5.0.6 pkgsrc-2012Q3-base:1.5 pkgsrc-2012Q2:1.5.0.4 pkgsrc-2012Q2-base:1.5 pkgsrc-2012Q1:1.5.0.2 pkgsrc-2012Q1-base:1.5 pkgsrc-2011Q4:1.4.0.10 pkgsrc-2011Q4-base:1.4 pkgsrc-2011Q3:1.4.0.8 pkgsrc-2011Q3-base:1.4 pkgsrc-2011Q2:1.4.0.6 pkgsrc-2011Q2-base:1.4 pkgsrc-2011Q1:1.4.0.4 pkgsrc-2011Q1-base:1.4 pkgsrc-2010Q4:1.4.0.2 pkgsrc-2010Q4-base:1.4 pkgsrc-2010Q3:1.3.0.68 pkgsrc-2010Q3-base:1.3 pkgsrc-2010Q2:1.3.0.66 pkgsrc-2010Q2-base:1.3 pkgsrc-2010Q1:1.3.0.64 pkgsrc-2010Q1-base:1.3 pkgsrc-2009Q4:1.3.0.62 pkgsrc-2009Q4-base:1.3 pkgsrc-2009Q3:1.3.0.60 pkgsrc-2009Q3-base:1.3 pkgsrc-2009Q2:1.3.0.58 pkgsrc-2009Q2-base:1.3 pkgsrc-2009Q1:1.3.0.56 pkgsrc-2009Q1-base:1.3 pkgsrc-2008Q4:1.3.0.54 pkgsrc-2008Q4-base:1.3 pkgsrc-2008Q3:1.3.0.52 pkgsrc-2008Q3-base:1.3 cube-native-xorg:1.3.0.50 cube-native-xorg-base:1.3 pkgsrc-2008Q2:1.3.0.48 pkgsrc-2008Q2-base:1.3 cwrapper:1.3.0.46 pkgsrc-2008Q1:1.3.0.44 pkgsrc-2008Q1-base:1.3 pkgsrc-2007Q4:1.3.0.42 pkgsrc-2007Q4-base:1.3 pkgsrc-2007Q3:1.3.0.40 pkgsrc-2007Q3-base:1.3 pkgsrc-2007Q2:1.3.0.38 pkgsrc-2007Q2-base:1.3 pkgsrc-2007Q1:1.3.0.36 pkgsrc-2007Q1-base:1.3 pkgsrc-2006Q4:1.3.0.34 pkgsrc-2006Q4-base:1.3 pkgsrc-2006Q3:1.3.0.32 pkgsrc-2006Q3-base:1.3 pkgsrc-2006Q2:1.3.0.30 pkgsrc-2006Q2-base:1.3 pkgsrc-2006Q1:1.3.0.28 pkgsrc-2006Q1-base:1.3 pkgsrc-2005Q4:1.3.0.26 pkgsrc-2005Q4-base:1.3 pkgsrc-2005Q3:1.3.0.24 pkgsrc-2005Q3-base:1.3 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.3 netbsd-1-5-RELEASE:1.3 netbsd-1-4-PATCH003:1.3 netbsd-1-4-PATCH002:1.3 comdex-fall-1999:1.3 netbsd-1-4-PATCH001:1.3 netbsd-1-4-RELEASE:1.3 netbsd-1-3-PATCH003:1.2; locks; strict; comment @# @; 1.7 date 2015.07.09.11.44.09; author jperkin; state Exp; branches; next 1.6; commitid 8PWUs1MPC6CvvBsy; 1.6 date 2013.09.10.14.24.20; author joerg; state Exp; branches; next 1.5; commitid xMPb0meEmU7MPT4x; 1.5 date 2012.03.01.16.25.16; author hans; state Exp; branches; next 1.4; 1.4 date 2011.01.02.14.46.39; author obache; state Exp; branches; next 1.3; 1.3 date 98.12.28.22.13.05; author marc; state Exp; branches; next 1.2; 1.2 date 98.08.07.11.10.12; author agc; state Exp; branches; next 1.1; 1.1 date 98.05.21.14.06.37; author frueauf; state Exp; branches; next ; desc @@ 1.7 log @Use nbcompat correctly, add patch comments. Fixes build on SunOS. @ text @$NetBSD: patch-ac,v 1.6 2013/09/10 14:24:20 joerg Exp $ Use nbcompat. --- ls.c.orig 1996-12-21 23:40:58.000000000 +0000 +++ ls.c @@@@ -53,18 +53,37 @@@@ static char const sccsid[] = "@@(#)ls.c 8 #include #include #include +#if defined(HAVE_NBCOMPAT_H) +#include +#include +#else #include +#endif #include #include #include #include #include +#ifdef HAVE_NBCOMPAT_H +#include +#include +#endif +#include +#include + +#ifdef __sun +#include +#endif #include "ls.h" #include "extern.h" static void display __P((FTSENT *, FTSENT *)); +#ifdef __DragonFly__ +static int mastercmp __P((const FTSENT * const *, const FTSENT * const *)); +#else static int mastercmp __P((const FTSENT **, const FTSENT **)); +#endif static void traverse __P((int, char **, int)); static void (*printfcn) __P((DISPLAY *)); @@@@ -76,7 +95,9 @@@@ int termwidth = 80; /* default terminal /* flags */ int f_accesstime; /* use time of last access */ int f_column; /* columnated format */ +#ifndef __sun int f_flags; /* show flags associated with a file */ +#endif int f_inode; /* print inode */ int f_kblocks; /* print size in kilobytes */ int f_listdir; /* list actual directory, not contents */ @@@@ -94,6 +115,7 @@@@ int f_statustime; /* use time of last m int f_dirname; /* if precede with directory name */ int f_timesort; /* sort by time vice name */ int f_type; /* add type character for non-regular files */ +int f_color; /* add type in color for non-regular files */ #ifndef BSD4_4_LITE int f_whiteout; /* show whiteout entries */ #endif @@@@ -135,9 +157,13 @@@@ main(argc, argv) fts_options = FTS_PHYSICAL; #ifdef BSD4_4_LITE - while ((ch = getopt(argc, argv, "1ACFLRTacdfgikloqrstu")) != EOF) { + while ((ch = getopt(argc, argv, "1ACFGLRTacdfgikloqrstu")) != EOF) { #else - while ((ch = getopt(argc, argv, "1ACFLRTWacdfgikloqrstu")) != EOF) { +#ifndef __sun + while ((ch = getopt(argc, argv, "1ACFGLRTWacdfgikloqrstu")) != EOF) { +#else + while ((ch = getopt(argc, argv, "1ACFGLRTWacdfgiklqrstu")) != EOF) { +#endif #endif switch (ch) { /* @@@@ -168,6 +194,10 @@@@ main(argc, argv) case 'F': f_type = 1; break; + case 'G': + if (isatty(STDOUT_FILENO)) + f_color = 1; + break; case 'L': fts_options &= ~FTS_PHYSICAL; fts_options |= FTS_LOGICAL; @@@@ -197,9 +227,11 @@@@ main(argc, argv) case 'k': f_kblocks = 1; break; +#ifndef __sun case 'o': f_flags = 1; break; +#endif case 'q': f_nonprint = 1; break; @@@@ -228,18 +260,21 @@@@ main(argc, argv) argc -= optind; argv += optind; + parsecolors(getenv("LSCOLORS")); + /* * If not -F, -i, -l, -s or -t options, don't require stat * information. */ - if (!f_inode && !f_longform && !f_size && !f_timesort && !f_type) + if (!f_inode && !f_longform && !f_size && !f_timesort && !f_type + && !f_color) fts_options |= FTS_NOSTAT; /* * If not -F, -d or -l options, follow any symbolic links listed on * the command line. */ - if (!f_longform && !f_listdir && !f_type) + if (!f_longform && !f_listdir && !f_type && !f_color) fts_options |= FTS_COMFOLLOW; #ifndef BSD4_4_LITE @@@@ -257,7 +292,11 @@@@ main(argc, argv) if (f_kblocks) blocksize = 2; else { +#ifdef __sun + blocksize = 512; +#else (void)getbsize(¬used, &blocksize); +#endif blocksize /= 512; } } @@@@ -384,7 +423,8 @@@@ display(p, list) u_long btotal, maxblock, maxinode, maxlen, maxnlink; int bcfile, flen, glen, ulen, maxflags, maxgroup, maxuser; int entries, needstats; - char *user, *group, *flags, buf[20]; /* 32 bits == 10 digits */ + const char *user, *group; + char *flags, buf[20]; /* 32 bits == 10 digits */ /* * If list is NULL there are two possibilities: that the parent @@@@ -452,12 +492,14 @@@@ display(p, list) group = group_from_gid(sp->st_gid, 0); if ((glen = strlen(group)) > maxgroup) maxgroup = glen; +#ifndef __sun if (f_flags) { flags = flags_to_string(sp->st_flags, "-"); if ((flen = strlen(flags)) > maxflags) maxflags = flen; } else +#endif flen = 0; if ((np = malloc(sizeof(NAMES) + @@@@ -473,10 +515,12 @@@@ display(p, list) S_ISBLK(sp->st_mode)) bcfile = 1; +#ifndef __sun if (f_flags) { np->flags = &np->data[ulen + glen + 2]; (void)strcpy(np->flags, flags); } +#endif cur->fts_pointer = np; } } @@@@ -500,7 +544,7 @@@@ display(p, list) d.s_inode = strlen(buf); (void)snprintf(buf, sizeof(buf), "%lu", maxnlink); d.s_nlink = strlen(buf); - (void)snprintf(buf, sizeof(buf), "%qu", maxsize); + (void)snprintf(buf, sizeof(buf), "%llu", (long long)maxsize); d.s_size = strlen(buf); d.s_user = maxuser; } @@@@ -521,7 +565,11 @@@@ display(p, list) */ static int mastercmp(a, b) +#ifdef __DragonFly__ + const FTSENT * const *a, * const *b; +#else const FTSENT **a, **b; +#endif { int a_info, b_info; @ 1.6 log @Don't use non-standard %qd. @ text @d1 3 a3 1 $NetBSD: patch-ac,v 1.5 2012/03/01 16:25:16 hans Exp $ d7 12 a18 1 @@@@ -59,12 +59,26 @@@@ static char const sccsid[] = "@@(#)ls.c 8 d45 1 a45 1 @@@@ -76,7 +90,9 @@@@ int termwidth = 80; /* default terminal d55 1 a55 1 @@@@ -94,6 +110,7 @@@@ int f_statustime; /* use time of last m d63 1 a63 1 @@@@ -135,9 +152,13 @@@@ main(argc, argv) d79 1 a79 1 @@@@ -168,6 +189,10 @@@@ main(argc, argv) d90 1 a90 1 @@@@ -197,9 +222,11 @@@@ main(argc, argv) d102 1 a102 1 @@@@ -228,18 +255,21 @@@@ main(argc, argv) d126 13 a138 1 @@@@ -384,7 +414,8 @@@@ display(p, list) d148 1 a148 1 @@@@ -452,12 +483,14 @@@@ display(p, list) d163 1 a163 1 @@@@ -473,10 +506,12 @@@@ display(p, list) d176 1 a176 1 @@@@ -500,7 +535,7 @@@@ display(p, list) d185 1 a185 1 @@@@ -521,7 +556,11 @@@@ display(p, list) @ 1.5 log @Fix build on SunOS. - uses fts functions - define u_quad_t and S_ISTXT - no st_flags in struct stat @ text @d1 1 a1 1 $NetBSD: patch-ac,v 1.4 2011/01/02 14:46:39 obache Exp $ d151 9 @ 1.4 log @Fixes build on DragonFly-2.8.2. @ text @d1 1 a1 1 $NetBSD: patch-ac,v 1.3 1998/12/28 22:13:05 marc Exp $ d5 1 a5 1 @@@@ -59,12 +59,18 @@@@ static char const sccsid[] = "@@(#)ls.c 8 d9 4 d15 4 d32 11 a42 1 @@@@ -94,6 +100,7 @@@@ int f_statustime; /* use time of last m d50 1 a50 1 @@@@ -135,9 +142,9 @@@@ main(argc, argv) d58 1 d60 3 d66 1 a66 1 @@@@ -168,6 +175,10 @@@@ main(argc, argv) d77 13 a89 1 @@@@ -228,18 +239,21 @@@@ main(argc, argv) d113 1 a113 1 @@@@ -384,7 +398,8 @@@@ display(p, list) d123 29 a151 1 @@@@ -521,7 +536,11 @@@@ display(p, list) @ 1.3 log @patch a compile error. @ text @d1 1 a1 1 $NetBSD: patch-ac,v 1.2 1998/08/07 11:10:12 agc Exp $ d3 3 a5 3 --- ls.c.orig Sat Dec 21 18:40:58 1996 +++ ls.c Mon Dec 28 17:10:04 1998 @@@@ -59,6 +59,8 @@@@ d14 11 a24 1 @@@@ -94,6 +96,7 @@@@ d32 1 a32 1 @@@@ -135,9 +138,9 @@@@ d44 1 a44 1 @@@@ -168,6 +171,10 @@@@ d55 1 a55 1 @@@@ -228,18 +235,21 @@@@ d79 1 a79 1 @@@@ -384,7 +394,8 @@@@ d89 12 @ 1.2 log @Add NetBSD RCS Ids. @ text @d1 1 a1 1 $NetBSD$ d3 2 a4 2 --- ls.c-orig Thu May 21 15:41:32 1998 +++ ls.c Thu May 21 15:42:09 1998 d69 10 @ 1.1 log @Handle MANZ case better and split the big patch file into one patch per file for better maintainance. @ text @d1 2 @