diff --git a/manifest b/manifest index 58254a2b1c..f4ec6d1cde 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C :-)\s(CVS\s98) -D 2000-06-15T15:57:23 +C :-)\s(CVS\s99) +D 2000-06-15T16:49:49 F COPYRIGHT 74a8a6531a42e124df07ab5599aad63870fa0bd4 F Makefile.in 4dc16840f68e3b599915e1ec8463d365474dd286 F README 51f6a4e7408b34afa5bc1c0485f61b6a4efb6958 @@ -15,7 +15,7 @@ F src/insert.c ac4edfff474589c00b2490f206317dc5822122e5 F src/main.c e3297835b8e38ca726ac73f2c2bdb7cf08103197 F src/parse.y 6a3085fd8e2c477e73468e6d1a278cb72254c0c9 F src/select.c 3a12d76074fa57d7c39c4436bdeb8d7e1eb6fdf4 -F src/shell.c 082feaeb8815c0521b6dfad451aefddb98b694f2 +F src/shell.c 78a35607a88b3d557e1666ae9d0c2c03cbb3553e F src/sqlite.h 58da0a8590133777b741f9836beaef3d58f40268 F src/sqliteInt.h 19954bd2f75632849b265b9d7163a67391ec5148 F src/tclsqlite.c 9f358618ae803bedf4fb96da5154fd45023bc1f7 @@ -64,7 +64,7 @@ F www/index.tcl 4116afce6a8c63d68882d2b00aa10b079e0129cd F www/lang.tcl 1645e9107d75709be4c6099b643db235bbe0a151 F www/opcode.tcl 3cdc4bb2515fcfcbe853e3f0c91cd9199e82dadd F www/sqlite.tcl 5420eab24b539928f80ea9b3088e2549d34f438d -P 3b9689cc35acd3008ca32b6b9882f4e625381c6e -R d21be2d1bea392ba1ec68d7cba7fe995 +P f26d0cdf45221a8fc97253c2a1939e79ae866fc9 +R 3d6fd2505d53920665c06f6bc8a3f7f8 U drh -Z 5039ec205aa1fc0411a39151197585a9 +Z 2f294d1f9fc8c0dea244e0fb7909addf diff --git a/manifest.uuid b/manifest.uuid index 5c60b3ebff..84c6bdd81e 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -f26d0cdf45221a8fc97253c2a1939e79ae866fc9 \ No newline at end of file +ac38f460c8f5b9e5bb9d3cf2549f1787055f05cf \ No newline at end of file diff --git a/src/shell.c b/src/shell.c index f1fc9f58c0..e3bf5e9645 100644 --- a/src/shell.c +++ b/src/shell.c @@ -24,7 +24,7 @@ ** This file contains code to implement the "sqlite" command line ** utility for accessing SQLite databases. ** -** $Id: shell.c,v 1.13 2000/06/15 15:57:23 drh Exp $ +** $Id: shell.c,v 1.14 2000/06/15 16:49:49 drh Exp $ */ #include #include @@ -205,6 +205,28 @@ static void output_quoted_string(FILE *out, const char *z){ } } +/* +** Output the given string with characters that are special to +** HTML escaped. +*/ +static void output_html_string(FILE *out, const char *z){ + int i; + while( *z ){ + for(i=0; z[i] && z[i]!='<' && z[i]!='&'; i++){} + if( i>0 ){ + fprintf(out,"%.*s",i,z); + } + if( z[i]=='<' ){ + fprintf(out,"<"); + }else if( z[i]=='&' ){ + fprintf(out,"&"); + }else{ + break; + } + z += i + 1; + } +} + /* ** This is the callback routine that the SQLite library ** invokes for each row of a query result. @@ -290,7 +312,9 @@ static int callback(void *pArg, int nArg, char **azArg, char **azCol){ } fprintf(p->out,""); for(i=0; iout,"%s",azArg[i] ? azArg[i] : ""); + fprintf(p->out,""); + output_html_string(p->out, azArg[i] ? azArg[i] : ""); + fprintf(p->out,"\n"); } fprintf(p->out,"\n"); break; @@ -352,6 +376,7 @@ static char zHelp[] = ".indices TABLE Show names of all indices on TABLE\n" ".mode MODE Set mode to one of \"line\", \"column\", " "\"list\", or \"html\"\n" + ".mode insert TABLE Generate SQL insert statements for TABLE\n" ".output FILENAME Send output to FILENAME\n" ".output stdout Send output to the screen\n" ".schema ?TABLE? Show the CREATE statements\n"