Magellan Linux

Diff of /trunk/mkinitrd-magellan/busybox/coreutils/od_bloaty.c

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

revision 816 by niro, Fri Apr 24 18:33:46 2009 UTC revision 984 by niro, Sun May 30 11:32:42 2010 UTC
# Line 545  decode_one_format(const char *s_orig, co Line 545  decode_one_format(const char *s_orig, co
545    
546   c = *s++;   c = *s++;
547   p = strchr(CSIL, *s);   p = strchr(CSIL, *s);
548   if (!p) {   /* if *s == NUL, p != NULL! Testcase: "od -tx" */
549     if (!p || *p == '\0') {
550   size = sizeof(int);   size = sizeof(int);
551   if (isdigit(s[0])) {   if (isdigit(s[0])) {
552   size = bb_strtou(s, &end, 0);   size = bb_strtou(s, &end, 0);
# Line 807  skip(off_t n_skip) Line 808  skip(off_t n_skip)
808   }   }
809    
810   if (n_skip)   if (n_skip)
811   bb_error_msg_and_die("cannot skip past end of combined input");   bb_error_msg_and_die("can't skip past end of combined input");
812  }  }
813    
814    
# Line 832  format_address_std(off_t address, char c Line 833  format_address_std(off_t address, char c
833   printf(address_fmt, address);   printf(address_fmt, address);
834  }  }
835    
836  #if ENABLE_GETOPT_LONG  #if ENABLE_LONG_OPTS
837  /* only used with --traditional */  /* only used with --traditional */
838  static void  static void
839  format_address_paren(off_t address, char c)  format_address_paren(off_t address, char c)
# Line 953  get_lcm(void) Line 954  get_lcm(void)
954   return l_c_m;   return l_c_m;
955  }  }
956    
957  #if ENABLE_GETOPT_LONG  #if ENABLE_LONG_OPTS
958  /* If S is a valid traditional offset specification with an optional  /* If S is a valid traditional offset specification with an optional
959     leading '+' return nonzero and set *OFFSET to the offset it denotes.  */     leading '+' return nonzero and set *OFFSET to the offset it denotes.  */
960    
# Line 963  parse_old_offset(const char *s, off_t *o Line 964  parse_old_offset(const char *s, off_t *o
964   static const struct suffix_mult Bb[] = {   static const struct suffix_mult Bb[] = {
965   { "B", 1024 },   { "B", 1024 },
966   { "b", 512 },   { "b", 512 },
967   { }   { "", 0 }
968   };   };
969   char *p;   char *p;
970   int radix;   int radix;
# Line 1178  int od_main(int argc, char **argv) Line 1179  int od_main(int argc, char **argv)
1179   { "b", 512 },   { "b", 512 },
1180   { "k", 1024 },   { "k", 1024 },
1181   { "m", 1024*1024 },   { "m", 1024*1024 },
1182   { }   { "", 0 }
1183   };   };
1184   enum {   enum {
1185   OPT_A = 1 << 0,   OPT_A = 1 << 0,
# Line 1199  int od_main(int argc, char **argv) Line 1200  int od_main(int argc, char **argv)
1200   OPT_s = 1 << 15,   OPT_s = 1 << 15,
1201   OPT_S = 1 << 16,   OPT_S = 1 << 16,
1202   OPT_w = 1 << 17,   OPT_w = 1 << 17,
1203   OPT_traditional = (1 << 18) * ENABLE_GETOPT_LONG,   OPT_traditional = (1 << 18) * ENABLE_LONG_OPTS,
1204   };   };
1205  #if ENABLE_GETOPT_LONG  #if ENABLE_LONG_OPTS
1206   static const char od_longopts[] ALIGN1 =   static const char od_longopts[] ALIGN1 =
1207   "skip-bytes\0"        Required_argument "j"   "skip-bytes\0"        Required_argument "j"
1208   "address-radix\0"     Required_argument "A"   "address-radix\0"     Required_argument "A"
# Line 1235  int od_main(int argc, char **argv) Line 1236  int od_main(int argc, char **argv)
1236    
1237   /* Parse command line */   /* Parse command line */
1238   opt_complementary = "w+:t::"; /* -w N, -t is a list */   opt_complementary = "w+:t::"; /* -w N, -t is a list */
1239  #if ENABLE_GETOPT_LONG  #if ENABLE_LONG_OPTS
1240   applet_long_options = od_longopts;   applet_long_options = od_longopts;
1241  #endif  #endif
1242   opt = getopt32(argv, "A:N:abcdfhij:lot:vxsS:"   opt = getopt32(argv, "A:N:abcdfhij:lot:vxsS:"
# Line 1306  int od_main(int argc, char **argv) Line 1307  int od_main(int argc, char **argv)
1307   * FIXME: POSIX 1003.1-2001 with XSI requires support for the   * FIXME: POSIX 1003.1-2001 with XSI requires support for the
1308   * traditional syntax even if --traditional is not given.  */   * traditional syntax even if --traditional is not given.  */
1309    
1310  #if ENABLE_GETOPT_LONG  #if ENABLE_LONG_OPTS
1311   if (opt & OPT_traditional) {   if (opt & OPT_traditional) {
1312   off_t o1, o2;   off_t o1, o2;
1313    

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