ported 257:258 from hidra branch
[webpac] / parse_format.pm
index b7c0e47..9123832 100644 (file)
@@ -80,18 +80,31 @@ sub parse_iso_format {
                        # this might be our local scpeciality -- fields 10 and 11
                        # (as opposed to 010 and 011) so they are strictly listed
                        # here
-                       } elsif ($f =~ s/^(1[01])//) {
+                       } elsif ($f =~ s/^(1[01]\w?)//) {
                                push @fmt,$1;
                                push @fmt,undef;
                        } elsif ($f =~ s/^mfn//i) {
                                push @fmt,'mfn';
                                push @fmt,'';
                        } elsif ($f =~ s/^([^\d]+)(\d{0,3})/$2/) {
-                               push @fmt,$1;
+                               # still prefix?
+                               if ($#fmt == 0) {
+                                       $fmt[0] .= $1;
+                               } else {
+                                       push @fmt,$1;
+                               }
                        } elsif ($f =~ s/^([^\d]+\d{0,2})//) {
-                               push @fmt,$1;
+                               if ($#fmt == 0) {
+                                       $fmt[0] .= $1;
+                               } else {
+                                       push @fmt,$1;
+                               }
                        } elsif ($f =~ s/^(\d{1,2})//) {
-                               push @fmt,$1;
+                               if ($#fmt == 0) {
+                                       $fmt[0] .= $1;
+                               } else {
+                                       push @fmt,$1;
+                               }
                        } else {
                                print STDERR "unparsed format: $f\n";
                                $f = "";
@@ -140,7 +153,9 @@ sub parse_iso_format {
        $display = $prefix.$display.$sufix if ($display);
        print STDERR "format left unused: [",join("|",@fmt),"]\n" if (@fmt);
 
-#      print STDERR "display: $display swish: $swish\n";
+       print STDERR "format: [",join("|",@{$tmp}),"]\n" if (@fmt);
+
+#      print STDERR "format: {",$format || '',"} display: {",$display || '',"} swish: {",$swish || '',"}\n";
 
        return ($swish,$display);
 }