Fossil SCM
Ignore unfinalized statements when shutting down the SQLite command-line shell. Ticket [891cd78969e03ec3009].
Commit
31f5b295fafdd3a50f4a87d92a5469fadd072a3e
Parent
57f374a7f4062db…
1 file changed
+6
-6
+6
-6
| --- src/shell.c | ||
| +++ src/shell.c | ||
| @@ -36,14 +36,18 @@ | ||
| 36 | 36 | |
| 37 | 37 | #ifdef __OS2__ |
| 38 | 38 | # include <unistd.h> |
| 39 | 39 | #endif |
| 40 | 40 | |
| 41 | +#ifdef HAVE_EDITLINE | |
| 42 | +# include <editline/editline.h> | |
| 43 | +#endif | |
| 41 | 44 | #if defined(HAVE_READLINE) && HAVE_READLINE==1 |
| 42 | 45 | # include <readline/readline.h> |
| 43 | 46 | # include <readline/history.h> |
| 44 | -#else | |
| 47 | +#endif | |
| 48 | +#if !defined(HAVE_EDITLINE) && (!defined(HAVE_READLINE) || HAVE_READLINE!=1) | |
| 45 | 49 | # define readline(p) local_getline(p,stdin) |
| 46 | 50 | # define add_history(X) |
| 47 | 51 | # define read_history(X) |
| 48 | 52 | # define write_history(X) |
| 49 | 53 | # define stifle_history(X) |
| @@ -2727,13 +2731,9 @@ | ||
| 2727 | 2731 | rc = process_input(&data, stdin); |
| 2728 | 2732 | } |
| 2729 | 2733 | } |
| 2730 | 2734 | set_table_name(&data, 0); |
| 2731 | 2735 | if( data.db ){ |
| 2732 | - if( sqlite3_close(data.db)!=SQLITE_OK ){ | |
| 2733 | - fprintf(stderr,"Error: cannot close database \"%s\"\n", | |
| 2734 | - sqlite3_errmsg(db)); | |
| 2735 | - rc++; | |
| 2736 | - } | |
| 2736 | + sqlite3_close(data.db); | |
| 2737 | 2737 | } |
| 2738 | 2738 | return rc; |
| 2739 | 2739 | } |
| 2740 | 2740 |
| --- src/shell.c | |
| +++ src/shell.c | |
| @@ -36,14 +36,18 @@ | |
| 36 | |
| 37 | #ifdef __OS2__ |
| 38 | # include <unistd.h> |
| 39 | #endif |
| 40 | |
| 41 | #if defined(HAVE_READLINE) && HAVE_READLINE==1 |
| 42 | # include <readline/readline.h> |
| 43 | # include <readline/history.h> |
| 44 | #else |
| 45 | # define readline(p) local_getline(p,stdin) |
| 46 | # define add_history(X) |
| 47 | # define read_history(X) |
| 48 | # define write_history(X) |
| 49 | # define stifle_history(X) |
| @@ -2727,13 +2731,9 @@ | |
| 2727 | rc = process_input(&data, stdin); |
| 2728 | } |
| 2729 | } |
| 2730 | set_table_name(&data, 0); |
| 2731 | if( data.db ){ |
| 2732 | if( sqlite3_close(data.db)!=SQLITE_OK ){ |
| 2733 | fprintf(stderr,"Error: cannot close database \"%s\"\n", |
| 2734 | sqlite3_errmsg(db)); |
| 2735 | rc++; |
| 2736 | } |
| 2737 | } |
| 2738 | return rc; |
| 2739 | } |
| 2740 |
| --- src/shell.c | |
| +++ src/shell.c | |
| @@ -36,14 +36,18 @@ | |
| 36 | |
| 37 | #ifdef __OS2__ |
| 38 | # include <unistd.h> |
| 39 | #endif |
| 40 | |
| 41 | #ifdef HAVE_EDITLINE |
| 42 | # include <editline/editline.h> |
| 43 | #endif |
| 44 | #if defined(HAVE_READLINE) && HAVE_READLINE==1 |
| 45 | # include <readline/readline.h> |
| 46 | # include <readline/history.h> |
| 47 | #endif |
| 48 | #if !defined(HAVE_EDITLINE) && (!defined(HAVE_READLINE) || HAVE_READLINE!=1) |
| 49 | # define readline(p) local_getline(p,stdin) |
| 50 | # define add_history(X) |
| 51 | # define read_history(X) |
| 52 | # define write_history(X) |
| 53 | # define stifle_history(X) |
| @@ -2727,13 +2731,9 @@ | |
| 2731 | rc = process_input(&data, stdin); |
| 2732 | } |
| 2733 | } |
| 2734 | set_table_name(&data, 0); |
| 2735 | if( data.db ){ |
| 2736 | sqlite3_close(data.db); |
| 2737 | } |
| 2738 | return rc; |
| 2739 | } |
| 2740 |