Skip to content

Commit 3e8dbc8

Browse files
committed
Support only octal for psql PROMPT values, rather than the confusing
hex/decimal/octal. Documentation already updated. BACKWARD COMPATIBLE CHANGE
1 parent 33294d5 commit 3e8dbc8

File tree

3 files changed

+5
-24
lines changed

3 files changed

+5
-24
lines changed

src/bin/psql/common.c

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
*
44
* Copyright (c) 2000-2005, PostgreSQL Global Development Group
55
*
6-
* $PostgreSQL: pgsql/src/bin/psql/common.c,v 1.97 2005/04/28 13:09:59 momjian Exp $
6+
* $PostgreSQL: pgsql/src/bin/psql/common.c,v 1.98 2005/05/30 18:28:11 momjian Exp $
77
*/
88
#include "postgres_fe.h"
99
#include "common.h"
@@ -1237,17 +1237,6 @@ command_no_begin(const char *query)
12371237
}
12381238

12391239

1240-
char
1241-
parse_char(char **buf)
1242-
{
1243-
long l;
1244-
1245-
l = strtol(*buf, buf, 0);
1246-
--*buf;
1247-
return (char) l;
1248-
}
1249-
1250-
12511240
/*
12521241
* Test if the current user is a database superuser.
12531242
*

src/bin/psql/common.h

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
*
44
* Copyright (c) 2000-2005, PostgreSQL Global Development Group
55
*
6-
* $PostgreSQL: pgsql/src/bin/psql/common.h,v 1.42 2005/01/01 05:43:08 momjian Exp $
6+
* $PostgreSQL: pgsql/src/bin/psql/common.h,v 1.43 2005/05/30 18:28:11 momjian Exp $
77
*/
88
#ifndef COMMON_H
99
#define COMMON_H
@@ -60,12 +60,6 @@ extern bool SendQuery(const char *query);
6060
extern bool is_superuser(void);
6161
extern const char *session_username(void);
6262

63-
/* Parse a numeric character code from the string pointed at by *buf, e.g.
64-
* one written as 0x0c (hexadecimal) or 015 (octal); advance *buf to the last
65-
* character of the numeric character code.
66-
*/
67-
extern char parse_char(char **buf);
68-
6963
extern char *expand_tilde(char **filename);
7064

7165
#endif /* COMMON_H */

src/bin/psql/prompt.c

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
*
44
* Copyright (c) 2000-2005, PostgreSQL Global Development Group
55
*
6-
* $PostgreSQL: pgsql/src/bin/psql/prompt.c,v 1.38 2005/01/01 05:43:08 momjian Exp $
6+
* $PostgreSQL: pgsql/src/bin/psql/prompt.c,v 1.39 2005/05/30 18:28:11 momjian Exp $
77
*/
88
#include "postgres_fe.h"
99
#include "prompt.h"
@@ -175,11 +175,9 @@ get_prompt(promptStatus_t status)
175175
case '5':
176176
case '6':
177177
case '7':
178-
case '8':
179-
case '9':
180-
*buf = parse_char((char **) &p);
178+
*buf = (char) strtol(p, (char **)&p, 8);
179+
--p;
181180
break;
182-
183181
case 'R':
184182
switch (status)
185183
{

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy