From: drh <> Date: Sun, 16 Nov 2025 02:32:06 +0000 (+0000) Subject: Fix a problem with the new command-line parsing in the CLI. X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4dc404cef4f124bffa9b2491d327ae43d093caa3;p=thirdparty%2Fsqlite.git Fix a problem with the new command-line parsing in the CLI. FossilOrigin-Name: 3e02804c387c89afde59eef8e464c6011e083e158873e4f8ab1f17bcc12b7c28 --- diff --git a/manifest b/manifest index d97ad9c922..359cd72211 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Improved\s--safe\smode\sdefenses.\s\sFix\sa\stest\scase\serror. -D 2025-11-16T01:34:01.562 +C Fix\sa\sproblem\swith\sthe\snew\scommand-line\sparsing\sin\sthe\sCLI. +D 2025-11-16T02:32:06.514 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 eff75b6dc40d8dfa4a030a439d7cfa5e0e02d77d867f3f52384d58d07b37460b +F src/shell.c.in d5061f93c48631db375f840d5a2f285721d5fa199a20b1502123992f933aadb5 F src/sqlite.h.in 795ce84cc136b4e74d882cf4fab56d2927c20b9af9fd2fcea27760a6fe50851b F src/sqlite3.rc 015537e6ac1eec6c7050e17b616c2ffe6f70fca241835a84a4f0d5937383c479 F src/sqlite3ext.h 5d5330f5f8461f5ce74960436ddcfa53ecd09c2b8b23901e22ae38aec3243998 @@ -2176,8 +2176,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 4d774ee495e38282b8701988fe514344ee0e81285692c8d1adc1ee7e22960ad9 -R c4d15b800fc1c75eb6a38fec8ce701a3 +P eacc9db80de8baa878ebdc3a054538c8998db9a2e46720c0d8b109d62a0cac29 +R 450d5c3fe2f33369a4fbfa48f61bccbe U drh -Z 7f8fd796cbf55d5f3557e7ec4c2e1cff +Z ba61afd99c07012ae48b06245fa4f0b1 # Remove this line to create a well-formed Fossil manifest. diff --git a/manifest.uuid b/manifest.uuid index e325b35c47..ea82fadf49 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -eacc9db80de8baa878ebdc3a054538c8998db9a2e46720c0d8b109d62a0cac29 +3e02804c387c89afde59eef8e464c6011e083e158873e4f8ab1f17bcc12b7c28 diff --git a/src/shell.c.in b/src/shell.c.in index 9de001b1ef..ba7a4f4e5d 100644 --- a/src/shell.c.in +++ b/src/shell.c.in @@ -8050,6 +8050,15 @@ dotCmdOutput_error: ** Parse input line zLine up into individual arguments. Retain the ** parse in the p->dot substructure. */ +static void parseDotRealloc(ShellState *p, int nArg){ + p->dot.nAlloc = nArg+22; + p->dot.azArg = realloc(p->dot.azArg,p->dot.nAlloc*sizeof(char*)); + shell_check_oom(p->dot.azArg); + p->dot.aiOfst = realloc(p->dot.aiOfst,p->dot.nAlloc*sizeof(int)); + shell_check_oom(p->dot.aiOfst); + p->dot.abQuot = realloc(p->dot.abQuot,p->dot.nAlloc); + shell_check_oom(p->dot.abQuot); +} static void parseDotCmdArgs(const char *zLine, ShellState *p){ char *z; int h = 1; @@ -8059,17 +8068,12 @@ static void parseDotCmdArgs(const char *zLine, ShellState *p){ free(p->dot.zCopy); z = p->dot.zCopy = strdup(zLine); shell_check_oom(z); + parseDotRealloc(p, 2); while( z[h] ){ while( IsSpace(z[h]) ){ h++; } if( z[h]==0 ) break; if( nArg+2>p->dot.nAlloc ){ - p->dot.nAlloc = nArg+22; - p->dot.azArg = realloc(p->dot.azArg,p->dot.nAlloc*sizeof(char*)); - shell_check_oom(p->dot.azArg); - p->dot.aiOfst = realloc(p->dot.aiOfst,p->dot.nAlloc*sizeof(int)); - shell_check_oom(p->dot.aiOfst); - p->dot.abQuot = realloc(p->dot.abQuot,p->dot.nAlloc); - shell_check_oom(p->dot.abQuot); + parseDotRealloc(p, nArg); } if( z[h]=='\'' || z[h]=='"' ){ int delim = z[h++];