From: Mike Taylor Date: Fri, 2 Jul 2010 15:22:13 +0000 (+0100) Subject: _irspy_identifier2target() recognises and allows for comma-separated X-Git-Tag: CPAN-v1.02~26^2~1 X-Git-Url: http://git.indexdata.com/?p=irspy-moved-to-github.git;a=commitdiff_plain;h=efb3be8248d2ab9d737879a9ebf1a4459f5362d4 _irspy_identifier2target() recognises and allows for comma-separated ZOOM-style options at the front of IRSpy identifiers. --- diff --git a/lib/ZOOM/IRSpy/Utils.pm b/lib/ZOOM/IRSpy/Utils.pm index 9ead6b3..089e8e7 100644 --- a/lib/ZOOM/IRSpy/Utils.pm +++ b/lib/ZOOM/IRSpy/Utils.pm @@ -285,13 +285,13 @@ sub _irspy_identifier2target { confess "_irspy_identifier2target(): id is undefined" if !defined $id; - my($protocol, $target) = ($id =~ /(.*?):(.*)/); + my($prefix, $protocol, $target) = ($id =~ /([^:]*,)?(.*?):(.*)/); if (uc($protocol) eq "Z39.50" || uc($protocol) eq "TCP") { - return "tcp:$target"; + return "${prefix}tcp:$target"; } elsif (uc($protocol) eq "SRU") { - return "sru=get,http:$target"; + return "${prefix}sru=get,http:$target"; } elsif (uc($protocol) eq "SRW") { - return "sru=srw,http:$target"; + return "${prefix}sru=srw,http:$target"; } warn "_irspy_identifier2target($id): unrecognised protocol '$protocol'";