diff options
author | Alexandre De Dommelin <adedommelin@tuxz.net> | 2017-03-12 15:49:46 -0700 |
---|---|---|
committer | Lukas Schwaighofer <lukas@schwaighofer.name> | 2017-03-12 15:49:46 -0700 |
commit | 5f65da2f46554406eda093604ae5173502466755 (patch) | |
tree | 1098e4910da29c82164abf6c2f59a99a6a65465b /src/history.cc | |
parent | 4e008f47e664c1dddb62dc90d2345dd29442f950 (diff) |
history_string
# Description: Handle more than 256 characters in the history
# Author: <bdefreese@bddebian3.bddebian.com>
Gbp-Pq: Name 40-history_string.patch
Diffstat (limited to 'src/history.cc')
-rw-r--r-- | src/history.cc | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/src/history.cc b/src/history.cc index 61afba0..33d946c 100644 --- a/src/history.cc +++ b/src/history.cc @@ -41,15 +41,14 @@ HistoryFile::read_the_file() ifstream f(filename); if (!f) return; + string line_text; + while (!f.eof()) { - char line_text[256]; string line_str; - f.getline(line_text, sizeof(line_text)); - if (*line_text) { - line_str = line_text; - history.push_back(line_str); - } + getline(f,line_text); + line_str = line_text; + history.push_back(line_str); } m_file_entries = history.size(); |