From dd74fc504cf5dd215de8bcf82500caf364cf300b Mon Sep 17 00:00:00 2001 From: Andrew Borodin Date: Wed, 7 Apr 2010 11:38:09 +0400 Subject: [PATCH] Minor optimization of show_version() function. Set "Virtual File System" text item to plural form. Applied i18n to "Data types" text item. Added output of size_t size. Signed-off-by: Andrew Borodin --- src/textconf.c | 23 +++++++++-------------- 1 file changed, 9 insertions(+), 14 deletions(-) diff --git a/src/textconf.c b/src/textconf.c index 2dd3c7ebc..b9344aa86 100644 --- a/src/textconf.c +++ b/src/textconf.c @@ -26,7 +26,6 @@ #include #include - #include #include "lib/global.h" @@ -115,33 +114,29 @@ static const char *const features[] = { void show_version (void) { - int i; + size_t i; printf (_("GNU Midnight Commander %s\n"), VERSION); #ifdef ENABLE_VFS - printf (_("Virtual File System:")); - for (i = 0; vfs_supported[i]; i++) { - if (i == 0) - printf (" "); - else - printf (", "); - - printf ("%s", _(vfs_supported[i])); - } + printf (_("Virtual File Systems:")); + for (i = 0; vfs_supported[i] != NULL; i++) + printf ("%s %s", i == 0 ? "" : ",", _(vfs_supported[i])); + printf ("\n"); #endif /* ENABLE_VFS */ - for (i = 0; features[i]; i++) + for (i = 0; features[i] != NULL; i++) printf ("%s", _(features[i])); - (void)printf("Data types:"); + (void)printf(_("Data types:")); #define TYPE_INFO(T) \ - (void)printf(" %s %d", #T, (int) (CHAR_BIT * sizeof(T))) + (void)printf(" %s: %d;", #T, (int) (CHAR_BIT * sizeof(T))) TYPE_INFO(char); TYPE_INFO(int); TYPE_INFO(long); TYPE_INFO(void *); + TYPE_INFO(size_t); TYPE_INFO(off_t); #undef TYPE_INFO (void)printf("\n"); -- 2.11.4.GIT