Index: src/shell.c ================================================================== --- src/shell.c +++ src/shell.c @@ -10,11 +10,11 @@ ** ************************************************************************* ** This file contains code to implement the "sqlite" command line ** utility for accessing SQLite databases. ** -** $Id: shell.c,v 1.71 2003/04/24 01:45:04 drh Exp $ +** $Id: shell.c,v 1.72 2003/04/26 02:50:11 drh Exp $ */ #include #include #include #include "sqlite.h" @@ -44,10 +44,14 @@ # define add_history(X) # define read_history(X) # define write_history(X) # define stifle_history(X) #endif + +/* Make sure isatty() has a prototype. +*/ +extern int isatty(); /* ** The following is the open SQLite database. We make a pointer ** to this database a static variable so that it can be accessed ** by the SIGINT handler to interrupt database processing. @@ -1044,11 +1048,11 @@ } sprintf(sqliterc,"%s/.sqliterc",home_dir); free(home_dir); } in = fopen(sqliterc,"r"); - if(in) { + if(in && isatty(fileno(stdout))) { printf("Loading resources from %s\n",sqliterc); process_input(p,in); fclose(in); } return; @@ -1180,11 +1184,10 @@ fprintf(stderr,"SQL error: %s\n", zErrMsg); exit(1); } } }else{ - extern int isatty(); if( isatty(fileno(stdout)) && isatty(fileno(stdin)) ){ char *zHome; char *zHistory = 0; printf( "SQLite version %s\n"