aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/shell.c.in15
1 files changed, 12 insertions, 3 deletions
diff --git a/src/shell.c.in b/src/shell.c.in
index 50f1c5bfe..cdd09becf 100644
--- a/src/shell.c.in
+++ b/src/shell.c.in
@@ -5795,15 +5795,22 @@ static char **readline_completion(const char *zText, int iStart, int iEnd){
** Linenoise completion callback. Note that the 3rd argument is from
** the "msteveb" version of linenoise, not the "antirez" version.
*/
-static void linenoise_completion(const char *zLine, linenoiseCompletions *lc,
- void *pUserData){
+static void linenoise_completion(
+ const char *zLine,
+ linenoiseCompletions *lc
+#if HAVE_LINENOISE==2
+ ,void *pUserData
+#endif
+){
i64 nLine = strlen(zLine);
i64 i, iStart;
sqlite3_stmt *pStmt = 0;
char *zSql;
char zBuf[1000];
+#if HAVE_LINENOISE==2
UNUSED_PARAMETER(pUserData);
+#endif
if( nLine>(i64)sizeof(zBuf)-30 ) return;
if( zLine[0]=='.' || zLine[0]=='#') return;
for(i=nLine-1; i>=0 && (isalnum(zLine[i]) || zLine[i]=='_'); i--){}
@@ -13196,7 +13203,9 @@ int SQLITE_CDECL wmain(int argc, wchar_t **wargv){
if( zHistory ){ shell_read_history(zHistory); }
#if (HAVE_READLINE || HAVE_EDITLINE) && !defined(SQLITE_OMIT_READLINE_COMPLETION)
rl_attempted_completion_function = readline_completion;
-#elif HAVE_LINENOISE
+#elif HAVE_LINENOISE==1
+ linenoiseSetCompletionCallback(linenoise_completion);
+#elif HAVE_LINENOISE==2
linenoiseSetCompletionCallback(linenoise_completion, NULL);
#endif
data.in = 0;