Duplicate assignment in Unicode/convutils.pm

Started by Kyotaro HORIGUCHIalmost 9 years ago2 messages
#1Kyotaro HORIGUCHI
horiguchi.kyotaro@lab.ntt.co.jp
1 attachment(s)

Hi, I found that convutils.pl contains a harmless duplicate
assignemnt.

my $out = {f => $fname, l => $.,
code => hex($1),
ucs => hex($2),
comment => $4,
direction => BOTH,
f => $fname,
l => $.
};

Of course this is utterly harmless but wrong.

The attached patch fixes this following other perl files around.
No similar mistake is not found there.

regards,

--
Kyotaro Horiguchi
NTT Open Source Software Center

Attachments:

convutils_remove_duplicate_assignments.patchtext/x-patch; charset=us-asciiDownload
diff --git a/src/backend/utils/mb/Unicode/convutils.pm b/src/backend/utils/mb/Unicode/convutils.pm
index 479bfe9..42b4ffa 100644
--- a/src/backend/utils/mb/Unicode/convutils.pm
+++ b/src/backend/utils/mb/Unicode/convutils.pm
@@ -47,12 +47,11 @@ sub read_source
 		if (!/^0x([0-9A-Fa-f]+)\s+0x([0-9A-Fa-f]+)\s+(#.*)$/)
 		{
 			print STDERR "READ ERROR at line $. in $fname: $_\n";
 			exit;
 		}
-		my $out = {f => $fname, l => $.,
-				   code => hex($1),
+		my $out = {code => hex($1),
 				   ucs => hex($2),
 				   comment => $4,
 				   direction => BOTH,
 				   f => $fname,
 				   l => $.
#2Heikki Linnakangas
hlinnaka@iki.fi
In reply to: Kyotaro HORIGUCHI (#1)
Re: Duplicate assignment in Unicode/convutils.pm

On 04/07/2017 09:32 AM, Kyotaro HORIGUCHI wrote:

Hi, I found that convutils.pl contains a harmless duplicate
assignemnt.

my $out = {f => $fname, l => $.,
code => hex($1),
ucs => hex($2),
comment => $4,
direction => BOTH,
f => $fname,
l => $.
};

Of course this is utterly harmless but wrong.

The attached patch fixes this following other perl files around.
No similar mistake is not found there.

Committed, thanks!

- Heikki

--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers