]> git.ipfire.org Git - thirdparty/sqlite.git/commitdiff
Fix harmless display bug in previous check-in. Add the -noinit command-line
authordrh <>
Fri, 14 Nov 2025 19:04:23 +0000 (19:04 +0000)
committerdrh <>
Fri, 14 Nov 2025 19:04:23 +0000 (19:04 +0000)
option to bypass reading the ~/.sqliterc file.

FossilOrigin-Name: 229650a01dcd9cc4b39526d661106e9c3eb2f90ca7fbed8adc6e6fe85ef3fdaa

manifest
manifest.uuid
src/shell.c.in

index 708085f66acfebaa5b1a9cc50aaf78b3f8fef456..6bea940199115bee3097f10a660ebf60b048fc6a 100644 (file)
--- a/manifest
+++ b/manifest
@@ -1,5 +1,5 @@
-C Add\sthe\s--tag\sand\s--list\soptions\sto\sthe\s".mode"\scommand.
-D 2025-11-14T18:41:21.284
+C Fix\sharmless\sdisplay\sbug\sin\sprevious\scheck-in.\s\sAdd\sthe\s-noinit\scommand-line\noption\sto\sbypass\sreading\sthe\s~/.sqliterc\sfile.
+D 2025-11-14T19:04:23.019
 F .fossil-settings/binary-glob 61195414528fb3ea9693577e1980230d78a1f8b0a54c78cf1b9b24d0a409ed6a x
 F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1
 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea
@@ -735,7 +735,7 @@ F src/random.c 606b00941a1d7dd09c381d3279a058d771f406c5213c9932bbd93d5587be4b9c
 F src/resolve.c 5616fbcf3b833c7c705b24371828215ad0925d0c0073216c4f153348d5753f0a
 F src/rowset.c 8432130e6c344b3401a8874c3cb49fefe6873fec593294de077afea2dce5ec97
 F src/select.c ba9cd07ffa3277883c1986085f6ddc4320f4d35d5f212ab58df79a7ecc1a576a
-F src/shell.c.in 84a30f8d3ca31ba31de3e823bd90f07de211bb7dd0ea770831d392e2b894d06c
+F src/shell.c.in 036a035b7338d2b2a487ed8bc5704fe328730ff0e69fd2ad7eddac433ccb0fd1
 F src/sqlite.h.in 684c19c3b093cca7a38e3f6405d067777464285f17a58a78f7f89d6763e011e7
 F src/sqlite3.rc 015537e6ac1eec6c7050e17b616c2ffe6f70fca241835a84a4f0d5937383c479
 F src/sqlite3ext.h 7f236ca1b175ffe03316d974ef57df79b3938466c28d2f95caef5e08c57f3a52
@@ -2175,8 +2175,8 @@ F tool/version-info.c 33d0390ef484b3b1cb685d59362be891ea162123cea181cb8e6d2cf6dd
 F tool/warnings-clang.sh bbf6a1e685e534c92ec2bfba5b1745f34fb6f0bc2a362850723a9ee87c1b31a7
 F tool/warnings.sh d924598cf2f55a4ecbc2aeb055c10bd5f48114793e7ba25f9585435da29e7e98
 F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f
-P 253980122a35f787423aaeedbec12ec94b31768f245fe1c1fcc7e08911855c60
-R 3310fe55886bfbe2545dc792f3febefa
+P 9daf98c2f449688b7463b71dfa926cb4ae96d8c7ee34946df2172bb37f7c5616
+R e360db8c5b351166499414f2456224e9
 U drh
-Z 827696bc8e94178725eea170d53fd831
+Z 01ee205d237f871f1acf344f0ffb9d23
 # Remove this line to create a well-formed Fossil manifest.
index ffdc9ed8046b1b214b690627fe467b2017b79b8e..db3c24f1434dca734a06b3bfc81cee158e3cdd64 100644 (file)
@@ -1 +1 @@
-9daf98c2f449688b7463b71dfa926cb4ae96d8c7ee34946df2172bb37f7c5616
+229650a01dcd9cc4b39526d661106e9c3eb2f90ca7fbed8adc6e6fe85ef3fdaa
index a000e8f054d5a930634e6cd14e49a485e48ae3b7..7941c53fd81cb89c46c19d5a8961a295dfe08383 100644 (file)
@@ -7677,7 +7677,7 @@ static int dotCmdMode(ShellState *p){
       return 1;
     }
   }
-  if( chng || bAll ){
+  if( !chng || bAll ){
     const ModeInfo *pI = aModeInfo + p->mode.eMode;
     sqlite3_str *pDesc = sqlite3_str_new(p->db);
     char *zDesc;
@@ -7774,6 +7774,7 @@ static int dotCmdMode(ShellState *p){
     }
     zDesc = sqlite3_str_finish(pDesc);
     cli_printf(p->out, "current output mode: %s\n", zDesc);
+    fflush(p->out);
     sqlite3_free(zDesc);
   }
   return 0;
@@ -12180,6 +12181,7 @@ static const char zOptions[] =
 #endif
   "   -newline SEP         set output row separator. Default: '\\n'\n"
   "   -nofollow            refuse to open symbolic links to database files\n"
+  "   -noinit              Do not read the ~/.sqliterc file at startup\n"
   "   -nonce STRING        set the safe-mode escape nonce\n"
   "   -no-rowid-in-view    Disable rowid-in-view using sqlite3_config()\n"
   "   -nullvalue TEXT      set text string for NULL values. Default ''\n"
@@ -12327,6 +12329,7 @@ int SQLITE_CDECL wmain(int argc, wchar_t **wargv){
   int rc = 0;
   int warnInmemoryDb = 0;
   int readStdin = 1;
+  int noInit = 0;                 /* Do not read ~/.sqliterc if true */
   int nCmd = 0;
   int nOptsEnd = argc;
   int bEnableVfstrace = 0;
@@ -12577,6 +12580,8 @@ int SQLITE_CDECL wmain(int argc, wchar_t **wargv){
       data.openFlags |= SQLITE_OPEN_READONLY;
     }else if( cli_strcmp(z,"-nofollow")==0 ){
       data.openFlags |= SQLITE_OPEN_NOFOLLOW;
+    }else if( cli_strcmp(z,"-noinit")==0 ){
+      noInit = 1;
     }else if( cli_strcmp(z,"-exclusive")==0 ){  /* UNDOCUMENTED */
       data.openFlags |= SQLITE_OPEN_EXCLUSIVE;
     }else if( cli_strcmp(z,"-ifexists")==0 ){
@@ -12667,7 +12672,7 @@ int SQLITE_CDECL wmain(int argc, wchar_t **wargv){
   ** is given on the command line, look for a file named ~/.sqliterc and
   ** try to process it.
   */
-  process_sqliterc(&data,zInitFile);
+  if( !noInit ) process_sqliterc(&data,zInitFile);
 
   /* Make a second pass through the command-line argument and set
   ** options.  This second pass is delayed until after the initialization
@@ -12736,6 +12741,8 @@ int SQLITE_CDECL wmain(int argc, wchar_t **wargv){
       data.openFlags |= SQLITE_OPEN_READONLY;
     }else if( cli_strcmp(z,"-nofollow")==0 ){
       data.openFlags |= SQLITE_OPEN_NOFOLLOW;
+    }else if( cli_strcmp(z,"-noinit")==0 ){
+      /* No-op */
     }else if( cli_strcmp(z,"-exclusive")==0 ){  /* UNDOCUMENTED */
       data.openFlags |= SQLITE_OPEN_EXCLUSIVE;
     }else if( cli_strcmp(z,"-ifexists")==0 ){