join some common strings, -400 bytes
authorDenys Vlasenko <vda.linux@googlemail.com>
Thu, 8 Oct 2015 09:24:44 +0000 (11:24 +0200)
committerDenys Vlasenko <vda.linux@googlemail.com>
Thu, 8 Oct 2015 09:24:44 +0000 (11:24 +0200)
function                                             old     new   delta
print_intel_cstates                                  499     511     +12
file_insert                                          355     364      +9
dpkg_main                                           2944    2940      -4
ifenslave_main                                       645     640      -5
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 2/2 up/down: 21/-9)              Total: 12 bytes
   text    data     bss     dec     hex filename
 937564     932   17676  956172   e970c busybox_old
 937164     932   17676  955772   e957c busybox_unstripped

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
archival/dpkg.c
archival/libarchive/data_extract_to_command.c
debianutils/run_parts.c
editors/vi.c
findutils/xargs.c
miscutils/i2c_tools.c
networking/httpd.c
networking/ifenslave.c
procps/powertop.c
runit/runsv.c
util-linux/mkfs_minix.c

index 151f0ca436b17b3b3532563c59507baa926b2b07..df7a0db64fd712fe3a317919bb464f0b2dac19f9 100644 (file)
@@ -1151,13 +1151,13 @@ static int check_deps(deb_file_t **deb_file, int deb_start /*, int dep_max_count
                                if (result && number_of_alternatives == 0) {
                                        if (root_of_alternatives)
                                                bb_error_msg_and_die(
-                                                       "package %s %sdepends on %s, "
-                                                       "which cannot be satisfied",
+                                                       "package %s %sdepends on %s, which %s",
                                                        name_hashtable[package_node->name],
                                                        package_edge->type == EDGE_PRE_DEPENDS ? "pre-" : "",
-                                                       name_hashtable[root_of_alternatives->name]);
+                                                       name_hashtable[root_of_alternatives->name],
+                                                       "cannot be satisfied");
                                        bb_error_msg_and_die(
-                                               "package %s %sdepends on %s, which %s\n",
+                                               "package %s %sdepends on %s, which %s",
                                                name_hashtable[package_node->name],
                                                package_edge->type == EDGE_PRE_DEPENDS ? "pre-" : "",
                                                name_hashtable[package_edge->name],
index 5b32c2ec88c90e458502778b9bfcb229b12cd6c3..6f5317a0eebbcd463b744afd0f9009f8c27bb307 100644 (file)
@@ -118,7 +118,7 @@ void FAST_FUNC data_extract_to_command(archive_handle_t *archive_handle)
                        bb_error_msg_and_die("'%s' returned status %d",
                                archive_handle->tar__to_command, WEXITSTATUS(status));
                if (WIFSIGNALED(status))
-                       bb_error_msg_and_die("'%s' terminated on signal %d",
+                       bb_error_msg_and_die("'%s' terminated by signal %d",
                                archive_handle->tar__to_command, WTERMSIG(status));
 
                if (!BB_MMU) {
index 527fae227c5121d8265531c7e2fcdd057eb0952e..dd6fe7d49bf0f891ed19e35bcc6e75897b41dc6d 100644 (file)
@@ -189,7 +189,7 @@ int run_parts_main(int argc UNUSED_PARAM, char **argv)
                if (ret < 0)
                        bb_perror_msg("can't execute '%s'", name);
                else /* ret > 0 */
-                       bb_error_msg("%s exited with code %d", name, ret & 0xff);
+                       bb_error_msg("%s: exit status %u", name, ret & 0xff);
 
                if (option_mask32 & OPT_e)
                        xfunc_die();
index 3db597ae16f73e1e362cd47c1d26ddf2fac220d8..f355712ab2568bb3cadb410528f7e7c8bad3e224 100644 (file)
@@ -2910,10 +2910,10 @@ static int file_insert(const char *fn, char *p, int initial)
        int fd, size;
        struct stat statbuf;
 
-       if (p < text || p > end) {
-               status_line_bold("Trying to insert file outside of memory");
-               return cnt;
-       }
+       if (p < text)
+               p = text;
+       if (p > end)
+               p = end;
 
        fd = open(fn, O_RDONLY);
        if (fd < 0) {
index 25e47ec8908e6e2e5b56e4b7b92e870385ef1a0c..5870b8a167631ca374c7d8adfa1f28c95e59c4ce 100644 (file)
@@ -122,7 +122,7 @@ static int xargs_exec(void)
                return 124;
        }
        if (status >= 0x180) {
-               bb_error_msg("%s: terminated by signal %d",
+               bb_error_msg("'%s' terminated by signal %d",
                        G.args[0], status - 0x180);
                return 125;
        }
index 292ff88ddb61a8e5614d9499b80609842c6b960a..d77e6bacf51876626f92bc60824f71d2db9ea3df 100644 (file)
@@ -358,7 +358,7 @@ static void check_read_funcs(int fd, int mode, int data_addr, int pec)
                break;
 #endif /* ENABLE_I2CDUMP */
        default:
-               bb_error_msg_and_die("Programmer goofed!");
+               bb_error_msg_and_die("internal error");
        }
        check_funcs_test_end(funcs, pec, err);
 }
