From: larrybr Date: Tue, 2 May 2023 19:33:27 +0000 (+0000) Subject: Give CLI quoted args hex escapes (as documented.) X-Git-Tag: version-3.42.0~53^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=refs%2Fheads%2Fcli-hex-escape;p=thirdparty%2Fsqlite.git Give CLI quoted args hex escapes (as documented.) FossilOrigin-Name: 90e434a6ae370a35109802fc336b98298d345f3d23125ef2cc68c31d8e69bb50 --- diff --git a/manifest b/manifest index f9c673affa..fca5ae88ea 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Cure\sCLI\shang\son\s.import\swith\shigh-ASCII\scolumn\sseparator. -D 2023-05-02T18:03:25.907 +C Give\sCLI\squoted\sargs\shex\sescapes\s(as\sdocumented.) +D 2023-05-02T19:33:27.498 F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea F LICENSE.md df5091916dbb40e6e9686186587125e1b2ff51f022cc334e886c19a0e9982724 @@ -636,7 +636,7 @@ F src/random.c 606b00941a1d7dd09c381d3279a058d771f406c5213c9932bbd93d5587be4b9c F src/resolve.c 3e53e02ce87c9582bd7e7d22f13f4094a271678d9dc72820fa257a2abb5e4032 F src/rowset.c ba9515a922af32abe1f7d39406b9d35730ed65efab9443dc5702693b60854c92 F src/select.c f879cef11c462a2c37a8c906932781e384c3bb32042c355a704a043029c90d27 -F src/shell.c.in a835e8b580b771ed5a3cbaf7406b831dee4c9fc9b2bddd133c94c90ff9e2a9ba +F src/shell.c.in 2c462effd2cc970bd528c7dd5bc740b4ea24dac62c8269f00aed1901335ba39b F src/sqlite.h.in d6b0b83b2deab8f92ef7cc6f6fb94fa59d21c59f7b55f4c693bfff161ce42238 F src/sqlite3.rc 5121c9e10c3964d5755191c80dd1180c122fc3a8 F src/sqlite3ext.h da473ce2b3d0ae407a6300c4a164589b9a6bfdbec9462688a8593ff16f3bb6e4 @@ -1500,7 +1500,7 @@ F test/sharedA.test 64bdd21216dda2c6a3bd3475348ccdc108160f34682c97f2f51c19fc0e21 F test/sharedB.test 1a84863d7a2204e0d42f2e1606577c5e92e4473fa37ea0f5bdf829e4bf8ee707 F test/shared_err.test 32634e404a3317eeb94abc7a099c556a346fdb8fb3858dbe222a4cbb8926a939 F test/sharedlock.test 5ede3c37439067c43b0198f580fd374ebf15d304 -F test/shell1.test 291c5c4b313adbe44d847af78b730a3bbfa1598c450e09ffe5601170bf7f28e7 +F test/shell1.test 300b77328aaafb9f3e7a53a26e4162fbf92181d92251d259ff105a2275ff998d F test/shell2.test 09a202f57e7cd99788537f763e0845796a173fcea06a0d199a08d69446fe1daf F test/shell3.test 91febeac0412812bf6370abb8ed72700e32bf8f9878849414518f662dfd55e8a F test/shell4.test 9abd0c12a7e20a4c49e84d5be208d2124fa6c09e728f56f1f4bee0f02853935f @@ -2068,8 +2068,11 @@ F vsixtest/vsixtest.tcl 6a9a6ab600c25a91a7acc6293828957a386a8a93 F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0 -P 6bee0a19e2efb6e39097fb22602556791d3d3962c50a1a0471c39a0c61db632e -R cedc5713e8adb684ab4577dbf72daabf +P aac8ac631de5c5b439c48c13f5fd271d76c11b1a5fd0919dfe4506ef7725f5ab +R 61a0707faa27c9f2a615e39c3eb91b1c +T *branch * cli-hex-escape +T *sym-cli-hex-escape * +T -sym-trunk * U larrybr -Z 10156d687667290729862638bd5abda0 +Z fb17004bd6ff087d69821cbf74a7ae8f # Remove this line to create a well-formed Fossil manifest. diff --git a/manifest.uuid b/manifest.uuid index 26639eef12..2b597bb0fd 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -aac8ac631de5c5b439c48c13f5fd271d76c11b1a5fd0919dfe4506ef7725f5ab \ No newline at end of file +90e434a6ae370a35109802fc336b98298d345f3d23125ef2cc68c31d8e69bb50 \ No newline at end of file diff --git a/src/shell.c.in b/src/shell.c.in index 3fcd3e4a59..896139356b 100644 --- a/src/shell.c.in +++ b/src/shell.c.in @@ -5599,6 +5599,7 @@ static void linenoise_completion(const char *zLine, linenoiseCompletions *lc){ ** \' -> ' ** \\ -> backslash ** \NNN -> ascii character NNN in octal +** \xHH -> ascii character HH in hexadecimal */ static void resolve_backslashes(char *z){ int i, j; @@ -5627,6 +5628,15 @@ static void resolve_backslashes(char *z){ c = '\''; }else if( c=='\\' ){ c = '\\'; + }else if( c=='x' ){ + int nhd = 0, hdv; + u8 hv = 0; + while( nhd<2 && (c=z[i+1+nhd])!=0 && (hdv=hexDigitValue(c))>=0 ){ + hv = (u8)((hv<<4)|hdv); + ++nhd; + } + i += nhd; + c = (u8)hv; }else if( c>='0' && c<='7' ){ c -= '0'; if( z[i+1]>='0' && z[i+1]<='7' ){ diff --git a/test/shell1.test b/test/shell1.test index 7a32c7b1bb..d017379107 100644 --- a/test/shell1.test +++ b/test/shell1.test @@ -254,6 +254,11 @@ do_test shell1-2.4.2 { catchcmd "test.db" ".mode \"csv\"" } {0 {}} +# check that certain quoted arg escapes work +do_test shell1-2.5.1 { + catchcmd ":memory:" ".print \"\\060\\077 \\x3f\\x30 \\a\\t\"" +} [list 0 "0? ?0 \a\t"] + #---------------------------------------------------------------------------- # Test cases shell1-3.*: Basic test that "dot" command can be called.