From 534f4dfa3c85250b56ecc2c746edf3427da4d5e3 Mon Sep 17 00:00:00 2001 From: drh Date: Sat, 28 Feb 2015 14:03:35 +0000 Subject: [PATCH] In the command-line shell, the inability to read ~/.sqliterc is no longer a fatal error. A warning is issued, but processing continues. FossilOrigin-Name: 6bf6246306e6fd490766c0a05932be52a0ed66f2 --- manifest | 12 ++++++------ manifest.uuid | 2 +- src/shell.c | 18 ++++++------------ 3 files changed, 13 insertions(+), 19 deletions(-) diff --git a/manifest b/manifest index b5975aaf29..4ccc83a559 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C More\stest\scases\sand\srequirements\smarks\sfor\spragmas. -D 2015-02-28T01:04:27.551 +C In\sthe\scommand-line\sshell,\sthe\sinability\sto\sread\s~/.sqliterc\sis\sno\slonger\na\sfatal\serror.\s\sA\swarning\sis\sissued,\sbut\sprocessing\scontinues. +D 2015-02-28T14:03:35.210 F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f F Makefile.in 6b9e7677829aa94b9f30949656e27312aefb9a46 F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23 @@ -231,7 +231,7 @@ F src/random.c ba2679f80ec82c4190062d756f22d0c358180696 F src/resolve.c f4d79e31ffa5820c2e3d1740baa5e9b190425f2b F src/rowset.c eccf6af6d620aaa4579bd3b72c1b6395d9e9fa1e F src/select.c e46cef4c224549b439384c88fc7f57ba064dad54 -F src/shell.c f06cca68a3f07e03d35d2f879375967169db6a61 +F src/shell.c a552c1ffc33aac6ab9246c55938835434130432d F src/sqlite.h.in 62d3997824038cc32335b04aaa18cc8f4c19e9be F src/sqlite3.rc 992c9f5fb8285ae285d6be28240a7e8d3a7f2bad F src/sqlite3ext.h 17d487c3c91b0b8c584a32fbeb393f6f795eea7d @@ -1239,7 +1239,7 @@ F tool/vdbe_profile.tcl 67746953071a9f8f2f668b73fe899074e2c6d8c1 F tool/warnings-clang.sh f6aa929dc20ef1f856af04a730772f59283631d4 F tool/warnings.sh 0abfd78ceb09b7f7c27c688c8e3fe93268a13b32 F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f -P 766ad65025a9d5815300978e6e349f5af5db6012 -R 8204e8f9043c535de0f2497c8e561323 +P fc51037cd97063069620213a62efdeff5d898706 +R 6857d3f3463c24fa73a9fc0de2ae11e8 U drh -Z a56e97eeca3c59d6452815bc1cc7253f +Z b9ffbe353e645ecee0849e3fef86b4ab diff --git a/manifest.uuid b/manifest.uuid index 8cfe091b9c..16a50d0d9d 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -fc51037cd97063069620213a62efdeff5d898706 \ No newline at end of file +6bf6246306e6fd490766c0a05932be52a0ed66f2 \ No newline at end of file diff --git a/src/shell.c b/src/shell.c index 4aaa2d90ec..47b16f4e6f 100644 --- a/src/shell.c +++ b/src/shell.c @@ -4189,7 +4189,7 @@ static char *find_home_dir(void){ ** ** Returns the number of errors. */ -static int process_sqliterc( +static void process_sqliterc( ShellState *p, /* Configuration data */ const char *sqliterc_override /* Name of config file. NULL to use default */ ){ @@ -4197,15 +4197,13 @@ static int process_sqliterc( const char *sqliterc = sqliterc_override; char *zBuf = 0; FILE *in = NULL; - int rc = 0; if (sqliterc == NULL) { home_dir = find_home_dir(); if( home_dir==0 ){ -#if !defined(__RTP__) && !defined(_WRS_KERNEL) - fprintf(stderr,"%s: Error: cannot locate your home directory\n", Argv0); -#endif - return 1; + fprintf(stderr, "-- warning: cannot find home directory;" + " cannot read ~/.sqliterc\n"); + return; } sqlite3_initialize(); zBuf = sqlite3_mprintf("%s/.sqliterc",home_dir); @@ -4216,11 +4214,10 @@ static int process_sqliterc( if( stdin_is_interactive ){ fprintf(stderr,"-- Loading resources from %s\n",sqliterc); } - rc = process_input(p,in); + process_input(p,in); fclose(in); } sqlite3_free(zBuf); - return rc; } /* @@ -4496,10 +4493,7 @@ int main(int argc, char **argv){ ** is given on the command line, look for a file named ~/.sqliterc and ** try to process it. */ - rc = process_sqliterc(&data,zInitFile); - if( rc>0 ){ - return rc; - } + process_sqliterc(&data,zInitFile); /* Make a second pass through the command-line argument and set ** options. This second pass is delayed until after the initialization -- 2.47.2