Fossil SCM
Merge all recent trunk changes into the eclipse-project branch.
Commit
e2d0fa884a13c1a63e85f00d372e9b2d990934f8
Parent
6c945311bc58e50…
6 files changed
+3
-3
+1
+2
-2
+2
-4
+2
+4
-5
+3
-3
| --- src/cgi.c | ||
| +++ src/cgi.c | ||
| @@ -21,15 +21,15 @@ | ||
| 21 | 21 | ** formatting function and its cousins, and routines to encode and |
| 22 | 22 | ** decode strings in HTML or HTTP. |
| 23 | 23 | */ |
| 24 | 24 | #include "config.h" |
| 25 | 25 | #ifdef _WIN32 |
| 26 | -# include <windows.h> /* for Sleep once server works again */ | |
| 27 | 26 | # if defined(__MINGW32__) |
| 28 | -# define sleep Sleep /* windows does not have sleep, but Sleep */ | |
| 29 | -# include <ws2tcpip.h> | |
| 27 | +# include <ws2tcpip.h> | |
| 30 | 28 | # endif |
| 29 | +# include <windows.h> /* for Sleep once server works again */ | |
| 30 | +# define sleep Sleep /* windows does not have sleep, but Sleep */ | |
| 31 | 31 | #else |
| 32 | 32 | # include <sys/socket.h> |
| 33 | 33 | # include <netinet/in.h> |
| 34 | 34 | # include <arpa/inet.h> |
| 35 | 35 | # include <sys/times.h> |
| 36 | 36 |
| --- src/cgi.c | |
| +++ src/cgi.c | |
| @@ -21,15 +21,15 @@ | |
| 21 | ** formatting function and its cousins, and routines to encode and |
| 22 | ** decode strings in HTML or HTTP. |
| 23 | */ |
| 24 | #include "config.h" |
| 25 | #ifdef _WIN32 |
| 26 | # include <windows.h> /* for Sleep once server works again */ |
| 27 | # if defined(__MINGW32__) |
| 28 | # define sleep Sleep /* windows does not have sleep, but Sleep */ |
| 29 | # include <ws2tcpip.h> |
| 30 | # endif |
| 31 | #else |
| 32 | # include <sys/socket.h> |
| 33 | # include <netinet/in.h> |
| 34 | # include <arpa/inet.h> |
| 35 | # include <sys/times.h> |
| 36 |
| --- src/cgi.c | |
| +++ src/cgi.c | |
| @@ -21,15 +21,15 @@ | |
| 21 | ** formatting function and its cousins, and routines to encode and |
| 22 | ** decode strings in HTML or HTTP. |
| 23 | */ |
| 24 | #include "config.h" |
| 25 | #ifdef _WIN32 |
| 26 | # if defined(__MINGW32__) |
| 27 | # include <ws2tcpip.h> |
| 28 | # endif |
| 29 | # include <windows.h> /* for Sleep once server works again */ |
| 30 | # define sleep Sleep /* windows does not have sleep, but Sleep */ |
| 31 | #else |
| 32 | # include <sys/socket.h> |
| 33 | # include <netinet/in.h> |
| 34 | # include <arpa/inet.h> |
| 35 | # include <sys/times.h> |
| 36 |
+1
| --- src/file.c | ||
| +++ src/file.c | ||
| @@ -42,10 +42,11 @@ | ||
| 42 | 42 | ** |
| 43 | 43 | ** Use _stati64 rather than stat on windows, in order to handle files |
| 44 | 44 | ** larger than 2GB. |
| 45 | 45 | */ |
| 46 | 46 | #if defined(_WIN32) && (defined(__MSVCRT__) || defined(_MSC_VER)) |
| 47 | +# undef stat | |
| 47 | 48 | # define stat _stati64 |
| 48 | 49 | #endif |
| 49 | 50 | /* |
| 50 | 51 | ** On Windows S_ISLNK always returns FALSE. |
| 51 | 52 | */ |
| 52 | 53 |
| --- src/file.c | |
| +++ src/file.c | |
| @@ -42,10 +42,11 @@ | |
| 42 | ** |
| 43 | ** Use _stati64 rather than stat on windows, in order to handle files |
| 44 | ** larger than 2GB. |
| 45 | */ |
| 46 | #if defined(_WIN32) && (defined(__MSVCRT__) || defined(_MSC_VER)) |
| 47 | # define stat _stati64 |
| 48 | #endif |
| 49 | /* |
| 50 | ** On Windows S_ISLNK always returns FALSE. |
| 51 | */ |
| 52 |
| --- src/file.c | |
| +++ src/file.c | |
| @@ -42,10 +42,11 @@ | |
| 42 | ** |
| 43 | ** Use _stati64 rather than stat on windows, in order to handle files |
| 44 | ** larger than 2GB. |
| 45 | */ |
| 46 | #if defined(_WIN32) && (defined(__MSVCRT__) || defined(_MSC_VER)) |
| 47 | # undef stat |
| 48 | # define stat _stati64 |
| 49 | #endif |
| 50 | /* |
| 51 | ** On Windows S_ISLNK always returns FALSE. |
| 52 | */ |
| 53 |
+2
-2
| --- src/http_socket.c | ||
| +++ src/http_socket.c | ||
| @@ -27,15 +27,15 @@ | ||
| 27 | 27 | */ |
| 28 | 28 | |
| 29 | 29 | #include "config.h" |
| 30 | 30 | #include "http_socket.h" |
| 31 | 31 | #if defined(_WIN32) |
| 32 | -# include <windows.h> /* for Sleep once server works again */ | |
| 33 | -# define sleep Sleep /* windows does not have sleep, but Sleep */ | |
| 34 | 32 | # if defined(__MINGW32__) |
| 35 | 33 | # include <ws2tcpip.h> |
| 36 | 34 | # endif |
| 35 | +# include <windows.h> /* for Sleep once server works again */ | |
| 36 | +# define sleep Sleep /* windows does not have sleep, but Sleep */ | |
| 37 | 37 | #else |
| 38 | 38 | # include <netinet/in.h> |
| 39 | 39 | # include <arpa/inet.h> |
| 40 | 40 | # include <sys/socket.h> |
| 41 | 41 | # include <netdb.h> |
| 42 | 42 |
| --- src/http_socket.c | |
| +++ src/http_socket.c | |
| @@ -27,15 +27,15 @@ | |
| 27 | */ |
| 28 | |
| 29 | #include "config.h" |
| 30 | #include "http_socket.h" |
| 31 | #if defined(_WIN32) |
| 32 | # include <windows.h> /* for Sleep once server works again */ |
| 33 | # define sleep Sleep /* windows does not have sleep, but Sleep */ |
| 34 | # if defined(__MINGW32__) |
| 35 | # include <ws2tcpip.h> |
| 36 | # endif |
| 37 | #else |
| 38 | # include <netinet/in.h> |
| 39 | # include <arpa/inet.h> |
| 40 | # include <sys/socket.h> |
| 41 | # include <netdb.h> |
| 42 |
| --- src/http_socket.c | |
| +++ src/http_socket.c | |
| @@ -27,15 +27,15 @@ | |
| 27 | */ |
| 28 | |
| 29 | #include "config.h" |
| 30 | #include "http_socket.h" |
| 31 | #if defined(_WIN32) |
| 32 | # if defined(__MINGW32__) |
| 33 | # include <ws2tcpip.h> |
| 34 | # endif |
| 35 | # include <windows.h> /* for Sleep once server works again */ |
| 36 | # define sleep Sleep /* windows does not have sleep, but Sleep */ |
| 37 | #else |
| 38 | # include <netinet/in.h> |
| 39 | # include <arpa/inet.h> |
| 40 | # include <sys/socket.h> |
| 41 | # include <netdb.h> |
| 42 |
+2
-4
| --- src/main.c | ||
| +++ src/main.c | ||
| @@ -86,12 +86,11 @@ | ||
| 86 | 86 | ** All Tcl related context information is in this structure. This structure |
| 87 | 87 | ** definition has been copied from and should be kept in sync with the one in |
| 88 | 88 | ** "th_tcl.c". |
| 89 | 89 | */ |
| 90 | 90 | struct TclContext { |
| 91 | - int argc; | |
| 92 | - char **argv; | |
| 91 | + char *argv0; | |
| 93 | 92 | Tcl_Interp *interp; |
| 94 | 93 | }; |
| 95 | 94 | #endif |
| 96 | 95 | |
| 97 | 96 | /* |
| @@ -412,12 +411,11 @@ | ||
| 412 | 411 | int idx; |
| 413 | 412 | int rc; |
| 414 | 413 | int i; |
| 415 | 414 | |
| 416 | 415 | #ifdef FOSSIL_ENABLE_TCL |
| 417 | - g.tcl.argc = argc; | |
| 418 | - g.tcl.argv = argv; | |
| 416 | + g.tcl.argv0 = argv[0]; | |
| 419 | 417 | g.tcl.interp = 0; |
| 420 | 418 | #endif |
| 421 | 419 | |
| 422 | 420 | sqlite3_config(SQLITE_CONFIG_LOG, fossil_sqlite_log, 0); |
| 423 | 421 | memset(&g, 0, sizeof(g)); |
| 424 | 422 |
| --- src/main.c | |
| +++ src/main.c | |
| @@ -86,12 +86,11 @@ | |
| 86 | ** All Tcl related context information is in this structure. This structure |
| 87 | ** definition has been copied from and should be kept in sync with the one in |
| 88 | ** "th_tcl.c". |
| 89 | */ |
| 90 | struct TclContext { |
| 91 | int argc; |
| 92 | char **argv; |
| 93 | Tcl_Interp *interp; |
| 94 | }; |
| 95 | #endif |
| 96 | |
| 97 | /* |
| @@ -412,12 +411,11 @@ | |
| 412 | int idx; |
| 413 | int rc; |
| 414 | int i; |
| 415 | |
| 416 | #ifdef FOSSIL_ENABLE_TCL |
| 417 | g.tcl.argc = argc; |
| 418 | g.tcl.argv = argv; |
| 419 | g.tcl.interp = 0; |
| 420 | #endif |
| 421 | |
| 422 | sqlite3_config(SQLITE_CONFIG_LOG, fossil_sqlite_log, 0); |
| 423 | memset(&g, 0, sizeof(g)); |
| 424 |
| --- src/main.c | |
| +++ src/main.c | |
| @@ -86,12 +86,11 @@ | |
| 86 | ** All Tcl related context information is in this structure. This structure |
| 87 | ** definition has been copied from and should be kept in sync with the one in |
| 88 | ** "th_tcl.c". |
| 89 | */ |
| 90 | struct TclContext { |
| 91 | char *argv0; |
| 92 | Tcl_Interp *interp; |
| 93 | }; |
| 94 | #endif |
| 95 | |
| 96 | /* |
| @@ -412,12 +411,11 @@ | |
| 411 | int idx; |
| 412 | int rc; |
| 413 | int i; |
| 414 | |
| 415 | #ifdef FOSSIL_ENABLE_TCL |
| 416 | g.tcl.argv0 = argv[0]; |
| 417 | g.tcl.interp = 0; |
| 418 | #endif |
| 419 | |
| 420 | sqlite3_config(SQLITE_CONFIG_LOG, fossil_sqlite_log, 0); |
| 421 | memset(&g, 0, sizeof(g)); |
| 422 |
+2
| --- src/shell.c | ||
| +++ src/shell.c | ||
| @@ -62,11 +62,13 @@ | ||
| 62 | 62 | |
| 63 | 63 | #if defined(_WIN32) || defined(WIN32) |
| 64 | 64 | # include <io.h> |
| 65 | 65 | #define isatty(h) _isatty(h) |
| 66 | 66 | #define access(f,m) _access((f),(m)) |
| 67 | +#undef popen | |
| 67 | 68 | #define popen(a,b) _popen((a),(b)) |
| 69 | +#undef pclose | |
| 68 | 70 | #define pclose(x) _pclose(x) |
| 69 | 71 | #else |
| 70 | 72 | /* Make sure isatty() has a prototype. |
| 71 | 73 | */ |
| 72 | 74 | extern int isatty(int); |
| 73 | 75 |
| --- src/shell.c | |
| +++ src/shell.c | |
| @@ -62,11 +62,13 @@ | |
| 62 | |
| 63 | #if defined(_WIN32) || defined(WIN32) |
| 64 | # include <io.h> |
| 65 | #define isatty(h) _isatty(h) |
| 66 | #define access(f,m) _access((f),(m)) |
| 67 | #define popen(a,b) _popen((a),(b)) |
| 68 | #define pclose(x) _pclose(x) |
| 69 | #else |
| 70 | /* Make sure isatty() has a prototype. |
| 71 | */ |
| 72 | extern int isatty(int); |
| 73 |
| --- src/shell.c | |
| +++ src/shell.c | |
| @@ -62,11 +62,13 @@ | |
| 62 | |
| 63 | #if defined(_WIN32) || defined(WIN32) |
| 64 | # include <io.h> |
| 65 | #define isatty(h) _isatty(h) |
| 66 | #define access(f,m) _access((f),(m)) |
| 67 | #undef popen |
| 68 | #define popen(a,b) _popen((a),(b)) |
| 69 | #undef pclose |
| 70 | #define pclose(x) _pclose(x) |
| 71 | #else |
| 72 | /* Make sure isatty() has a prototype. |
| 73 | */ |
| 74 | extern int isatty(int); |
| 75 |
+4
-5
| --- src/th_tcl.c | ||
| +++ src/th_tcl.c | ||
| @@ -93,12 +93,11 @@ | ||
| 93 | 93 | /* |
| 94 | 94 | ** Tcl context information used by TH1. This structure definition has been |
| 95 | 95 | ** copied from and should be kept in sync with the one in "main.c". |
| 96 | 96 | */ |
| 97 | 97 | struct TclContext { |
| 98 | - int argc; | |
| 99 | - char **argv; | |
| 98 | + char *argv0; | |
| 100 | 99 | Tcl_Interp *interp; |
| 101 | 100 | }; |
| 102 | 101 | |
| 103 | 102 | /* |
| 104 | 103 | ** Syntax: |
| @@ -341,11 +340,11 @@ | ||
| 341 | 340 | |
| 342 | 341 | /* |
| 343 | 342 | ** Array of Tcl integration commands. Used when adding or removing the Tcl |
| 344 | 343 | ** integration commands from TH1. |
| 345 | 344 | */ |
| 346 | -static struct _Command { | |
| 345 | +static const struct _Command { | |
| 347 | 346 | const char *zName; |
| 348 | 347 | Th_CommandProc xProc; |
| 349 | 348 | void *pContext; |
| 350 | 349 | } aCommand[] = { |
| 351 | 350 | {"tclEval", tclEval_command, 0}, |
| @@ -389,12 +388,12 @@ | ||
| 389 | 388 | return TH_ERROR; |
| 390 | 389 | } |
| 391 | 390 | if ( tclContext->interp ){ |
| 392 | 391 | return TH_OK; |
| 393 | 392 | } |
| 394 | - if ( tclContext->argc>0 && tclContext->argv ) { | |
| 395 | - Tcl_FindExecutable(tclContext->argv[0]); | |
| 393 | + if ( tclContext->argv0 ){ | |
| 394 | + Tcl_FindExecutable(tclContext->argv0); | |
| 396 | 395 | } |
| 397 | 396 | tclInterp = tclContext->interp = Tcl_CreateInterp(); |
| 398 | 397 | if( !tclInterp || Tcl_InterpDeleted(tclInterp) ){ |
| 399 | 398 | Th_ErrorMessage(interp, |
| 400 | 399 | "Could not create Tcl interpreter", (const char *)"", 0); |
| 401 | 400 |
| --- src/th_tcl.c | |
| +++ src/th_tcl.c | |
| @@ -93,12 +93,11 @@ | |
| 93 | /* |
| 94 | ** Tcl context information used by TH1. This structure definition has been |
| 95 | ** copied from and should be kept in sync with the one in "main.c". |
| 96 | */ |
| 97 | struct TclContext { |
| 98 | int argc; |
| 99 | char **argv; |
| 100 | Tcl_Interp *interp; |
| 101 | }; |
| 102 | |
| 103 | /* |
| 104 | ** Syntax: |
| @@ -341,11 +340,11 @@ | |
| 341 | |
| 342 | /* |
| 343 | ** Array of Tcl integration commands. Used when adding or removing the Tcl |
| 344 | ** integration commands from TH1. |
| 345 | */ |
| 346 | static struct _Command { |
| 347 | const char *zName; |
| 348 | Th_CommandProc xProc; |
| 349 | void *pContext; |
| 350 | } aCommand[] = { |
| 351 | {"tclEval", tclEval_command, 0}, |
| @@ -389,12 +388,12 @@ | |
| 389 | return TH_ERROR; |
| 390 | } |
| 391 | if ( tclContext->interp ){ |
| 392 | return TH_OK; |
| 393 | } |
| 394 | if ( tclContext->argc>0 && tclContext->argv ) { |
| 395 | Tcl_FindExecutable(tclContext->argv[0]); |
| 396 | } |
| 397 | tclInterp = tclContext->interp = Tcl_CreateInterp(); |
| 398 | if( !tclInterp || Tcl_InterpDeleted(tclInterp) ){ |
| 399 | Th_ErrorMessage(interp, |
| 400 | "Could not create Tcl interpreter", (const char *)"", 0); |
| 401 |
| --- src/th_tcl.c | |
| +++ src/th_tcl.c | |
| @@ -93,12 +93,11 @@ | |
| 93 | /* |
| 94 | ** Tcl context information used by TH1. This structure definition has been |
| 95 | ** copied from and should be kept in sync with the one in "main.c". |
| 96 | */ |
| 97 | struct TclContext { |
| 98 | char *argv0; |
| 99 | Tcl_Interp *interp; |
| 100 | }; |
| 101 | |
| 102 | /* |
| 103 | ** Syntax: |
| @@ -341,11 +340,11 @@ | |
| 340 | |
| 341 | /* |
| 342 | ** Array of Tcl integration commands. Used when adding or removing the Tcl |
| 343 | ** integration commands from TH1. |
| 344 | */ |
| 345 | static const struct _Command { |
| 346 | const char *zName; |
| 347 | Th_CommandProc xProc; |
| 348 | void *pContext; |
| 349 | } aCommand[] = { |
| 350 | {"tclEval", tclEval_command, 0}, |
| @@ -389,12 +388,12 @@ | |
| 388 | return TH_ERROR; |
| 389 | } |
| 390 | if ( tclContext->interp ){ |
| 391 | return TH_OK; |
| 392 | } |
| 393 | if ( tclContext->argv0 ){ |
| 394 | Tcl_FindExecutable(tclContext->argv0); |
| 395 | } |
| 396 | tclInterp = tclContext->interp = Tcl_CreateInterp(); |
| 397 | if( !tclInterp || Tcl_InterpDeleted(tclInterp) ){ |
| 398 | Th_ErrorMessage(interp, |
| 399 | "Could not create Tcl interpreter", (const char *)"", 0); |
| 400 |