hex/decimal/octal. Documentation already updated.
BACKWARD COMPATIBLE CHANGE
*
* 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 "common.h"
}
-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.
*
*
* 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
#define COMMON_H
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 */
*
* 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 "prompt.h"
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)
{