Commit Graph

27 Commits

Author SHA1 Message Date
dholland ac57bd7b30 Improve previous slightly; while we accept e.g. "meter2" to mean "meter^2",
don't allow "meter-2" to be interpreted as "meter^-2" as that's very
confusing.
2016-02-05 03:32:49 +00:00
dholland 0561f14b04 Improve the parser. Now we understand negative exponents; fixes PR 50768.
Also handle negative numbers better in general (don't randomly drop
the sign in a number of cases) and don't choke on exponents > 9.

This commit alters the meaning of a few previously valid but marginal
inputs (e.g. "3 foot-5 pound" is now treated as "3*-5 foot-pound"
rather than "3*5 foot-pound"; if you want the latter insert another
space) but corrects obviously wrong handling of many more.
2016-02-05 03:30:08 +00:00
joerg d9c7ee5b63 Annotate functions using format strings. 2014-01-07 02:07:08 +00:00
wiz 4bdac686eb Sort options in man page SYNOPSIS and sync usage with it.
Bump date.
2013-01-06 00:19:13 +00:00
apb e5b434bcf4 Really expand the name, not the definition, as the comment says. 2013-01-02 14:05:04 +00:00
apb 25dbb40a11 fix incomplete comment 2013-01-01 12:45:06 +00:00
apb c6933fca67 Add -l and -L options to units(1). "-l" simply lists all unit
definitions, while "-L" alsoreduces them to depend only on a few
primitive units (such as m, kg, sec).
2013-01-01 11:51:55 +00:00
apb 55f985ffa7 Correctly ignore duplicate definitions. "continue" applies only to the
innermost loop.
2013-01-01 11:44:00 +00:00
apb fd02783e45 Allow a number and a unit to be juxtaposed without an intervening space.
Now "litres/100km" works as desired, instead of silently being
treated as "litres/100".
2012-12-28 17:07:03 +00:00
matt d34c2845b8 Use C89 function definitions 2012-03-20 20:34:57 +00:00
joerg 1ed141bb41 ANSIfy, static + __dead 2011-09-06 18:35:41 +00:00
lukem 95f5c18e58 Appease -Wcast-qual with a liberal sprinkling of const. 2009-04-14 05:55:12 +00:00
christos 4f0fad7e36 Coverity CID 814: Add extraneous checks to shut up Coverity. 2006-05-01 00:00:12 +00:00
dsl df38245cee Add (unsigned char) cast to ctype functions 2004-11-04 07:38:43 +00:00
mycroft 8ee74ae180 Recognize reciprocal conversions and generate output like GNU units(1). 2003-12-05 22:26:43 +00:00
itojun 4005e1b9e9 use strl* 2003-05-17 21:05:10 +00:00
kristerw 29301c43b8 Remove bogus output of '\n' when using -q. 2002-08-31 07:26:17 +00:00
atatat d68a625e3d Fix a spelling error in the usage, and while I'm here, make it a
little more intelligent about the arguments.  A count of the
"from-unit" can now be passed more easily on the command line.
2002-04-02 18:08:28 +00:00
simonb d88dfea295 Don't declare 'extern opt*' getopt variables. 2000-04-14 06:11:07 +00:00
perry db49a9331a change includes to fix compiler warning 1998-02-03 04:08:01 +00:00
lukem 2c87553437 WARNSify, fix .Nm usage, deprecate register, use <err.h> 1997-10-20 02:36:41 +00:00
thorpej 69aab31531 RCS Id police. 1996-04-06 06:00:58 +00:00
mark d786999078 Use an integer instead of a char to store the getopt() return value in
order to match the function prototype and to work with compilers that
default to unsigned chars.
Compare the getopt() return value with -1 instead of EOF.
1996-04-01 21:43:53 +00:00
jtc cac62b2d65 Be pedantic, main() returns int in C. 1996-03-21 17:56:15 +00:00
jtc d9a436e9ca misc cleanup by jimj. 1994-12-21 07:22:00 +00:00
jtc 42f840d29d Fix spelling error in Copyright notice 1994-01-29 01:43:03 +00:00
cgd 1701238139 add units command, written by Adrian Mariano (adrian@cam.cornell.edu or
mariano@geom.umn.edu), cleaned up, KNF'd, etc., by cgd
1993-10-27 03:31:49 +00:00