Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com Date: Wed, 23 Feb 2005 18:49:32 +0200 From: Leonardo Vainsencher Subject: findutils 20041227-1: problem with find -printf %n To: cygwin AT cygwin DOT com Message-id: <200502231849.32463.lev9@013.net.il> Organization: Home Office MIME-version: 1.0 Content-type: text/plain; charset=iso-8859-1 Content-transfer-encoding: 7bit Content-disposition: inline User-Agent: KMail/1.7.1 I would like to report that "find -printf %n" appends a spurious 'd' to the output produced. This happens also for %G, %U, %b, %D, %k format directives. Under Cygwin: ========= % cygcheck -v -s | grep ^find findutils 20041227-1 % for i in G U b D k n; do fmt="%12$i\t%f\n" echo \"$fmt\": find -maxdepth 1 -name Makefile -printf $fmt done "%12G\t%f\n": 513d Makefile "%12U\t%f\n": 1001d Makefile "%12b\t%f\n": 6d Makefile "%12D\t%f\n": 3371281718d Makefile "%12k\t%f\n": 3d Makefile "%12n\t%f\n": 1d Makefile Under Linux (%D removed): ================= % for i in G U b k n; do fmt="%12$i\t%f\n" echo \"$fmt\": find -maxdepth 1 -name Makefile -printf $fmt done "%12G\t%f\n": 1000 Makefile "%12U\t%f\n": 1000 Makefile "%12b\t%f\n": 40 Makefile "%12k\t%f\n": 20 Makefile "%12n\t%f\n": 1 Makefile Looking at find/parser.c source (from findutils-20041227-1-src.tar.bz2) it appears that a "break;" is missing at line 1777 in funcion "static struct segment ** make_segment (struct segment **segment, char *format, int len, int kind)" The result after adding the break statement: =========================== % for i in G U b D k n; do fmt="%12$i\t%f\n" echo \"$fmt\": /usr/src/findutils-20041227-1/find/find -maxdepth 1 -name Makefile -printf $fmt done "%12G\t%f\n": 513 Makefile "%12U\t%f\n": 1001 Makefile "%12b\t%f\n": 6 Makefile "%12D\t%f\n": 3371281718 Makefile "%12k\t%f\n": 3 Makefile "%12n\t%f\n": 1 Makefile -- Leonardo Vainsencher LEV9 AT 013 DOT net DOT il -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/