? autom4te.cache
? config.guess
? gnulib
? po/refresh-translations.sh
Index: doc/find.texi
===================================================================
RCS file: /cvsroot/findutils/findutils/doc/find.texi,v
retrieving revision 1.37
diff -u -r1.37 find.texi
--- doc/find.texi	8 Nov 2004 21:34:27 -0000	1.37
+++ doc/find.texi	10 Nov 2004 22:32:15 -0000
@@ -1168,9 +1168,9 @@
 @subsection Format Directives
 
 @samp{-printf} and @samp{-fprintf} support the following format
-directives to print information about the file being processed.
-The C @code{printf} function, field width and precision specifiers
-are supported, as applied to string (%s) types. I.E. you can specify
+directives to print information about the file being processed.  The C
+@code{printf} function, field width and precision specifiers are
+supported, as applied to string (%s) types. That is, you can specify
 "minimum field width"."maximum field width" for each directive.
 
 @samp{%%} is a literal percent sign.  A @samp{%} character followed by
@@ -1185,6 +1185,7 @@
 * Size Directives::
 * Location Directives::
 * Time Directives::
+* Formatting Flags::
 @end menu
 
 @node Name Directives
@@ -1192,17 +1193,24 @@
 
 @table @code
 @item %p
-File's name.
+@c supports %-X.Yp
+File's name (not the absolute path name, but the name of the file as
+it was encountered by find - that is, as a relative path from one of
+the starting points).
 @item %f
 File's name with any leading directories removed (only the last element).
+@c supports %-X.Yf
 @item %h
 Leading directories of file's name (all but the last element and the
 slash before it).
+@c supports %-X.Yh
 @item %P
 File's name with the name of the command line argument under which
 it was found removed from the beginning.
+@c supports %-X.YP
 @item %H
 Command line argument under which file was found.
+@c supports %-X.YH
 @end table
 
 @node Ownership Directives
@@ -1210,15 +1218,23 @@
 
 @table @code
 @item %g
+@c supports %-X.Yg
 File's group name, or numeric group ID if the group has no name.
 @item %G
+@c supports %-X.Yg
+@c TODO: Needs to support # flag and 0 flag
 File's numeric group ID.
 @item %u
+@c supports %-X.Yu
 File's user name, or numeric user ID if the user has no name.
 @item %U
+@c supports %-X.Yu
+@c TODO: Needs to support # flag
 File's numeric user ID.
 @item %m
-File's permissions (in octal).
+@c full support, including # and 0.
+File's permissions (in octal).   If you always want to have a leading
+zero on the number, use the '#' format flag, for example '%#m'.
 @end table
 
 @node Size Directives
@@ -1228,7 +1244,7 @@
 @item %k
 Amount of disk space occupied by the file, measured in 1K blocks
 (rounded up).  This can be less than the length of the file if 
-it is a sparse file (that is, it has ``holes'').
+it is a sparse file (that is, it has ``holes'').  
 @item %b
 File's size in 512-byte blocks (rounded up).  This also can be less 
 than the length of the file, if the file is sparse.
@@ -1391,6 +1407,21 @@
 locale's date representation (mm/dd/yy)
 @end table
 
