chiark / gitweb /
Slightly improved formatting
[ypp-sc-tools.db-live.git] / yarrg / web / routetextstring
index 9107780def29f20e6f28715178efe4397c9c6176..be009d4e5a4b8fa624a5f809a079a432d0b1da2f 100755 (executable)
@@ -69,12 +69,12 @@ my ($output, $output_wrong);
 
 if ($format =~ /json/) {
        $r->content_type($ctype or $format);
-       $output= sub { print to_json({
+       $output= sub { print to_json_shim({
                success => 1,
                show => length $canontext ? encode_entities($canontext)
                        : ' ',
                })};
-       $output_wrong= sub { print to_json({
+       $output_wrong= sub { print to_json_shim({
                success => 0,
                show => $_[0],
                })};
@@ -108,7 +108,7 @@ foreach my $each (split m#[/|,]#, $string) {
        if (!$results) {
                if (!%m) {
                        return $err->('no island or arch matches "%s"');
-               } elsif (%m > 5) {
+               } elsif (keys(%m) > 5) {
                        return $err->(' ');
                } else {
                        return $err->('ambiguous island or arch "%s",'.