udhcpc: fix a problem with binary-encoded options #2
[oweals/busybox.git] / libbb / bb_strtod.c
index 0515ff8678e6480368727f0703a10bdb017502c2..5dde784141a17fb52b640a1f0be9267a0fb0d195 100644 (file)
@@ -4,7 +4,7 @@
  *
  * Copyright (C) 1999-2004 by Erik Andersen <andersen@codepoet.org>
  *
- * Licensed under GPLv2 or later, see file LICENSE in this tarball for details.
+ * Licensed under GPLv2 or later, see file LICENSE in this source tree.
  */
 
 #include "libbb.h"
 
 #define NOT_DIGIT(a) (((unsigned char)(a-'0')) > 9)
 
+#if 0 // UNUSED
 double FAST_FUNC bb_strtod(const char *arg, char **endp)
 {
        double v;
        char *endptr;
 
-       if (arg[0] != '-' && NOT_DIGIT(arg[0]))
+       /* Allow .NN form. People want to use "sleep .15" etc */
+       if (arg[0] != '-' && arg[0] != '.' && NOT_DIGIT(arg[0]))
                goto err;
        errno = 0;
        v = strtod(arg, &endptr);
@@ -35,6 +37,7 @@ double FAST_FUNC bb_strtod(const char *arg, char **endp)
        }
        return v;
 }
+#endif
 
 #if 0
 /* String to timespec: "NNNN[.NNNNN]" -> struct timespec.