summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorHye-Shik Chang <hyeshik@gmail.com>2004-11-25 04:04:20 (GMT)
committerHye-Shik Chang <hyeshik@gmail.com>2004-11-25 04:04:20 (GMT)
commit7a8173a477d69269d8f4b1f80253310b07a088d2 (patch)
tree3e2abdc07000150b756e3b73d6ef882156e7791b /Modules
parent536183b021a65979d5d0d352e1582e2a2b7d029d (diff)
downloadcpython-7a8173a477d69269d8f4b1f80253310b07a088d2.zip
cpython-7a8173a477d69269d8f4b1f80253310b07a088d2.tar.gz
cpython-7a8173a477d69269d8f4b1f80253310b07a088d2.tar.bz2
Rename a static variable "history_length" to "_history_length".
GNU readline exports a global variable that has such a name already and the collision makes gcc4 doesn't compile the source.
Diffstat (limited to 'Modules')
-rw-r--r--Modules/readline.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/Modules/readline.c b/Modules/readline.c
index 3377c8ea..9d5a6be 100644
--- a/Modules/readline.c
+++ b/Modules/readline.c
@@ -94,7 +94,7 @@ read_history_file(PyObject *self, PyObject *args)
return Py_None;
}
-static int history_length = -1; /* do not truncate history by default */
+static int _history_length = -1; /* do not truncate history by default */
PyDoc_STRVAR(doc_read_history_file,
"read_history_file([filename]) -> None\n\
Load a readline history file.\n\
@@ -110,8 +110,8 @@ write_history_file(PyObject *self, PyObject *args)
if (!PyArg_ParseTuple(args, "|z:write_history_file", &s))
return NULL;
errno = write_history(s);
- if (!errno && history_length >= 0)
- history_truncate_file(s, history_length);
+ if (!errno && _history_length >= 0)
+ history_truncate_file(s, _history_length);
if (errno)
return PyErr_SetFromErrno(PyExc_IOError);
Py_INCREF(Py_None);
@@ -129,10 +129,10 @@ The default filename is ~/.history.");
static PyObject*
set_history_length(PyObject *self, PyObject *args)
{
- int length = history_length;
+ int length = _history_length;
if (!PyArg_ParseTuple(args, "i:set_history_length", &length))
return NULL;
- history_length = length;
+ _history_length = length;
Py_INCREF(Py_None);
return Py_None;
}
@@ -149,7 +149,7 @@ history truncation.");
static PyObject*
get_history_length(PyObject *self, PyObject *noarg)
{
- return PyInt_FromLong(history_length);
+ return PyInt_FromLong(_history_length);
}
PyDoc_STRVAR(get_history_length_doc,