[HACKERS] Duplicate assignment in Unicode/convutils.pm - Mailing list pgsql-hackers

From Kyotaro HORIGUCHI
Subject [HACKERS] Duplicate assignment in Unicode/convutils.pm
Date
Msg-id 20170407.153228.167545180.horiguchi.kyotaro@lab.ntt.co.jp
Whole thread Raw
Responses Re: [HACKERS] Duplicate assignment in Unicode/convutils.pm  (Heikki Linnakangas <hlinnaka@iki.fi>)
List pgsql-hackers
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
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+(#.*)$/)        {
printSTDERR "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 => $. 

pgsql-hackers by date:

Previous
From: Amit Khandekar
Date:
Subject: Re: [HACKERS] Parallel Append implementation
Next
From: Beena Emerson
Date:
Subject: Re: [HACKERS] increasing the default WAL segment size