]> git.ipfire.org Git - thirdparty/sqlite.git/commitdiff
In the CLI, quote strings that contain the separator character.
authordrh <drh@noemail.net>
Tue, 18 Dec 2007 15:41:44 +0000 (15:41 +0000)
committerdrh <drh@noemail.net>
Tue, 18 Dec 2007 15:41:44 +0000 (15:41 +0000)
Ticket #2850. (CVS 4638)

FossilOrigin-Name: 493a17c46a66d2febc11205c052bf949a3f22bd8

manifest
manifest.uuid
src/shell.c

index 2961ccc86b8d4bee6a066c24fbb65f167264258c..520735ab6d65b3e2e9d5248dd0b3024e27e1ade0 100644 (file)
--- a/manifest
+++ b/manifest
@@ -1,5 +1,5 @@
-C Fix\sfor\stypo\sin\smain.mk:\sthe\soutput\sof\starget\ssqlite3\swas\stestcli.\s(CVS\s4637)
-D 2007-12-18T11:19:36
+C In\sthe\sCLI,\squote\sstrings\sthat\scontain\sthe\sseparator\scharacter.\nTicket\s#2850.\s(CVS\s4638)
+D 2007-12-18T15:41:44
 F Makefile.arm-wince-mingw32ce-gcc ac5f7b2cef0cd850d6f755ba6ee4ab961b1fadf7
 F Makefile.in 30789bf70614bad659351660d76b8e533f3340e9
 F Makefile.linux-gcc d53183f4aa6a9192d249731c90dbdffbd2c68654
@@ -133,7 +133,7 @@ F src/printf.c eb27822ba2eec669161409ca31279a24c26ac910
 F src/random.c 4a22746501bf36b0a088c66e38dde5daba6a35da
 F src/select.c 5a137027415a74e950603baddbbcbe9d3f8bc5a5
 F src/server.c 087b92a39d883e3fa113cae259d64e4c7438bc96
-F src/shell.c c97be281cfc3dcb14902f45e4b16f20038eb83ff
+F src/shell.c 77895a54c2082157e169c857a2e244525ec25af7
 F src/sqlite.h.in 2a7e3776534bbe6ff2cdc058f3abebe91e7e429f
 F src/sqlite3ext.h a93f59cdee3638dc0c9c086f80df743a4e68c3cb
 F src/sqliteInt.h 445530263725d19d6315f137f234aea08ad59303
@@ -600,7 +600,7 @@ F www/tclsqlite.tcl 8be95ee6dba05eabcd27a9d91331c803f2ce2130
 F www/vdbe.tcl 87a31ace769f20d3627a64fa1fade7fed47b90d0
 F www/version3.tcl 890248cf7b70e60c383b0e84d77d5132b3ead42b
 F www/whentouse.tcl fc46eae081251c3c181bd79c5faef8195d7991a5
-P 07aeca3b9c51e538ba7939950a970f62e51bd3ea
-R d2b6f10127f038ee449d534d56b54663
-U danielk1977
-Z ea06aba96818072332bedca968603b4d
+P 15675dc518dbcf2ce2daa0bbcaf8daf3329ead75
+R 7df473269d55337eaf1c2164ee79279e
+U drh
+Z 17ffea682be2dd31aa5472716e6a62a2
index f0ffc05c9508c4966276dcd823a637a6d74b51a9..abdf081f9bf6722b85804ec8169483eb0dc008ed 100644 (file)
@@ -1 +1 @@
-15675dc518dbcf2ce2daa0bbcaf8daf3329ead75
\ No newline at end of file
+493a17c46a66d2febc11205c052bf949a3f22bd8
\ No newline at end of file
index a4b76f0f6599dc9bac60dd3281c1d7e8b375974d..9c1babcdb8ab893e7e82bebfdd08a1cd172f0214 100644 (file)
@@ -12,7 +12,7 @@
 ** This file contains code to implement the "sqlite" command line
 ** utility for accessing SQLite databases.
 **
-** $Id: shell.c,v 1.170 2007/11/26 22:54:27 drh Exp $
+** $Id: shell.c,v 1.171 2007/12/18 15:41:44 drh Exp $
 */
 #include <stdlib.h>
 #include <string.h>
@@ -469,8 +469,11 @@ static void output_csv(struct callback_data *p, const char *z, int bSep){
     fprintf(out,"%s",p->nullvalue);
   }else{
     int i;
+    int nSep = strlen(p->separator);
     for(i=0; z[i]; i++){
-      if( needCsvQuote[((unsigned char*)z)[i]] ){
+      if( needCsvQuote[((unsigned char*)z)[i]] 
+         || (z[i]==p->separator[0] && 
+             (nSep==1 || memcmp(z, p->separator, nSep)==0)) ){
         i = 0;
         break;
       }