From: stephan Date: Thu, 30 May 2024 11:14:16 +0000 (+0000) Subject: Update shell.c to use the msteve fork of linenoise, per /chat discussion. X-Git-Tag: version-3.47.0~368 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=5b7048d5af1ec22371bb1f57556548f9724903c3;p=thirdparty%2Fsqlite.git Update shell.c to use the msteve fork of linenoise, per /chat discussion. FossilOrigin-Name: ee92fa8366b743266b17c692499087c0d11b9302d096c3dfb4e6356b467e939e --- diff --git a/manifest b/manifest index 5ff1e3b94c..b726f2bc02 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Remove\san\sunused\sparameter\sfrom\sfts5ConfigParseSpecial().\s\sCompiler-warning\nfix\sonly\s-\sno\sfunctional\schanges. -D 2024-05-29T15:16:17.746 +C Update\sshell.c\sto\suse\sthe\smsteve\sfork\sof\slinenoise,\sper\s/chat\sdiscussion. +D 2024-05-30T11:14:16.476 F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea F LICENSE.md df5091916dbb40e6e9686186587125e1b2ff51f022cc334e886c19a0e9982724 @@ -756,7 +756,7 @@ F src/random.c 606b00941a1d7dd09c381d3279a058d771f406c5213c9932bbd93d5587be4b9c F src/resolve.c 22f1fa3423b377c02ae78d451cfeb1c2d96dcf0389c0642cbdcd19d3bfd7ae01 F src/rowset.c 8432130e6c344b3401a8874c3cb49fefe6873fec593294de077afea2dce5ec97 F src/select.c cbdaf9cb2d9a697ee9ce1484f27d2e96762d33cc19259aedfb818a68b9d3be10 -F src/shell.c.in cba809572972ff736aa6c3423ffb87015c740864206d97e168bb77316129015f +F src/shell.c.in a4d5957a853d6065549a1f2d8f46ded9940f72835e0328bbad292560f36b4d45 F src/sqlite.h.in 892d0c427608ad7128a0fe44e972d6c4197225f5077f64f07792ffa44c6ecd77 F src/sqlite3.rc 5121c9e10c3964d5755191c80dd1180c122fc3a8 F src/sqlite3ext.h 3f046c04ea3595d6bfda99b781926b17e672fd6d27da2ba6d8d8fc39981dcb54 @@ -2194,8 +2194,8 @@ F vsixtest/vsixtest.tcl 6a9a6ab600c25a91a7acc6293828957a386a8a93 F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0 -P 38db9b5c83dfb3021333365b2f6b11e3b54afd7033e9f4dadf0c0df1d4b082d8 -R 63a18f932f7717068d6dced4ac639265 -U drh -Z c0825dd43d1a5a8b45060034ee2bb433 +P c08dd245f7706f2fd2269d700be480477619a722e27e6b439462ae543302c49f +R 72c04f74ef51a04b1a629955fe9bd59f +U stephan +Z 89260005431ea7f0523c5c606191a398 # Remove this line to create a well-formed Fossil manifest. diff --git a/manifest.uuid b/manifest.uuid index 804506c8a1..3471ecfb66 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -c08dd245f7706f2fd2269d700be480477619a722e27e6b439462ae543302c49f \ No newline at end of file +ee92fa8366b743266b17c692499087c0d11b9302d096c3dfb4e6356b467e939e \ No newline at end of file diff --git a/src/shell.c.in b/src/shell.c.in index b895fb0501..6773b2b4ee 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);