chiark / gitweb /
Fix new textstring indirection
authorIan Jackson <ian@liberator.relativity.greenend.org.uk>
Sun, 16 Aug 2009 02:13:58 +0000 (03:13 +0100)
committerIan Jackson <ian@liberator.relativity.greenend.org.uk>
Sun, 16 Aug 2009 02:13:58 +0000 (03:13 +0100)
yarrg/web/qtextstringcheck
yarrg/web/query_route

index 4196018..4018455 100644 (file)
@@ -59,12 +59,6 @@ if ($format =~ /json/) {
        };
        print to_json_shim($jobj);
 }
        };
        print to_json_shim($jobj);
 }
-if ($format =~ /return/) {
-       return {
-               Error => $emsg,
-               Results => length $emsg ? $results : undef
-       };
-}
 if ($format =~ /dump/) {
        $r->content_type('text/plain');
        print Dumper($emsg, $canontext, $results);
 if ($format =~ /dump/) {
        $r->content_type('text/plain');
        print Dumper($emsg, $canontext, $results);
index b91e55c..dc1ebc9 100644 (file)
@@ -168,15 +168,15 @@ $results_head= sub {
 if (!$qa->{Dropdowns}) {
   if (length $routestring) {
        $results_head->();
 if (!$qa->{Dropdowns}) {
   if (length $routestring) {
        $results_head->();
-       my $rsr= $m->comp('routetextstring',
+       my ($emsg,$canonstring,$results)= $m->comp('check_routestring',
                ocean => $qa->{Ocean},
                string => $routestring,
                format => 'return'
        );
                ocean => $qa->{Ocean},
                string => $routestring,
                format => 'return'
        );
-       if (length $rsr->{Error}) {
-               print encode_entities($rsr->{Error});
+       if (length $emsg) {
+               print encode_entities($emsg);
        } else {
        } else {
-               foreach my $entry (@{ $rsr->{Results} }) {
+               foreach my $entry (@$results) {
                        push @archipelagoes,
                                defined $entry->[1] ? undef : $entry->[0];
                        push @islandids, $entry->[1];
                        push @archipelagoes,
                                defined $entry->[1] ? undef : $entry->[0];
                        push @islandids, $entry->[1];