-# now open the rsgb.cty file and process that again the prefix file we have
-open(IN, "$main::data/rsgb.cty") or die "Can't open $main::data/rsgb.cty ($!)";
-$line = 0;
-while (<IN>) {
- $line++;
- next if /^\s*#/;
- next if /^\s*$/;
- my $l = $_;
- chomp;
- my @f = split /:\s+|;/;
- my $p = uc $f[4];
- my $ref = $pre{$p};
- if ($ref) {
- # split up the alias string
- my @alias = split /=/, $f[5];
- my $a;
- foreach $a (@alias) {
- next if $a eq $p; # ignore if we have it already
- my $nref = $pre{$a};
- $pre{$a} = $ref if !$nref; # copy the original ref if new
- }
- } else {
- print "line $line: unknown prefix '$p' on $l in rsgb.cty\n";
- }
+# now open the cty.dat file if it is there
+my $r;
+$ifn = $system ? "$main::data/cty.dat" : "$prefix/cty.dat";
+unless ($r = open (IN, $ifn)) {
+ $ifn = "$main::data/cty.dat";
+ $r = open(IN, $ifn);