From: shane Date: Wed, 21 Oct 2009 14:11:48 +0000 (+0000) Subject: Modified shell to call output_html_string() for header values in .mode html. X-Git-Tag: fts3-refactor~72 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=43d9cb2c94c4bae0ade2e790cc05d48f64197dcd;p=thirdparty%2Fsqlite.git Modified shell to call output_html_string() for header values in .mode html. Updated output_html_string() to support the 5 basic HTML entities (<,>,&,',"). Ticket [dc3a6e5b31]. FossilOrigin-Name: c8815fcd88d17b2864e689c84eb8a63ef242ff04 --- diff --git a/manifest b/manifest index a044795ceb..3277e39692 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Made\sdetectSchemaProblem\sfunction\sand\saSchemaTable\sarray\sstatic.\sTicket\s[6f8b0c5855]. -D 2009-10-21T13:53:58 +C Modified\sshell\sto\scall\soutput_html_string()\sfor\sheader\svalues\sin\s.mode\shtml.\nUpdated\soutput_html_string()\sto\ssupport\sthe\s5\sbasic\sHTML\sentities\s(<,>,&,',").\nTicket\s[dc3a6e5b31]. +D 2009-10-21T14:11:49 F Makefile.arm-wince-mingw32ce-gcc fcd5e9cd67fe88836360bb4f9ef4cb7f8e2fb5a0 F Makefile.in 4ca3f1dd6efa2075bcb27f4dc43eef749877740d F Makefile.linux-gcc d53183f4aa6a9192d249731c90dbdffbd2c68654 @@ -161,7 +161,7 @@ F src/random.c 676b9d7ac820fe81e6fb2394ac8c10cff7f38628 F src/resolve.c 3ac31c7181fab03732125fdedf7c2091a5c07f1b F src/rowset.c c64dafba1f9fd876836c8db8682966b9d197eb1f F src/select.c cbe366a0ce114856e66f5daf0f848d7c48a88298 -F src/shell.c 9b242f44d9c37a89b7cbc0459daf4fb3c8f1f169 +F src/shell.c 9a9fab0d54332c7e20876286dc48a145fd9dd462 F src/sqlite.h.in 2643b0946d2564a05088e656e0740863d55a02ea F src/sqlite3ext.h 1db7d63ab5de4b3e6b83dd03d1a4e64fef6d2a17 F src/sqliteInt.h 3b00a3ce79e60c5a47c342b738c8b75013f3ec84 @@ -761,7 +761,7 @@ F tool/speedtest2.tcl ee2149167303ba8e95af97873c575c3e0fab58ff F tool/speedtest8.c 2902c46588c40b55661e471d7a86e4dd71a18224 F tool/speedtest8inst1.c 293327bc76823f473684d589a8160bde1f52c14e F tool/vdbe-compress.tcl d70ea6d8a19e3571d7ab8c9b75cba86d1173ff0f -P 8a8eeb0c5af4bbeafd9864b03557eb9cd32f09ce -R 935a094368cd345415b98c2f2b23e93d +P c6f22f3e38018246a2add1a509aa6c5c55b7e0be +R c9cac35396ade96c4c2aae2d1ecbde46 U shane -Z 9b47c2c796964563350fc17fec51b2ab +Z bee4e4d5e09912cf13ef82493f9c4b10 diff --git a/manifest.uuid b/manifest.uuid index 85f5c8397d..8bc38aadfb 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -c6f22f3e38018246a2add1a509aa6c5c55b7e0be \ No newline at end of file +c8815fcd88d17b2864e689c84eb8a63ef242ff04 \ No newline at end of file diff --git a/src/shell.c b/src/shell.c index 48e2f11e26..90f933bec5 100644 --- a/src/shell.c +++ b/src/shell.c @@ -1384,7 +1384,13 @@ static void output_c_string(FILE *out, const char *z){ static void output_html_string(FILE *out, const char *z){ int i; while( *z ){ - for(i=0; z[i] && z[i]!='<' && z[i]!='&'; i++){} + for(i=0; z[i] + && z[i]!='<' + && z[i]!='&' + && z[i]!='>' + && z[i]!='\"' + && z[i]!='\''; + i++){} if( i>0 ){ fprintf(out,"%.*s",i,z); } @@ -1392,6 +1398,12 @@ static void output_html_string(FILE *out, const char *z){ fprintf(out,"<"); }else if( z[i]=='&' ){ fprintf(out,"&"); + }else if( z[i]=='>' ){ + fprintf(out,">"); + }else if( z[i]=='\"' ){ + fprintf(out,"""); + }else if( z[i]=='\'' ){ + fprintf(out,"'"); }else{ break; } @@ -1572,7 +1584,9 @@ static int callback(void *pArg, int nArg, char **azArg, char **azCol){ if( p->cnt++==0 && p->showHeader ){ fprintf(p->out,""); for(i=0; iout,"%s",azCol[i]); + fprintf(p->out,""); + output_html_string(p->out, azCol[i]); + fprintf(p->out,"\n"); } fprintf(p->out,"\n"); }