Magellan Linux

Diff of /trunk/mkinitrd-magellan/busybox/coreutils/od.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 20  Line 20 
20    
21  #include "dump.h"  #include "dump.h"
22    
 #define isdecdigit(c) isdigit(c)  
 #define ishexdigit(c) (isxdigit)(c)  
   
23  static void  static void
24  odoffset(dumper_t *dumper, int argc, char ***argvp)  odoffset(dumper_t *dumper, int argc, char ***argvp)
25  {  {
# Line 51  odoffset(dumper_t *dumper, int argc, cha Line 48  odoffset(dumper_t *dumper, int argc, cha
48    
49   if ((*p != '+')   if ((*p != '+')
50   && (argc < 2   && (argc < 2
51   || (!isdecdigit(p[0])   || (!isdigit(p[0])
52   && ((p[0] != 'x') || !ishexdigit(p[1])))))   && ((p[0] != 'x') || !isxdigit(p[1])))))
53   return;   return;
54    
55   base = 0;   base = 0;
# Line 62  odoffset(dumper_t *dumper, int argc, cha Line 59  odoffset(dumper_t *dumper, int argc, cha
59   */   */
60   if (p[0] == '+')   if (p[0] == '+')
61   ++p;   ++p;
62   if (p[0] == 'x' && ishexdigit(p[1])) {   if (p[0] == 'x' && isxdigit(p[1])) {
63   ++p;   ++p;
64   base = 16;   base = 16;
65   } else if (p[0] == '0' && p[1] == 'x') {   } else if (p[0] == '0' && p[1] == 'x') {
# Line 72  odoffset(dumper_t *dumper, int argc, cha Line 69  odoffset(dumper_t *dumper, int argc, cha
69    
70   /* skip over the number */   /* skip over the number */
71   if (base == 16)   if (base == 16)
72   for (num = p; ishexdigit(*p); ++p)   for (num = p; isxdigit(*p); ++p)
73   continue;   continue;
74   else   else
75   for (num = p; isdecdigit(*p); ++p)   for (num = p; isdigit(*p); ++p)
76   continue;   continue;
77    
78   /* check for no number */   /* check for no number */

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