chiark / gitweb /
Properly reject capacity strings which start with a commodity
[ypp-sc-tools.db-live.git] / yarrg / web / check_capacitystring
index 3c779727ea005d2ce3e6766a59702bbb1c937890..a79b6f1ac06f1dffbed02820e33a819a1e31bb29 100644 (file)
@@ -88,6 +88,9 @@ my $parse_values= sub {
        elsif (s/^( $iqtyrex ) \s* ([a-z ]+) \s+ //xo) {
                my ($qty,$spec) = ($1,$2);
                $debugf->("VALUE COMMOD $qty '$spec'");
+               expected_error("Capacity specification must start with".
+                              " ship size or amount with units")
+                       if $first_term;
                $commodsth ||=
                    $dbh->prepare("SELECT commodname,unitmass,unitvolume
                                     FROM commods WHERE commodname LIKE ?");