From 853520ddbf85b29db418cc283648e4eac0f62a83 Mon Sep 17 00:00:00 2001 From: drh <> Date: Wed, 25 Sep 2024 11:38:00 +0000 Subject: [PATCH] Fix stray fputs() calls in the CLI. FossilOrigin-Name: 1ee3fa0f0e87a61b5700abd56547c4acefe999317b0d53d66d890d9e09d8b7d9 --- manifest | 12 ++++++------ manifest.uuid | 2 +- src/shell.c.in | 19 ++++++++++--------- 3 files changed, 17 insertions(+), 16 deletions(-) diff --git a/manifest b/manifest index 590b028e17..9b7a96878f 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Use\ssqlite3_fgets()\sinstead\sof\sfgetc()\sto\send\sthe\sstartup\sdebugging\spause\nin\sthe\sCLI. -D 2024-09-25T11:27:59.291 +C Fix\sstray\sfputs()\scalls\sin\sthe\sCLI. +D 2024-09-25T11:38:00.160 F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea F LICENSE.md df5091916dbb40e6e9686186587125e1b2ff51f022cc334e886c19a0e9982724 @@ -770,7 +770,7 @@ F src/random.c 606b00941a1d7dd09c381d3279a058d771f406c5213c9932bbd93d5587be4b9c F src/resolve.c 9750a281f7ba073b4e6da2be1a6c4071f5d841a7746c5fb3f70d6d793b6675ea F src/rowset.c 8432130e6c344b3401a8874c3cb49fefe6873fec593294de077afea2dce5ec97 F src/select.c 4b14337a2742f0c0beeba490e9a05507e9b4b12184b9cd12773501d08d48e3fe -F src/shell.c.in 4ff7790dc89c0ca7f7a0f1921b34ed01d78c70e1c8d080659ebaecdca298411f +F src/shell.c.in d91ad1c7b7c00cfe2d5f0577016fa31411b238b0a8eba232087265c89ed134e2 F src/sqlite.h.in 77f55bd1978a04a14db211732f0a609077cf60ba4ccf9baf39988f508945419c F src/sqlite3.rc 5121c9e10c3964d5755191c80dd1180c122fc3a8 F src/sqlite3ext.h 3f046c04ea3595d6bfda99b781926b17e672fd6d27da2ba6d8d8fc39981dcb54 @@ -2215,8 +2215,8 @@ F vsixtest/vsixtest.tcl 6195aba1f12a5e10efc2b8c0009532167be5e301abe5b31385638080 F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0 -P d6262a4bcd7b0334b23ae4d194ca2bce7c6554ee6c678666b24c830e4c14a467 -R d977d49e5dea1a4e01fec0c001abe012 +P 869b3c05e852a797b5801a81d30a1f7955c31afad0274327f7af2284b555f23a +R 65de7bdaddb9c81ab30a8bc4f548eed2 U drh -Z 0a28ca13fa93e1f632f49b48601d4127 +Z fec9edb9be260bf1b825cec9b6314a72 # Remove this line to create a well-formed Fossil manifest. diff --git a/manifest.uuid b/manifest.uuid index 1375b7c7d3..19e0615510 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -869b3c05e852a797b5801a81d30a1f7955c31afad0274327f7af2284b555f23a +1ee3fa0f0e87a61b5700abd56547c4acefe999317b0d53d66d890d9e09d8b7d9 diff --git a/src/shell.c.in b/src/shell.c.in index 667f3e2d1f..6dba6e8c33 100644 --- a/src/shell.c.in +++ b/src/shell.c.in @@ -2891,14 +2891,14 @@ static int shell_callback( if( azArg==0 ) break; if( p->cnt==0 && p->showHeader ){ for(i=0; i0 ) fputs(p->colSeparator, p->out); + if( i>0 ) sqlite3_fputs(p->colSeparator, p->out); output_quoted_string(p->out, azCol[i]); } - fputs(p->rowSeparator, p->out); + sqlite3_fputs(p->rowSeparator, p->out); } p->cnt++; for(i=0; i0 ) fputs(p->colSeparator, p->out); + if( i>0 ) sqlite3_fputs(p->colSeparator, p->out); if( (azArg[i]==0) || (aiType && aiType[i]==SQLITE_NULL) ){ sqlite3_fputs("NULL", p->out); }else if( aiType && aiType[i]==SQLITE_TEXT ){ @@ -2920,7 +2920,7 @@ static int shell_callback( output_quoted_string(p->out, azArg[i]); } } - fputs(p->rowSeparator, p->out); + sqlite3_fputs(p->rowSeparator, p->out); break; } case MODE_Ascii: { @@ -4104,7 +4104,7 @@ static void exec_prepared_stmt_columnar( } for(i=0; iout, p->actualWidth[i]); - fputs(i==nColumn-1?"\n":" ", p->out); + sqlite3_fputs(i==nColumn-1?"\n":" ", p->out); } } break; @@ -4113,7 +4113,7 @@ static void exec_prepared_stmt_columnar( colSep = " | "; rowSep = " |\n"; print_row_separator(p, nColumn, "+"); - fputs("| ", p->out); + sqlite3_fputs("| ", p->out); for(i=0; iactualWidth[i]; n = strlenChar(azData[i]); @@ -4127,7 +4127,7 @@ static void exec_prepared_stmt_columnar( case MODE_Markdown: { colSep = " | "; rowSep = " |\n"; - fputs("| ", p->out); + sqlite3_fputs("| ", p->out); for(i=0; iactualWidth[i]; n = strlenChar(azData[i]); @@ -4274,7 +4274,7 @@ static void exec_prepared_stmt( } while( SQLITE_ROW == rc ); sqlite3_free(pData); if( pArg->cMode==MODE_Json ){ - fputs("]\n", pArg->out); + sqlite3_fputs("]\n", pArg->out); }else if( pArg->cMode==MODE_Count ){ char zBuf[200]; sqlite3_snprintf(sizeof(zBuf), zBuf, "%llu row%s\n", @@ -12845,7 +12845,8 @@ int SQLITE_CDECL wmain(int argc, wchar_t **wargv){ default: sqlite3_config(SQLITE_CONFIG_SERIALIZED); break; } }else if( cli_strcmp(z,"-vfstrace")==0 ){ - vfstrace_register("trace",0,(int(*)(const char*,void*))fputs,stderr,1); + vfstrace_register("trace",0,(int(*)(const char*,void*))sqlite3_fputs, + stderr,1); bEnableVfstrace = 1; #ifdef SQLITE_ENABLE_MULTIPLEX }else if( cli_strcmp(z,"-multiplex")==0 ){