aboutsummaryrefslogtreecommitdiff
path: root/coreutils
diff options
context:
space:
mode:
authorDenis Vlasenko <vda.linux@googlemail.com>2007-06-12 07:24:11 +0000
committerDenis Vlasenko <vda.linux@googlemail.com>2007-06-12 07:24:11 +0000
commitaa198dd39cad6cb41fbf6c8b64301b581a9ba206 (patch)
tree52e694aa0738e3c4b0bc110fce1a76e6a2285bf6 /coreutils
parent745119605e2ecdffad1def6aaabfc8f6d270209e (diff)
downloadbusybox-aa198dd39cad6cb41fbf6c8b64301b581a9ba206.tar.gz
uudecode: nuke duplicate base64_table[]. saves 65 bytes
Diffstat (limited to 'coreutils')
-rw-r--r--coreutils/uudecode.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/coreutils/uudecode.c b/coreutils/uudecode.c
index 287386d9d..2dd8f9457 100644
--- a/coreutils/uudecode.c
+++ b/coreutils/uudecode.c
@@ -68,8 +68,6 @@ static void read_stduu(FILE *src_stream, FILE *dst_stream)
static void read_base64(FILE *src_stream, FILE *dst_stream)
{
- static const char base64_table[] =
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\n";
int term_count = 1;
while (1) {
@@ -80,17 +78,20 @@ static void read_base64(FILE *src_stream, FILE *dst_stream)
char *table_ptr;
int ch;
- /* Get next _valid_ character */
+ /* Get next _valid_ character.
+ * global vector bb_uuenc_tbl_base64[] contains this string:
+ * "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\n"
+ */
do {
ch = fgetc(src_stream);
if (ch == EOF) {
bb_error_msg_and_die("short file");
}
- table_ptr = strchr(base64_table, ch);
+ table_ptr = strchr(bb_uuenc_tbl_base64, ch);
} while (table_ptr == NULL);
- /* Convert encoded charcter to decimal */
- ch = table_ptr - base64_table;
+ /* Convert encoded character to decimal */
+ ch = table_ptr - bb_uuenc_tbl_base64;
if (*table_ptr == '=') {
if (term_count == 0) {