Skip to content

Commit

Permalink
Fix uninitialised variable
Browse files Browse the repository at this point in the history
  • Loading branch information
nigelhorne committed Nov 10, 2023
1 parent 22a75e4 commit ee9c60b
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions gedcom
Original file line number Diff line number Diff line change
Expand Up @@ -5694,14 +5694,13 @@ sub print_person
print "Event type: $type\n" if($opts{'v'});
if($type eq 'Military service') {
if(!$mentioned_military) {
my $service;
my $notes = notes(record => $event);
if($notes =~ /Navy/i) {
$service = 'navy';
} elsif(($notes =~ /^army\.?$/i) || ($notes =~ /\sarmy\s/i)) {
$service = 'army';
} else {
$service = 'military';
my $service = 'military';
if(my $notes = notes(record => $event)) {
if($notes =~ /Navy/i) {
$service = 'navy';
} elsif(($notes =~ /^army\.?$/i) || ($notes =~ /\sarmy\s/i)) {
$service = 'army';
}
}
if(defined(my $date = year(record => $event))) {
if($date =~ /^from /) {
Expand All @@ -5722,7 +5721,7 @@ sub print_person
}
$phrase->append(' ' . lcfirst($pronoun) . " was serving in the $service");
}
} elsif($notes) {
} else {
$phrase->set("$pronoun served in the $service");
}

Expand Down

0 comments on commit ee9c60b

Please sign in to comment.