@@ -1022,33 +1022,33 @@ static const struct i2c_func i2c_funcs_tab[] = {
        { .value = I2C_FUNC_I2C,
          .name = "I2C" },
        { .value = I2C_FUNC_SMBUS_QUICK,
-         .name = "SMBus Quick Command" },
+         .name = "SMBus quick command" },
        { .value = I2C_FUNC_SMBUS_WRITE_BYTE,
-         .name = "SMBus Send Byte" },
+         .name = "SMBus send byte" },
        { .value = I2C_FUNC_SMBUS_READ_BYTE,
-         .name = "SMBus Receive Byte" },
+         .name = "SMBus receive byte" },
        { .value = I2C_FUNC_SMBUS_WRITE_BYTE_DATA,
-         .name = "SMBus Write Byte" },
+         .name = "SMBus write byte" },
        { .value = I2C_FUNC_SMBUS_READ_BYTE_DATA,
-         .name = "SMBus Read Byte" },
+         .name = "SMBus read byte" },
        { .value = I2C_FUNC_SMBUS_WRITE_WORD_DATA,
-         .name = "SMBus Write Word" },
+         .name = "SMBus write word" },
        { .value = I2C_FUNC_SMBUS_READ_WORD_DATA,
-         .name = "SMBus Read Word" },
+         .name = "SMBus read word" },
        { .value = I2C_FUNC_SMBUS_PROC_CALL,
-         .name = "SMBus Process Call" },
+         .name = "SMBus process call" },
        { .value = I2C_FUNC_SMBUS_WRITE_BLOCK_DATA,
-         .name = "SMBus Block Write" },
+         .name = "SMBus block write" },
        { .value = I2C_FUNC_SMBUS_READ_BLOCK_DATA,
-         .name = "SMBus Block Read" },
+         .name = "SMBus block read" },
        { .value = I2C_FUNC_SMBUS_BLOCK_PROC_CALL,
-         .name = "SMBus Block Process Call" },
+         .name = "SMBus block process call" },
        { .value = I2C_FUNC_SMBUS_PEC,
          .name = "SMBus PEC" },
        { .value = I2C_FUNC_SMBUS_WRITE_I2C_BLOCK,
-         .name = "I2C Block Write" },
+         .name = "I2C block write" },
        { .value = I2C_FUNC_SMBUS_READ_I2C_BLOCK,
-         .name = "I2C Block Read" },
+         .name = "I2C block read" },
        { .value = 0, .name = NULL }
 };
 
@@ -1251,17 +1251,17 @@ int i2cdetect_main(int argc UNUSED_PARAM, char **argv)
                no_support("detection commands");
        } else
        if (mode == I2CDETECT_MODE_QUICK && !(funcs & I2C_FUNC_SMBUS_QUICK)) {
-               no_support("SMBus Quick Write command");
+               no_support("SMBus quick write");
        } else
        if (mode == I2CDETECT_MODE_READ && !(funcs & I2C_FUNC_SMBUS_READ_BYTE)) {
-               no_support("SMBus Receive Byte command");
+               no_support("SMBus receive byte");
        }
 
        if (mode == I2CDETECT_MODE_AUTO) {
                if (!(funcs & I2C_FUNC_SMBUS_QUICK))
-                       will_skip("SMBus Quick Write");
+                       will_skip("SMBus quick write");
                if (!(funcs & I2C_FUNC_SMBUS_READ_BYTE))
-                       will_skip("SMBus Receive Byte");
+                       will_skip("SMBus receive byte");
        }
 
        if (!(opts & opt_y))
