From: drh Date: Fri, 21 Dec 2018 22:11:37 +0000 (+0000) Subject: Update the dbtotxt utility program so that it does not output characters that X-Git-Tag: version-3.27.0~268 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=a86c8ce9403c3575e08b02d856612a6dfbbb66b6;p=thirdparty%2Fsqlite.git Update the dbtotxt utility program so that it does not output characters that are special to TCL, thus making the output of dbtotxt easier to insert into test scripts. FossilOrigin-Name: 48438bb35b48955a1df83ef90f0ef6c9cfed0b16d2e938f36d74ad9d53b4b5b4 --- diff --git a/manifest b/manifest index 99bc7a55a1..4b1f9d96bd 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Improved\sdetection\sof\sshadow\stable\scorruption\sin\sRTREE. -D 2018-12-21T22:08:59.777 +C Update\sthe\sdbtotxt\sutility\sprogram\sso\sthat\sit\sdoes\snot\soutput\scharacters\sthat\nare\sspecial\sto\sTCL,\sthus\smaking\sthe\soutput\sof\sdbtotxt\seasier\sto\sinsert\sinto\ntest\sscripts. +D 2018-12-21T22:11:37.526 F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea F Makefile.in d8b254f8bb81bab43c340d70d17dc3babab40fcc8a348c8255881f780a45fee6 @@ -1699,7 +1699,7 @@ F tool/build-shell.sh 950f47c6174f1eea171319438b93ba67ff5bf367 F tool/cg_anno.tcl f95b0006c52cf7f0496b506343415b6ee3cdcdd3 x F tool/checkSpacing.c 810e51703529a204fc4e1eb060e9ab663e3c06d2 F tool/dbhash.c a06228aa21ebc4e6ea8daa486601d938499238a5 -F tool/dbtotxt.c 1655f60fd7b24a3e7a25d01cdb3a6a4785f30112213b08ff83a27ae7ef2dd13e +F tool/dbtotxt.c 249536df1f4b540b275d3e20fbe1421e28e5a92db3498c0fb065d88b60bf6eb8 F tool/dbtotxt.md c9a57af8739957ef36d2cfad5c4b1443ff3688ed33e4901ee200c8b651f43f3c F tool/extract.c 054069d81b095fbdc189a6f5d4466e40380505e2 F tool/fast_vacuum.c 5ba0d6f5963a0a63bdc42840f678bad75b2ebce1 @@ -1791,7 +1791,7 @@ F vsixtest/vsixtest.tcl 6a9a6ab600c25a91a7acc6293828957a386a8a93 F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0 -P da587d18575ac06a6b65fec1d106f0cc65bc10f493ca6c6b99117a2162d15a52 -R 248bca4ac4fc95678d2d785205706e52 +P b39bf4356e6bcf1d8442721d6cbbfe06caba01325104fb469da8fe69e1f623a2 +R 3408a85b9c4129beca4542bd35c340d6 U drh -Z 13f01e556de62866a8c0edd7feaff34e +Z a34a043ff225af5ec4da7a2cecb32954 diff --git a/manifest.uuid b/manifest.uuid index 82982bfc4b..5ee71b60c7 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -b39bf4356e6bcf1d8442721d6cbbfe06caba01325104fb469da8fe69e1f623a2 \ No newline at end of file +48438bb35b48955a1df83ef90f0ef6c9cfed0b16d2e938f36d74ad9d53b4b5b4 \ No newline at end of file diff --git a/tool/dbtotxt.c b/tool/dbtotxt.c index f28e209ce2..98a8cdc6f8 100644 --- a/tool/dbtotxt.c +++ b/tool/dbtotxt.c @@ -27,6 +27,7 @@ #include #include #include +#include /* Return true if the line is all zeros */ static int allZero(unsigned char *aLine){ @@ -47,6 +48,11 @@ int main(int argc, char **argv){ int iPage; /* Current page number */ unsigned char aLine[16]; /* A single line of the file */ unsigned char aHdr[100]; /* File header */ + unsigned char bShow[256]; /* Characters ok to display */ + memset(bShow, '.', sizeof(bShow)); + for(i=' '; i<='~'; i++){ + if( i!='{' && i!='}' && i!='"' && i!='\\' ) bShow[i] = i; + } for(i=1; i=0x20 && c<=0x7e ? c : '.', stdout); + unsigned char c = (unsigned char)aLine[j]; + fputc( bShow[c], stdout); } fputc('\n', stdout); }