[PATCH] stat: reformat quoted file names

Bernhard Reutner-Fischer rep.dot.nop at gmail.com
Sat Jun 12 16:12:19 UTC 2010


On Sat, Jun 12, 2010 at 05:45:15PM +0200, Seb wrote:
--- busybox-1.16.2/coreutils/stat.c.orig        2010-06-12
16:48:35.193321263 +0200
+++ busybox-1.16.2/coreutils/stat.c     2010-06-12 17:15:37.408261675
+0200
@@ -219,9 +219,9 @@
                        if (linkname == NULL)
                                return;
                        /*printf("\"%s\" -> \"%s\"", filename,
 * linkname); */
-                       printf(pformat, filename);
+                       printf("`%s'", filename);
                        printf(" -> ");
-                       printf(pformat, linkname);
+                       printf("`%s'", linkname);
                        free(linkname);
                } else {
                        printf(pformat, filename);

This is an excellent example why those fmt tricks that (used to) avoid
calls -- to printf in this example -- were a good idea. Just look at the
size(1) output if you coerce to _one_ printf() call.. Other than that it
sounds reasonable.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: busybox-1.16.2-stat.LZD6HP.patch
Type: application/octet-stream
Size: 2897 bytes
Desc: not available
URL: <http://lists.busybox.net/pipermail/busybox/attachments/20100612/6ca677b9/attachment.obj>


More information about the busybox mailing list