1 /* vi: set sw=4 ts=4: */
2 /* This file was released into the public domain by Paul Fox.
5 #include "bbconfigopts.h"
6 #if ENABLE_FEATURE_COMPRESS_BBCONFIG
8 # include "bbconfigopts_bz2.h"
11 int bbconfig_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
12 int bbconfig_main(int argc UNUSED_PARAM, char **argv UNUSED_PARAM)
14 #if ENABLE_FEATURE_COMPRESS_BBCONFIG
16 int i = start_bunzip(&bd,
18 /* inbuf: */ bbconfig_config_bz2,
19 /* len: */ sizeof(bbconfig_config_bz2));
20 /* read_bunzip can longjmp to start_bunzip, and ultimately
21 * end up here with i != 0 on read data errors! Not trivial */
23 /* Cannot use xmalloc: will leak bd in NOFORK case! */
24 char *outbuf = malloc_or_warn(sizeof(bbconfig_config));
26 read_bunzip(bd, outbuf, sizeof(bbconfig_config));
27 full_write1_str(outbuf);
31 full_write1_str(bbconfig_config);