*
* 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);
}
return v;
}
+#endif
#if 0
/* String to timespec: "NNNN[.NNNNN]" -> struct timespec.