index feaaa94d59466c654620fdd7d4fa362682a92530..00169c36d2fef25f628fcd3b628c1fcc2b8f5200 100644 (file)
@@ -1222,12 +1222,12 @@ static NOINLINE void cgi_io_loop_and_exit(int fromCgi_rd, int toCgi_wr, int post
                                out_cnt += count;
                                count = 0;
                                /* "Status" header format is: "Status: 302 Redirected\r\n" */
-                               if (out_cnt >= 8 && memcmp(rbuf, "Status: ", 8) == 0) {
+                               if (out_cnt >= 7 && memcmp(rbuf, "Status:", 7) == 0) {
                                        /* send "HTTP/1.0 " */
                                        if (full_write(STDOUT_FILENO, HTTP_200, 9) != 9)
                                                break;
-                                       rbuf += 8; /* skip "Status: " */
-                                       count = out_cnt - 8;
+                                       rbuf += 7; /* skip "Status:" */
+                                       count = out_cnt - 7;
                                        out_cnt = -1; /* buffering off */
                                } else if (out_cnt >= 4) {
                                        /* Did CGI add "HTTP"? */
index c3be8180b6f75716c324011bf1e7590b2cfbcaba..6b234adee586d0e9b80e00f80d95b11088c70af5 100644 (file)
@@ -577,8 +577,8 @@ int ifenslave_main(int argc UNUSED_PARAM, char **argv)
                                /* Can't work with this slave, */
                                /* remember the error and skip it */
                                bb_perror_msg(
-                                       "skipping %s: can't get flags",
-                                       slave_ifname);
+                                       "skipping %s: can't get %s",
+                                       slave_ifname, "flags");
                                res = rv;
                                continue;
                        }
@@ -595,8 +595,8 @@ int ifenslave_main(int argc UNUSED_PARAM, char **argv)
                                /* Can't work with this slave, */
                                /* remember the error and skip it */
                                bb_perror_msg(
-                                       "skipping %s: can't get settings",
-                                       slave_ifname);
+                                       "skipping %s: can't get %s",
+                                       slave_ifname, "settings");
                                res = rv;
                                continue;
                        }
index 18418100f62352ad4c1115fc414ff1a2a0011da2..ce85f4191e0f605dfd67e1f00f072956201a4b92 100644 (file)
@@ -591,7 +591,7 @@ static NOINLINE void print_intel_cstates(void)
        if (!edx || !(ecx & 1))
                return;
 
-       printf("Your CPU supports the following C-states: ");
+       printf("Your %s the following C-states: ", "CPU supports");
        i = 0;
        while (edx) {
                if (edx & 7)
@@ -602,7 +602,7 @@ static NOINLINE void print_intel_cstates(void)
        bb_putchar('\n');
 
        /* Print BIOS C-States */
-       printf("Your BIOS reports the following C-states: ");
+       printf("Your %s the following C-states: ", "BIOS reports");
        for (i = 0; i < ARRAY_SIZE(bios_table); i++)
                if (bios_table[i])
                        printf("C%u ", i);
index d941e897d0baf7917c3a8c084e16211f4590201f..94d286059431a7d393692cafa9b2803be8b6153c 100644 (file)
@@ -114,7 +114,7 @@ struct globals {
 
 static void fatal2_cannot(const char *m1, const char *m2)
 {
-       bb_perror_msg_and_die("%s: fatal: cannot %s%s", dir, m1, m2);
+       bb_perror_msg_and_die("%s: fatal: can't %s%s", dir, m1, m2);
        /* was exiting 111 */
 }
 static void fatal_cannot(const char *m)
@@ -124,7 +124,7 @@ static void fatal_cannot(const char *m)
 }
 static void fatal2x_cannot(const char *m1, const char *m2)
 {
-       bb_error_msg_and_die("%s: fatal: cannot %s%s", dir, m1, m2);
+       bb_error_msg_and_die("%s: fatal: can't %s%s", dir, m1, m2);
        /* was exiting 111 */
 }
 static void warn_cannot(const char *m)
index d65a5161cc73ca306490142661bd72b913207cd4..88d797584cca03aedda8b101734b573621209cd3 100644 (file)
@@ -576,11 +576,11 @@ static void setup_tables(void)
        for (i = MINIX_ROOT_INO; i <= SB_INODES; i++)
                unmark_inode(i);
        G.inode_buffer = xzalloc(INODE_BUFFER_SIZE);
-       printf("%ld inodes\n", (long)SB_INODES);
-       printf("%ld blocks\n", (long)SB_ZONES);
-       printf("Firstdatazone=%ld (%ld)\n", (long)SB_FIRSTZONE, (long)norm_firstzone);
-       printf("Zonesize=%d\n", BLOCK_SIZE << SB_ZONE_SIZE);
-       printf("Maxsize=%ld\n", (long)SB_MAXSIZE);
+       printf("%lu inodes\n", (unsigned long)SB_INODES);
+       printf("%lu blocks\n", (unsigned long)SB_ZONES);
+       printf("Firstdatazone=%lu (%lu)\n", (unsigned long)SB_FIRSTZONE, (unsigned long)norm_firstzone);
+       printf("Zonesize=%u\n", BLOCK_SIZE << SB_ZONE_SIZE);
+       printf("Maxsize=%lu\n", (unsigned long)SB_MAXSIZE);
 }
 
 int mkfs_minix_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;