From: drh Date: Thu, 5 Oct 2017 19:12:10 +0000 (+0000) Subject: Fix the command-line shell so that the ".schema --indent" command does a better X-Git-Tag: version-3.21.0~27 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=c3cbd678a1480c53dec3b8f986747c6686b4dee9;p=thirdparty%2Fsqlite.git Fix the command-line shell so that the ".schema --indent" command does a better job of dealing with \r\n in the middle of a CREATE statement in the schema. FossilOrigin-Name: 4258fb578a6e75590c7314fe511ca8dc6659e5f2d3a54d8f60ff705fe51ccc92 --- diff --git a/manifest b/manifest index f6f9c47a6f..c8dcd3d77f 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Disable\sthe\sdelta\schecksum\sverification\sin\sRBU\sby\sdefault.\s\sReenable\sit\susing\n-DRBU_ENABLE_DELTA_CKSUM,\sif\sdesired. -D 2017-10-05T11:29:37.874 +C Fix\sthe\scommand-line\sshell\sso\sthat\sthe\s".schema\s--indent"\scommand\sdoes\sa\sbetter\njob\sof\sdealing\swith\s\\r\\n\sin\sthe\smiddle\sof\sa\sCREATE\sstatement\sin\sthe\sschema. +D 2017-10-05T19:12:10.083 F Makefile.in 4bc36d913c2e3e2d326d588d72f618ac9788b2fd4b7efda61102611a6495c3ff F Makefile.linux-gcc 7bc79876b875010e8c8f9502eb935ca92aa3c434 F Makefile.msc 6033b51b6aea702ea059f6ab2d47b1d3cef648695f787247dd4fb395fe60673f @@ -459,8 +459,8 @@ F src/random.c 80f5d666f23feb3e6665a6ce04c7197212a88384 F src/resolve.c 4324a94573b1e29286f8121e4881db59eaedc014afeb274c8d3e07ed282e0e20 F src/rowset.c 7b7e7e479212e65b723bf40128c7b36dc5afdfac F src/select.c 42aca61e739c405ddd8a1b702977a7743c7d52a94885f7c5596bd7e73e6bff18 -F src/shell.c c1206a23d9239f8f51751d3be9b8c3b02fa4103546bea1add7f864d84a8276ab -F src/shell.c.in bb9720a8c5c98d3984b16ab7540e7142bcae959666ecf248bfc523a1d44220ee +F src/shell.c cbf450e75665a185c546adc702ec5fd091306ae7a08bc88b1508ac9c11acc7fe +F src/shell.c.in e03f7d473e10b65c25836a058a3e7a1665ffb1fe712949dcd6e38c790e4eafd0 F src/sqlite.h.in ab4f8a29d1580dfaeb6891fa1b83cff8229ba0daa56994707ceaca71495d9ab7 F src/sqlite3.rc 5121c9e10c3964d5755191c80dd1180c122fc3a8 F src/sqlite3ext.h a1fd3aa82f967da436164e0728a7d6841651fd0c6e27b9044e0eb9f6c8462e47 @@ -1655,7 +1655,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 40964a4ef7565ea0ddf452f48cb22373d068528e07d40eefc008f2231c969422 -R 56c4429917e25e309d2b170a348071dc +P d22c99b6ba997179ef3ccd341d9c36d5213d699305d15942d82587a0bfd16f9d +R 275813642399adb31ada00e2bf9958bd U drh -Z 02d9f9a2aecdfad7c3d7a847ab2e4ae9 +Z f0605b7334559ebfe51c1e99fb005c13 diff --git a/manifest.uuid b/manifest.uuid index 62bdb52227..bfe1bbba34 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -d22c99b6ba997179ef3ccd341d9c36d5213d699305d15942d82587a0bfd16f9d \ No newline at end of file +4258fb578a6e75590c7314fe511ca8dc6659e5f2d3a54d8f60ff705fe51ccc92 \ No newline at end of file diff --git a/src/shell.c b/src/shell.c index 6a19e3610a..f7be941570 100644 --- a/src/shell.c +++ b/src/shell.c @@ -2773,6 +2773,7 @@ static int shell_callback( for(i=0; IsSpace(z[i]); i++){} for(; (c = z[i])!=0; i++){ if( IsSpace(c) ){ + if( z[j-1]=='\r' ) z[j-1] = '\n'; if( IsSpace(z[j-1]) || z[j-1]=='(' ) continue; }else if( (c=='(' || c==')') && j>0 && IsSpace(z[j-1]) ){ j--; diff --git a/src/shell.c.in b/src/shell.c.in index 82680d484c..db4f2e1128 100644 --- a/src/shell.c.in +++ b/src/shell.c.in @@ -1413,6 +1413,7 @@ static int shell_callback( for(i=0; IsSpace(z[i]); i++){} for(; (c = z[i])!=0; i++){ if( IsSpace(c) ){ + if( z[j-1]=='\r' ) z[j-1] = '\n'; if( IsSpace(z[j-1]) || z[j-1]=='(' ) continue; }else if( (c=='(' || c==')') && j>0 && IsSpace(z[j-1]) ){ j--;