| 503 | } |
| 504 | |
| 505 | inline void CLI_saveHistory( char *buff ) |
| 506 | { |
| 507 | if ( buff == NULL ) |
| 508 | { |
| 509 | //clear the item |
| 510 | CLIHistoryBuffer[ CLIHistoryTail ][ 0 ] = '\0'; |
| 511 | return; |
| 512 | } |
| 513 | |
| 514 | // Don't write empty lines to the history |
| 515 | const char *cursor = buff; |
| 516 | while (*cursor == ' ') { cursor++; } // advance past the leading whitespace |
| 517 | if (*cursor == '\0') { return ; } |
| 518 | |
| 519 | // Copy the line to the history |
| 520 | int i; |
| 521 | for (i = 0; i < CLILineBufferCurrent; i++) |
| 522 | { |
| 523 | CLIHistoryBuffer[ CLIHistoryTail ][ i ] = CLILineBuffer[ i ]; |
| 524 | } |
| 525 | } |
| 526 | |
| 527 | void CLI_retreiveHistory( int index ) |
| 528 | { |
no outgoing calls
no test coverage detected
searching dependent graphs…