From e0b7cf5eb5e6828d07094fa44be67e2d7d63e722 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Wed, 27 Jul 2016 22:28:26 +0000 Subject: localize $/ when using chomp Callers may have localized $/ to something else, so make sure we chomp the expected character(s) when calling chomp. --- lib/PublicInbox/Inbox.pm | 2 ++ 1 file changed, 2 insertions(+) (limited to 'lib/PublicInbox/Inbox.pm') diff --git a/lib/PublicInbox/Inbox.pm b/lib/PublicInbox/Inbox.pm index 23b77213..4fbbb522 100644 --- a/lib/PublicInbox/Inbox.pm +++ b/lib/PublicInbox/Inbox.pm @@ -106,6 +106,7 @@ sub description { my $desc = $self->{description}; return $desc if defined $desc; $desc = try_cat("$self->{mainrepo}/description"); + local $/ = "\n"; chomp $desc; $desc =~ s/\s+/ /smg; $desc = '($GIT_DIR/description missing)' if $desc eq ''; @@ -118,6 +119,7 @@ sub cloneurl { return $url if $url; $url = try_cat("$self->{mainrepo}/cloneurl"); my @url = split(/\s+/s, $url); + local $/ = "\n"; chomp @url; $self->{cloneurl} = \@url; } -- cgit v1.2.3-24-ge0c7