Revert "separate ifdef for history for linenoise"

This reverts commit 261d65d693.
This commit is contained in:
Eliot Horowitz
2011-03-18 15:33:39 -04:00
parent 261d65d693
commit 7cbc2f2d8e

View File

@@ -43,16 +43,12 @@ static volatile bool atPrompt = false; // can eval before getting to prompt
bool autoKillOp = false;
#if defined(USE_LINENOISE) && !defined(__freebsd__) && !defined(__openbsd__) && !defined(_WIN32) && !defined(WIN32)
#if defined(USE_LINENOISE) && !defined(__freebsd__) && !defined(__openbsd__) && !defined(_WIN32)
// this is for ctrl-c handling
#include <setjmp.h>
jmp_buf jbuf;
#endif
#if defined(USE_LINENOISE) && !defined(WIN32) && !defined(_WIN32)
#define USE_HISTORY
#endif
namespace mongo {
Scope * shellMainScope;
@@ -90,7 +86,7 @@ void completionHook(const char* text , linenoiseCompletions* lc ) {
#endif
void shellHistoryInit() {
#ifdef USE_HISTORY
#ifdef USE_LINENOISE
stringstream ss;
char * h = getenv( "HOME" );
if ( h )
@@ -106,12 +102,12 @@ void shellHistoryInit() {
#endif
}
void shellHistoryDone() {
#ifdef USE_HISTORY
#ifdef USE_LINENOISE
linenoiseHistorySave( (char*)historyFile.c_str() );
#endif
}
void shellHistoryAdd( const char * line ) {
#ifdef USE_HISTORY
#ifdef USE_LINENOISE
if ( line[0] == '\0' )
return;