Magellan Linux

Diff of /trunk/mkinitrd-magellan/busybox/coreutils/sleep.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 29  static const struct suffix_mult sfx[] = Line 29  static const struct suffix_mult sfx[] =
29   { "m", 60 },   { "m", 60 },
30   { "h", 60*60 },   { "h", 60*60 },
31   { "d", 24*60*60 },   { "d", 24*60*60 },
32   { }   { "", 0 }
33  };  };
34  #endif  #endif
35    
# Line 54  int sleep_main(int argc UNUSED_PARAM, ch Line 54  int sleep_main(int argc UNUSED_PARAM, ch
54   char *arg = *argv;   char *arg = *argv;
55   if (strchr(arg, '.')) {   if (strchr(arg, '.')) {
56   double d;   double d;
57     char *pp;
58   int len = strspn(arg, "0123456789.");   int len = strspn(arg, "0123456789.");
59   char sv = arg[len];   char sv = arg[len];
60   arg[len] = '\0';   arg[len] = '\0';
61   d = bb_strtod(arg, NULL);   errno = 0;
62   if (errno)   d = strtod(arg, &pp);
63     if (errno || *pp)
64   bb_show_usage();   bb_show_usage();
65   arg[len] = sv;   arg[len] = sv;
66   len--;   len--;

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