-C Fix\s-DSQLITE_OS_OTHER=0\sbuilds.
-D 2025-10-02T14:48:27.422
+C In\sthe\s".open"\scommand\sof\sthe\sCLI\sif\susing\sthe\s--new\soption\swith\sa\sURI\nfilename,\sthen\sdecode\sthe\sURI\sto\sextract\sthe\sactual\sfilename\sprior\sto\ntrying\sto\sdelete\sthat\sfile.
+D 2025-10-02T18:31:19.026
F .fossil-settings/binary-glob 61195414528fb3ea9693577e1980230d78a1f8b0a54c78cf1b9b24d0a409ed6a x
F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1
F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea
F src/resolve.c f8d1d011aba0964ff1bdccd049d4d2c2fec217efd90d202a4bb775e926b2c25d
F src/rowset.c 8432130e6c344b3401a8874c3cb49fefe6873fec593294de077afea2dce5ec97
F src/select.c b95181711d59c36d9789e67f76c4cfec64b99f9629a50be5e6566e117b87d957
-F src/shell.c.in 9cfc941ea2068076bb54b10b7c18c2958bda29e9d6aa2d0e807bf4af29a8ac05
+F src/shell.c.in cb057f99dbc549ba2524b81243076d1f438403f70a7ed761ce778ae59028c0c6
F src/sqlite.h.in 5732519a2acb09066032ceac21f25996eb3f28f807a4468e30633c7c70faae1c
F src/sqlite3.rc 015537e6ac1eec6c7050e17b616c2ffe6f70fca241835a84a4f0d5937383c479
F src/sqlite3ext.h 3f0c4ed6934e7309a61c6f3c30f70a30a5b869f785bb3d9f721a36c5e4359126
F tool/warnings-clang.sh bbf6a1e685e534c92ec2bfba5b1745f34fb6f0bc2a362850723a9ee87c1b31a7
F tool/warnings.sh 1ad0169b022b280bcaaf94a7fa231591be96b514230ab5c98fbf15cd7df842dd
F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f
-P 22b2700ac20bb8e5883d484bfd0aee7a0fbc99b92696d8ca850cd129e2ccbb43
-R 399a433d692825e6557f7aa80a566057
-U dan
-Z 1d09f435c80c1e511337c9686eefb17c
+P 2971d7470110fcd43bdc8ad5d09d1f2f63f5a3bccda41810948a683e310ad908
+R 336d33ed228557f8a4572eff7757820f
+U drh
+Z 771c3346d655dc279ea944b772a8bb1f
# Remove this line to create a well-formed Fossil manifest.
return cli_strcmp(zStr, zOpt)==0;
}
+/*
+** The input zFN is guaranteed to start with "file:" and is thus a URI
+** filename. Extract the actual filename and return a pointer to that
+** filename in spaced obtained from sqlite3_malloc().
+**
+** The caller is responsible for freeing space using sqlite3_free() when
+** it has finished with the filename.
+*/
+static char *shellFilenameFromUri(const char *zFN){
+ char *zOut;
+ int i, j, d1, d2;
+
+ assert( cli_strncmp(zFN,"file:",5)==0 );
+ zOut = sqlite3_mprintf("%s", zFN+5);
+ shell_check_oom(zOut);
+ for(i=j=0; zOut[i]!=0 && zOut[i]!='?'; i++){
+ if( zOut[i]!='%' ){
+ zOut[j++] = zOut[i];
+ continue;
+ }
+ d1 = hexDigitValue(zOut[i+1]);
+ if( d1<0 ){
+ zOut[j] = 0;
+ break;
+ }
+ d2 = hexDigitValue(zOut[i+2]);
+ if( d2<0 ){
+ zOut[j] = 0;
+ break;
+ }
+ zOut[j++] = d1*16 + d2;
+ i += 2;
+ }
+ zOut[j] = 0;
+ return zOut;
+}
+
/*
** Delete a file.
*/
/* If a filename is specified, try to open it first */
if( zFN || p->openMode==SHELL_OPEN_HEXDB ){
- if( newFlag && zFN && !p->bSafeMode ) shellDeleteFile(zFN);
+ if( newFlag && zFN && !p->bSafeMode ){
+ if( cli_strncmp(zFN,"file:",5)==0 ){
+ char *zDel = shellFilenameFromUri(zFN);
+ shell_check_oom(zDel);
+ shellDeleteFile(zDel);
+ sqlite3_free(zDel);
+ }else{
+ shellDeleteFile(zFN);
+ }
+ }
#ifndef SQLITE_SHELL_FIDDLE
if( p->bSafeMode
&& p->openMode!=SHELL_OPEN_HEXDB