Replicate behaviour of C2
Change-Id: I1c7ab035b4619a0480af1a7e4c69983606dfeb24
diff --git a/lib/KorAP/Def.pm b/lib/KorAP/Def.pm
index a204c5c..aff0b4b 100644
--- a/lib/KorAP/Def.pm
+++ b/lib/KorAP/Def.pm
@@ -91,7 +91,8 @@
my ($key, $value, $desc);
# Line-Type: <e>c</a>
- if ($line =~ /^\s*<([^>]+)>\s*([^<]*)\s*<\/\1>\s*$/) {
+ #if ($line =~ /^\s*<([^>]+)>\s*([^<]*)\s*<\/\1>\s*$/) {
+ if ($line =~ /^\s*<([^>]+)>\s*([^<]*)\s*<[^>]+>\s*$/) {
$key = $1;
$value = $2 // undef;
}
@@ -312,6 +313,10 @@
warn $key . ' is an unknown field';
};
};
+
+ if ($frozen) {
+ warn '' . ($self->{file} ? $self->{file} : 'Input') . ' is frozen';
+ }
$self->{vc} = $vc;
close($fh);
diff --git a/t/data/list3.def b/t/data/list3.def
index 783cf23..1131c7a 100644
--- a/t/data/list3.def
+++ b/t/data/list3.def
@@ -8,7 +8,7 @@
<date>m1=1991/1 bis 2012/12</date>
<end></end>
-<name>Berliner Zeitung</name>
+<name>Berliner Zeitung</date>
<ql>Berliner Zeitung</ql>
<and>1991-2012</and>
<redabs>143237</redabs>