mirror of
https://git.postgresql.org/git/postgresql.git
synced 2024-10-02 02:11:16 +02:00
Tweak clean_encoding_name() API to avoid need to cast away const.
Kris Jurka
This commit is contained in:
parent
6ee2a3be4a
commit
274dfdb513
@ -2,7 +2,7 @@
|
|||||||
* Encoding names and routines for work with it. All
|
* Encoding names and routines for work with it. All
|
||||||
* in this file is shared bedween FE and BE.
|
* in this file is shared bedween FE and BE.
|
||||||
*
|
*
|
||||||
* $PostgreSQL: pgsql/src/backend/utils/mb/encnames.c,v 1.33 2007/04/15 10:56:25 ishii Exp $
|
* $PostgreSQL: pgsql/src/backend/utils/mb/encnames.c,v 1.34 2007/04/16 18:50:49 tgl Exp $
|
||||||
*/
|
*/
|
||||||
#ifdef FRONTEND
|
#ifdef FRONTEND
|
||||||
#include "postgres_fe.h"
|
#include "postgres_fe.h"
|
||||||
@ -460,10 +460,10 @@ pg_valid_server_encoding(const char *name)
|
|||||||
* ----------
|
* ----------
|
||||||
*/
|
*/
|
||||||
static char *
|
static char *
|
||||||
clean_encoding_name(char *key, char *newkey)
|
clean_encoding_name(const char *key, char *newkey)
|
||||||
{
|
{
|
||||||
char *p,
|
const char *p;
|
||||||
*np;
|
char *np;
|
||||||
|
|
||||||
for (p = key, np = newkey; *p != '\0'; p++)
|
for (p = key, np = newkey; *p != '\0'; p++)
|
||||||
{
|
{
|
||||||
@ -508,7 +508,7 @@ pg_char_to_encname_struct(const char *name)
|
|||||||
errmsg("encoding name too long")));
|
errmsg("encoding name too long")));
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
key = clean_encoding_name((char *) name, buff);
|
key = clean_encoding_name(name, buff);
|
||||||
|
|
||||||
while (last >= base)
|
while (last >= base)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user