Single-digit values followed by 's' were not recognized as a valid unit with number.

This commit is contained in:
Moritz Bunkus 2005-08-21 18:07:59 +00:00
parent 09551a3f94
commit 18d1ab995f

View File

@ -378,7 +378,7 @@ parse_number_with_unit(const string &s,
if (display_s == "")
display_s = s;
if (s.length() < 3)
if (s.length() < 2)
mxerror(_("'%s' is not a valid %s in '%s %s'.\n"),
s.c_str(), subject.c_str(), argument.c_str(), display_s.c_str());
@ -399,6 +399,10 @@ parse_number_with_unit(const string &s,
"in '%s %s'.\n"), s.c_str(), argument.c_str(),
display_s.c_str());
if (s.length() < (unit_length + 1))
mxerror(_("'%s' is not a valid %s in '%s %s'.\n"),
s.c_str(), subject.c_str(), argument.c_str(), display_s.c_str());
if (!parse_int(s.substr(0, s.length() - unit_length), value))
mxerror(_("'%s' does not contain a valid number in front of the unit in "
"'%s %s'.\n"), s.c_str(), argument.c_str(), display_s.c_str());