Commit 3e8dbc84 authored by Bruce Momjian's avatar Bruce Momjian

Support only octal for psql PROMPT values, rather than the confusing

hex/decimal/octal.  Documentation already updated.

BACKWARD COMPATIBLE CHANGE
parent 33294d57
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
* *
* Copyright (c) 2000-2005, PostgreSQL Global Development Group * Copyright (c) 2000-2005, PostgreSQL Global Development Group
* *
* $PostgreSQL: pgsql/src/bin/psql/common.c,v 1.97 2005/04/28 13:09:59 momjian Exp $ * $PostgreSQL: pgsql/src/bin/psql/common.c,v 1.98 2005/05/30 18:28:11 momjian Exp $
*/ */
#include "postgres_fe.h" #include "postgres_fe.h"
#include "common.h" #include "common.h"
...@@ -1237,17 +1237,6 @@ command_no_begin(const char *query) ...@@ -1237,17 +1237,6 @@ command_no_begin(const char *query)
} }
char
parse_char(char **buf)
{
long l;
l = strtol(*buf, buf, 0);
--*buf;
return (char) l;
}
/* /*
* Test if the current user is a database superuser. * Test if the current user is a database superuser.
* *
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
* *
* Copyright (c) 2000-2005, PostgreSQL Global Development Group * Copyright (c) 2000-2005, PostgreSQL Global Development Group
* *
* $PostgreSQL: pgsql/src/bin/psql/common.h,v 1.42 2005/01/01 05:43:08 momjian Exp $ * $PostgreSQL: pgsql/src/bin/psql/common.h,v 1.43 2005/05/30 18:28:11 momjian Exp $
*/ */
#ifndef COMMON_H #ifndef COMMON_H
#define COMMON_H #define COMMON_H
...@@ -60,12 +60,6 @@ extern bool SendQuery(const char *query); ...@@ -60,12 +60,6 @@ extern bool SendQuery(const char *query);
extern bool is_superuser(void); extern bool is_superuser(void);
extern const char *session_username(void); extern const char *session_username(void);
/* Parse a numeric character code from the string pointed at by *buf, e.g.
* one written as 0x0c (hexadecimal) or 015 (octal); advance *buf to the last
* character of the numeric character code.
*/
extern char parse_char(char **buf);
extern char *expand_tilde(char **filename); extern char *expand_tilde(char **filename);
#endif /* COMMON_H */ #endif /* COMMON_H */
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
* *
* Copyright (c) 2000-2005, PostgreSQL Global Development Group * Copyright (c) 2000-2005, PostgreSQL Global Development Group
* *
* $PostgreSQL: pgsql/src/bin/psql/prompt.c,v 1.38 2005/01/01 05:43:08 momjian Exp $ * $PostgreSQL: pgsql/src/bin/psql/prompt.c,v 1.39 2005/05/30 18:28:11 momjian Exp $
*/ */
#include "postgres_fe.h" #include "postgres_fe.h"
#include "prompt.h" #include "prompt.h"
...@@ -175,11 +175,9 @@ get_prompt(promptStatus_t status) ...@@ -175,11 +175,9 @@ get_prompt(promptStatus_t status)
case '5': case '5':
case '6': case '6':
case '7': case '7':
case '8': *buf = (char) strtol(p, (char **)&p, 8);
case '9': --p;
*buf = parse_char((char **) &p);
break; break;
case 'R': case 'R':
switch (status) switch (status)
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment