chiark / gitweb /
Properly reject capacity strings which start with a commodity
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Mon, 21 Sep 2009 17:04:51 +0000 (18:04 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Mon, 21 Sep 2009 17:04:51 +0000 (18:04 +0100)
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 ?");