diff options
author | 2012-11-29 05:18:03 +0000 | |
---|---|---|
committer | 2012-11-29 05:18:03 +0000 | |
commit | 5544cc6efbc76a8f2d65b89600874018d1222a3d (patch) | |
tree | 71940973b5dcdd4a11cd9069c5d4b9868fa3ce8c | |
parent | lemon.c fixed differently upstream, solve conflict (diff) | |
download | wireguard-openbsd-5544cc6efbc76a8f2d65b89600874018d1222a3d.tar.xz wireguard-openbsd-5544cc6efbc76a8f2d65b89600874018d1222a3d.zip |
fix stupid cvs conflict
-rw-r--r-- | usr.bin/sqlite3/shell.c | 34 |
1 files changed, 15 insertions, 19 deletions
diff --git a/usr.bin/sqlite3/shell.c b/usr.bin/sqlite3/shell.c index f23290ba252..a17d966245c 100644 --- a/usr.bin/sqlite3/shell.c +++ b/usr.bin/sqlite3/shell.c @@ -36,7 +36,7 @@ #include <ctype.h> #include <stdarg.h> -#if !defined(_WIN32) && !defined(WIN32) && !defined(__OS2__) +#if !defined(_WIN32) && !defined(WIN32) # include <signal.h> # if !defined(__RTP__) && !defined(_WRS_KERNEL) # include <pwd.h> @@ -45,10 +45,6 @@ # include <sys/types.h> #endif -#ifdef __OS2__ -# include <unistd.h> -#endif - #ifdef HAVE_EDITLINE # include <editline/editline.h> #endif @@ -68,7 +64,9 @@ # include <io.h> #define isatty(h) _isatty(h) #define access(f,m) _access((f),(m)) +#undef popen #define popen(a,b) _popen((a),(b)) +#undef pclose #define pclose(x) _pclose(x) #else /* Make sure isatty() has a prototype. @@ -92,7 +90,7 @@ static int enableTimer = 0; #define IsDigit(X) isdigit((unsigned char)X) #define ToLower(X) (char)tolower((unsigned char)X) -#if !defined(_WIN32) && !defined(WIN32) && !defined(__OS2__) && !defined(__RTP__) && !defined(_WRS_KERNEL) +#if !defined(_WIN32) && !defined(WIN32) && !defined(_WRS_KERNEL) #include <sys/time.h> #include <sys/resource.h> @@ -1453,6 +1451,7 @@ static int process_input(struct callback_data *p, FILE *in); */ static void open_db(struct callback_data *p){ if( p->db==0 ){ + sqlite3_initialize(); sqlite3_open(p->zDbFilename, &p->db); db = p->db; if( db && sqlite3_errcode(db)==SQLITE_OK ){ @@ -2468,7 +2467,7 @@ static int do_meta_command(char *zLine, struct callback_data *p){ open_db(p); output_file_close(p->traceOut); p->traceOut = output_file_open(azArg[1]); -#ifndef SQLITE_OMIT_TRACE +#if !defined(SQLITE_OMIT_TRACE) && !defined(SQLITE_OMIT_FLOATING_POINT) if( p->traceOut==0 ){ sqlite3_trace(p->db, 0, 0); }else{ @@ -2696,13 +2695,13 @@ static char *find_home_dir(void){ static char *home_dir = NULL; if( home_dir ) return home_dir; -#if !defined(_WIN32) && !defined(WIN32) && !defined(__OS2__) && !defined(_WIN32_WCE) && !defined(__RTP__) && !defined(_WRS_KERNEL) +#if !defined(_WIN32) && !defined(WIN32) && !defined(_WIN32_WCE) && !defined(__RTP__) && !defined(_WRS_KERNEL) { - struct passwd *pwent; - uid_t uid = getuid(); - if( (pwent=getpwuid(uid)) != NULL) { - home_dir = pwent->pw_dir; - } + struct passwd *pwent; + uid_t uid = getuid(); + if( (pwent=getpwuid(uid)) != NULL) { + home_dir = pwent->pw_dir; + } } #endif @@ -2712,7 +2711,7 @@ static char *find_home_dir(void){ home_dir = "/"; #else -#if defined(_WIN32) || defined(WIN32) || defined(__OS2__) +#if defined(_WIN32) || defined(WIN32) if (!home_dir) { home_dir = getenv("USERPROFILE"); } @@ -2722,7 +2721,7 @@ static char *find_home_dir(void){ home_dir = getenv("HOME"); } -#if defined(_WIN32) || defined(WIN32) || defined(__OS2__) +#if defined(_WIN32) || defined(WIN32) if (!home_dir) { char *zDrive, *zPath; int n; @@ -2775,6 +2774,7 @@ static int process_sqliterc( #endif return 1; } + sqlite3_initialize(); zBuf = sqlite3_mprintf("%s/.sqliterc",home_dir); sqliterc = zBuf; } @@ -2938,11 +2938,7 @@ int main(int argc, char **argv){ } } if( i<argc ){ -#if defined(SQLITE_OS_OS2) && SQLITE_OS_OS2 - data.zDbFilename = (const char *)convertCpPathToUtf8( argv[i++] ); -#else data.zDbFilename = argv[i++]; -#endif }else{ #ifndef SQLITE_OMIT_MEMORYDB data.zDbFilename = ":memory:"; |