summaryrefslogtreecommitdiffhomepage
path: root/libbb
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2018-09-30 16:56:56 +0200
committerDenys Vlasenko <vda.linux@googlemail.com>2018-09-30 16:56:56 +0200
commit349d72c19ced4fae64e8fdd5792b37e78ac2f616 (patch)
treec7f228ac570984a552242e64fe815d212876c0dc /libbb
parent14454b3071c7a5c053fde8eed416ab3b2f8475fb (diff)
unzip: use printable_string() for printing filenames
function old new delta unzip_main 2726 2792 +66 printable_string2 - 57 +57 identify 4329 4336 +7 expmeta 659 663 +4 add_interface 99 103 +4 beep_main 286 289 +3 changepath 192 194 +2 builtin_type 115 117 +2 devmem_main 469 470 +1 input_tab 1076 1074 -2 create_J 1821 1819 -2 poplocalvars 314 311 -3 doCommands 2222 2214 -8 do_load 918 902 -16 printable_string 57 9 -48 ------------------------------------------------------------------------------ (add/remove: 1/0 grow/shrink: 8/6 up/down: 146/-79) Total: 67 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'libbb')
-rw-r--r--libbb/lineedit.c2
-rw-r--r--libbb/printable_string.c7
-rw-r--r--libbb/unicode.c2
3 files changed, 8 insertions, 3 deletions
diff --git a/libbb/lineedit.c b/libbb/lineedit.c
index d5e92e84c..b1e971f88 100644
--- a/libbb/lineedit.c
+++ b/libbb/lineedit.c
@@ -1086,7 +1086,7 @@ static void showfiles(void)
);
}
if (ENABLE_UNICODE_SUPPORT)
- puts(printable_string(NULL, matches[n]));
+ puts(printable_string(matches[n]));
else
puts(matches[n]);
}
diff --git a/libbb/printable_string.c b/libbb/printable_string.c
index 077d58d32..a814fd03c 100644
--- a/libbb/printable_string.c
+++ b/libbb/printable_string.c
@@ -9,7 +9,7 @@
#include "libbb.h"
#include "unicode.h"
-const char* FAST_FUNC printable_string(uni_stat_t *stats, const char *str)
+const char* FAST_FUNC printable_string2(uni_stat_t *stats, const char *str)
{
char *dst;
const char *s;
@@ -55,3 +55,8 @@ const char* FAST_FUNC printable_string(uni_stat_t *stats, const char *str)
#endif
return auto_string(dst);
}
+
+const char* FAST_FUNC printable_string(const char *str)
+{
+ return printable_string2(NULL, str);
+}
diff --git a/libbb/unicode.c b/libbb/unicode.c
index d378175a4..89d42179b 100644
--- a/libbb/unicode.c
+++ b/libbb/unicode.c
@@ -996,7 +996,7 @@ size_t FAST_FUNC unicode_strlen(const char *string)
size_t FAST_FUNC unicode_strwidth(const char *string)
{
uni_stat_t uni_stat;
- printable_string(&uni_stat, string);
+ printable_string2(&uni_stat, string);
return uni_stat.unicode_width;
}