From 2c14ec962a46ae53d39149112ae6902ed771d497 Mon Sep 17 00:00:00 2001 From: Eric Blake Date: Fri, 1 Oct 2010 11:44:05 -0600 Subject: stat: optimize and translate default format strings Yes, this patch intentionally leaks the results of default_format(), since it is called only twice, and since the results are in scope until main() exits. Not worth the extra code to pacify valgrind. * src/stat.c (main): Hoist default format computation out of loop. (do_statfs, do_stat): Move default format generation... (default_format): ...into new function. Allocate the result in pieces, rather than repeating mostly-similar chunks. Allow translation of verbose format. Pass a second format to do_stat, for the one aspect of the default format that is conditional on file type. * NEWS: Document the translation aspect. --- NEWS | 2 ++ 1 file changed, 2 insertions(+) (limited to 'NEWS') diff --git a/NEWS b/NEWS index 2ce03e312..dd8a18b51 100644 --- a/NEWS +++ b/NEWS @@ -71,6 +71,8 @@ GNU coreutils NEWS -*- outline -*- limited with the --parallel option or with external process control like taskset for example. + stat now provides translated output when no format is specified. + stat no longer accepts the --context (-Z) option. Initially it was merely accepted and ignored, for compatibility. Starting two years ago, with coreutils-7.0, its use evoked a warning. -- cgit v1.2.3-54-g00ecf