]> git.ipfire.org Git - thirdparty/postgresql.git/commit
Get rid of scribbling on a const variable in psql's print.c.
authorTom Lane <tgl@sss.pgh.pa.us>
Sat, 12 Mar 2016 23:16:24 +0000 (18:16 -0500)
committerTom Lane <tgl@sss.pgh.pa.us>
Sat, 12 Mar 2016 23:16:38 +0000 (18:16 -0500)
commit1598dc15bab35a9fd061babbae716777259d3147
treeb268af34a9bb9ecc718937cf8ed6b2d4f54d8f42
parentc84c87ccc0e219a3f263aea9ec80068022ca1cc0
Get rid of scribbling on a const variable in psql's print.c.

Commit a2dabf0e1dda93c8 had the bright idea that it could modify a "const"
global variable if it merely casted away const from a pointer.  This does
not work on platforms where the compiler puts "const" variables into
read-only storage.  Depressingly, we evidently have no such platforms in
our buildfarm ... an oversight I have now remedied.  (The one platform
that is known to catch this is recent OS X with -fno-common.)

Per report from Chris Ruprecht.  Back-patch to 9.5 where the bogus
code was introduced.
src/bin/psql/print.c
src/bin/psql/print.h