Changeset 11145
- Timestamp:
- 2008-09-02 07:51:14 (3 months ago)
- Location:
- trunk/xapian-core
- Files:
-
- 2 modified
-
ChangeLog (modified) (1 diff)
-
bin/xapian-inspect.cc (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/xapian-core/ChangeLog
r11142 r11145 1 Tue Sep 02 06:48:50 GMT 2008 Olly Betts <olly@survex.com> 2 3 * bin/xapian-inspect.cc: Show the help message on start-up. Correct 4 the alias for next from ' ' to ''. Avoid reading outside of input 5 string when it is empty. Bug#286. 6 1 7 Tue Sep 02 04:19:34 GMT 2008 Olly Betts <olly@survex.com> 2 8 -
trunk/xapian-core/bin/xapian-inspect.cc
r10302 r11145 73 73 } 74 74 75 static void 76 show_help() 77 { 78 cout << "Commands:\n" 79 "next : Next entry (alias 'n' or '')\n" 80 "prev : Previous entry (alias 'p')\n" 81 "goto X : Goto entry X (alias 'g')\n" 82 "help : Show this (alias 'h' or '?')\n" 83 "quit : Quit this utility (alias 'q')" << endl; 84 } 85 75 86 int 76 87 main(int argc, char **argv) … … 124 135 125 136 FlintCursor cursor(&table); 126 cursor.find_entry( "");137 cursor.find_entry(string()); 127 138 cursor.next(); 139 140 show_help(); 141 cout << endl; 128 142 129 143 while (!cin.eof()) { … … 141 155 if (cin.eof()) break; 142 156 143 if ( input[input.size() - 1] == '\r')157 if (endswith(input, '\r')) 144 158 input.resize(input.size() - 1); 145 159 146 if (input == ""|| input == "n" || input == "next") {160 if (input.empty() || input == "n" || input == "next") { 147 161 if (cursor.after_end() || !cursor.next()) { 148 162 cout << "At end already." << endl; … … 172 186 break; 173 187 } else if (input == "h" || input == "help" || input == "?") { 174 cout << "Commands:\n" 175 "next : Next entry (alias 'n' or ' ')\n" 176 "prev : Previous entry (alias 'p')\n" 177 "goto X : Goto entry X (alias 'g')\n" 178 "help : Show this (alias 'h' or '?')\n" 179 "quit : Quit this utility (alias 'q')" << endl; 188 show_help(); 180 189 goto wait_for_input; 181 190 } else {
