# HG changeset patch # User Pascal Bellard # Date 1212652851 0 # Node ID ae743024f98b93534f12f9b372102ec80c52fce2 # Parent 4b14537dc5b5d2d962370e531af914b14191254f Up: busybox (1.10.3) diff -r 4b14537dc5b5 -r ae743024f98b busybox/receipt --- a/busybox/receipt Wed Jun 04 17:21:29 2008 +0000 +++ b/busybox/receipt Thu Jun 05 08:00:51 2008 +0000 @@ -1,7 +1,7 @@ # SliTaz package receipt. PACKAGE="busybox" -VERSION="1.10.1" +VERSION="1.10.3" CATEGORY="base-system" SHORT_DESC="Busybox combines tiny versions of many common UNIX utilities." MAINTAINER="pascal.bellard@slitaz.org" @@ -14,7 +14,7 @@ # Rules to configure and make the package. compile_rules() { - cd $PACKAGE-$VERSION + cd $src while read file; do patch -p1 < ../stuff/$file || return 1 done < +- + #include "libbb.h" + +-static unsigned int copy_lines(FILE *src_stream, FILE *dest_stream, const unsigned int lines_count) ++static unsigned copy_lines(FILE *src_stream, FILE *dest_stream, unsigned lines_count) + { +- unsigned int i = 0; +- +- while (src_stream && (i < lines_count)) { ++ while (src_stream && lines_count) { + char *line; + line = xmalloc_fgets(src_stream); + if (line == NULL) { +@@ -37,60 +33,70 @@ + bb_perror_msg_and_die("error writing to new file"); + } + free(line); +- +- i++; ++ lines_count--; + } +- return i; ++ return lines_count; + } + + /* If patch_level is -1 it will remove all directory names + * char *line must be greater than 4 chars + * returns NULL if the file doesnt exist or error + * returns malloc'ed filename ++ * NB: frees 1st argument! + */ + +-static char *extract_filename(char *line, int patch_level) ++static char *extract_filename(char *line, unsigned patch_level, const char *pat) + { +- char *temp, *filename_start_ptr = line + 4; +- int i; ++ char *temp = NULL, *filename_start_ptr = line + 4; + +- /* Terminate string at end of source filename */ +- temp = strchrnul(filename_start_ptr, '\t'); +- *temp = '\0'; +- +- /* Skip over (patch_level) number of leading directories */ +- if (patch_level == -1) +- patch_level = INT_MAX; +- for (i = 0; i < patch_level; i++) { +- temp = strchr(filename_start_ptr, '/'); +- if (!temp) +- break; +- filename_start_ptr = temp + 1; ++ if (strncmp(line, pat, 4) == 0) { ++ /* Terminate string at end of source filename */ ++ line[strcspn(line,"\t\n\r")] = '\0'; ++ ++ /* Skip over (patch_level) number of leading directories */ ++ while (patch_level--) { ++ temp = strchr(filename_start_ptr, '/'); ++ if (!temp) ++ break; ++ filename_start_ptr = temp + 1; ++ } ++ temp = xstrdup(filename_start_ptr); + } +- +- return xstrdup(filename_start_ptr); ++ free(line); ++ return temp; + } + + int patch_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; + int patch_main(int argc ATTRIBUTE_UNUSED, char **argv) + { +- int patch_level = -1; +- char *patch_line; +- int ret; +- FILE *patch_file = NULL; + struct stat saved_stat; +- ++ char *patch_line; ++ FILE *patch_file; ++ int patch_level; ++ int ret = 0; ++#define ENABLE_FEATURE_PATCH_REVERSE 1 ++#if ENABLE_FEATURE_PATCH_REVERSE ++ char minus = '-'; ++ char plus = '+'; ++#else ++ const char minus = '-'; ++ const char plus = '+'; ++#endif ++ ++ xfunc_error_retval = 2; + { +- char *p, *i; +- ret = getopt32(argv, "p:i:", &p, &i); +- if (ret & 1) +- patch_level = xatol_range(p, -1, USHRT_MAX); +- if (ret & 2) { +- patch_file = xfopen(i, "r"); +- } else { +- patch_file = stdin; +- } +- ret = 0; ++ const char *p = "-1"; ++ const char *i = "-"; /* compat */ ++#if ENABLE_FEATURE_PATCH_REVERSE ++ if (getopt32(argv, "p:i:R", &p, &i) & 4) { ++ minus = '+'; ++ plus = '-'; ++ } ++#else ++ getopt32(argv, "p:i:", &p, &i); ++#endif ++ patch_level = xatoi(p); /* can be negative! */ ++ patch_file = xfopen_stdin(i); + } + + patch_line = xmalloc_getline(patch_file); +@@ -100,38 +106,38 @@ + char *original_filename; + char *new_filename; + char *backup_filename; +- unsigned int src_cur_line = 1; +- unsigned int dest_cur_line = 0; +- unsigned int dest_beg_line; +- unsigned int bad_hunk_count = 0; +- unsigned int hunk_count = 0; +- char copy_trailing_lines_flag = 0; ++ unsigned src_cur_line = 1; ++ unsigned dest_cur_line = 0; ++ unsigned dest_beg_line; ++ unsigned bad_hunk_count = 0; ++ unsigned hunk_count = 0; ++ smallint copy_trailing_lines_flag = 0; + + /* Skip everything upto the "---" marker + * No need to parse the lines "Only in ", and "diff " + */ +- while (patch_line && strncmp(patch_line, "--- ", 4) != 0) { +- free(patch_line); ++ do { ++ /* Extract the filename used before the patch was generated */ ++ original_filename = extract_filename(patch_line, patch_level, "--- "); + patch_line = xmalloc_getline(patch_file); +- } +- /* FIXME: patch_line NULL check?? */ ++ if (!patch_line) goto quit; ++ } while (!original_filename); + +- /* Extract the filename used before the patch was generated */ +- original_filename = extract_filename(patch_line, patch_level); +- free(patch_line); +- +- patch_line = xmalloc_getline(patch_file); +- /* FIXME: NULL check?? */ +- if (strncmp(patch_line, "+++ ", 4) != 0) { +- ret = 2; +- bb_error_msg("invalid patch"); +- continue; ++ new_filename = extract_filename(patch_line, patch_level, "+++ "); ++ if (!new_filename) { ++ bb_error_msg_and_die("invalid patch"); ++ } ++#if ENABLE_FEATURE_PATCH_REVERSE ++ if (plus != '+') { ++ /* reverse patch */ ++ char *tmp = original_filename; ++ original_filename = new_filename; ++ new_filename = tmp; + } +- new_filename = extract_filename(patch_line, patch_level); +- free(patch_line); ++#endif + + /* Get access rights from the file to be patched, -1 file does not exist */ +- if (stat(new_filename, &saved_stat)) { ++ if (stat(new_filename, &saved_stat) != 0) { + char *line_ptr; + /* Create leading directories */ + line_ptr = strrchr(new_filename, '/'); +@@ -140,132 +146,137 @@ + bb_make_directory(new_filename, -1, FILEUTILS_RECUR); + *line_ptr = '/'; + } +- dst_stream = xfopen(new_filename, "w+"); + backup_filename = NULL; ++ saved_stat.st_mode = 0644; + } else { +- backup_filename = xmalloc(strlen(new_filename) + 6); +- strcpy(backup_filename, new_filename); +- strcat(backup_filename, ".orig"); ++ backup_filename = xasprintf("%s.orig", new_filename); + xrename(new_filename, backup_filename); +- dst_stream = xfopen(new_filename, "w"); +- fchmod(fileno(dst_stream), saved_stat.st_mode); + } +- +- if ((backup_filename == NULL) || stat(original_filename, &saved_stat)) { +- src_stream = NULL; +- } else { +- if (strcmp(original_filename, new_filename) == 0) { +- src_stream = xfopen(backup_filename, "r"); +- } else { +- src_stream = xfopen(original_filename, "r"); +- } ++ dst_stream = xfopen(new_filename, "w"); ++ fchmod(fileno(dst_stream), saved_stat.st_mode); ++ src_stream = NULL; ++ ++ if (backup_filename && !stat(original_filename, &saved_stat)) { ++ src_stream = xfopen((strcmp(original_filename, new_filename)) ? ++ original_filename : backup_filename, "r"); + } + + printf("patching file %s\n", new_filename); + +- /* Handle each hunk */ ++ /* Handle all hunks for this file */ + patch_line = xmalloc_fgets(patch_file); + while (patch_line) { +- unsigned int count; +- unsigned int src_beg_line; +- unsigned int unused; +- unsigned int hunk_offset_start = 0; +- int hunk_error = 0; +- +- /* This bit should be improved */ +- if ((sscanf(patch_line, "@@ -%d,%d +%d,%d @@", &src_beg_line, &unused, &dest_beg_line, &unused) != 4) && +- (sscanf(patch_line, "@@ -%d,%d +%d @@", &src_beg_line, &unused, &dest_beg_line) != 3) && +- (sscanf(patch_line, "@@ -%d +%d,%d @@", &src_beg_line, &dest_beg_line, &unused) != 3)) { ++ unsigned count; ++ unsigned src_beg_line; ++ unsigned hunk_offset_start; ++ unsigned src_last_line = 1; ++#if ENABLE_FEATURE_PATCH_REVERSE ++ unsigned dst_last_line = 1; ++ ++ if ((sscanf(patch_line, "@@ -%d,%d +%d,%d", &src_beg_line, &src_last_line, &dest_beg_line, &dst_last_line) < 3) && ++ (sscanf(patch_line, "@@ -%d +%d,%d", &src_beg_line, &dest_beg_line, &dst_last_line) < 2)) { + /* No more hunks for this file */ + break; + } +- free(patch_line); ++ if (plus != '+') { ++ /* reverse patch */ ++ unsigned tmp = src_last_line; ++ src_last_line = dst_last_line; ++ dst_last_line = tmp; ++ tmp = src_beg_line; ++ src_beg_line = dest_beg_line; ++ dest_beg_line = tmp; ++ } ++#else ++ ++ if ((sscanf(patch_line, "@@ -%d,%d +%d", &src_beg_line, &src_last_line, &dest_beg_line) != 3) && ++ (sscanf(patch_line, "@@ -%d +%d", &src_beg_line, &dest_beg_line) != 2)) { ++ /* No more hunks for this file */ ++ break; ++ } ++#endif + hunk_count++; + + if (src_beg_line && dest_beg_line) { + /* Copy unmodified lines upto start of hunk */ +- /* src_beg_line will be 0 if its a new file */ ++ /* src_beg_line will be 0 if it's a new file */ + count = src_beg_line - src_cur_line; +- if (copy_lines(src_stream, dst_stream, count) != count) { ++ if (copy_lines(src_stream, dst_stream, count)) { + bb_error_msg_and_die("bad src file"); + } + src_cur_line += count; + dest_cur_line += count; + copy_trailing_lines_flag = 1; + } +- hunk_offset_start = src_cur_line; +- +- while ((patch_line = xmalloc_fgets(patch_file)) != NULL) { +- if ((*patch_line == '-') || (*patch_line == ' ')) { ++ src_last_line += hunk_offset_start = src_cur_line; ++#if ENABLE_FEATURE_PATCH_REVERSE ++ dst_last_line += dest_cur_line; ++#endif ++ while (1) { ++ free(patch_line); ++ patch_line = xmalloc_fgets(patch_file); ++ if (patch_line == NULL) break; ++ if ((*patch_line == minus) || (*patch_line == ' ')) { + char *src_line = NULL; ++ if (src_cur_line == src_last_line) break; + if (src_stream) { + src_line = xmalloc_fgets(src_stream); +- if (!src_line) { +- hunk_error++; +- break; +- } else { ++ if (src_line) { ++ int diff = strcmp(src_line, patch_line + 1); + src_cur_line++; ++ free(src_line); ++ if (diff) src_line = NULL; + } +- if (strcmp(src_line, patch_line + 1) != 0) { +- bb_error_msg("hunk #%d FAILED at %d", hunk_count, hunk_offset_start); +- hunk_error++; +- free(patch_line); +- /* Probably need to find next hunk, etc... */ +- /* but for now we just bail out */ +- patch_line = NULL; +- break; +- } +- free(src_line); + } +- if (*patch_line == ' ') { +- fputs(patch_line + 1, dst_stream); +- dest_cur_line++; ++ if (!src_line) { ++ bb_error_msg("hunk #%u FAILED at %u", hunk_count, hunk_offset_start); ++ bad_hunk_count++; ++ break; + } +- } else if (*patch_line == '+') { +- fputs(patch_line + 1, dst_stream); +- dest_cur_line++; +- } else { ++ if (*patch_line != ' ') { ++ continue; ++ } ++ } else if (*patch_line != plus) { + break; + } +- free(patch_line); +- } +- if (hunk_error) { +- bad_hunk_count++; +- } +- } ++#if ENABLE_FEATURE_PATCH_REVERSE ++ if (dest_cur_line == dst_last_line) break; ++#endif ++ fputs(patch_line + 1, dst_stream); ++ dest_cur_line++; ++ } /* end of while loop handling one hunk */ ++ } /* end of while loop handling one file */ + + /* Cleanup last patched file */ + if (copy_trailing_lines_flag) { +- copy_lines(src_stream, dst_stream, -1); ++ copy_lines(src_stream, dst_stream, (unsigned)(-1)); + } + if (src_stream) { + fclose(src_stream); + } +- if (dst_stream) { +- fclose(dst_stream); +- } ++ fclose(dst_stream); + if (bad_hunk_count) { +- if (!ret) { +- ret = 1; +- } +- bb_error_msg("%d out of %d hunk FAILED", bad_hunk_count, hunk_count); ++ ret = 1; ++ bb_error_msg("%u out of %u hunk FAILED", bad_hunk_count, hunk_count); + } else { + /* It worked, we can remove the backup */ + if (backup_filename) { + unlink(backup_filename); ++ free(backup_filename); + } + if ((dest_cur_line == 0) || (dest_beg_line == 0)) { + /* The new patched file is empty, remove it */ + xunlink(new_filename); +- if (strcmp(new_filename, original_filename) != 0) +- xunlink(original_filename); ++ /* original_filename and new_filename may be the same file */ ++ unlink(original_filename); + } + } +- } ++ } /* end of "while there are patch lines" */ ++quit: + + /* 0 = SUCCESS + * 1 = Some hunks failed +- * 2 = More serious problems ++ * 2 = More serious problems (exited earlier) + */ + return ret; + } + +--- busybox-1.10.3/include/usage.h 2008-03-24 16:20:43.000000000 +0100 ++++ busybox-1.10.3/include/usage.h 2008-03-24 16:22:06.000000000 +0100 +@@ -2837,8 +2837,9 @@ + ) + + #define patch_trivial_usage \ +- "[-p NUM] [-i DIFF]" ++ "[-R] [-p NUM] [-i DIFF]" + #define patch_full_usage \ ++ " -R Reverse patch\n" \ + " -p NUM Strip NUM leading components from file names" \ + "\n -i DIFF Read DIFF instead of stdin" \ + diff -r 4b14537dc5b5 -r ae743024f98b busybox/stuff/busybox-1.10.3-script.u --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/busybox/stuff/busybox-1.10.3-script.u Thu Jun 05 08:00:51 2008 +0000 @@ -0,0 +1,1 @@ +busybox-1.10.1-script.u \ No newline at end of file diff -r 4b14537dc5b5 -r ae743024f98b busybox/stuff/busybox-1.10.3-stat.u --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/busybox/stuff/busybox-1.10.3-stat.u Thu Jun 05 08:00:51 2008 +0000 @@ -0,0 +1,73 @@ +--- busybox-1.10.1/coreutils/stat.c ++++ busybox-1.10.1/coreutils/stat.c +@@ -14,12 +14,14 @@ + */ + + #include "libbb.h" ++#include + + /* vars to control behavior */ + #define OPT_FILESYS (1 << 0) + #define OPT_TERSE (1 << 1) + #define OPT_DEREFERENCE (1 << 2) +-#define OPT_SELINUX (1 << 3) ++#define OPT_MAP (1 << 3) ++#define OPT_SELINUX (1 << 4) + + #if ENABLE_FEATURE_STAT_FORMAT + typedef bool (*statfunc_ptr)(const char *, const char *); +@@ -345,6 +347,26 @@ + + /* Stat the file system and print what we find. */ + #if !ENABLE_FEATURE_STAT_FORMAT ++#define do_mapfile(filename, format) do_mapfile(filename) ++#endif ++static bool do_mapfile(const char *filename, const char *format) ++{ ++ int i = 0; ++ int fd = xopen(filename, O_RDONLY); ++ ++#if ENABLE_FEATURE_STAT_FORMAT ++ (void) format; ++#endif ++ while (1) { ++ int blk = i++; ++ if (ioctl(fd,FIBMAP,&blk) < 0 || blk == 0) break; ++ printf("%u\n",blk); ++ } ++ return 1; ++} ++ ++/* Stat the file system and print what we find. */ ++#if !ENABLE_FEATURE_STAT_FORMAT + #define do_statfs(filename, format) do_statfs(filename) + #endif + static bool do_statfs(const char *filename, const char *format) +@@ -632,13 +654,15 @@ + int ok = 1; + statfunc_ptr statfunc = do_stat; + +- getopt32(argv, "ftL" ++ getopt32(argv, "ftLm" + USE_SELINUX("Z") + USE_FEATURE_STAT_FORMAT("c:", &format) + ); + + if (option_mask32 & OPT_FILESYS) /* -f */ + statfunc = do_statfs; ++ if (option_mask32 & OPT_MAP) /* -m */ ++ statfunc = do_mapfile; + if (argc == optind) /* files */ + bb_show_usage(); + + +--- busybox-1.10.1/include/usage.h ++++ busybox-1.10.1/include/usage.h +@@ -3589,6 +3589,7 @@ + ) \ + "\n -f Display filesystem status" \ + "\n -L Dereference links" \ ++ "\n -m Display block list" \ + "\n -t Display info in terse form" \ + USE_SELINUX( \ + "\n -Z Print security context" \ diff -r 4b14537dc5b5 -r ae743024f98b busybox/stuff/busybox-1.10.3-tar.u --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/busybox/stuff/busybox-1.10.3-tar.u Thu Jun 05 08:00:51 2008 +0000 @@ -0,0 +1,1 @@ +busybox-1.10.1-tar.u \ No newline at end of file diff -r 4b14537dc5b5 -r ae743024f98b busybox/stuff/busybox-1.10.3-tftp.u --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/busybox/stuff/busybox-1.10.3-tftp.u Thu Jun 05 08:00:51 2008 +0000 @@ -0,0 +1,1 @@ +busybox-1.10.1-tftp.u \ No newline at end of file diff -r 4b14537dc5b5 -r ae743024f98b busybox/stuff/busybox-1.10.3-unlzma.u --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/busybox/stuff/busybox-1.10.3-unlzma.u Thu Jun 05 08:00:51 2008 +0000 @@ -0,0 +1,1 @@ +busybox-1.10.1-unlzma.u \ No newline at end of file diff -r 4b14537dc5b5 -r ae743024f98b busybox/stuff/busybox-1.10.3-vcsa2txt.u --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/busybox/stuff/busybox-1.10.3-vcsa2txt.u Thu Jun 05 08:00:51 2008 +0000 @@ -0,0 +1,134 @@ +--- busybox-1.10.3/include/applets.h Sat Mar 22 02:31:50 2008 ++++ busybox-1.10.3/include/applets.h Sat Mar 22 02:31:50 2008 +@@ -382,6 +382,7 @@ + USE_UUDECODE(APPLET(uudecode, _BB_DIR_USR_BIN, _BB_SUID_NEVER)) + USE_UUENCODE(APPLET(uuencode, _BB_DIR_USR_BIN, _BB_SUID_NEVER)) + USE_VCONFIG(APPLET(vconfig, _BB_DIR_SBIN, _BB_SUID_NEVER)) ++USE_VCSA2TXT(APPLET(vcsa2txt, _BB_DIR_USR_BIN, _BB_SUID_NEVER)) + USE_VI(APPLET(vi, _BB_DIR_BIN, _BB_SUID_NEVER)) + USE_VLOCK(APPLET(vlock, _BB_DIR_USR_BIN, _BB_SUID_ALWAYS)) + USE_WATCH(APPLET(watch, _BB_DIR_BIN, _BB_SUID_NEVER)) + +--- busybox-1.10.3/include/usage.h Sat Mar 22 02:31:50 2008 ++++ busybox-1.10.3/include/usage.h Sat Mar 22 02:31:50 2008 +@@ -4318,6 +4318,13 @@ + "\n set_ingress_map [vlan-name] [skb_priority] [vlan_qos]" \ + "\n set_name_type [name-type]" \ + ++#define vcsa2txt_trivial_usage \ ++ "stdin" ++#define vcsa2txt_full_usage \ ++ "Filter /dev/vcsa* to ansi escape sequences" ++#define vcsa2txt_example_usage \ ++ "# vcsa2txt < /dev/vcsa1\n" ++ + #define vi_trivial_usage \ + "[OPTION] [FILE]..." + #define vi_full_usage \ + +--- busybox-1.10.3/miscutils/Config.in Sat Mar 22 02:31:50 2008 ++++ busybox-1.10.3/miscutils/Config.in Sat Mar 22 02:31:50 2008 +@@ -461,6 +461,12 @@ + only height, or both, in any order. It also does not complain on error, + but returns default 80x24. Usage in shell scripts: width=`ttysize w`. + ++config VCSA2TXT ++ bool "vcsa2txt" ++ default n ++ help ++ Filter /dev/vcsa* output to ansi escape sequences. ++ + config WATCHDOG + bool "watchdog" + default n + +--- busybox-1.10.3/util-linux/Kbuild Sat Mar 22 02:31:53 2008 ++++ busybox-1.10.3/util-linux/Kbuild Sat Mar 22 02:31:53 2008 +@@ -33,3 +33,4 @@ + lib-$(CONFIG_SWAPONOFF) += swaponoff.o + lib-$(CONFIG_SWITCH_ROOT) += switch_root.o + lib-$(CONFIG_UMOUNT) += umount.o ++lib-$(CONFIG_VCSA2TXT) += vcsa2txt.o + +--- busybox-1.10.3/util-linux/vcsa2txt.c Sat Mar 22 19:40:15 2008 ++++ busybox-1.10.3/util-linux/vcsa2txt.c Sat Mar 22 19:40:15 2008 +@@ -0,0 +1,79 @@ ++/* vi: set sw=4 ts=4: */ ++/* ++ * /dev/vcsa* filter for busybox ++ * ++ * pascal.bellard@ads-lu.com ++ * ++ * Licensed under GPLv2 or later, see file License in this tarball for details. ++ */ ++ ++#include "libbb.h" ++ ++int vcsa2txt_main(int argc) MAIN_EXTERNALLY_VISIBLE; ++int vcsa2txt_main(int argc) ++{ ++ struct { ++ unsigned char l, c, x, y; // man 4 console_codes ++ } scrn; ++ unsigned char last = 0, ch[2]; // BLGCRMOW ++ static unsigned char end[5] = "\e[0m\n", color[8] = "04261537"; ++ int sp, lf, x; ++ ++ if (safe_read(0, &scrn, 4) < 0) return 1; ++ for (lf = 0; scrn.l; lf++, scrn.l--) { ++ for (sp = x = 0; ++x <= scrn.c;) { ++ if (safe_read(0, &ch[0], 2) < 0) return 1; ++ if (argc > 1) ch[1] = 0; ++ sp++; ++ if (last == ch[1] && ch[0] == ' ') continue; ++ for (lf++; --lf;) bb_putchar('\n'); ++ while (--sp) bb_putchar(' '); ++#define ENABLE_VCSA_PACKED 1 ++#if ENABLE_VCSA_PACKED ++ if (last ^= ch[1]) { ++ char esc[16],*s; ++ struct offsets { ++ char mask, type, shr; ++ } *p; ++ static struct offsets offset[3] = { ++ {8,0,1}, {0x70,'4',4}, {7,'3',0} ++ }; ++ static char init = 0x7F; ++ ++ s = esc+2; ++ *(short *)esc = ntohs(256*'\e'+'['); ++ p = offset; ++ do { ++ if ((init|last) & p->mask) { ++ int c = (ch[1] & p->mask) >> p->shr; ++ ++ if ((*s = p->type) != 0) s++; ++ else if (c == 0) { ++ c = 2; ++ *s++ = '2'; /* normal */ ++ } ++ *s++ = color[c]; ++ *s++ = ';'; ++ } ++ } while (p++->shr); ++ s[-1] = 'm'; ++ init = 0; ++ fwrite(esc,s-esc,1,stdout); ++ } ++ last = ch[1]; ++#else ++ if (last != ch[1]) { ++ static char esc[10] = "\e[0;47;37m"; ++ ++ esc[2] = ((last = ch[1]) & 8) ? '1' /* bold */ : '0' /* defaults */; ++ esc[sizeof(esc)-5] = color[(ch[1] >> 4) & 7]; ++ esc[sizeof(esc)-2] = color[ch[1] & 7]; ++ fwrite(esc,sizeof(esc),1,stdout); ++ } ++#endif ++ bb_putchar(ch[0]); ++ } ++ } ++ fwrite(end,sizeof(end),1,stdout); ++ return 0; ++} diff -r 4b14537dc5b5 -r ae743024f98b busybox/stuff/busybox-1.10.3.config --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/busybox/stuff/busybox-1.10.3.config Thu Jun 05 08:00:51 2008 +0000 @@ -0,0 +1,1 @@ +busybox-1.10.1.config \ No newline at end of file