Line 0
Link Here
|
|
|
1 |
--- Modules/readline.c.orig Wed Jan 17 18:10:23 2007 |
2 |
+++ Modules/readline.c Wed Jan 17 18:12:54 2007 |
3 |
@@ -93,7 +93,7 @@ |
4 |
return Py_None; |
5 |
} |
6 |
|
7 |
-static int history_length = -1; /* do not truncate history by default */ |
8 |
+static int _history_length = -1; /* do not truncate history by default */ |
9 |
PyDoc_STRVAR(doc_read_history_file, |
10 |
"read_history_file([filename]) -> None\n\ |
11 |
Load a readline history file.\n\ |
12 |
@@ -109,8 +109,8 @@ |
13 |
if (!PyArg_ParseTuple(args, "|z:write_history_file", &s)) |
14 |
return NULL; |
15 |
errno = write_history(s); |
16 |
- if (!errno && history_length >= 0) |
17 |
- history_truncate_file(s, history_length); |
18 |
+ if (!errno && _history_length >= 0) |
19 |
+ history_truncate_file(s, _history_length); |
20 |
if (errno) |
21 |
return PyErr_SetFromErrno(PyExc_IOError); |
22 |
Py_INCREF(Py_None); |
23 |
@@ -128,10 +128,10 @@ |
24 |
static PyObject* |
25 |
set_history_length(PyObject *self, PyObject *args) |
26 |
{ |
27 |
- int length = history_length; |
28 |
+ int length = _history_length; |
29 |
if (!PyArg_ParseTuple(args, "i:set_history_length", &length)) |
30 |
return NULL; |
31 |
- history_length = length; |
32 |
+ _history_length = length; |
33 |
Py_INCREF(Py_None); |
34 |
return Py_None; |
35 |
} |
36 |
@@ -148,7 +148,7 @@ |
37 |
static PyObject* |
38 |
get_history_length(PyObject *self, PyObject *noarg) |
39 |
{ |
40 |
- return PyInt_FromLong(history_length); |
41 |
+ return PyInt_FromLong(_history_length); |
42 |
} |
43 |
|
44 |
PyDoc_STRVAR(get_history_length_doc, |