]> git.ipfire.org Git - thirdparty/sqlite.git/commitdiff
:-) (CVS 99)
authordrh <drh@noemail.net>
Thu, 15 Jun 2000 16:49:48 +0000 (16:49 +0000)
committerdrh <drh@noemail.net>
Thu, 15 Jun 2000 16:49:48 +0000 (16:49 +0000)
FossilOrigin-Name: ac38f460c8f5b9e5bb9d3cf2549f1787055f05cf

manifest
manifest.uuid
src/shell.c

index 58254a2b1c938ec4192e6c919d7c27234423d642..f4ec6d1cde0a3d9b279c1a54bfaee5ad4b91eb20 100644 (file)
--- 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
index 5c60b3ebff1daf3f6b14a596eed8cc3e076863c8..84c6bdd81e333e632b7adab4ebd2dabd0d10d8ac 100644 (file)
@@ -1 +1 @@
-f26d0cdf45221a8fc97253c2a1939e79ae866fc9
\ No newline at end of file
+ac38f460c8f5b9e5bb9d3cf2549f1787055f05cf
\ No newline at end of file
index f1fc9f58c0659a34a9d720864911b1060fb02cca..e3bf5e96458821109ba3b54d3d108fd8eebb2150 100644 (file)
@@ -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 <stdlib.h>
 #include <string.h>
@@ -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,"&lt;");
+    }else if( z[i]=='&' ){
+      fprintf(out,"&amp;");
+    }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,"<TR>");
       for(i=0; i<nArg; i++){
-        fprintf(p->out,"<TD>%s</TD>",azArg[i] ? azArg[i] : "");
+        fprintf(p->out,"<TD>");
+        output_html_string(p->out, azArg[i] ? azArg[i] : "");
+        fprintf(p->out,"</TD>\n");
       }
       fprintf(p->out,"</TD></TR>\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"