aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorstephan <stephan@noemail.net>2024-05-30 11:14:16 +0000
committerstephan <stephan@noemail.net>2024-05-30 11:14:16 +0000
commit5b7048d5af1ec22371bb1f57556548f9724903c3 (patch)
tree6aa1bef034471c5e5f113f8880fe3dff7930002b /src
parent7da33383c7952e88b6ded2b684d12545b93caca0 (diff)
downloadsqlite-5b7048d5af1ec22371bb1f57556548f9724903c3.tar.gz
sqlite-5b7048d5af1ec22371bb1f57556548f9724903c3.zip
Update shell.c to use the msteve fork of linenoise, per /chat discussion.
FossilOrigin-Name: ee92fa8366b743266b17c692499087c0d11b9302d096c3dfb4e6356b467e939e
Diffstat (limited to 'src')
-rw-r--r--src/shell.c.in9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/shell.c.in b/src/shell.c.in
index b895fb050..6773b2b4e 100644
--- a/src/shell.c.in
+++ b/src/shell.c.in
@@ -5518,15 +5518,18 @@ static char **readline_completion(const char *zText, int iStart, int iEnd){
#elif HAVE_LINENOISE
/*
-** Linenoise completion callback
+** 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){
+static void linenoise_completion(const char *zLine, linenoiseCompletions *lc,
+ void *pUserData){
i64 nLine = strlen(zLine);
i64 i, iStart;
sqlite3_stmt *pStmt = 0;
char *zSql;
char zBuf[1000];
+ UNUSED_PARAMETER(pUserData);
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--){}
@@ -12799,7 +12802,7 @@ int SQLITE_CDECL wmain(int argc, wchar_t **wargv){
#if HAVE_READLINE || HAVE_EDITLINE
rl_attempted_completion_function = readline_completion;
#elif HAVE_LINENOISE
- linenoiseSetCompletionCallback(linenoise_completion);
+ linenoiseSetCompletionCallback(linenoise_completion, NULL);
#endif
data.in = 0;
rc = process_input(&data);