Invalid ports were previously silently dropped; now a warning message
is produced.
Signed-off-by: Maxim Cournoyer <maxim@guixotic.coop>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
if (!defined $nentry->{machine}) {
next;
}
- if (defined $nentry->{port} && $nentry->{port} =~ m/^\d+$/) {
- $num_port = $nentry->{port};
- delete $nentry->{port};
+ if (defined $nentry->{port}) {
+ if ($nentry->{port} =~ m/^\d+$/) {
+ $num_port = $nentry->{port};
+ delete $nentry->{port};
+ } else {
+ printf(STDERR "ignoring invalid port `%s' " .
+ "from netrc file\n", $nentry->{port});
+ }
}
# create the new entry for the credential helper protocol