Skip to content

Commit

Permalink
Fix uninitialized variable
Browse files Browse the repository at this point in the history
  • Loading branch information
nigelhorne committed Dec 5, 2024
1 parent 1744f34 commit 3244376
Showing 1 changed file with 17 additions and 11 deletions.
28 changes: 17 additions & 11 deletions gedcom
Original file line number Diff line number Diff line change
Expand Up @@ -912,7 +912,7 @@ if($opts{'w'}) {

my $gpt;
if(my $key = $ENV{'OPENAI_KEY'}) {
$gpt = OpenAIGPT4->new($key);
# $gpt = OpenAIGPT4->new($key);
}

my $meteo;
Expand Down Expand Up @@ -3354,6 +3354,7 @@ sub print_person
}
}
if($phrase->length()) {
$phrase =~ s/.$// if($phrase =~ /\s[A-Z]\.$/); # middle initial
push @phrases, $phrase;
}
if(scalar(@phrases)) {
Expand Down Expand Up @@ -5934,15 +5935,17 @@ sub print_person
last;
}
}
if($place =~ /.+,\s*(.+),\s*.+$/) {
if($1 ne $all_in_county) {
$all_in_one_county = 0;
last;
}
} elsif($place =~ /^(.+),\s*.+$/) {
if($1 ne $all_in_county) {
$all_in_one_county = 0;
last;
if(defined($all_in_county)) {
if($place =~ /.+,\s*(.+),\s*.+$/) {
if($1 ne $all_in_county) {
$all_in_one_county = 0;
last;
}
} elsif($place =~ /^(.+),\s*.+$/) {
if($1 ne $all_in_county) {
$all_in_one_county = 0;
last;
}
}
}
}
Expand Down Expand Up @@ -6425,7 +6428,7 @@ sub print_person
($type ne 'Register UK 1939')) {

complain({ person => $person, warning => "Unhandled event type: $type" });
die 'TODO: ', $person->as_string({ nee => 1, include_years => 1, middle_names => 1 }), " event type $type";
# die 'TODO: ', $person->as_string({ nee => 1, include_years => 1, middle_names => 1 }), " event type $type";
append_notes({ phrase => $phrase, record => $event });
# } elsif($end_of_sentence) {
# $phrase->append(' ');
Expand Down Expand Up @@ -9208,6 +9211,7 @@ sub Gedcom::Individual::relationship_up
12 << 24 | 4 => 'third cousin eight-times-removed',
12 << 24 | 5 => 'fourth cousin seven-times-removed',
13 << 24 | 1 => 'eleven times great-uncle',
13 << 24 | 2 => 'first cousin eleven-times-removed',
14 << 24 | 1 => 'twelve times great-uncle',
15 << 24 | 1 => 'thirteen times great-uncle',
16 << 24 | 1 => 'fourteen times great-uncle',
Expand Down Expand Up @@ -9284,6 +9288,7 @@ sub Gedcom::Individual::relationship_up
12 << 24 | 4 => 'third cousin eight-times-removed',
12 << 24 | 5 => 'fourth cousin seven-times-removed',
13 << 24 | 1 => 'eleven times great-uncle',
13 << 24 | 2 => 'first cousin eleven-times-removed',
14 << 24 | 1 => 'twelve times great-uncle',
15 << 24 | 1 => 'thirteen times great-uncle',
16 << 24 | 1 => 'fourteen times great-uncle',
Expand Down Expand Up @@ -9361,6 +9366,7 @@ sub Gedcom::Individual::relationship_up
12 << 24 | 4 => 'third cousin eight-times-removed',
12 << 24 | 5 => 'fourth cousin seven-times-removed',
13 << 24 | 1 => 'eleven times great-aunt',
13 << 24 | 2 => 'first cousin eleven-times-removed',
14 << 24 | 1 => 'twelve times great-aunt',
15 << 24 | 1 => 'thirteen times great-aunt',
16 << 24 | 1 => 'fourteen times great-aunt',
Expand Down

0 comments on commit 3244376

Please sign in to comment.