+@node Formatting Flags
+@subsubsection Formatting Flags
+
+The @samp{%m} and @samp{%d} directives support the @samp{#}, @samp{0}
+and @samp{+} flags, but the other directives do not, even if they
+print numbers.  Numeric directives that do not support these flags
+include 
+
+@samp{G},
+@samp{U},
+@samp{b},
+@samp{D},
+@samp{k} and
+@samp{n}.
+
 @node Run Commands
 @section Run Commands
 
Index: find/find.1
===================================================================
RCS file: /cvsroot/findutils/findutils/find/find.1,v
retrieving revision 1.25
diff -u -r1.25 find.1
--- find/find.1	8 Nov 2004 20:40:51 -0000	1.25
+++ find/find.1	10 Nov 2004 22:32:16 -0000
@@ -505,7 +505,10 @@
 numbers which most Unix implementations use, but if your particular 
 implementation uses an unusual ordering of octal permissions bits, you
 will see a difference between the actual value of the file's mode and
-the output of @samp{%m}.
+the output of %m.   Normally you will want to have a leading
+zero on this number, and to do this, you should use the 
+.B #
+flag (as in, for example, '%#m').
 .IP %n
 Number of hard links to file.
 .IP %p
@@ -532,6 +535,24 @@
 .PP
 A `%' character followed by any other character is discarded (but the
 other character is printed).
+
+The %m and %d directives support the 
+.B #
+, 
+.B 0 
+and 
+.B + 
+flags, but the other directives do not, even if they
+print numbers.  Numeric directives that do not support these flags
+include 
+.BR G , 
+.BR U , 
+.BR b , 
+.BR D , 
+.B  k 
+and 
+.BR n .
+
 .RE
 .IP \-prune
 If \-depth is not given, true; do not descend the current directory.
Index: find/parser.c
===================================================================
RCS file: /cvsroot/findutils/findutils/find/parser.c,v
retrieving revision 1.36
diff -u -r1.36 parser.c
--- find/parser.c	8 Nov 2004 20:40:51 -0000	1.36
+++ find/parser.c	10 Nov 2004 22:32:16 -0000
@@ -1707,21 +1707,15 @@
 
     case 'a':			/* atime in `ctime' format */
     case 'A':			/* atime in user-specified strftime format */
-    case 'b':			/* size in 512-byte blocks */
     case 'c':			/* ctime in `ctime' format */
     case 'C':			/* ctime in user-specified strftime format */
-    case 'D':                   /* Filesystem device on which the file exits */
     case 'F':			/* filesystem type */
-    case 'G':			/* GID number */
     case 'g':			/* group name */
     case 'i':			/* inode number */
-    case 'k':			/* size in 1K blocks */
     case 'l':			/* object of symlink */
-    case 'n':			/* number of links */
     case 's':			/* size in bytes */
     case 't':			/* mtime in `ctime' format */
     case 'T':			/* mtime in user-specified strftime format */
-    case 'U':			/* UID number */
     case 'u':			/* user name */
     case 'y':			/* file type */
     case 'Y':			/* symlink pointed file type */
@@ -1735,6 +1729,20 @@
       *fmt++ = 's';
       break;
 
+      /* Numeric items that one might expect to honour 
+       * #, 0, + flags but which do not.
+       */
+    case 'G':			/* GID number */
+    case 'U':			/* UID number */
+    case 'b':			/* size in 512-byte blocks */
+    case 'D':                   /* Filesystem device on which the file exits */
+    case 'k':			/* size in 1K blocks */
+    case 'n':			/* number of links */
+      fprintf_stat_needed = true;
+      *fmt++ = 's';
+      
+      /* Numeric items that DO honour #, 0, + flags.
+       */
     case 'd':			/* depth in search tree (0 = ARGV element) */
       *fmt++ = 'd';
       break;
Index: find/pred.c
===================================================================
RCS file: /cvsroot/findutils/findutils/find/pred.c,v
retrieving revision 1.25
diff -u -r1.25 pred.c
--- find/pred.c	30 Oct 2004 20:23:18 -0000	1.25
+++ find/pred.c	10 Nov 2004 22:32:16 -0000
@@ -701,6 +701,7 @@
 			 | (m & S_IXOTH ? 00001 : 0))));
 	  }
 	  break;
+	  
 	case 'n':		/* number of links */
 	  fprintf (fp, segment->text,
 		   human_readable ((uintmax_t) stat_buf->st_nlink,
@@ -747,6 +748,7 @@
 	      }
 	    /* else fallthru */
 	  }
+	  
 	case 'U':		/* UID number */
 	  fprintf (fp, segment->text,
 		   human_readable ((uintmax_t) stat_buf->st_uid, hbuf,
