aboutsummaryrefslogtreecommitdiff
path: root/libbb
diff options
context:
space:
mode:
authorNguyễn Thái Ngọc Duy <pclouds@gmail.com>2010-09-14 12:47:25 +1000
committerNguyễn Thái Ngọc Duy <pclouds@gmail.com>2010-09-14 12:47:25 +1000
commit9df56f96fd9a213189ca94c1fccfc3c42bd9c16a (patch)
treedb1db005b59e2b78d5daf9527fa8fc604e07e8c4 /libbb
parent30c62e541a1484fedc3d689d62f96d246a28b147 (diff)
parent5f3303712ef483d270097cae4ba0a559b1056121 (diff)
downloadbusybox-w32-9df56f96fd9a213189ca94c1fccfc3c42bd9c16a.tar.gz
busybox-w32-9df56f96fd9a213189ca94c1fccfc3c42bd9c16a.tar.bz2
busybox-w32-9df56f96fd9a213189ca94c1fccfc3c42bd9c16a.zip
Merge branch 'origin/master' (early part)
Diffstat (limited to 'libbb')
-rw-r--r--libbb/Config.src (renamed from libbb/Config.in)12
-rw-r--r--libbb/Kbuild.src (renamed from libbb/Kbuild)0
-rw-r--r--libbb/appletlib.c43
3 files changed, 25 insertions, 30 deletions
diff --git a/libbb/Config.in b/libbb/Config.src
index 55367b21b..a0aeb3683 100644
--- a/libbb/Config.in
+++ b/libbb/Config.src
@@ -28,7 +28,7 @@ config MD5_SIZE_VS_SPEED
28 28
29config FEATURE_FAST_TOP 29config FEATURE_FAST_TOP
30 bool "Faster /proc scanning code (+100 bytes)" 30 bool "Faster /proc scanning code (+100 bytes)"
31 default n 31 default y
32 help 32 help
33 This option makes top (and ps) ~20% faster (or 20% less CPU hungry), 33 This option makes top (and ps) ~20% faster (or 20% less CPU hungry),
34 but code size is slightly bigger. 34 but code size is slightly bigger.
@@ -43,7 +43,7 @@ config FEATURE_ETC_NETWORKS
43 43
44config FEATURE_EDITING 44config FEATURE_EDITING
45 bool "Command line editing" 45 bool "Command line editing"
46 default n 46 default y
47 help 47 help
48 Enable line editing (mainly for shell command line). 48 Enable line editing (mainly for shell command line).
49 49
@@ -68,21 +68,21 @@ config FEATURE_EDITING_VI
68config FEATURE_EDITING_HISTORY 68config FEATURE_EDITING_HISTORY
69 int "History size" 69 int "History size"
70 range 0 99999 70 range 0 99999
71 default 15 71 default 255
72 depends on FEATURE_EDITING 72 depends on FEATURE_EDITING
73 help 73 help
74 Specify command history size. 74 Specify command history size.
75 75
76config FEATURE_EDITING_SAVEHISTORY 76config FEATURE_EDITING_SAVEHISTORY
77 bool "History saving" 77 bool "History saving"
78 default n 78 default y
79 depends on ASH && FEATURE_EDITING 79 depends on ASH && FEATURE_EDITING
80 help 80 help
81 Enable history saving in ash shell. 81 Enable history saving in ash shell.
82 82
83config FEATURE_TAB_COMPLETION 83config FEATURE_TAB_COMPLETION
84 bool "Tab completion" 84 bool "Tab completion"
85 default n 85 default y
86 depends on FEATURE_EDITING 86 depends on FEATURE_EDITING
87 help 87 help
88 Enable tab completion. 88 Enable tab completion.
@@ -150,7 +150,7 @@ config FEATURE_COPYBUF_KB
150 150
151config MONOTONIC_SYSCALL 151config MONOTONIC_SYSCALL
152 bool "Use clock_gettime(CLOCK_MONOTONIC) syscall" 152 bool "Use clock_gettime(CLOCK_MONOTONIC) syscall"
153 default y 153 default n
154 help 154 help
155 Use clock_gettime(CLOCK_MONOTONIC) syscall for measuring 155 Use clock_gettime(CLOCK_MONOTONIC) syscall for measuring
156 time intervals (time, ping, traceroute etc need this). 156 time intervals (time, ping, traceroute etc need this).
diff --git a/libbb/Kbuild b/libbb/Kbuild.src
index a8a1da1f9..a8a1da1f9 100644
--- a/libbb/Kbuild
+++ b/libbb/Kbuild.src
diff --git a/libbb/appletlib.c b/libbb/appletlib.c
index f6dc1f171..cb18a688e 100644
--- a/libbb/appletlib.c
+++ b/libbb/appletlib.c
@@ -43,35 +43,30 @@
43#include "applets.h" 43#include "applets.h"
44#undef PROTOTYPES 44#undef PROTOTYPES
45 45
46#if ENABLE_SHOW_USAGE && !ENABLE_FEATURE_COMPRESS_USAGE
47/* Define usage_messages[] */
48static const char usage_messages[] ALIGN1 = ""
49# define MAKE_USAGE
50# include "usage.h"
51# include "applets.h"
52;
53# undef MAKE_USAGE
54#else
55# define usage_messages 0
56#endif /* SHOW_USAGE */
57
58 46
59/* Include generated applet names, pointers to <applet>_main, etc */ 47/* Include generated applet names, pointers to <applet>_main, etc */
60#include "applet_tables.h" 48#include "applet_tables.h"
61/* ...and if applet_tables generator says we have only one applet... */ 49/* ...and if applet_tables generator says we have only one applet... */
62#ifdef SINGLE_APPLET_MAIN 50#ifdef SINGLE_APPLET_MAIN
63#undef ENABLE_FEATURE_INDIVIDUAL 51# undef ENABLE_FEATURE_INDIVIDUAL
64#define ENABLE_FEATURE_INDIVIDUAL 1 52# define ENABLE_FEATURE_INDIVIDUAL 1
65#undef IF_FEATURE_INDIVIDUAL 53# undef IF_FEATURE_INDIVIDUAL
66#define IF_FEATURE_INDIVIDUAL(...) __VA_ARGS__ 54# define IF_FEATURE_INDIVIDUAL(...) __VA_ARGS__
67#endif 55#endif
68 56
69 57
70#if ENABLE_FEATURE_COMPRESS_USAGE
71
72#include "usage_compressed.h" 58#include "usage_compressed.h"
73#include "unarchive.h"
74 59
60#if ENABLE_SHOW_USAGE && !ENABLE_FEATURE_COMPRESS_USAGE
61static const char usage_messages[] ALIGN1 = UNPACKED_USAGE;
62#else
63# define usage_messages 0
64#endif /* SHOW_USAGE */
65
66#if ENABLE_FEATURE_COMPRESS_USAGE
67
68static const char packed_usage[] = { PACKED_USAGE };
69# include "unarchive.h"
75static const char *unpack_usage_messages(void) 70static const char *unpack_usage_messages(void)
76{ 71{
77 char *outbuf = NULL; 72 char *outbuf = NULL;
@@ -86,19 +81,19 @@ static const char *unpack_usage_messages(void)
86 * end up here with i != 0 on read data errors! Not trivial */ 81 * end up here with i != 0 on read data errors! Not trivial */
87 if (!i) { 82 if (!i) {
88 /* Cannot use xmalloc: will leak bd in NOFORK case! */ 83 /* Cannot use xmalloc: will leak bd in NOFORK case! */
89 outbuf = malloc_or_warn(SIZEOF_usage_messages); 84 outbuf = malloc_or_warn(sizeof(UNPACKED_USAGE));
90 if (outbuf) 85 if (outbuf)
91 read_bunzip(bd, outbuf, SIZEOF_usage_messages); 86 read_bunzip(bd, outbuf, sizeof(UNPACKED_USAGE));
92 } 87 }
93 dealloc_bunzip(bd); 88 dealloc_bunzip(bd);
94 return outbuf; 89 return outbuf;
95} 90}
96#define dealloc_usage_messages(s) free(s) 91# define dealloc_usage_messages(s) free(s)
97 92
98#else 93#else
99 94
100#define unpack_usage_messages() usage_messages 95# define unpack_usage_messages() usage_messages
101#define dealloc_usage_messages(s) ((void)(s)) 96# define dealloc_usage_messages(s) ((void)(s))
102 97
103#endif /* FEATURE_COMPRESS_USAGE */ 98#endif /* FEATURE_COMPRESS_USAGE */
104 99