Fossil SCM
Use binary mode for CGI trace files. Make CGI trace cross-platform.
Commit
6a8084abcb24c02c23da0cd8df402253edf44ee3
Parent
7136ff4c65754f0…
2 files changed
+1
-1
+1
-1
+1
-1
| --- src/cgi.c | ||
| +++ src/cgi.c | ||
| @@ -800,11 +800,11 @@ | ||
| 800 | 800 | if( pLog==0 ){ |
| 801 | 801 | char zFile[50]; |
| 802 | 802 | unsigned r; |
| 803 | 803 | sqlite3_randomness(sizeof(r), &r); |
| 804 | 804 | sqlite3_snprintf(sizeof(zFile), zFile, "httplog-%08x.txt", r); |
| 805 | - pLog = fopen(zFile, "w"); | |
| 805 | + pLog = fossil_fopen(zFile, "wb"); | |
| 806 | 806 | if( pLog ){ |
| 807 | 807 | fprintf(stderr, "# open log on %s\n", zFile); |
| 808 | 808 | }else{ |
| 809 | 809 | fprintf(stderr, "# failed to open %s\n", zFile); |
| 810 | 810 | return; |
| 811 | 811 |
| --- src/cgi.c | |
| +++ src/cgi.c | |
| @@ -800,11 +800,11 @@ | |
| 800 | if( pLog==0 ){ |
| 801 | char zFile[50]; |
| 802 | unsigned r; |
| 803 | sqlite3_randomness(sizeof(r), &r); |
| 804 | sqlite3_snprintf(sizeof(zFile), zFile, "httplog-%08x.txt", r); |
| 805 | pLog = fopen(zFile, "w"); |
| 806 | if( pLog ){ |
| 807 | fprintf(stderr, "# open log on %s\n", zFile); |
| 808 | }else{ |
| 809 | fprintf(stderr, "# failed to open %s\n", zFile); |
| 810 | return; |
| 811 |
| --- src/cgi.c | |
| +++ src/cgi.c | |
| @@ -800,11 +800,11 @@ | |
| 800 | if( pLog==0 ){ |
| 801 | char zFile[50]; |
| 802 | unsigned r; |
| 803 | sqlite3_randomness(sizeof(r), &r); |
| 804 | sqlite3_snprintf(sizeof(zFile), zFile, "httplog-%08x.txt", r); |
| 805 | pLog = fossil_fopen(zFile, "wb"); |
| 806 | if( pLog ){ |
| 807 | fprintf(stderr, "# open log on %s\n", zFile); |
| 808 | }else{ |
| 809 | fprintf(stderr, "# failed to open %s\n", zFile); |
| 810 | return; |
| 811 |
+1
-1
| --- src/main.c | ||
| +++ src/main.c | ||
| @@ -1632,11 +1632,11 @@ | ||
| 1632 | 1632 | blob_read_from_file(&config, zFile); |
| 1633 | 1633 | while( blob_line(&config, &line) ){ |
| 1634 | 1634 | if( !blob_token(&line, &key) ) continue; |
| 1635 | 1635 | if( blob_buffer(&key)[0]=='#' ) continue; |
| 1636 | 1636 | if( blob_eq(&key, "debug:") && blob_token(&line, &value) ){ |
| 1637 | - g.fDebug = fossil_fopen(blob_str(&value), "a"); | |
| 1637 | + g.fDebug = fossil_fopen(blob_str(&value), "ab"); | |
| 1638 | 1638 | blob_reset(&value); |
| 1639 | 1639 | continue; |
| 1640 | 1640 | } |
| 1641 | 1641 | if( blob_eq(&key, "HOME:") && blob_token(&line, &value) ){ |
| 1642 | 1642 | cgi_setenv("HOME", blob_str(&value)); |
| 1643 | 1643 |
| --- src/main.c | |
| +++ src/main.c | |
| @@ -1632,11 +1632,11 @@ | |
| 1632 | blob_read_from_file(&config, zFile); |
| 1633 | while( blob_line(&config, &line) ){ |
| 1634 | if( !blob_token(&line, &key) ) continue; |
| 1635 | if( blob_buffer(&key)[0]=='#' ) continue; |
| 1636 | if( blob_eq(&key, "debug:") && blob_token(&line, &value) ){ |
| 1637 | g.fDebug = fossil_fopen(blob_str(&value), "a"); |
| 1638 | blob_reset(&value); |
| 1639 | continue; |
| 1640 | } |
| 1641 | if( blob_eq(&key, "HOME:") && blob_token(&line, &value) ){ |
| 1642 | cgi_setenv("HOME", blob_str(&value)); |
| 1643 |
| --- src/main.c | |
| +++ src/main.c | |
| @@ -1632,11 +1632,11 @@ | |
| 1632 | blob_read_from_file(&config, zFile); |
| 1633 | while( blob_line(&config, &line) ){ |
| 1634 | if( !blob_token(&line, &key) ) continue; |
| 1635 | if( blob_buffer(&key)[0]=='#' ) continue; |
| 1636 | if( blob_eq(&key, "debug:") && blob_token(&line, &value) ){ |
| 1637 | g.fDebug = fossil_fopen(blob_str(&value), "ab"); |
| 1638 | blob_reset(&value); |
| 1639 | continue; |
| 1640 | } |
| 1641 | if( blob_eq(&key, "HOME:") && blob_token(&line, &value) ){ |
| 1642 | cgi_setenv("HOME", blob_str(&value)); |
| 1643 |