tree.patch 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. Index: man/tree.1
  2. --- man/tree.1.orig 2008-06-04 17:35:31 +0200
  3. +++ man/tree.1 2008-06-07 20:49:03 +0200
  4. @@ -25,8 +25,8 @@
  5. .br
  6. .SH DESCRIPTION
  7. \fITree\fP is a recursive directory listing program that produces a depth
  8. -indented listing of files, which is colorized ala \fIdircolors\fP if the \fBLS_COLORS\fP
  9. -environment variable is set and output is to tty. With no arguments,
  10. +indented listing of files. Color is supported ala \fIdircolors\fP if the \fBLS_COLORS\fP
  11. +environment variable is set, output is to a tty, and the \fB-C\fP flag is used. With no arguments,
  12. \fItree\fP lists the files in the current directory. When directory
  13. arguments are given, \fItree\fP lists all the files and/or directories found
  14. in the given directories each in turn. Upon completion of listing all
  15. @@ -149,11 +149,7 @@
  16. .PP
  17. .TP
  18. .B -N
  19. -Print non-printable characters as is instead of the default carrot notation.
  20. -.PP
  21. -.TP
  22. -.B -v
  23. -Sort the output by version.
  24. +Print non-printable characters as is instead of the default caret notation.
  25. .PP
  26. .TP
  27. .B -r
  28. Index: tree.c
  29. --- tree.c.orig 2008-06-04 21:45:46 +0200
  30. +++ tree.c 2008-06-07 20:49:20 +0200
  31. @@ -33,6 +33,12 @@
  32. #include <limits.h>
  33. #include <pwd.h>
  34. #include <grp.h>
  35. +
  36. +#if !defined(LINUX_BIGFILE) && defined(__linux__)
  37. +# define stat64 stat
  38. +# define lstat64 lstat
  39. +#endif
  40. +
  41. #ifdef __EMX__ /* for OS/2 systems */
  42. # define INCL_DOSFILEMGR
  43. # define INCL_DOSNLS
  44. @@ -143,7 +149,6 @@
  45. /* Function prototypes: */
  46. int color(u_short, char *, char, char), cmd(char *), patmatch(char *, char *);
  47. int alnumsort(struct _info **, struct _info **);
  48. -int versort(struct _info **a, struct _info **b);
  49. int reversealnumsort(struct _info **, struct _info **);
  50. int timesort(struct _info **, struct _info **);
  51. int dirsfirstsort(struct _info **, struct _info **);
  52. @@ -200,7 +205,8 @@
  53. q = p = dtotal = ftotal = 0;
  54. aflag = dflag = fflag = lflag = pflag = sflag = Fflag = uflag = gflag = FALSE;
  55. Dflag = qflag = Nflag = Hflag = Rflag = hflag = FALSE;
  56. - noindent = force_color = nocolor = xdev = noreport = nolinks = FALSE;
  57. + noindent = force_color = xdev = noreport = nolinks = FALSE;
  58. + nocolor = TRUE;
  59. inodeflag = devflag = FALSE;
  60. flimit = 0;
  61. dirs = xmalloc(sizeof(int) * (maxdirs=4096));
  62. @@ -296,9 +302,6 @@
  63. case 'r':
  64. cmpfunc = reversealnumsort;
  65. break;
  66. - case 'v':
  67. - cmpfunc = versort;
  68. - break;
  69. case 'H':
  70. Hflag = TRUE;
  71. if (argv[n] == NULL) {
  72. @@ -658,7 +661,7 @@
  73. #ifdef __USE_FILE_OFFSET64
  74. if (inodeflag) sprintf(path," %7lld",(*dir)->inode);
  75. #else
  76. - if (inodeflag) sprintf(path," %7ld",(*dir)->inode);
  77. + if (inodeflag) sprintf(path," %7ld", (long int)((*dir)->inode));
  78. #endif
  79. if (devflag) sprintf(path+strlen(path), " %3d", (int)(*dir)->dev);
  80. #ifdef __EMX__
  81. @@ -917,11 +920,6 @@
  82. return strcmp((*a)->name,(*b)->name);
  83. }
  84. -int versort(struct _info **a, struct _info **b)
  85. -{
  86. - return strverscmp((*a)->name,(*b)->name);
  87. -}
  88. -
  89. int reversealnumsort(struct _info **a, struct _info **b)
  90. {
  91. return strcmp((*b)->name,(*a)->name);