Support only octal for psql PROMPT values, rather than the confusing
authorBruce Momjian <bruce@momjian.us>
Mon, 30 May 2005 18:28:11 +0000 (18:28 +0000)
committerBruce Momjian <bruce@momjian.us>
Mon, 30 May 2005 18:28:11 +0000 (18:28 +0000)
hex/decimal/octal.  Documentation already updated.

BACKWARD COMPATIBLE CHANGE

src/bin/psql/common.c
src/bin/psql/common.h
src/bin/psql/prompt.c

index 1e60fbe915b3d4d99ed088acaaba2667daf02cf8..9df9f9f2a68a8933e829bd55159f8907f426ac5c 100644 (file)
@@ -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.
  *
index 65c182d6eea2a89e60fa66089ed1cbe937a19742..f49acde221cb41ecc7f21ed657731b7c22654639 100644 (file)
@@ -60,12 +60,6 @@ extern bool SendQuery(const char *query);
 extern bool is_superuser(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);
 
 #endif   /* COMMON_H */
index d9610aca8857a3dc1f4b9371869d50871b8f8ecc..4e4b71a0d6add12f15cf0adbc9e8bf5637fb8c44 100644 (file)
@@ -175,11 +175,9 @@ get_prompt(promptStatus_t status)
                                case '5':
                                case '6':
                                case '7':
-                               case '8':
-                               case '9':
-                                       *buf = parse_char((char **) &p);
+                                       *buf = (char) strtol(p, (char **)&p, 8);
+                                       --p;
                                        break;
-
                                case 'R':
                                        switch (status)
                                        {