Magellan Linux

Diff of /trunk/mkinitrd-magellan/busybox/libbb/dump.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 983 by niro, Fri Apr 24 18:33:46 2009 UTC revision 984 by niro, Sun May 30 11:32:42 2010 UTC
# Line 96  static NOINLINE int bb_dump_size(FS *fs) Line 96  static NOINLINE int bb_dump_size(FS *fs)
96   return cur_size;   return cur_size;
97  }  }
98    
99  static void rewrite(priv_dumper_t *dumper, FS *fs)  static NOINLINE void rewrite(priv_dumper_t *dumper, FS *fs)
100  {  {
101   enum { NOTOKAY, USEBCNT, USEPREC } sokay;   enum { NOTOKAY, USEBCNT, USEPREC } sokay;
102   PR *pr, **nextpr = NULL;   PR *pr, **nextpr = NULL;
# Line 492  static void conv_c(PR *pr, unsigned char Line 492  static void conv_c(PR *pr, unsigned char
492   str += 4;   str += 4;
493   } while (*str);   } while (*str);
494    
495   if (isprint(*p)) {   if (isprint_asciionly(*p)) {
496   *pr->cchar = 'c';   *pr->cchar = 'c';
497   printf(pr->fmt, *p);   printf(pr->fmt, *p);
498   } else {   } else {
499   sprintf(buf, "%03o", (int) *p);   sprintf(buf, "%03o", (int) *p);
500   str = buf;   str = buf;
501    strpr:   strpr:
502   *pr->cchar = 's';   *pr->cchar = 's';
503   printf(pr->fmt, str);   printf(pr->fmt, str);
504   }   }
# Line 519  static void conv_u(PR *pr, unsigned char Line 519  static void conv_u(PR *pr, unsigned char
519   } else if (*p == 0x7f) {   } else if (*p == 0x7f) {
520   *pr->cchar = 's';   *pr->cchar = 's';
521   printf(pr->fmt, "del");   printf(pr->fmt, "del");
522   } else if (isprint(*p)) {   } else if (*p < 0x7f) { /* isprint() */
523   *pr->cchar = 'c';   *pr->cchar = 'c';
524   printf(pr->fmt, *p);   printf(pr->fmt, *p);
525   } else {   } else {
# Line 579  static void display(priv_dumper_t* dumpe Line 579  static void display(priv_dumper_t* dumpe
579    
580   switch (pr->bcnt) {   switch (pr->bcnt) {
581   case 4:   case 4:
582   memmove(&fval, bp, sizeof(fval));   memcpy(&fval, bp, sizeof(fval));
583   printf(pr->fmt, fval);   printf(pr->fmt, fval);
584   break;   break;
585   case 8:   case 8:
586   memmove(&dval, bp, sizeof(dval));   memcpy(&dval, bp, sizeof(dval));
587   printf(pr->fmt, dval);   printf(pr->fmt, dval);
588   break;   break;
589   }   }
# Line 598  static void display(priv_dumper_t* dumpe Line 598  static void display(priv_dumper_t* dumpe
598   printf(pr->fmt, (int) *bp);   printf(pr->fmt, (int) *bp);
599   break;   break;
600   case 2:   case 2:
601   memmove(&sval, bp, sizeof(sval));   memcpy(&sval, bp, sizeof(sval));
602   printf(pr->fmt, (int) sval);   printf(pr->fmt, (int) sval);
603   break;   break;
604   case 4:   case 4:
605   memmove(&ival, bp, sizeof(ival));   memcpy(&ival, bp, sizeof(ival));
606   printf(pr->fmt, ival);   printf(pr->fmt, ival);
607   break;   break;
608   }   }
609   break;   break;
610   }   }
611   case F_P:   case F_P:
612   printf(pr->fmt, isprint(*bp) ? *bp : '.');   printf(pr->fmt, isprint_asciionly(*bp) ? *bp : '.');
613   break;   break;
614   case F_STR:   case F_STR:
615   printf(pr->fmt, (char *) bp);   printf(pr->fmt, (char *) bp);
# Line 629  static void display(priv_dumper_t* dumpe Line 629  static void display(priv_dumper_t* dumpe
629   printf(pr->fmt, (unsigned) *bp);   printf(pr->fmt, (unsigned) *bp);
630   break;   break;
631   case 2:   case 2:
632   memmove(&sval, bp, sizeof(sval));   memcpy(&sval, bp, sizeof(sval));
633   printf(pr->fmt, (unsigned) sval);   printf(pr->fmt, (unsigned) sval);
634   break;   break;
635   case 4:   case 4:
636   memmove(&ival, bp, sizeof(ival));   memcpy(&ival, bp, sizeof(ival));
637   printf(pr->fmt, ival);   printf(pr->fmt, ival);
638   break;   break;
639   }   }

Legend:
Removed from v.983  
changed lines
  Added in v.984