X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;f=lib%2Fhuman.c;h=dbf536b1efdd630c151934c2ecd4ca2dda49428f;hb=0451b1d84d734d0cbdd64a506ded848a842a5dc6;hp=285e4fd55e8c41bbdf11bf871cb0d09adc5e08d6;hpb=346048a288f00c94a93f05e0de073695dedb4325;p=gnulib.git diff --git a/lib/human.c b/lib/human.c index 285e4fd55..dbf536b1e 100644 --- a/lib/human.c +++ b/lib/human.c @@ -1,7 +1,7 @@ /* human.c -- print human readable file size - Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 Free - Software Foundation, Inc. + Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004 + Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -36,25 +36,9 @@ # include #endif -#if HAVE_STDLIB_H -# include -#endif -#ifndef HAVE_DECL_GETENV -"this configure-time declaration test was not run" -#endif -#if !HAVE_DECL_GETENV -char *getenv (); -#endif - -#if HAVE_STRING_H -# include -#endif - -#if HAVE_STRINGS_H -# include -#endif - #include +#include +#include #include "gettext.h" #define _(msgid) gettext (msgid) @@ -444,7 +428,9 @@ humblock (char const *spec, uintmax_t *block_size, int *options) int i; int opts = 0; - if (! spec && ! (spec = getenv ("BLOCK_SIZE"))) + if (! spec + && ! (spec = getenv ("BLOCK_SIZE")) + && ! (spec = getenv ("BLOCKSIZE"))) *block_size = default_block_size (); else { @@ -466,8 +452,6 @@ humblock (char const *spec, uintmax_t *block_size, int *options) "eEgGkKmMpPtTyYzZ0"); if (e != LONGINT_OK) return e; - if (*ptr) - return LONGINT_INVALID_SUFFIX_CHAR; for (; ! ('0' <= *spec && *spec <= '9'); spec++) if (spec == ptr) {