40-history_string.patch 782 B

1234567891011121314151617181920212223242526272829
  1. # Description: Handle more than 256 characters in the history
  2. # Author: <bdefreese@bddebian3.bddebian.com>
  3. Index: gmrun-0.9.2/src/history.cc
  4. ===================================================================
  5. --- gmrun-0.9.2.orig/src/history.cc 2010-02-03 12:32:18.519767950 +0800
  6. +++ gmrun-0.9.2/src/history.cc 2010-02-03 12:32:43.586035039 +0800
  7. @@ -41,15 +41,14 @@
  8. ifstream f(filename);
  9. if (!f) return;
  10. + string line_text;
  11. +
  12. while (!f.eof()) {
  13. - char line_text[256];
  14. string line_str;
  15. - f.getline(line_text, sizeof(line_text));
  16. - if (*line_text) {
  17. - line_str = line_text;
  18. - history.push_back(line_str);
  19. - }
  20. + getline(f,line_text);
  21. + line_str = line_text;
  22. + history.push_back(line_str);
  23. }
  24. m_file_entries = history.size();