Fossil SCM
merge trunk
Commit
8994f3680a47bcf60644cbece53501738d7b1973
Parent
e8ecd18db10b935…
33 files changed
+2
-1
+1
+1
+1
+12
-17
+12
-17
+26
-16
+26
-16
+3
+15
-15
+19
-60
+19
-60
+7
-3
+52
-29
+6
-2
+51
-6
+1
-1
+3
-2
+1
-1
+34
-15
+1
-1
+8
-3
+9
+8
-1
+25
-6
+10
-1
+19
-3
+26
+5
-5
+5
-5
+30
-7
+3
-3
+2
-2
~
auto.def
~
compat/zlib/configure
~
compat/zlib/configure
~
src/allrepo.c
~
src/blob.c
~
src/blob.c
~
src/checkin.c
~
src/checkin.c
~
src/cson_amalgamation.h
~
src/db.c
~
src/diff.c
~
src/diff.c
~
src/doc.c
~
src/file.c
~
src/http.c
~
src/http_transport.c
~
src/json_detail.h
~
src/main.c
~
src/main.mk
~
src/makemake.tcl
~
src/printf.c
~
src/rebuild.c
~
src/setup.c
~
src/stat.c
~
src/update.c
~
src/url.c
~
src/xfer.c
~
test/revert.test
~
win/Makefile.mingw
~
win/Makefile.mingw.mistachkin
~
win/Makefile.msc
~
win/include/dirent.h
~
www/build.wiki
M
auto.def
+2
-1
| --- auto.def | ||
| +++ auto.def | ||
| @@ -193,11 +193,11 @@ | ||
| 193 | 193 | if {$found} { |
| 194 | 194 | define FOSSIL_ENABLE_SSL |
| 195 | 195 | define-append EXTRA_CFLAGS $cflags |
| 196 | 196 | define-append EXTRA_LDFLAGS $ldflags |
| 197 | 197 | define-append LIBS -lssl -lcrypto |
| 198 | - msg-result "HTTP support enabled" | |
| 198 | + msg-result "HTTPS support enabled" | |
| 199 | 199 | |
| 200 | 200 | # Silence OpenSSL deprecation warnings on Mac OS X 10.7. |
| 201 | 201 | if {[string match *-darwin* [get-define host]]} { |
| 202 | 202 | if {[cctest -cflags {-Wdeprecated-declarations}]} { |
| 203 | 203 | define-append EXTRA_CFLAGS -Wdeprecated-declarations |
| @@ -233,8 +233,9 @@ | ||
| 233 | 233 | # Check for getpassphrase() for Solaris 10 where getpass() truncates to 10 chars |
| 234 | 234 | if {![cc-check-functions getpassphrase]} { |
| 235 | 235 | # Haiku needs this |
| 236 | 236 | cc-check-function-in-lib getpass bsd |
| 237 | 237 | } |
| 238 | +cc-check-function-in-lib dlopen dl | |
| 238 | 239 | |
| 239 | 240 | make-template Makefile.in |
| 240 | 241 | make-config-header autoconfig.h -auto {USE_* FOSSIL_*} |
| 241 | 242 |
| --- auto.def | |
| +++ auto.def | |
| @@ -193,11 +193,11 @@ | |
| 193 | if {$found} { |
| 194 | define FOSSIL_ENABLE_SSL |
| 195 | define-append EXTRA_CFLAGS $cflags |
| 196 | define-append EXTRA_LDFLAGS $ldflags |
| 197 | define-append LIBS -lssl -lcrypto |
| 198 | msg-result "HTTP support enabled" |
| 199 | |
| 200 | # Silence OpenSSL deprecation warnings on Mac OS X 10.7. |
| 201 | if {[string match *-darwin* [get-define host]]} { |
| 202 | if {[cctest -cflags {-Wdeprecated-declarations}]} { |
| 203 | define-append EXTRA_CFLAGS -Wdeprecated-declarations |
| @@ -233,8 +233,9 @@ | |
| 233 | # Check for getpassphrase() for Solaris 10 where getpass() truncates to 10 chars |
| 234 | if {![cc-check-functions getpassphrase]} { |
| 235 | # Haiku needs this |
| 236 | cc-check-function-in-lib getpass bsd |
| 237 | } |
| 238 | |
| 239 | make-template Makefile.in |
| 240 | make-config-header autoconfig.h -auto {USE_* FOSSIL_*} |
| 241 |
| --- auto.def | |
| +++ auto.def | |
| @@ -193,11 +193,11 @@ | |
| 193 | if {$found} { |
| 194 | define FOSSIL_ENABLE_SSL |
| 195 | define-append EXTRA_CFLAGS $cflags |
| 196 | define-append EXTRA_LDFLAGS $ldflags |
| 197 | define-append LIBS -lssl -lcrypto |
| 198 | msg-result "HTTPS support enabled" |
| 199 | |
| 200 | # Silence OpenSSL deprecation warnings on Mac OS X 10.7. |
| 201 | if {[string match *-darwin* [get-define host]]} { |
| 202 | if {[cctest -cflags {-Wdeprecated-declarations}]} { |
| 203 | define-append EXTRA_CFLAGS -Wdeprecated-declarations |
| @@ -233,8 +233,9 @@ | |
| 233 | # Check for getpassphrase() for Solaris 10 where getpass() truncates to 10 chars |
| 234 | if {![cc-check-functions getpassphrase]} { |
| 235 | # Haiku needs this |
| 236 | cc-check-function-in-lib getpass bsd |
| 237 | } |
| 238 | cc-check-function-in-lib dlopen dl |
| 239 | |
| 240 | make-template Makefile.in |
| 241 | make-config-header autoconfig.h -auto {USE_* FOSSIL_*} |
| 242 |
| --- compat/zlib/configure | ||
| +++ compat/zlib/configure | ||
| @@ -814,5 +814,6 @@ | ||
| 814 | 814 | /^mandir *=/s#=.*#=$mandir# |
| 815 | 815 | /^LDFLAGS *=/s#=.*#=$LDFLAGS# |
| 816 | 816 | " | sed -e " |
| 817 | 817 | s/\@VERSION\@/$VER/g; |
| 818 | 818 | " > zlib.pc |
| 819 | +# | |
| 819 | 820 |
| --- compat/zlib/configure | |
| +++ compat/zlib/configure | |
| @@ -814,5 +814,6 @@ | |
| 814 | /^mandir *=/s#=.*#=$mandir# |
| 815 | /^LDFLAGS *=/s#=.*#=$LDFLAGS# |
| 816 | " | sed -e " |
| 817 | s/\@VERSION\@/$VER/g; |
| 818 | " > zlib.pc |
| 819 |
| --- compat/zlib/configure | |
| +++ compat/zlib/configure | |
| @@ -814,5 +814,6 @@ | |
| 814 | /^mandir *=/s#=.*#=$mandir# |
| 815 | /^LDFLAGS *=/s#=.*#=$LDFLAGS# |
| 816 | " | sed -e " |
| 817 | s/\@VERSION\@/$VER/g; |
| 818 | " > zlib.pc |
| 819 | # |
| 820 |
| --- compat/zlib/configure | ||
| +++ compat/zlib/configure | ||
| @@ -814,5 +814,6 @@ | ||
| 814 | 814 | /^mandir *=/s#=.*#=$mandir# |
| 815 | 815 | /^LDFLAGS *=/s#=.*#=$LDFLAGS# |
| 816 | 816 | " | sed -e " |
| 817 | 817 | s/\@VERSION\@/$VER/g; |
| 818 | 818 | " > zlib.pc |
| 819 | +# | |
| 819 | 820 |
| --- compat/zlib/configure | |
| +++ compat/zlib/configure | |
| @@ -814,5 +814,6 @@ | |
| 814 | /^mandir *=/s#=.*#=$mandir# |
| 815 | /^LDFLAGS *=/s#=.*#=$LDFLAGS# |
| 816 | " | sed -e " |
| 817 | s/\@VERSION\@/$VER/g; |
| 818 | " > zlib.pc |
| 819 |
| --- compat/zlib/configure | |
| +++ compat/zlib/configure | |
| @@ -814,5 +814,6 @@ | |
| 814 | /^mandir *=/s#=.*#=$mandir# |
| 815 | /^LDFLAGS *=/s#=.*#=$LDFLAGS# |
| 816 | " | sed -e " |
| 817 | s/\@VERSION\@/$VER/g; |
| 818 | " > zlib.pc |
| 819 | # |
| 820 |
+1
| --- src/allrepo.c | ||
| +++ src/allrepo.c | ||
| @@ -144,10 +144,11 @@ | ||
| 144 | 144 | collect_argument(&extra, "compress"); |
| 145 | 145 | collect_argument(&extra, "noverify"); |
| 146 | 146 | collect_argument_value(&extra, "pagesize"); |
| 147 | 147 | collect_argument(&extra, "vacuum"); |
| 148 | 148 | collect_argument(&extra, "deanalyze"); |
| 149 | + collect_argument(&extra, "analyze"); | |
| 149 | 150 | collect_argument(&extra, "wal"); |
| 150 | 151 | collect_argument(&extra, "stat"); |
| 151 | 152 | }else if( strncmp(zCmd, "sync", n)==0 ){ |
| 152 | 153 | zCmd = "sync -autourl -R"; |
| 153 | 154 | collect_argument(&extra, "verbose"); |
| 154 | 155 |
| --- src/allrepo.c | |
| +++ src/allrepo.c | |
| @@ -144,10 +144,11 @@ | |
| 144 | collect_argument(&extra, "compress"); |
| 145 | collect_argument(&extra, "noverify"); |
| 146 | collect_argument_value(&extra, "pagesize"); |
| 147 | collect_argument(&extra, "vacuum"); |
| 148 | collect_argument(&extra, "deanalyze"); |
| 149 | collect_argument(&extra, "wal"); |
| 150 | collect_argument(&extra, "stat"); |
| 151 | }else if( strncmp(zCmd, "sync", n)==0 ){ |
| 152 | zCmd = "sync -autourl -R"; |
| 153 | collect_argument(&extra, "verbose"); |
| 154 |
| --- src/allrepo.c | |
| +++ src/allrepo.c | |
| @@ -144,10 +144,11 @@ | |
| 144 | collect_argument(&extra, "compress"); |
| 145 | collect_argument(&extra, "noverify"); |
| 146 | collect_argument_value(&extra, "pagesize"); |
| 147 | collect_argument(&extra, "vacuum"); |
| 148 | collect_argument(&extra, "deanalyze"); |
| 149 | collect_argument(&extra, "analyze"); |
| 150 | collect_argument(&extra, "wal"); |
| 151 | collect_argument(&extra, "stat"); |
| 152 | }else if( strncmp(zCmd, "sync", n)==0 ){ |
| 153 | zCmd = "sync -autourl -R"; |
| 154 | collect_argument(&extra, "verbose"); |
| 155 |
+12
-17
| --- src/blob.c | ||
| +++ src/blob.c | ||
| @@ -1150,35 +1150,30 @@ | ||
| 1150 | 1150 | ** done. If useMbcs is false and there is no BOM, the input string is assumed |
| 1151 | 1151 | ** to be UTF-8 already, so no conversion is done. |
| 1152 | 1152 | */ |
| 1153 | 1153 | void blob_to_utf8_no_bom(Blob *pBlob, int useMbcs){ |
| 1154 | 1154 | char *zUtf8; |
| 1155 | - int bomSize = 0; | |
| 1156 | - if( starts_with_utf8_bom(pBlob, &bomSize) ){ | |
| 1155 | + int bomSize = starts_with_bom(pBlob); | |
| 1156 | + if( bomSize == 3 ){ | |
| 1157 | 1157 | struct Blob temp; |
| 1158 | 1158 | zUtf8 = blob_str(pBlob) + bomSize; |
| 1159 | 1159 | blob_zero(&temp); |
| 1160 | 1160 | blob_append(&temp, zUtf8, -1); |
| 1161 | 1161 | blob_swap(pBlob, &temp); |
| 1162 | 1162 | blob_reset(&temp); |
| 1163 | 1163 | #ifdef _WIN32 |
| 1164 | - }else if( starts_with_utf16le_bom(pBlob, &bomSize) ){ | |
| 1165 | - /* Make sure the blob contains two terminating 0-bytes */ | |
| 1166 | - blob_append(pBlob, "", 1); | |
| 1167 | - zUtf8 = blob_str(pBlob) + bomSize; | |
| 1168 | - zUtf8 = fossil_unicode_to_utf8(zUtf8); | |
| 1169 | - blob_zero(pBlob); | |
| 1170 | - blob_append(pBlob, zUtf8, -1); | |
| 1171 | - fossil_unicode_free(zUtf8); | |
| 1172 | - }else if( starts_with_utf16be_bom(pBlob, &bomSize) ){ | |
| 1173 | - unsigned int i = blob_size(pBlob); | |
| 1164 | + }else if( bomSize == 2 ){ | |
| 1174 | 1165 | zUtf8 = blob_buffer(pBlob); |
| 1175 | - while( i > 0 ){ | |
| 1176 | - /* swap bytes of unicode representation */ | |
| 1177 | - char zTemp = zUtf8[--i]; | |
| 1178 | - zUtf8[i] = zUtf8[i-1]; | |
| 1179 | - zUtf8[--i] = zTemp; | |
| 1166 | + if (*((unsigned short *)zUtf8) == 0xfffe) { | |
| 1167 | + /* Found BOM, but with reversed bytes */ | |
| 1168 | + unsigned int i = blob_size(pBlob); | |
| 1169 | + while( i > 0 ){ | |
| 1170 | + /* swap bytes of unicode representation */ | |
| 1171 | + char zTemp = zUtf8[--i]; | |
| 1172 | + zUtf8[i] = zUtf8[i-1]; | |
| 1173 | + zUtf8[--i] = zTemp; | |
| 1174 | + } | |
| 1180 | 1175 | } |
| 1181 | 1176 | /* Make sure the blob contains two terminating 0-bytes */ |
| 1182 | 1177 | blob_append(pBlob, "", 1); |
| 1183 | 1178 | zUtf8 = blob_str(pBlob) + bomSize; |
| 1184 | 1179 | zUtf8 = fossil_unicode_to_utf8(zUtf8); |
| 1185 | 1180 |
| --- src/blob.c | |
| +++ src/blob.c | |
| @@ -1150,35 +1150,30 @@ | |
| 1150 | ** done. If useMbcs is false and there is no BOM, the input string is assumed |
| 1151 | ** to be UTF-8 already, so no conversion is done. |
| 1152 | */ |
| 1153 | void blob_to_utf8_no_bom(Blob *pBlob, int useMbcs){ |
| 1154 | char *zUtf8; |
| 1155 | int bomSize = 0; |
| 1156 | if( starts_with_utf8_bom(pBlob, &bomSize) ){ |
| 1157 | struct Blob temp; |
| 1158 | zUtf8 = blob_str(pBlob) + bomSize; |
| 1159 | blob_zero(&temp); |
| 1160 | blob_append(&temp, zUtf8, -1); |
| 1161 | blob_swap(pBlob, &temp); |
| 1162 | blob_reset(&temp); |
| 1163 | #ifdef _WIN32 |
| 1164 | }else if( starts_with_utf16le_bom(pBlob, &bomSize) ){ |
| 1165 | /* Make sure the blob contains two terminating 0-bytes */ |
| 1166 | blob_append(pBlob, "", 1); |
| 1167 | zUtf8 = blob_str(pBlob) + bomSize; |
| 1168 | zUtf8 = fossil_unicode_to_utf8(zUtf8); |
| 1169 | blob_zero(pBlob); |
| 1170 | blob_append(pBlob, zUtf8, -1); |
| 1171 | fossil_unicode_free(zUtf8); |
| 1172 | }else if( starts_with_utf16be_bom(pBlob, &bomSize) ){ |
| 1173 | unsigned int i = blob_size(pBlob); |
| 1174 | zUtf8 = blob_buffer(pBlob); |
| 1175 | while( i > 0 ){ |
| 1176 | /* swap bytes of unicode representation */ |
| 1177 | char zTemp = zUtf8[--i]; |
| 1178 | zUtf8[i] = zUtf8[i-1]; |
| 1179 | zUtf8[--i] = zTemp; |
| 1180 | } |
| 1181 | /* Make sure the blob contains two terminating 0-bytes */ |
| 1182 | blob_append(pBlob, "", 1); |
| 1183 | zUtf8 = blob_str(pBlob) + bomSize; |
| 1184 | zUtf8 = fossil_unicode_to_utf8(zUtf8); |
| 1185 |
| --- src/blob.c | |
| +++ src/blob.c | |
| @@ -1150,35 +1150,30 @@ | |
| 1150 | ** done. If useMbcs is false and there is no BOM, the input string is assumed |
| 1151 | ** to be UTF-8 already, so no conversion is done. |
| 1152 | */ |
| 1153 | void blob_to_utf8_no_bom(Blob *pBlob, int useMbcs){ |
| 1154 | char *zUtf8; |
| 1155 | int bomSize = starts_with_bom(pBlob); |
| 1156 | if( bomSize == 3 ){ |
| 1157 | struct Blob temp; |
| 1158 | zUtf8 = blob_str(pBlob) + bomSize; |
| 1159 | blob_zero(&temp); |
| 1160 | blob_append(&temp, zUtf8, -1); |
| 1161 | blob_swap(pBlob, &temp); |
| 1162 | blob_reset(&temp); |
| 1163 | #ifdef _WIN32 |
| 1164 | }else if( bomSize == 2 ){ |
| 1165 | zUtf8 = blob_buffer(pBlob); |
| 1166 | if (*((unsigned short *)zUtf8) == 0xfffe) { |
| 1167 | /* Found BOM, but with reversed bytes */ |
| 1168 | unsigned int i = blob_size(pBlob); |
| 1169 | while( i > 0 ){ |
| 1170 | /* swap bytes of unicode representation */ |
| 1171 | char zTemp = zUtf8[--i]; |
| 1172 | zUtf8[i] = zUtf8[i-1]; |
| 1173 | zUtf8[--i] = zTemp; |
| 1174 | } |
| 1175 | } |
| 1176 | /* Make sure the blob contains two terminating 0-bytes */ |
| 1177 | blob_append(pBlob, "", 1); |
| 1178 | zUtf8 = blob_str(pBlob) + bomSize; |
| 1179 | zUtf8 = fossil_unicode_to_utf8(zUtf8); |
| 1180 |
+12
-17
| --- src/blob.c | ||
| +++ src/blob.c | ||
| @@ -1150,35 +1150,30 @@ | ||
| 1150 | 1150 | ** done. If useMbcs is false and there is no BOM, the input string is assumed |
| 1151 | 1151 | ** to be UTF-8 already, so no conversion is done. |
| 1152 | 1152 | */ |
| 1153 | 1153 | void blob_to_utf8_no_bom(Blob *pBlob, int useMbcs){ |
| 1154 | 1154 | char *zUtf8; |
| 1155 | - int bomSize = 0; | |
| 1156 | - if( starts_with_utf8_bom(pBlob, &bomSize) ){ | |
| 1155 | + int bomSize = starts_with_bom(pBlob); | |
| 1156 | + if( bomSize == 3 ){ | |
| 1157 | 1157 | struct Blob temp; |
| 1158 | 1158 | zUtf8 = blob_str(pBlob) + bomSize; |
| 1159 | 1159 | blob_zero(&temp); |
| 1160 | 1160 | blob_append(&temp, zUtf8, -1); |
| 1161 | 1161 | blob_swap(pBlob, &temp); |
| 1162 | 1162 | blob_reset(&temp); |
| 1163 | 1163 | #ifdef _WIN32 |
| 1164 | - }else if( starts_with_utf16le_bom(pBlob, &bomSize) ){ | |
| 1165 | - /* Make sure the blob contains two terminating 0-bytes */ | |
| 1166 | - blob_append(pBlob, "", 1); | |
| 1167 | - zUtf8 = blob_str(pBlob) + bomSize; | |
| 1168 | - zUtf8 = fossil_unicode_to_utf8(zUtf8); | |
| 1169 | - blob_zero(pBlob); | |
| 1170 | - blob_append(pBlob, zUtf8, -1); | |
| 1171 | - fossil_unicode_free(zUtf8); | |
| 1172 | - }else if( starts_with_utf16be_bom(pBlob, &bomSize) ){ | |
| 1173 | - unsigned int i = blob_size(pBlob); | |
| 1164 | + }else if( bomSize == 2 ){ | |
| 1174 | 1165 | zUtf8 = blob_buffer(pBlob); |
| 1175 | - while( i > 0 ){ | |
| 1176 | - /* swap bytes of unicode representation */ | |
| 1177 | - char zTemp = zUtf8[--i]; | |
| 1178 | - zUtf8[i] = zUtf8[i-1]; | |
| 1179 | - zUtf8[--i] = zTemp; | |
| 1166 | + if (*((unsigned short *)zUtf8) == 0xfffe) { | |
| 1167 | + /* Found BOM, but with reversed bytes */ | |
| 1168 | + unsigned int i = blob_size(pBlob); | |
| 1169 | + while( i > 0 ){ | |
| 1170 | + /* swap bytes of unicode representation */ | |
| 1171 | + char zTemp = zUtf8[--i]; | |
| 1172 | + zUtf8[i] = zUtf8[i-1]; | |
| 1173 | + zUtf8[--i] = zTemp; | |
| 1174 | + } | |
| 1180 | 1175 | } |
| 1181 | 1176 | /* Make sure the blob contains two terminating 0-bytes */ |
| 1182 | 1177 | blob_append(pBlob, "", 1); |
| 1183 | 1178 | zUtf8 = blob_str(pBlob) + bomSize; |
| 1184 | 1179 | zUtf8 = fossil_unicode_to_utf8(zUtf8); |
| 1185 | 1180 |
| --- src/blob.c | |
| +++ src/blob.c | |
| @@ -1150,35 +1150,30 @@ | |
| 1150 | ** done. If useMbcs is false and there is no BOM, the input string is assumed |
| 1151 | ** to be UTF-8 already, so no conversion is done. |
| 1152 | */ |
| 1153 | void blob_to_utf8_no_bom(Blob *pBlob, int useMbcs){ |
| 1154 | char *zUtf8; |
| 1155 | int bomSize = 0; |
| 1156 | if( starts_with_utf8_bom(pBlob, &bomSize) ){ |
| 1157 | struct Blob temp; |
| 1158 | zUtf8 = blob_str(pBlob) + bomSize; |
| 1159 | blob_zero(&temp); |
| 1160 | blob_append(&temp, zUtf8, -1); |
| 1161 | blob_swap(pBlob, &temp); |
| 1162 | blob_reset(&temp); |
| 1163 | #ifdef _WIN32 |
| 1164 | }else if( starts_with_utf16le_bom(pBlob, &bomSize) ){ |
| 1165 | /* Make sure the blob contains two terminating 0-bytes */ |
| 1166 | blob_append(pBlob, "", 1); |
| 1167 | zUtf8 = blob_str(pBlob) + bomSize; |
| 1168 | zUtf8 = fossil_unicode_to_utf8(zUtf8); |
| 1169 | blob_zero(pBlob); |
| 1170 | blob_append(pBlob, zUtf8, -1); |
| 1171 | fossil_unicode_free(zUtf8); |
| 1172 | }else if( starts_with_utf16be_bom(pBlob, &bomSize) ){ |
| 1173 | unsigned int i = blob_size(pBlob); |
| 1174 | zUtf8 = blob_buffer(pBlob); |
| 1175 | while( i > 0 ){ |
| 1176 | /* swap bytes of unicode representation */ |
| 1177 | char zTemp = zUtf8[--i]; |
| 1178 | zUtf8[i] = zUtf8[i-1]; |
| 1179 | zUtf8[--i] = zTemp; |
| 1180 | } |
| 1181 | /* Make sure the blob contains two terminating 0-bytes */ |
| 1182 | blob_append(pBlob, "", 1); |
| 1183 | zUtf8 = blob_str(pBlob) + bomSize; |
| 1184 | zUtf8 = fossil_unicode_to_utf8(zUtf8); |
| 1185 |
| --- src/blob.c | |
| +++ src/blob.c | |
| @@ -1150,35 +1150,30 @@ | |
| 1150 | ** done. If useMbcs is false and there is no BOM, the input string is assumed |
| 1151 | ** to be UTF-8 already, so no conversion is done. |
| 1152 | */ |
| 1153 | void blob_to_utf8_no_bom(Blob *pBlob, int useMbcs){ |
| 1154 | char *zUtf8; |
| 1155 | int bomSize = starts_with_bom(pBlob); |
| 1156 | if( bomSize == 3 ){ |
| 1157 | struct Blob temp; |
| 1158 | zUtf8 = blob_str(pBlob) + bomSize; |
| 1159 | blob_zero(&temp); |
| 1160 | blob_append(&temp, zUtf8, -1); |
| 1161 | blob_swap(pBlob, &temp); |
| 1162 | blob_reset(&temp); |
| 1163 | #ifdef _WIN32 |
| 1164 | }else if( bomSize == 2 ){ |
| 1165 | zUtf8 = blob_buffer(pBlob); |
| 1166 | if (*((unsigned short *)zUtf8) == 0xfffe) { |
| 1167 | /* Found BOM, but with reversed bytes */ |
| 1168 | unsigned int i = blob_size(pBlob); |
| 1169 | while( i > 0 ){ |
| 1170 | /* swap bytes of unicode representation */ |
| 1171 | char zTemp = zUtf8[--i]; |
| 1172 | zUtf8[i] = zUtf8[i-1]; |
| 1173 | zUtf8[--i] = zTemp; |
| 1174 | } |
| 1175 | } |
| 1176 | /* Make sure the blob contains two terminating 0-bytes */ |
| 1177 | blob_append(pBlob, "", 1); |
| 1178 | zUtf8 = blob_str(pBlob) + bomSize; |
| 1179 | zUtf8 = fossil_unicode_to_utf8(zUtf8); |
| 1180 |
+26
-16
| --- src/checkin.c | ||
| +++ src/checkin.c | ||
| @@ -895,42 +895,46 @@ | ||
| 895 | 895 | */ |
| 896 | 896 | static int commit_warning( |
| 897 | 897 | Blob *p, /* The content of the file being committed. */ |
| 898 | 898 | int crnlOk, /* Non-zero if CR/NL warnings should be disabled. */ |
| 899 | 899 | int binOk, /* Non-zero if binary warnings should be disabled. */ |
| 900 | - int unicodeOk, /* Non-zero if unicode warnings should be disabled. */ | |
| 900 | + int encodingOk, /* Non-zero if encoding warnings should be disabled. */ | |
| 901 | 901 | const char *zFilename /* The full name of the file being committed. */ |
| 902 | 902 | ){ |
| 903 | 903 | int eType; /* return value of looks_like_utf8/utf16() */ |
| 904 | - int fUnicode; /* return value of starts_with_utf16_bom() */ | |
| 904 | + int fUnicode; /* 1 if blob starts with UTF-16 BOM */ | |
| 905 | 905 | char *zMsg; /* Warning message */ |
| 906 | 906 | Blob fname; /* Relative pathname of the file */ |
| 907 | 907 | static int allOk = 0; /* Set to true to disable this routine */ |
| 908 | 908 | |
| 909 | 909 | if( allOk ) return 0; |
| 910 | - fUnicode = starts_with_utf16_bom(p, 0); | |
| 910 | + fUnicode = (starts_with_bom(p) == 2); | |
| 911 | 911 | eType = fUnicode ? looks_like_utf16(p) : looks_like_utf8(p); |
| 912 | 912 | if( eType<-2){ |
| 913 | 913 | const char *zWarning; |
| 914 | + const char *zDisable; | |
| 914 | 915 | const char *zConvert; |
| 915 | 916 | Blob ans; |
| 916 | 917 | char cReply; |
| 917 | 918 | |
| 918 | 919 | if(eType==-4){ |
| 919 | 920 | if (binOk) goto go_on; |
| 920 | 921 | zWarning = "long lines"; |
| 922 | + zDisable = "\"binary-glob\" setting"; | |
| 921 | 923 | zConvert = ""; |
| 922 | 924 | }else{ |
| 923 | - if (unicodeOk) goto go_on; | |
| 925 | + if (encodingOk) goto go_on; | |
| 924 | 926 | zWarning = "invalid UTF-8"; |
| 927 | + zDisable = "\"encoding-glob\" setting"; | |
| 925 | 928 | zConvert = "c=convert/"; |
| 926 | 929 | } |
| 927 | 930 | blob_zero(&ans); |
| 928 | 931 | file_relative_name(zFilename, &fname, 0); |
| 929 | 932 | zMsg = mprintf( |
| 930 | - "%s appears to be text, but contains %s. commit anyhow (%sy/N)? ", | |
| 931 | - blob_str(&fname), zWarning, zConvert); | |
| 933 | + "%s appears to be text, but contains %s. Use --no-warnings or the" | |
| 934 | + " %s to disable this warning.\nCommit anyhow (a=all/%sy/N)? ", | |
| 935 | + blob_str(&fname), zWarning, zDisable, zConvert); | |
| 932 | 936 | prompt_user(zMsg, &ans); |
| 933 | 937 | fossil_free(zMsg); |
| 934 | 938 | cReply = blob_str(&ans)[0]; |
| 935 | 939 | if( *zConvert && (cReply=='c' || cReply=='C') ){ |
| 936 | 940 | char *zOrig = file_newname(zFilename, "original", 1); |
| @@ -950,44 +954,50 @@ | ||
| 950 | 954 | go_on: |
| 951 | 955 | eType +=4 ; |
| 952 | 956 | } |
| 953 | 957 | if( eType==0 || eType==-1 || fUnicode ){ |
| 954 | 958 | const char *zWarning; |
| 959 | + const char *zDisable; | |
| 955 | 960 | const char *zConvert = "c=convert/"; |
| 956 | 961 | Blob ans; |
| 957 | 962 | char cReply; |
| 958 | 963 | |
| 959 | 964 | if( eType==-1 && fUnicode ){ |
| 960 | - if ( crnlOk && unicodeOk ){ | |
| 961 | - return 0; /* We don't want Unicode/CR/NL warnings for this file. */ | |
| 965 | + if ( crnlOk && encodingOk ){ | |
| 966 | + return 0; /* We don't want CR/NL and Unicode warnings for this file. */ | |
| 962 | 967 | } |
| 963 | - zWarning = "Unicode and CR/NL line endings"; | |
| 968 | + zWarning = "CR/NL line endings and Unicode"; | |
| 969 | + zDisable = "\"crnl-glob\" and \"encoding-glob\" settings"; | |
| 964 | 970 | }else if( eType==-1 ){ |
| 965 | 971 | if( crnlOk ){ |
| 966 | 972 | return 0; /* We don't want CR/NL warnings for this file. */ |
| 967 | 973 | } |
| 968 | 974 | zWarning = "CR/NL line endings"; |
| 975 | + zDisable = "\"crnl-glob\" setting"; | |
| 969 | 976 | }else if( eType==0 ){ |
| 970 | 977 | if( binOk ){ |
| 971 | 978 | return 0; /* We don't want binary warnings for this file. */ |
| 972 | 979 | } |
| 973 | 980 | zWarning = "binary data"; |
| 981 | + zDisable = "\"binary-glob\" setting"; | |
| 974 | 982 | zConvert = ""; /* We cannot convert binary files. */ |
| 975 | 983 | }else{ |
| 976 | - if ( unicodeOk ){ | |
| 977 | - return 0; /* We don't want unicode warnings for this file. */ | |
| 984 | + if ( encodingOk ){ | |
| 985 | + return 0; /* We don't want encoding warnings for this file. */ | |
| 978 | 986 | } |
| 979 | 987 | zWarning = "Unicode"; |
| 988 | + zDisable = "\"encoding-glob\" setting"; | |
| 980 | 989 | #ifndef _WIN32 |
| 981 | 990 | zConvert = ""; /* On Unix, we cannot easily convert Unicode files. */ |
| 982 | 991 | #endif |
| 983 | 992 | } |
| 984 | 993 | file_relative_name(zFilename, &fname, 0); |
| 985 | 994 | blob_zero(&ans); |
| 986 | 995 | zMsg = mprintf( |
| 987 | - "%s contains %s. commit anyhow (a=all/%sy/N)? ", | |
| 988 | - blob_str(&fname), zWarning, zConvert); | |
| 996 | + "%s contains %s. Use --no-warnings or the %s to disable this warning.\n" | |
| 997 | + "Commit anyhow (a=all/%sy/N)? ", | |
| 998 | + blob_str(&fname), zWarning, zDisable, zConvert); | |
| 989 | 999 | prompt_user(zMsg, &ans); |
| 990 | 1000 | fossil_free(zMsg); |
| 991 | 1001 | cReply = blob_str(&ans)[0]; |
| 992 | 1002 | if( cReply=='a' || cReply=='A' ){ |
| 993 | 1003 | allOk = 1; |
| @@ -1361,19 +1371,19 @@ | ||
| 1361 | 1371 | ); |
| 1362 | 1372 | while( db_step(&q)==SQLITE_ROW ){ |
| 1363 | 1373 | int id, rid; |
| 1364 | 1374 | const char *zFullname; |
| 1365 | 1375 | Blob content; |
| 1366 | - int crnlOk, binOk, unicodeOk, chnged; | |
| 1376 | + int crnlOk, binOk, encodingOk, chnged; | |
| 1367 | 1377 | |
| 1368 | 1378 | id = db_column_int(&q, 0); |
| 1369 | 1379 | zFullname = db_column_text(&q, 1); |
| 1370 | 1380 | rid = db_column_int(&q, 2); |
| 1371 | 1381 | crnlOk = db_column_int(&q, 3); |
| 1372 | 1382 | chnged = db_column_int(&q, 4); |
| 1373 | 1383 | binOk = db_column_int(&q, 5); |
| 1374 | - unicodeOk = db_column_int(&q, 6); | |
| 1384 | + encodingOk = db_column_int(&q, 6); | |
| 1375 | 1385 | |
| 1376 | 1386 | blob_zero(&content); |
| 1377 | 1387 | if( file_wd_islink(zFullname) ){ |
| 1378 | 1388 | /* Instead of file content, put link destination path */ |
| 1379 | 1389 | blob_read_link(&content, zFullname); |
| @@ -1381,11 +1391,11 @@ | ||
| 1381 | 1391 | blob_read_from_file(&content, zFullname); |
| 1382 | 1392 | } |
| 1383 | 1393 | /* Do not emit any warnings when they are disabled. */ |
| 1384 | 1394 | if( !noWarningFlag ){ |
| 1385 | 1395 | abortCommit |= commit_warning(&content, crnlOk, binOk, |
| 1386 | - unicodeOk, zFullname); | |
| 1396 | + encodingOk, zFullname); | |
| 1387 | 1397 | } |
| 1388 | 1398 | if( chnged==1 && contains_merge_marker(&content) ){ |
| 1389 | 1399 | Blob fname; /* Relative pathname of the file */ |
| 1390 | 1400 | |
| 1391 | 1401 | nConflict++; |
| 1392 | 1402 |
| --- src/checkin.c | |
| +++ src/checkin.c | |
| @@ -895,42 +895,46 @@ | |
| 895 | */ |
| 896 | static int commit_warning( |
| 897 | Blob *p, /* The content of the file being committed. */ |
| 898 | int crnlOk, /* Non-zero if CR/NL warnings should be disabled. */ |
| 899 | int binOk, /* Non-zero if binary warnings should be disabled. */ |
| 900 | int unicodeOk, /* Non-zero if unicode warnings should be disabled. */ |
| 901 | const char *zFilename /* The full name of the file being committed. */ |
| 902 | ){ |
| 903 | int eType; /* return value of looks_like_utf8/utf16() */ |
| 904 | int fUnicode; /* return value of starts_with_utf16_bom() */ |
| 905 | char *zMsg; /* Warning message */ |
| 906 | Blob fname; /* Relative pathname of the file */ |
| 907 | static int allOk = 0; /* Set to true to disable this routine */ |
| 908 | |
| 909 | if( allOk ) return 0; |
| 910 | fUnicode = starts_with_utf16_bom(p, 0); |
| 911 | eType = fUnicode ? looks_like_utf16(p) : looks_like_utf8(p); |
| 912 | if( eType<-2){ |
| 913 | const char *zWarning; |
| 914 | const char *zConvert; |
| 915 | Blob ans; |
| 916 | char cReply; |
| 917 | |
| 918 | if(eType==-4){ |
| 919 | if (binOk) goto go_on; |
| 920 | zWarning = "long lines"; |
| 921 | zConvert = ""; |
| 922 | }else{ |
| 923 | if (unicodeOk) goto go_on; |
| 924 | zWarning = "invalid UTF-8"; |
| 925 | zConvert = "c=convert/"; |
| 926 | } |
| 927 | blob_zero(&ans); |
| 928 | file_relative_name(zFilename, &fname, 0); |
| 929 | zMsg = mprintf( |
| 930 | "%s appears to be text, but contains %s. commit anyhow (%sy/N)? ", |
| 931 | blob_str(&fname), zWarning, zConvert); |
| 932 | prompt_user(zMsg, &ans); |
| 933 | fossil_free(zMsg); |
| 934 | cReply = blob_str(&ans)[0]; |
| 935 | if( *zConvert && (cReply=='c' || cReply=='C') ){ |
| 936 | char *zOrig = file_newname(zFilename, "original", 1); |
| @@ -950,44 +954,50 @@ | |
| 950 | go_on: |
| 951 | eType +=4 ; |
| 952 | } |
| 953 | if( eType==0 || eType==-1 || fUnicode ){ |
| 954 | const char *zWarning; |
| 955 | const char *zConvert = "c=convert/"; |
| 956 | Blob ans; |
| 957 | char cReply; |
| 958 | |
| 959 | if( eType==-1 && fUnicode ){ |
| 960 | if ( crnlOk && unicodeOk ){ |
| 961 | return 0; /* We don't want Unicode/CR/NL warnings for this file. */ |
| 962 | } |
| 963 | zWarning = "Unicode and CR/NL line endings"; |
| 964 | }else if( eType==-1 ){ |
| 965 | if( crnlOk ){ |
| 966 | return 0; /* We don't want CR/NL warnings for this file. */ |
| 967 | } |
| 968 | zWarning = "CR/NL line endings"; |
| 969 | }else if( eType==0 ){ |
| 970 | if( binOk ){ |
| 971 | return 0; /* We don't want binary warnings for this file. */ |
| 972 | } |
| 973 | zWarning = "binary data"; |
| 974 | zConvert = ""; /* We cannot convert binary files. */ |
| 975 | }else{ |
| 976 | if ( unicodeOk ){ |
| 977 | return 0; /* We don't want unicode warnings for this file. */ |
| 978 | } |
| 979 | zWarning = "Unicode"; |
| 980 | #ifndef _WIN32 |
| 981 | zConvert = ""; /* On Unix, we cannot easily convert Unicode files. */ |
| 982 | #endif |
| 983 | } |
| 984 | file_relative_name(zFilename, &fname, 0); |
| 985 | blob_zero(&ans); |
| 986 | zMsg = mprintf( |
| 987 | "%s contains %s. commit anyhow (a=all/%sy/N)? ", |
| 988 | blob_str(&fname), zWarning, zConvert); |
| 989 | prompt_user(zMsg, &ans); |
| 990 | fossil_free(zMsg); |
| 991 | cReply = blob_str(&ans)[0]; |
| 992 | if( cReply=='a' || cReply=='A' ){ |
| 993 | allOk = 1; |
| @@ -1361,19 +1371,19 @@ | |
| 1361 | ); |
| 1362 | while( db_step(&q)==SQLITE_ROW ){ |
| 1363 | int id, rid; |
| 1364 | const char *zFullname; |
| 1365 | Blob content; |
| 1366 | int crnlOk, binOk, unicodeOk, chnged; |
| 1367 | |
| 1368 | id = db_column_int(&q, 0); |
| 1369 | zFullname = db_column_text(&q, 1); |
| 1370 | rid = db_column_int(&q, 2); |
| 1371 | crnlOk = db_column_int(&q, 3); |
| 1372 | chnged = db_column_int(&q, 4); |
| 1373 | binOk = db_column_int(&q, 5); |
| 1374 | unicodeOk = db_column_int(&q, 6); |
| 1375 | |
| 1376 | blob_zero(&content); |
| 1377 | if( file_wd_islink(zFullname) ){ |
| 1378 | /* Instead of file content, put link destination path */ |
| 1379 | blob_read_link(&content, zFullname); |
| @@ -1381,11 +1391,11 @@ | |
| 1381 | blob_read_from_file(&content, zFullname); |
| 1382 | } |
| 1383 | /* Do not emit any warnings when they are disabled. */ |
| 1384 | if( !noWarningFlag ){ |
| 1385 | abortCommit |= commit_warning(&content, crnlOk, binOk, |
| 1386 | unicodeOk, zFullname); |
| 1387 | } |
| 1388 | if( chnged==1 && contains_merge_marker(&content) ){ |
| 1389 | Blob fname; /* Relative pathname of the file */ |
| 1390 | |
| 1391 | nConflict++; |
| 1392 |
| --- src/checkin.c | |
| +++ src/checkin.c | |
| @@ -895,42 +895,46 @@ | |
| 895 | */ |
| 896 | static int commit_warning( |
| 897 | Blob *p, /* The content of the file being committed. */ |
| 898 | int crnlOk, /* Non-zero if CR/NL warnings should be disabled. */ |
| 899 | int binOk, /* Non-zero if binary warnings should be disabled. */ |
| 900 | int encodingOk, /* Non-zero if encoding warnings should be disabled. */ |
| 901 | const char *zFilename /* The full name of the file being committed. */ |
| 902 | ){ |
| 903 | int eType; /* return value of looks_like_utf8/utf16() */ |
| 904 | int fUnicode; /* 1 if blob starts with UTF-16 BOM */ |
| 905 | char *zMsg; /* Warning message */ |
| 906 | Blob fname; /* Relative pathname of the file */ |
| 907 | static int allOk = 0; /* Set to true to disable this routine */ |
| 908 | |
| 909 | if( allOk ) return 0; |
| 910 | fUnicode = (starts_with_bom(p) == 2); |
| 911 | eType = fUnicode ? looks_like_utf16(p) : looks_like_utf8(p); |
| 912 | if( eType<-2){ |
| 913 | const char *zWarning; |
| 914 | const char *zDisable; |
| 915 | const char *zConvert; |
| 916 | Blob ans; |
| 917 | char cReply; |
| 918 | |
| 919 | if(eType==-4){ |
| 920 | if (binOk) goto go_on; |
| 921 | zWarning = "long lines"; |
| 922 | zDisable = "\"binary-glob\" setting"; |
| 923 | zConvert = ""; |
| 924 | }else{ |
| 925 | if (encodingOk) goto go_on; |
| 926 | zWarning = "invalid UTF-8"; |
| 927 | zDisable = "\"encoding-glob\" setting"; |
| 928 | zConvert = "c=convert/"; |
| 929 | } |
| 930 | blob_zero(&ans); |
| 931 | file_relative_name(zFilename, &fname, 0); |
| 932 | zMsg = mprintf( |
| 933 | "%s appears to be text, but contains %s. Use --no-warnings or the" |
| 934 | " %s to disable this warning.\nCommit anyhow (a=all/%sy/N)? ", |
| 935 | blob_str(&fname), zWarning, zDisable, zConvert); |
| 936 | prompt_user(zMsg, &ans); |
| 937 | fossil_free(zMsg); |
| 938 | cReply = blob_str(&ans)[0]; |
| 939 | if( *zConvert && (cReply=='c' || cReply=='C') ){ |
| 940 | char *zOrig = file_newname(zFilename, "original", 1); |
| @@ -950,44 +954,50 @@ | |
| 954 | go_on: |
| 955 | eType +=4 ; |
| 956 | } |
| 957 | if( eType==0 || eType==-1 || fUnicode ){ |
| 958 | const char *zWarning; |
| 959 | const char *zDisable; |
| 960 | const char *zConvert = "c=convert/"; |
| 961 | Blob ans; |
| 962 | char cReply; |
| 963 | |
| 964 | if( eType==-1 && fUnicode ){ |
| 965 | if ( crnlOk && encodingOk ){ |
| 966 | return 0; /* We don't want CR/NL and Unicode warnings for this file. */ |
| 967 | } |
| 968 | zWarning = "CR/NL line endings and Unicode"; |
| 969 | zDisable = "\"crnl-glob\" and \"encoding-glob\" settings"; |
| 970 | }else if( eType==-1 ){ |
| 971 | if( crnlOk ){ |
| 972 | return 0; /* We don't want CR/NL warnings for this file. */ |
| 973 | } |
| 974 | zWarning = "CR/NL line endings"; |
| 975 | zDisable = "\"crnl-glob\" setting"; |
| 976 | }else if( eType==0 ){ |
| 977 | if( binOk ){ |
| 978 | return 0; /* We don't want binary warnings for this file. */ |
| 979 | } |
| 980 | zWarning = "binary data"; |
| 981 | zDisable = "\"binary-glob\" setting"; |
| 982 | zConvert = ""; /* We cannot convert binary files. */ |
| 983 | }else{ |
| 984 | if ( encodingOk ){ |
| 985 | return 0; /* We don't want encoding warnings for this file. */ |
| 986 | } |
| 987 | zWarning = "Unicode"; |
| 988 | zDisable = "\"encoding-glob\" setting"; |
| 989 | #ifndef _WIN32 |
| 990 | zConvert = ""; /* On Unix, we cannot easily convert Unicode files. */ |
| 991 | #endif |
| 992 | } |
| 993 | file_relative_name(zFilename, &fname, 0); |
| 994 | blob_zero(&ans); |
| 995 | zMsg = mprintf( |
| 996 | "%s contains %s. Use --no-warnings or the %s to disable this warning.\n" |
| 997 | "Commit anyhow (a=all/%sy/N)? ", |
| 998 | blob_str(&fname), zWarning, zDisable, zConvert); |
| 999 | prompt_user(zMsg, &ans); |
| 1000 | fossil_free(zMsg); |
| 1001 | cReply = blob_str(&ans)[0]; |
| 1002 | if( cReply=='a' || cReply=='A' ){ |
| 1003 | allOk = 1; |
| @@ -1361,19 +1371,19 @@ | |
| 1371 | ); |
| 1372 | while( db_step(&q)==SQLITE_ROW ){ |
| 1373 | int id, rid; |
| 1374 | const char *zFullname; |
| 1375 | Blob content; |
| 1376 | int crnlOk, binOk, encodingOk, chnged; |
| 1377 | |
| 1378 | id = db_column_int(&q, 0); |
| 1379 | zFullname = db_column_text(&q, 1); |
| 1380 | rid = db_column_int(&q, 2); |
| 1381 | crnlOk = db_column_int(&q, 3); |
| 1382 | chnged = db_column_int(&q, 4); |
| 1383 | binOk = db_column_int(&q, 5); |
| 1384 | encodingOk = db_column_int(&q, 6); |
| 1385 | |
| 1386 | blob_zero(&content); |
| 1387 | if( file_wd_islink(zFullname) ){ |
| 1388 | /* Instead of file content, put link destination path */ |
| 1389 | blob_read_link(&content, zFullname); |
| @@ -1381,11 +1391,11 @@ | |
| 1391 | blob_read_from_file(&content, zFullname); |
| 1392 | } |
| 1393 | /* Do not emit any warnings when they are disabled. */ |
| 1394 | if( !noWarningFlag ){ |
| 1395 | abortCommit |= commit_warning(&content, crnlOk, binOk, |
| 1396 | encodingOk, zFullname); |
| 1397 | } |
| 1398 | if( chnged==1 && contains_merge_marker(&content) ){ |
| 1399 | Blob fname; /* Relative pathname of the file */ |
| 1400 | |
| 1401 | nConflict++; |
| 1402 |
+26
-16
| --- src/checkin.c | ||
| +++ src/checkin.c | ||
| @@ -895,42 +895,46 @@ | ||
| 895 | 895 | */ |
| 896 | 896 | static int commit_warning( |
| 897 | 897 | Blob *p, /* The content of the file being committed. */ |
| 898 | 898 | int crnlOk, /* Non-zero if CR/NL warnings should be disabled. */ |
| 899 | 899 | int binOk, /* Non-zero if binary warnings should be disabled. */ |
| 900 | - int unicodeOk, /* Non-zero if unicode warnings should be disabled. */ | |
| 900 | + int encodingOk, /* Non-zero if encoding warnings should be disabled. */ | |
| 901 | 901 | const char *zFilename /* The full name of the file being committed. */ |
| 902 | 902 | ){ |
| 903 | 903 | int eType; /* return value of looks_like_utf8/utf16() */ |
| 904 | - int fUnicode; /* return value of starts_with_utf16_bom() */ | |
| 904 | + int fUnicode; /* 1 if blob starts with UTF-16 BOM */ | |
| 905 | 905 | char *zMsg; /* Warning message */ |
| 906 | 906 | Blob fname; /* Relative pathname of the file */ |
| 907 | 907 | static int allOk = 0; /* Set to true to disable this routine */ |
| 908 | 908 | |
| 909 | 909 | if( allOk ) return 0; |
| 910 | - fUnicode = starts_with_utf16_bom(p, 0); | |
| 910 | + fUnicode = (starts_with_bom(p) == 2); | |
| 911 | 911 | eType = fUnicode ? looks_like_utf16(p) : looks_like_utf8(p); |
| 912 | 912 | if( eType<-2){ |
| 913 | 913 | const char *zWarning; |
| 914 | + const char *zDisable; | |
| 914 | 915 | const char *zConvert; |
| 915 | 916 | Blob ans; |
| 916 | 917 | char cReply; |
| 917 | 918 | |
| 918 | 919 | if(eType==-4){ |
| 919 | 920 | if (binOk) goto go_on; |
| 920 | 921 | zWarning = "long lines"; |
| 922 | + zDisable = "\"binary-glob\" setting"; | |
| 921 | 923 | zConvert = ""; |
| 922 | 924 | }else{ |
| 923 | - if (unicodeOk) goto go_on; | |
| 925 | + if (encodingOk) goto go_on; | |
| 924 | 926 | zWarning = "invalid UTF-8"; |
| 927 | + zDisable = "\"encoding-glob\" setting"; | |
| 925 | 928 | zConvert = "c=convert/"; |
| 926 | 929 | } |
| 927 | 930 | blob_zero(&ans); |
| 928 | 931 | file_relative_name(zFilename, &fname, 0); |
| 929 | 932 | zMsg = mprintf( |
| 930 | - "%s appears to be text, but contains %s. commit anyhow (%sy/N)? ", | |
| 931 | - blob_str(&fname), zWarning, zConvert); | |
| 933 | + "%s appears to be text, but contains %s. Use --no-warnings or the" | |
| 934 | + " %s to disable this warning.\nCommit anyhow (a=all/%sy/N)? ", | |
| 935 | + blob_str(&fname), zWarning, zDisable, zConvert); | |
| 932 | 936 | prompt_user(zMsg, &ans); |
| 933 | 937 | fossil_free(zMsg); |
| 934 | 938 | cReply = blob_str(&ans)[0]; |
| 935 | 939 | if( *zConvert && (cReply=='c' || cReply=='C') ){ |
| 936 | 940 | char *zOrig = file_newname(zFilename, "original", 1); |
| @@ -950,44 +954,50 @@ | ||
| 950 | 954 | go_on: |
| 951 | 955 | eType +=4 ; |
| 952 | 956 | } |
| 953 | 957 | if( eType==0 || eType==-1 || fUnicode ){ |
| 954 | 958 | const char *zWarning; |
| 959 | + const char *zDisable; | |
| 955 | 960 | const char *zConvert = "c=convert/"; |
| 956 | 961 | Blob ans; |
| 957 | 962 | char cReply; |
| 958 | 963 | |
| 959 | 964 | if( eType==-1 && fUnicode ){ |
| 960 | - if ( crnlOk && unicodeOk ){ | |
| 961 | - return 0; /* We don't want Unicode/CR/NL warnings for this file. */ | |
| 965 | + if ( crnlOk && encodingOk ){ | |
| 966 | + return 0; /* We don't want CR/NL and Unicode warnings for this file. */ | |
| 962 | 967 | } |
| 963 | - zWarning = "Unicode and CR/NL line endings"; | |
| 968 | + zWarning = "CR/NL line endings and Unicode"; | |
| 969 | + zDisable = "\"crnl-glob\" and \"encoding-glob\" settings"; | |
| 964 | 970 | }else if( eType==-1 ){ |
| 965 | 971 | if( crnlOk ){ |
| 966 | 972 | return 0; /* We don't want CR/NL warnings for this file. */ |
| 967 | 973 | } |
| 968 | 974 | zWarning = "CR/NL line endings"; |
| 975 | + zDisable = "\"crnl-glob\" setting"; | |
| 969 | 976 | }else if( eType==0 ){ |
| 970 | 977 | if( binOk ){ |
| 971 | 978 | return 0; /* We don't want binary warnings for this file. */ |
| 972 | 979 | } |
| 973 | 980 | zWarning = "binary data"; |
| 981 | + zDisable = "\"binary-glob\" setting"; | |
| 974 | 982 | zConvert = ""; /* We cannot convert binary files. */ |
| 975 | 983 | }else{ |
| 976 | - if ( unicodeOk ){ | |
| 977 | - return 0; /* We don't want unicode warnings for this file. */ | |
| 984 | + if ( encodingOk ){ | |
| 985 | + return 0; /* We don't want encoding warnings for this file. */ | |
| 978 | 986 | } |
| 979 | 987 | zWarning = "Unicode"; |
| 988 | + zDisable = "\"encoding-glob\" setting"; | |
| 980 | 989 | #ifndef _WIN32 |
| 981 | 990 | zConvert = ""; /* On Unix, we cannot easily convert Unicode files. */ |
| 982 | 991 | #endif |
| 983 | 992 | } |
| 984 | 993 | file_relative_name(zFilename, &fname, 0); |
| 985 | 994 | blob_zero(&ans); |
| 986 | 995 | zMsg = mprintf( |
| 987 | - "%s contains %s. commit anyhow (a=all/%sy/N)? ", | |
| 988 | - blob_str(&fname), zWarning, zConvert); | |
| 996 | + "%s contains %s. Use --no-warnings or the %s to disable this warning.\n" | |
| 997 | + "Commit anyhow (a=all/%sy/N)? ", | |
| 998 | + blob_str(&fname), zWarning, zDisable, zConvert); | |
| 989 | 999 | prompt_user(zMsg, &ans); |
| 990 | 1000 | fossil_free(zMsg); |
| 991 | 1001 | cReply = blob_str(&ans)[0]; |
| 992 | 1002 | if( cReply=='a' || cReply=='A' ){ |
| 993 | 1003 | allOk = 1; |
| @@ -1361,19 +1371,19 @@ | ||
| 1361 | 1371 | ); |
| 1362 | 1372 | while( db_step(&q)==SQLITE_ROW ){ |
| 1363 | 1373 | int id, rid; |
| 1364 | 1374 | const char *zFullname; |
| 1365 | 1375 | Blob content; |
| 1366 | - int crnlOk, binOk, unicodeOk, chnged; | |
| 1376 | + int crnlOk, binOk, encodingOk, chnged; | |
| 1367 | 1377 | |
| 1368 | 1378 | id = db_column_int(&q, 0); |
| 1369 | 1379 | zFullname = db_column_text(&q, 1); |
| 1370 | 1380 | rid = db_column_int(&q, 2); |
| 1371 | 1381 | crnlOk = db_column_int(&q, 3); |
| 1372 | 1382 | chnged = db_column_int(&q, 4); |
| 1373 | 1383 | binOk = db_column_int(&q, 5); |
| 1374 | - unicodeOk = db_column_int(&q, 6); | |
| 1384 | + encodingOk = db_column_int(&q, 6); | |
| 1375 | 1385 | |
| 1376 | 1386 | blob_zero(&content); |
| 1377 | 1387 | if( file_wd_islink(zFullname) ){ |
| 1378 | 1388 | /* Instead of file content, put link destination path */ |
| 1379 | 1389 | blob_read_link(&content, zFullname); |
| @@ -1381,11 +1391,11 @@ | ||
| 1381 | 1391 | blob_read_from_file(&content, zFullname); |
| 1382 | 1392 | } |
| 1383 | 1393 | /* Do not emit any warnings when they are disabled. */ |
| 1384 | 1394 | if( !noWarningFlag ){ |
| 1385 | 1395 | abortCommit |= commit_warning(&content, crnlOk, binOk, |
| 1386 | - unicodeOk, zFullname); | |
| 1396 | + encodingOk, zFullname); | |
| 1387 | 1397 | } |
| 1388 | 1398 | if( chnged==1 && contains_merge_marker(&content) ){ |
| 1389 | 1399 | Blob fname; /* Relative pathname of the file */ |
| 1390 | 1400 | |
| 1391 | 1401 | nConflict++; |
| 1392 | 1402 |
| --- src/checkin.c | |
| +++ src/checkin.c | |
| @@ -895,42 +895,46 @@ | |
| 895 | */ |
| 896 | static int commit_warning( |
| 897 | Blob *p, /* The content of the file being committed. */ |
| 898 | int crnlOk, /* Non-zero if CR/NL warnings should be disabled. */ |
| 899 | int binOk, /* Non-zero if binary warnings should be disabled. */ |
| 900 | int unicodeOk, /* Non-zero if unicode warnings should be disabled. */ |
| 901 | const char *zFilename /* The full name of the file being committed. */ |
| 902 | ){ |
| 903 | int eType; /* return value of looks_like_utf8/utf16() */ |
| 904 | int fUnicode; /* return value of starts_with_utf16_bom() */ |
| 905 | char *zMsg; /* Warning message */ |
| 906 | Blob fname; /* Relative pathname of the file */ |
| 907 | static int allOk = 0; /* Set to true to disable this routine */ |
| 908 | |
| 909 | if( allOk ) return 0; |
| 910 | fUnicode = starts_with_utf16_bom(p, 0); |
| 911 | eType = fUnicode ? looks_like_utf16(p) : looks_like_utf8(p); |
| 912 | if( eType<-2){ |
| 913 | const char *zWarning; |
| 914 | const char *zConvert; |
| 915 | Blob ans; |
| 916 | char cReply; |
| 917 | |
| 918 | if(eType==-4){ |
| 919 | if (binOk) goto go_on; |
| 920 | zWarning = "long lines"; |
| 921 | zConvert = ""; |
| 922 | }else{ |
| 923 | if (unicodeOk) goto go_on; |
| 924 | zWarning = "invalid UTF-8"; |
| 925 | zConvert = "c=convert/"; |
| 926 | } |
| 927 | blob_zero(&ans); |
| 928 | file_relative_name(zFilename, &fname, 0); |
| 929 | zMsg = mprintf( |
| 930 | "%s appears to be text, but contains %s. commit anyhow (%sy/N)? ", |
| 931 | blob_str(&fname), zWarning, zConvert); |
| 932 | prompt_user(zMsg, &ans); |
| 933 | fossil_free(zMsg); |
| 934 | cReply = blob_str(&ans)[0]; |
| 935 | if( *zConvert && (cReply=='c' || cReply=='C') ){ |
| 936 | char *zOrig = file_newname(zFilename, "original", 1); |
| @@ -950,44 +954,50 @@ | |
| 950 | go_on: |
| 951 | eType +=4 ; |
| 952 | } |
| 953 | if( eType==0 || eType==-1 || fUnicode ){ |
| 954 | const char *zWarning; |
| 955 | const char *zConvert = "c=convert/"; |
| 956 | Blob ans; |
| 957 | char cReply; |
| 958 | |
| 959 | if( eType==-1 && fUnicode ){ |
| 960 | if ( crnlOk && unicodeOk ){ |
| 961 | return 0; /* We don't want Unicode/CR/NL warnings for this file. */ |
| 962 | } |
| 963 | zWarning = "Unicode and CR/NL line endings"; |
| 964 | }else if( eType==-1 ){ |
| 965 | if( crnlOk ){ |
| 966 | return 0; /* We don't want CR/NL warnings for this file. */ |
| 967 | } |
| 968 | zWarning = "CR/NL line endings"; |
| 969 | }else if( eType==0 ){ |
| 970 | if( binOk ){ |
| 971 | return 0; /* We don't want binary warnings for this file. */ |
| 972 | } |
| 973 | zWarning = "binary data"; |
| 974 | zConvert = ""; /* We cannot convert binary files. */ |
| 975 | }else{ |
| 976 | if ( unicodeOk ){ |
| 977 | return 0; /* We don't want unicode warnings for this file. */ |
| 978 | } |
| 979 | zWarning = "Unicode"; |
| 980 | #ifndef _WIN32 |
| 981 | zConvert = ""; /* On Unix, we cannot easily convert Unicode files. */ |
| 982 | #endif |
| 983 | } |
| 984 | file_relative_name(zFilename, &fname, 0); |
| 985 | blob_zero(&ans); |
| 986 | zMsg = mprintf( |
| 987 | "%s contains %s. commit anyhow (a=all/%sy/N)? ", |
| 988 | blob_str(&fname), zWarning, zConvert); |
| 989 | prompt_user(zMsg, &ans); |
| 990 | fossil_free(zMsg); |
| 991 | cReply = blob_str(&ans)[0]; |
| 992 | if( cReply=='a' || cReply=='A' ){ |
| 993 | allOk = 1; |
| @@ -1361,19 +1371,19 @@ | |
| 1361 | ); |
| 1362 | while( db_step(&q)==SQLITE_ROW ){ |
| 1363 | int id, rid; |
| 1364 | const char *zFullname; |
| 1365 | Blob content; |
| 1366 | int crnlOk, binOk, unicodeOk, chnged; |
| 1367 | |
| 1368 | id = db_column_int(&q, 0); |
| 1369 | zFullname = db_column_text(&q, 1); |
| 1370 | rid = db_column_int(&q, 2); |
| 1371 | crnlOk = db_column_int(&q, 3); |
| 1372 | chnged = db_column_int(&q, 4); |
| 1373 | binOk = db_column_int(&q, 5); |
| 1374 | unicodeOk = db_column_int(&q, 6); |
| 1375 | |
| 1376 | blob_zero(&content); |
| 1377 | if( file_wd_islink(zFullname) ){ |
| 1378 | /* Instead of file content, put link destination path */ |
| 1379 | blob_read_link(&content, zFullname); |
| @@ -1381,11 +1391,11 @@ | |
| 1381 | blob_read_from_file(&content, zFullname); |
| 1382 | } |
| 1383 | /* Do not emit any warnings when they are disabled. */ |
| 1384 | if( !noWarningFlag ){ |
| 1385 | abortCommit |= commit_warning(&content, crnlOk, binOk, |
| 1386 | unicodeOk, zFullname); |
| 1387 | } |
| 1388 | if( chnged==1 && contains_merge_marker(&content) ){ |
| 1389 | Blob fname; /* Relative pathname of the file */ |
| 1390 | |
| 1391 | nConflict++; |
| 1392 |
| --- src/checkin.c | |
| +++ src/checkin.c | |
| @@ -895,42 +895,46 @@ | |
| 895 | */ |
| 896 | static int commit_warning( |
| 897 | Blob *p, /* The content of the file being committed. */ |
| 898 | int crnlOk, /* Non-zero if CR/NL warnings should be disabled. */ |
| 899 | int binOk, /* Non-zero if binary warnings should be disabled. */ |
| 900 | int encodingOk, /* Non-zero if encoding warnings should be disabled. */ |
| 901 | const char *zFilename /* The full name of the file being committed. */ |
| 902 | ){ |
| 903 | int eType; /* return value of looks_like_utf8/utf16() */ |
| 904 | int fUnicode; /* 1 if blob starts with UTF-16 BOM */ |
| 905 | char *zMsg; /* Warning message */ |
| 906 | Blob fname; /* Relative pathname of the file */ |
| 907 | static int allOk = 0; /* Set to true to disable this routine */ |
| 908 | |
| 909 | if( allOk ) return 0; |
| 910 | fUnicode = (starts_with_bom(p) == 2); |
| 911 | eType = fUnicode ? looks_like_utf16(p) : looks_like_utf8(p); |
| 912 | if( eType<-2){ |
| 913 | const char *zWarning; |
| 914 | const char *zDisable; |
| 915 | const char *zConvert; |
| 916 | Blob ans; |
| 917 | char cReply; |
| 918 | |
| 919 | if(eType==-4){ |
| 920 | if (binOk) goto go_on; |
| 921 | zWarning = "long lines"; |
| 922 | zDisable = "\"binary-glob\" setting"; |
| 923 | zConvert = ""; |
| 924 | }else{ |
| 925 | if (encodingOk) goto go_on; |
| 926 | zWarning = "invalid UTF-8"; |
| 927 | zDisable = "\"encoding-glob\" setting"; |
| 928 | zConvert = "c=convert/"; |
| 929 | } |
| 930 | blob_zero(&ans); |
| 931 | file_relative_name(zFilename, &fname, 0); |
| 932 | zMsg = mprintf( |
| 933 | "%s appears to be text, but contains %s. Use --no-warnings or the" |
| 934 | " %s to disable this warning.\nCommit anyhow (a=all/%sy/N)? ", |
| 935 | blob_str(&fname), zWarning, zDisable, zConvert); |
| 936 | prompt_user(zMsg, &ans); |
| 937 | fossil_free(zMsg); |
| 938 | cReply = blob_str(&ans)[0]; |
| 939 | if( *zConvert && (cReply=='c' || cReply=='C') ){ |
| 940 | char *zOrig = file_newname(zFilename, "original", 1); |
| @@ -950,44 +954,50 @@ | |
| 954 | go_on: |
| 955 | eType +=4 ; |
| 956 | } |
| 957 | if( eType==0 || eType==-1 || fUnicode ){ |
| 958 | const char *zWarning; |
| 959 | const char *zDisable; |
| 960 | const char *zConvert = "c=convert/"; |
| 961 | Blob ans; |
| 962 | char cReply; |
| 963 | |
| 964 | if( eType==-1 && fUnicode ){ |
| 965 | if ( crnlOk && encodingOk ){ |
| 966 | return 0; /* We don't want CR/NL and Unicode warnings for this file. */ |
| 967 | } |
| 968 | zWarning = "CR/NL line endings and Unicode"; |
| 969 | zDisable = "\"crnl-glob\" and \"encoding-glob\" settings"; |
| 970 | }else if( eType==-1 ){ |
| 971 | if( crnlOk ){ |
| 972 | return 0; /* We don't want CR/NL warnings for this file. */ |
| 973 | } |
| 974 | zWarning = "CR/NL line endings"; |
| 975 | zDisable = "\"crnl-glob\" setting"; |
| 976 | }else if( eType==0 ){ |
| 977 | if( binOk ){ |
| 978 | return 0; /* We don't want binary warnings for this file. */ |
| 979 | } |
| 980 | zWarning = "binary data"; |
| 981 | zDisable = "\"binary-glob\" setting"; |
| 982 | zConvert = ""; /* We cannot convert binary files. */ |
| 983 | }else{ |
| 984 | if ( encodingOk ){ |
| 985 | return 0; /* We don't want encoding warnings for this file. */ |
| 986 | } |
| 987 | zWarning = "Unicode"; |
| 988 | zDisable = "\"encoding-glob\" setting"; |
| 989 | #ifndef _WIN32 |
| 990 | zConvert = ""; /* On Unix, we cannot easily convert Unicode files. */ |
| 991 | #endif |
| 992 | } |
| 993 | file_relative_name(zFilename, &fname, 0); |
| 994 | blob_zero(&ans); |
| 995 | zMsg = mprintf( |
| 996 | "%s contains %s. Use --no-warnings or the %s to disable this warning.\n" |
| 997 | "Commit anyhow (a=all/%sy/N)? ", |
| 998 | blob_str(&fname), zWarning, zDisable, zConvert); |
| 999 | prompt_user(zMsg, &ans); |
| 1000 | fossil_free(zMsg); |
| 1001 | cReply = blob_str(&ans)[0]; |
| 1002 | if( cReply=='a' || cReply=='A' ){ |
| 1003 | allOk = 1; |
| @@ -1361,19 +1371,19 @@ | |
| 1371 | ); |
| 1372 | while( db_step(&q)==SQLITE_ROW ){ |
| 1373 | int id, rid; |
| 1374 | const char *zFullname; |
| 1375 | Blob content; |
| 1376 | int crnlOk, binOk, encodingOk, chnged; |
| 1377 | |
| 1378 | id = db_column_int(&q, 0); |
| 1379 | zFullname = db_column_text(&q, 1); |
| 1380 | rid = db_column_int(&q, 2); |
| 1381 | crnlOk = db_column_int(&q, 3); |
| 1382 | chnged = db_column_int(&q, 4); |
| 1383 | binOk = db_column_int(&q, 5); |
| 1384 | encodingOk = db_column_int(&q, 6); |
| 1385 | |
| 1386 | blob_zero(&content); |
| 1387 | if( file_wd_islink(zFullname) ){ |
| 1388 | /* Instead of file content, put link destination path */ |
| 1389 | blob_read_link(&content, zFullname); |
| @@ -1381,11 +1391,11 @@ | |
| 1391 | blob_read_from_file(&content, zFullname); |
| 1392 | } |
| 1393 | /* Do not emit any warnings when they are disabled. */ |
| 1394 | if( !noWarningFlag ){ |
| 1395 | abortCommit |= commit_warning(&content, crnlOk, binOk, |
| 1396 | encodingOk, zFullname); |
| 1397 | } |
| 1398 | if( chnged==1 && contains_merge_marker(&content) ){ |
| 1399 | Blob fname; /* Relative pathname of the file */ |
| 1400 | |
| 1401 | nConflict++; |
| 1402 |
| --- src/cson_amalgamation.h | ||
| +++ src/cson_amalgamation.h | ||
| @@ -1,6 +1,9 @@ | ||
| 1 | 1 | #ifdef FOSSIL_ENABLE_JSON |
| 2 | +#ifndef CSON_FOSSIL_MODE | |
| 3 | +#define CSON_FOSSIL_MODE | |
| 4 | +#endif | |
| 2 | 5 | /* auto-generated! Do not edit! */ |
| 3 | 6 | /* begin file include/wh/cson/cson.h */ |
| 4 | 7 | #if !defined(WANDERINGHORSE_NET_CSON_H_INCLUDED) |
| 5 | 8 | #define WANDERINGHORSE_NET_CSON_H_INCLUDED 1 |
| 6 | 9 | |
| 7 | 10 |
| --- src/cson_amalgamation.h | |
| +++ src/cson_amalgamation.h | |
| @@ -1,6 +1,9 @@ | |
| 1 | #ifdef FOSSIL_ENABLE_JSON |
| 2 | /* auto-generated! Do not edit! */ |
| 3 | /* begin file include/wh/cson/cson.h */ |
| 4 | #if !defined(WANDERINGHORSE_NET_CSON_H_INCLUDED) |
| 5 | #define WANDERINGHORSE_NET_CSON_H_INCLUDED 1 |
| 6 | |
| 7 |
| --- src/cson_amalgamation.h | |
| +++ src/cson_amalgamation.h | |
| @@ -1,6 +1,9 @@ | |
| 1 | #ifdef FOSSIL_ENABLE_JSON |
| 2 | #ifndef CSON_FOSSIL_MODE |
| 3 | #define CSON_FOSSIL_MODE |
| 4 | #endif |
| 5 | /* auto-generated! Do not edit! */ |
| 6 | /* begin file include/wh/cson/cson.h */ |
| 7 | #if !defined(WANDERINGHORSE_NET_CSON_H_INCLUDED) |
| 8 | #define WANDERINGHORSE_NET_CSON_H_INCLUDED 1 |
| 9 | |
| 10 |
M
src/db.c
+15
-15
| --- src/db.c | ||
| +++ src/db.c | ||
| @@ -2064,16 +2064,17 @@ | ||
| 2064 | 2064 | { "default-perms", 0, 16, 0, "u" }, |
| 2065 | 2065 | { "diff-binary", 0, 0, 0, "on" }, |
| 2066 | 2066 | { "diff-command", 0, 40, 0, "" }, |
| 2067 | 2067 | { "dont-push", 0, 0, 0, "off" }, |
| 2068 | 2068 | { "editor", 0, 32, 0, "" }, |
| 2069 | + { "empty-dirs", 0, 40, 1, "" }, | |
| 2070 | + { "encoding-glob", 0, 40, 1, "" }, | |
| 2069 | 2071 | { "gdiff-command", 0, 40, 0, "gdiff" }, |
| 2070 | 2072 | { "gmerge-command",0, 40, 0, "" }, |
| 2073 | + { "http-port", 0, 16, 0, "8080" }, | |
| 2071 | 2074 | { "https-login", 0, 0, 0, "off" }, |
| 2072 | 2075 | { "ignore-glob", 0, 40, 1, "" }, |
| 2073 | - { "empty-dirs", 0, 40, 1, "" }, | |
| 2074 | - { "http-port", 0, 16, 0, "8080" }, | |
| 2075 | 2076 | { "localauth", 0, 0, 0, "off" }, |
| 2076 | 2077 | { "main-branch", 0, 40, 0, "trunk" }, |
| 2077 | 2078 | { "manifest", 0, 0, 1, "off" }, |
| 2078 | 2079 | #ifdef FOSSIL_ENABLE_MARKDOWN |
| 2079 | 2080 | { "markdown", 0, 0, 0, "off" }, |
| @@ -2083,19 +2084,18 @@ | ||
| 2083 | 2084 | { "pgp-command", 0, 40, 0, "gpg --clearsign -o " }, |
| 2084 | 2085 | { "proxy", 0, 32, 0, "off" }, |
| 2085 | 2086 | { "relative-paths",0, 0, 0, "on" }, |
| 2086 | 2087 | { "repo-cksum", 0, 0, 0, "on" }, |
| 2087 | 2088 | { "self-register", 0, 0, 0, "off" }, |
| 2089 | + { "ssh-command", 0, 40, 0, "" }, | |
| 2088 | 2090 | { "ssl-ca-location",0, 40, 0, "" }, |
| 2089 | 2091 | { "ssl-identity", 0, 40, 0, "" }, |
| 2090 | - { "ssh-command", 0, 40, 0, "" }, | |
| 2091 | - { "th1-setup", 0, 40, 0, "" }, | |
| 2092 | 2092 | #ifdef FOSSIL_ENABLE_TCL |
| 2093 | 2093 | { "tcl", 0, 0, 0, "off" }, |
| 2094 | 2094 | { "tcl-setup", 0, 40, 0, "" }, |
| 2095 | 2095 | #endif |
| 2096 | - { "encoding-glob", 0, 40, 1, "" }, | |
| 2096 | + { "th1-setup", 0, 40, 0, "" }, | |
| 2097 | 2097 | { "web-browser", 0, 32, 0, "" }, |
| 2098 | 2098 | { "white-foreground", 0, 0, 0, "off" }, |
| 2099 | 2099 | { 0,0,0,0,0 } |
| 2100 | 2100 | }; |
| 2101 | 2101 | |
| @@ -2172,17 +2172,23 @@ | ||
| 2172 | 2172 | ** diff-command External command to run when performing a diff. |
| 2173 | 2173 | ** If undefined, the internal text diff will be used. |
| 2174 | 2174 | ** |
| 2175 | 2175 | ** dont-push Prevent this repository from pushing from client to |
| 2176 | 2176 | ** server. Useful when setting up a private branch. |
| 2177 | +** | |
| 2178 | +** editor Text editor command used for check-in comments. | |
| 2177 | 2179 | ** |
| 2178 | 2180 | ** empty-dirs A comma or newline-separated list of pathnames. On |
| 2179 | 2181 | ** (versionable) update and checkout commands, if no file or directory |
| 2180 | 2182 | ** exists with that name, an empty directory will be |
| 2181 | 2183 | ** created. |
| 2182 | 2184 | ** |
| 2183 | -** editor Text editor command used for check-in comments. | |
| 2185 | +** encoding-glob The VALUE is a comma or newline-separated list of GLOB | |
| 2186 | +** (versionable) patterns specifying files that the "commit" command will | |
| 2187 | +** ignore when issuing warnings about text files that may | |
| 2188 | +** use another encoding than ASCII or UTF-8. Set to "*" | |
| 2189 | +** to disable encoding checking. | |
| 2184 | 2190 | ** |
| 2185 | 2191 | ** gdiff-command External command to run when performing a graphical |
| 2186 | 2192 | ** diff. If undefined, text diff will be used. |
| 2187 | 2193 | ** |
| 2188 | 2194 | ** gmerge-command A graphical merge conflict resolver command operating |
| @@ -2241,10 +2247,13 @@ | ||
| 2241 | 2247 | ** |
| 2242 | 2248 | ** self-register Allow users to register themselves through the HTTP UI. |
| 2243 | 2249 | ** This is useful if you want to see other names than |
| 2244 | 2250 | ** "Anonymous" in e.g. ticketing system. On the other hand |
| 2245 | 2251 | ** users can not be deleted. Default: off. |
| 2252 | +** | |
| 2253 | +** ssh-command Command used to talk to a remote machine with | |
| 2254 | +** the "ssh://" protocol. | |
| 2246 | 2255 | ** |
| 2247 | 2256 | ** ssl-ca-location The full pathname to a file containing PEM encoded |
| 2248 | 2257 | ** CA root certificates, or a directory of certificates |
| 2249 | 2258 | ** with filenames formed from the certificate hashes as |
| 2250 | 2259 | ** required by OpenSSL. |
| @@ -2260,13 +2269,10 @@ | ||
| 2260 | 2269 | ** the certificate and private key files. |
| 2261 | 2270 | ** This identity will be presented to SSL servers to |
| 2262 | 2271 | ** authenticate this client, in addition to the normal |
| 2263 | 2272 | ** password authentication. |
| 2264 | 2273 | ** |
| 2265 | -** ssh-command Command used to talk to a remote machine with | |
| 2266 | -** the "ssh://" protocol. | |
| 2267 | -** | |
| 2268 | 2274 | ** tcl If enabled (and Fossil was compiled with Tcl support), |
| 2269 | 2275 | ** Tcl integration commands will be added to the TH1 |
| 2270 | 2276 | ** interpreter, allowing arbitrary Tcl expressions and |
| 2271 | 2277 | ** scripts to be evaluated from TH1. Additionally, the Tcl |
| 2272 | 2278 | ** interpreter will be able to evaluate arbitrary TH1 |
| @@ -2278,16 +2284,10 @@ | ||
| 2278 | 2284 | ** |
| 2279 | 2285 | ** th1-setup This is the setup script to be evaluated after creating |
| 2280 | 2286 | ** and initializing the TH1 interpreter. By default, this |
| 2281 | 2287 | ** is empty and no extra setup is performed. |
| 2282 | 2288 | ** |
| 2283 | -** encoding-glob The VALUE is a comma or newline-separated list of GLOB | |
| 2284 | -** (versionable) patterns specifying files that the "commit" command will | |
| 2285 | -** ignore when issuing warnings about text files that may | |
| 2286 | -** use an encoding other than ASCII or UTF-8 . Set to "*" | |
| 2287 | -** to disable encoding checking. | |
| 2288 | -** | |
| 2289 | 2289 | ** web-browser A shell command used to launch your preferred |
| 2290 | 2290 | ** web browser when given a URL as an argument. |
| 2291 | 2291 | ** Defaults to "start" on windows, "open" on Mac, |
| 2292 | 2292 | ** and "firefox" on Unix. |
| 2293 | 2293 | ** |
| 2294 | 2294 |
| --- src/db.c | |
| +++ src/db.c | |
| @@ -2064,16 +2064,17 @@ | |
| 2064 | { "default-perms", 0, 16, 0, "u" }, |
| 2065 | { "diff-binary", 0, 0, 0, "on" }, |
| 2066 | { "diff-command", 0, 40, 0, "" }, |
| 2067 | { "dont-push", 0, 0, 0, "off" }, |
| 2068 | { "editor", 0, 32, 0, "" }, |
| 2069 | { "gdiff-command", 0, 40, 0, "gdiff" }, |
| 2070 | { "gmerge-command",0, 40, 0, "" }, |
| 2071 | { "https-login", 0, 0, 0, "off" }, |
| 2072 | { "ignore-glob", 0, 40, 1, "" }, |
| 2073 | { "empty-dirs", 0, 40, 1, "" }, |
| 2074 | { "http-port", 0, 16, 0, "8080" }, |
| 2075 | { "localauth", 0, 0, 0, "off" }, |
| 2076 | { "main-branch", 0, 40, 0, "trunk" }, |
| 2077 | { "manifest", 0, 0, 1, "off" }, |
| 2078 | #ifdef FOSSIL_ENABLE_MARKDOWN |
| 2079 | { "markdown", 0, 0, 0, "off" }, |
| @@ -2083,19 +2084,18 @@ | |
| 2083 | { "pgp-command", 0, 40, 0, "gpg --clearsign -o " }, |
| 2084 | { "proxy", 0, 32, 0, "off" }, |
| 2085 | { "relative-paths",0, 0, 0, "on" }, |
| 2086 | { "repo-cksum", 0, 0, 0, "on" }, |
| 2087 | { "self-register", 0, 0, 0, "off" }, |
| 2088 | { "ssl-ca-location",0, 40, 0, "" }, |
| 2089 | { "ssl-identity", 0, 40, 0, "" }, |
| 2090 | { "ssh-command", 0, 40, 0, "" }, |
| 2091 | { "th1-setup", 0, 40, 0, "" }, |
| 2092 | #ifdef FOSSIL_ENABLE_TCL |
| 2093 | { "tcl", 0, 0, 0, "off" }, |
| 2094 | { "tcl-setup", 0, 40, 0, "" }, |
| 2095 | #endif |
| 2096 | { "encoding-glob", 0, 40, 1, "" }, |
| 2097 | { "web-browser", 0, 32, 0, "" }, |
| 2098 | { "white-foreground", 0, 0, 0, "off" }, |
| 2099 | { 0,0,0,0,0 } |
| 2100 | }; |
| 2101 | |
| @@ -2172,17 +2172,23 @@ | |
| 2172 | ** diff-command External command to run when performing a diff. |
| 2173 | ** If undefined, the internal text diff will be used. |
| 2174 | ** |
| 2175 | ** dont-push Prevent this repository from pushing from client to |
| 2176 | ** server. Useful when setting up a private branch. |
| 2177 | ** |
| 2178 | ** empty-dirs A comma or newline-separated list of pathnames. On |
| 2179 | ** (versionable) update and checkout commands, if no file or directory |
| 2180 | ** exists with that name, an empty directory will be |
| 2181 | ** created. |
| 2182 | ** |
| 2183 | ** editor Text editor command used for check-in comments. |
| 2184 | ** |
| 2185 | ** gdiff-command External command to run when performing a graphical |
| 2186 | ** diff. If undefined, text diff will be used. |
| 2187 | ** |
| 2188 | ** gmerge-command A graphical merge conflict resolver command operating |
| @@ -2241,10 +2247,13 @@ | |
| 2241 | ** |
| 2242 | ** self-register Allow users to register themselves through the HTTP UI. |
| 2243 | ** This is useful if you want to see other names than |
| 2244 | ** "Anonymous" in e.g. ticketing system. On the other hand |
| 2245 | ** users can not be deleted. Default: off. |
| 2246 | ** |
| 2247 | ** ssl-ca-location The full pathname to a file containing PEM encoded |
| 2248 | ** CA root certificates, or a directory of certificates |
| 2249 | ** with filenames formed from the certificate hashes as |
| 2250 | ** required by OpenSSL. |
| @@ -2260,13 +2269,10 @@ | |
| 2260 | ** the certificate and private key files. |
| 2261 | ** This identity will be presented to SSL servers to |
| 2262 | ** authenticate this client, in addition to the normal |
| 2263 | ** password authentication. |
| 2264 | ** |
| 2265 | ** ssh-command Command used to talk to a remote machine with |
| 2266 | ** the "ssh://" protocol. |
| 2267 | ** |
| 2268 | ** tcl If enabled (and Fossil was compiled with Tcl support), |
| 2269 | ** Tcl integration commands will be added to the TH1 |
| 2270 | ** interpreter, allowing arbitrary Tcl expressions and |
| 2271 | ** scripts to be evaluated from TH1. Additionally, the Tcl |
| 2272 | ** interpreter will be able to evaluate arbitrary TH1 |
| @@ -2278,16 +2284,10 @@ | |
| 2278 | ** |
| 2279 | ** th1-setup This is the setup script to be evaluated after creating |
| 2280 | ** and initializing the TH1 interpreter. By default, this |
| 2281 | ** is empty and no extra setup is performed. |
| 2282 | ** |
| 2283 | ** encoding-glob The VALUE is a comma or newline-separated list of GLOB |
| 2284 | ** (versionable) patterns specifying files that the "commit" command will |
| 2285 | ** ignore when issuing warnings about text files that may |
| 2286 | ** use an encoding other than ASCII or UTF-8 . Set to "*" |
| 2287 | ** to disable encoding checking. |
| 2288 | ** |
| 2289 | ** web-browser A shell command used to launch your preferred |
| 2290 | ** web browser when given a URL as an argument. |
| 2291 | ** Defaults to "start" on windows, "open" on Mac, |
| 2292 | ** and "firefox" on Unix. |
| 2293 | ** |
| 2294 |
| --- src/db.c | |
| +++ src/db.c | |
| @@ -2064,16 +2064,17 @@ | |
| 2064 | { "default-perms", 0, 16, 0, "u" }, |
| 2065 | { "diff-binary", 0, 0, 0, "on" }, |
| 2066 | { "diff-command", 0, 40, 0, "" }, |
| 2067 | { "dont-push", 0, 0, 0, "off" }, |
| 2068 | { "editor", 0, 32, 0, "" }, |
| 2069 | { "empty-dirs", 0, 40, 1, "" }, |
| 2070 | { "encoding-glob", 0, 40, 1, "" }, |
| 2071 | { "gdiff-command", 0, 40, 0, "gdiff" }, |
| 2072 | { "gmerge-command",0, 40, 0, "" }, |
| 2073 | { "http-port", 0, 16, 0, "8080" }, |
| 2074 | { "https-login", 0, 0, 0, "off" }, |
| 2075 | { "ignore-glob", 0, 40, 1, "" }, |
| 2076 | { "localauth", 0, 0, 0, "off" }, |
| 2077 | { "main-branch", 0, 40, 0, "trunk" }, |
| 2078 | { "manifest", 0, 0, 1, "off" }, |
| 2079 | #ifdef FOSSIL_ENABLE_MARKDOWN |
| 2080 | { "markdown", 0, 0, 0, "off" }, |
| @@ -2083,19 +2084,18 @@ | |
| 2084 | { "pgp-command", 0, 40, 0, "gpg --clearsign -o " }, |
| 2085 | { "proxy", 0, 32, 0, "off" }, |
| 2086 | { "relative-paths",0, 0, 0, "on" }, |
| 2087 | { "repo-cksum", 0, 0, 0, "on" }, |
| 2088 | { "self-register", 0, 0, 0, "off" }, |
| 2089 | { "ssh-command", 0, 40, 0, "" }, |
| 2090 | { "ssl-ca-location",0, 40, 0, "" }, |
| 2091 | { "ssl-identity", 0, 40, 0, "" }, |
| 2092 | #ifdef FOSSIL_ENABLE_TCL |
| 2093 | { "tcl", 0, 0, 0, "off" }, |
| 2094 | { "tcl-setup", 0, 40, 0, "" }, |
| 2095 | #endif |
| 2096 | { "th1-setup", 0, 40, 0, "" }, |
| 2097 | { "web-browser", 0, 32, 0, "" }, |
| 2098 | { "white-foreground", 0, 0, 0, "off" }, |
| 2099 | { 0,0,0,0,0 } |
| 2100 | }; |
| 2101 | |
| @@ -2172,17 +2172,23 @@ | |
| 2172 | ** diff-command External command to run when performing a diff. |
| 2173 | ** If undefined, the internal text diff will be used. |
| 2174 | ** |
| 2175 | ** dont-push Prevent this repository from pushing from client to |
| 2176 | ** server. Useful when setting up a private branch. |
| 2177 | ** |
| 2178 | ** editor Text editor command used for check-in comments. |
| 2179 | ** |
| 2180 | ** empty-dirs A comma or newline-separated list of pathnames. On |
| 2181 | ** (versionable) update and checkout commands, if no file or directory |
| 2182 | ** exists with that name, an empty directory will be |
| 2183 | ** created. |
| 2184 | ** |
| 2185 | ** encoding-glob The VALUE is a comma or newline-separated list of GLOB |
| 2186 | ** (versionable) patterns specifying files that the "commit" command will |
| 2187 | ** ignore when issuing warnings about text files that may |
| 2188 | ** use another encoding than ASCII or UTF-8. Set to "*" |
| 2189 | ** to disable encoding checking. |
| 2190 | ** |
| 2191 | ** gdiff-command External command to run when performing a graphical |
| 2192 | ** diff. If undefined, text diff will be used. |
| 2193 | ** |
| 2194 | ** gmerge-command A graphical merge conflict resolver command operating |
| @@ -2241,10 +2247,13 @@ | |
| 2247 | ** |
| 2248 | ** self-register Allow users to register themselves through the HTTP UI. |
| 2249 | ** This is useful if you want to see other names than |
| 2250 | ** "Anonymous" in e.g. ticketing system. On the other hand |
| 2251 | ** users can not be deleted. Default: off. |
| 2252 | ** |
| 2253 | ** ssh-command Command used to talk to a remote machine with |
| 2254 | ** the "ssh://" protocol. |
| 2255 | ** |
| 2256 | ** ssl-ca-location The full pathname to a file containing PEM encoded |
| 2257 | ** CA root certificates, or a directory of certificates |
| 2258 | ** with filenames formed from the certificate hashes as |
| 2259 | ** required by OpenSSL. |
| @@ -2260,13 +2269,10 @@ | |
| 2269 | ** the certificate and private key files. |
| 2270 | ** This identity will be presented to SSL servers to |
| 2271 | ** authenticate this client, in addition to the normal |
| 2272 | ** password authentication. |
| 2273 | ** |
| 2274 | ** tcl If enabled (and Fossil was compiled with Tcl support), |
| 2275 | ** Tcl integration commands will be added to the TH1 |
| 2276 | ** interpreter, allowing arbitrary Tcl expressions and |
| 2277 | ** scripts to be evaluated from TH1. Additionally, the Tcl |
| 2278 | ** interpreter will be able to evaluate arbitrary TH1 |
| @@ -2278,16 +2284,10 @@ | |
| 2284 | ** |
| 2285 | ** th1-setup This is the setup script to be evaluated after creating |
| 2286 | ** and initializing the TH1 interpreter. By default, this |
| 2287 | ** is empty and no extra setup is performed. |
| 2288 | ** |
| 2289 | ** web-browser A shell command used to launch your preferred |
| 2290 | ** web browser when given a URL as an argument. |
| 2291 | ** Defaults to "start" on windows, "open" on Mac, |
| 2292 | ** and "firefox" on Unix. |
| 2293 | ** |
| 2294 |
+19
-60
| --- src/diff.c | ||
| +++ src/diff.c | ||
| @@ -378,72 +378,31 @@ | ||
| 378 | 378 | if( pnByte ) *pnByte = 3; |
| 379 | 379 | return bom; |
| 380 | 380 | } |
| 381 | 381 | |
| 382 | 382 | /* |
| 383 | -** This function returns non-zero if the blob starts with a UTF-8 | |
| 384 | -** byte-order-mark (BOM). | |
| 383 | +** This function returns detected BOM size if the blob starts with | |
| 384 | +** a UTF-8, UTF-16le or UTF-16be byte-order-mark (BOM). | |
| 385 | 385 | */ |
| 386 | -int starts_with_utf8_bom(const Blob *pContent, int *pnByte){ | |
| 386 | +int starts_with_bom(const Blob *pContent){ | |
| 387 | 387 | const char *z = blob_buffer(pContent); |
| 388 | - int bomSize = 0; | |
| 388 | + int c1, bomSize = 0; | |
| 389 | 389 | const unsigned char *bom = get_utf8_bom(&bomSize); |
| 390 | 390 | |
| 391 | - if( pnByte ) *pnByte = bomSize; | |
| 392 | - if( blob_size(pContent)<bomSize ) return 0; | |
| 393 | - return memcmp(z, bom, bomSize)==0; | |
| 394 | -} | |
| 395 | - | |
| 396 | -/* | |
| 397 | -** This function returns non-zero if the blob starts with a UTF-16le or | |
| 398 | -** UTF-16be byte-order-mark (BOM). | |
| 399 | -*/ | |
| 400 | -int starts_with_utf16_bom(const Blob *pContent, int *pnByte){ | |
| 401 | - const char *z = blob_buffer(pContent); | |
| 402 | - int c1, c2; | |
| 403 | - | |
| 404 | - if( pnByte ) *pnByte = 2; | |
| 405 | - if( blob_size(pContent)<2 ) return 0; | |
| 406 | - c1 = z[0]; c2 = z[1]; | |
| 407 | - if( (c1==(char)0xff) && (c2==(char)0xfe) ){ | |
| 408 | - return 1; | |
| 409 | - }else if( (c1==(char)0xfe) && (c2==(char)0xff) ){ | |
| 410 | - return 1; | |
| 411 | - } | |
| 412 | - return 0; | |
| 413 | -} | |
| 414 | - | |
| 415 | -/* | |
| 416 | -** This function returns non-zero if the blob starts with a UTF-16le | |
| 417 | -** byte-order-mark (BOM). | |
| 418 | -*/ | |
| 419 | -int starts_with_utf16le_bom(const Blob *pContent, int *pnByte){ | |
| 420 | - const char *z = blob_buffer(pContent); | |
| 421 | - int c1, c2; | |
| 422 | - | |
| 423 | - if( pnByte ) *pnByte = 2; | |
| 424 | - if( blob_size(pContent)<2 ) return 0; | |
| 425 | - c1 = z[0]; c2 = z[1]; | |
| 426 | - if( (c1==(char)0xff) && (c2==(char)0xfe) ){ | |
| 427 | - return 1; | |
| 428 | - } | |
| 429 | - return 0; | |
| 430 | -} | |
| 431 | - | |
| 432 | -/* | |
| 433 | -** This function returns non-zero if the blob starts with a UTF-16be | |
| 434 | -** byte-order-mark (BOM). | |
| 435 | -*/ | |
| 436 | -int starts_with_utf16be_bom(const Blob *pContent, int *pnByte){ | |
| 437 | - const char *z = blob_buffer(pContent); | |
| 438 | - int c1, c2; | |
| 439 | - | |
| 440 | - if( pnByte ) *pnByte = 2; | |
| 441 | - if( blob_size(pContent)<2 ) return 0; | |
| 442 | - c1 = z[0]; c2 = z[1]; | |
| 443 | - if( (c1==(char)0xfe) && (c2==(char)0xff) ){ | |
| 444 | - return 1; | |
| 391 | + if( (blob_size(pContent)>=bomSize) | |
| 392 | + && (memcmp(z, bom, bomSize)==0) ){ | |
| 393 | + return bomSize; | |
| 394 | + } | |
| 395 | + /* Only accept UTF-16 BOM if the blob has an even number of bytes */ | |
| 396 | + if( (blob_size(pContent)<2) || (blob_size(pContent)&1) ) return 0; | |
| 397 | + c1 = *((unsigned short *)z); | |
| 398 | + if( (c1==0xfffe) || (c1==0xfeff) ){ | |
| 399 | + if( blob_size(pContent)>=4 ){ | |
| 400 | + /* For UTF-32 BOM, always return 0. */ | |
| 401 | + if( ((unsigned short *)z)[1] == 0 ) return 0; | |
| 402 | + } | |
| 403 | + return 2; | |
| 445 | 404 | } |
| 446 | 405 | return 0; |
| 447 | 406 | } |
| 448 | 407 | |
| 449 | 408 | /* |
| @@ -2407,11 +2366,11 @@ | ||
| 2407 | 2366 | if( zLimit==0 || zLimit[0]==0 ) zLimit = "-1"; |
| 2408 | 2367 | iLimit = atoi(zLimit); |
| 2409 | 2368 | showLog = find_option("log",0,0)!=0; |
| 2410 | 2369 | fileVers = find_option("filevers",0,0)!=0; |
| 2411 | 2370 | db_must_be_within_tree(); |
| 2412 | - if (g.argc<3) { | |
| 2371 | + if( g.argc<3 ){ | |
| 2413 | 2372 | usage("FILENAME"); |
| 2414 | 2373 | } |
| 2415 | 2374 | file_tree_name(g.argv[2], &treename, 1); |
| 2416 | 2375 | zFilename = blob_str(&treename); |
| 2417 | 2376 | fnid = db_int(0, "SELECT fnid FROM filename WHERE name=%Q", zFilename); |
| @@ -2421,11 +2380,11 @@ | ||
| 2421 | 2380 | fid = db_int(0, "SELECT rid FROM vfile WHERE pathname=%Q", zFilename); |
| 2422 | 2381 | if( fid==0 ){ |
| 2423 | 2382 | fossil_fatal("not part of current checkout: %s", zFilename); |
| 2424 | 2383 | } |
| 2425 | 2384 | cid = db_lget_int("checkout", 0); |
| 2426 | - if (cid == 0){ | |
| 2385 | + if( cid == 0 ){ | |
| 2427 | 2386 | fossil_fatal("Not in a checkout"); |
| 2428 | 2387 | } |
| 2429 | 2388 | if( iLimit<=0 ) iLimit = 1000000000; |
| 2430 | 2389 | compute_direct_ancestors(cid, iLimit); |
| 2431 | 2390 | mid = db_int(0, "SELECT mlink.mid FROM mlink, ancestor " |
| 2432 | 2391 |
| --- src/diff.c | |
| +++ src/diff.c | |
| @@ -378,72 +378,31 @@ | |
| 378 | if( pnByte ) *pnByte = 3; |
| 379 | return bom; |
| 380 | } |
| 381 | |
| 382 | /* |
| 383 | ** This function returns non-zero if the blob starts with a UTF-8 |
| 384 | ** byte-order-mark (BOM). |
| 385 | */ |
| 386 | int starts_with_utf8_bom(const Blob *pContent, int *pnByte){ |
| 387 | const char *z = blob_buffer(pContent); |
| 388 | int bomSize = 0; |
| 389 | const unsigned char *bom = get_utf8_bom(&bomSize); |
| 390 | |
| 391 | if( pnByte ) *pnByte = bomSize; |
| 392 | if( blob_size(pContent)<bomSize ) return 0; |
| 393 | return memcmp(z, bom, bomSize)==0; |
| 394 | } |
| 395 | |
| 396 | /* |
| 397 | ** This function returns non-zero if the blob starts with a UTF-16le or |
| 398 | ** UTF-16be byte-order-mark (BOM). |
| 399 | */ |
| 400 | int starts_with_utf16_bom(const Blob *pContent, int *pnByte){ |
| 401 | const char *z = blob_buffer(pContent); |
| 402 | int c1, c2; |
| 403 | |
| 404 | if( pnByte ) *pnByte = 2; |
| 405 | if( blob_size(pContent)<2 ) return 0; |
| 406 | c1 = z[0]; c2 = z[1]; |
| 407 | if( (c1==(char)0xff) && (c2==(char)0xfe) ){ |
| 408 | return 1; |
| 409 | }else if( (c1==(char)0xfe) && (c2==(char)0xff) ){ |
| 410 | return 1; |
| 411 | } |
| 412 | return 0; |
| 413 | } |
| 414 | |
| 415 | /* |
| 416 | ** This function returns non-zero if the blob starts with a UTF-16le |
| 417 | ** byte-order-mark (BOM). |
| 418 | */ |
| 419 | int starts_with_utf16le_bom(const Blob *pContent, int *pnByte){ |
| 420 | const char *z = blob_buffer(pContent); |
| 421 | int c1, c2; |
| 422 | |
| 423 | if( pnByte ) *pnByte = 2; |
| 424 | if( blob_size(pContent)<2 ) return 0; |
| 425 | c1 = z[0]; c2 = z[1]; |
| 426 | if( (c1==(char)0xff) && (c2==(char)0xfe) ){ |
| 427 | return 1; |
| 428 | } |
| 429 | return 0; |
| 430 | } |
| 431 | |
| 432 | /* |
| 433 | ** This function returns non-zero if the blob starts with a UTF-16be |
| 434 | ** byte-order-mark (BOM). |
| 435 | */ |
| 436 | int starts_with_utf16be_bom(const Blob *pContent, int *pnByte){ |
| 437 | const char *z = blob_buffer(pContent); |
| 438 | int c1, c2; |
| 439 | |
| 440 | if( pnByte ) *pnByte = 2; |
| 441 | if( blob_size(pContent)<2 ) return 0; |
| 442 | c1 = z[0]; c2 = z[1]; |
| 443 | if( (c1==(char)0xfe) && (c2==(char)0xff) ){ |
| 444 | return 1; |
| 445 | } |
| 446 | return 0; |
| 447 | } |
| 448 | |
| 449 | /* |
| @@ -2407,11 +2366,11 @@ | |
| 2407 | if( zLimit==0 || zLimit[0]==0 ) zLimit = "-1"; |
| 2408 | iLimit = atoi(zLimit); |
| 2409 | showLog = find_option("log",0,0)!=0; |
| 2410 | fileVers = find_option("filevers",0,0)!=0; |
| 2411 | db_must_be_within_tree(); |
| 2412 | if (g.argc<3) { |
| 2413 | usage("FILENAME"); |
| 2414 | } |
| 2415 | file_tree_name(g.argv[2], &treename, 1); |
| 2416 | zFilename = blob_str(&treename); |
| 2417 | fnid = db_int(0, "SELECT fnid FROM filename WHERE name=%Q", zFilename); |
| @@ -2421,11 +2380,11 @@ | |
| 2421 | fid = db_int(0, "SELECT rid FROM vfile WHERE pathname=%Q", zFilename); |
| 2422 | if( fid==0 ){ |
| 2423 | fossil_fatal("not part of current checkout: %s", zFilename); |
| 2424 | } |
| 2425 | cid = db_lget_int("checkout", 0); |
| 2426 | if (cid == 0){ |
| 2427 | fossil_fatal("Not in a checkout"); |
| 2428 | } |
| 2429 | if( iLimit<=0 ) iLimit = 1000000000; |
| 2430 | compute_direct_ancestors(cid, iLimit); |
| 2431 | mid = db_int(0, "SELECT mlink.mid FROM mlink, ancestor " |
| 2432 |
| --- src/diff.c | |
| +++ src/diff.c | |
| @@ -378,72 +378,31 @@ | |
| 378 | if( pnByte ) *pnByte = 3; |
| 379 | return bom; |
| 380 | } |
| 381 | |
| 382 | /* |
| 383 | ** This function returns detected BOM size if the blob starts with |
| 384 | ** a UTF-8, UTF-16le or UTF-16be byte-order-mark (BOM). |
| 385 | */ |
| 386 | int starts_with_bom(const Blob *pContent){ |
| 387 | const char *z = blob_buffer(pContent); |
| 388 | int c1, bomSize = 0; |
| 389 | const unsigned char *bom = get_utf8_bom(&bomSize); |
| 390 | |
| 391 | if( (blob_size(pContent)>=bomSize) |
| 392 | && (memcmp(z, bom, bomSize)==0) ){ |
| 393 | return bomSize; |
| 394 | } |
| 395 | /* Only accept UTF-16 BOM if the blob has an even number of bytes */ |
| 396 | if( (blob_size(pContent)<2) || (blob_size(pContent)&1) ) return 0; |
| 397 | c1 = *((unsigned short *)z); |
| 398 | if( (c1==0xfffe) || (c1==0xfeff) ){ |
| 399 | if( blob_size(pContent)>=4 ){ |
| 400 | /* For UTF-32 BOM, always return 0. */ |
| 401 | if( ((unsigned short *)z)[1] == 0 ) return 0; |
| 402 | } |
| 403 | return 2; |
| 404 | } |
| 405 | return 0; |
| 406 | } |
| 407 | |
| 408 | /* |
| @@ -2407,11 +2366,11 @@ | |
| 2366 | if( zLimit==0 || zLimit[0]==0 ) zLimit = "-1"; |
| 2367 | iLimit = atoi(zLimit); |
| 2368 | showLog = find_option("log",0,0)!=0; |
| 2369 | fileVers = find_option("filevers",0,0)!=0; |
| 2370 | db_must_be_within_tree(); |
| 2371 | if( g.argc<3 ){ |
| 2372 | usage("FILENAME"); |
| 2373 | } |
| 2374 | file_tree_name(g.argv[2], &treename, 1); |
| 2375 | zFilename = blob_str(&treename); |
| 2376 | fnid = db_int(0, "SELECT fnid FROM filename WHERE name=%Q", zFilename); |
| @@ -2421,11 +2380,11 @@ | |
| 2380 | fid = db_int(0, "SELECT rid FROM vfile WHERE pathname=%Q", zFilename); |
| 2381 | if( fid==0 ){ |
| 2382 | fossil_fatal("not part of current checkout: %s", zFilename); |
| 2383 | } |
| 2384 | cid = db_lget_int("checkout", 0); |
| 2385 | if( cid == 0 ){ |
| 2386 | fossil_fatal("Not in a checkout"); |
| 2387 | } |
| 2388 | if( iLimit<=0 ) iLimit = 1000000000; |
| 2389 | compute_direct_ancestors(cid, iLimit); |
| 2390 | mid = db_int(0, "SELECT mlink.mid FROM mlink, ancestor " |
| 2391 |
+19
-60
| --- src/diff.c | ||
| +++ src/diff.c | ||
| @@ -378,72 +378,31 @@ | ||
| 378 | 378 | if( pnByte ) *pnByte = 3; |
| 379 | 379 | return bom; |
| 380 | 380 | } |
| 381 | 381 | |
| 382 | 382 | /* |
| 383 | -** This function returns non-zero if the blob starts with a UTF-8 | |
| 384 | -** byte-order-mark (BOM). | |
| 383 | +** This function returns detected BOM size if the blob starts with | |
| 384 | +** a UTF-8, UTF-16le or UTF-16be byte-order-mark (BOM). | |
| 385 | 385 | */ |
| 386 | -int starts_with_utf8_bom(const Blob *pContent, int *pnByte){ | |
| 386 | +int starts_with_bom(const Blob *pContent){ | |
| 387 | 387 | const char *z = blob_buffer(pContent); |
| 388 | - int bomSize = 0; | |
| 388 | + int c1, bomSize = 0; | |
| 389 | 389 | const unsigned char *bom = get_utf8_bom(&bomSize); |
| 390 | 390 | |
| 391 | - if( pnByte ) *pnByte = bomSize; | |
| 392 | - if( blob_size(pContent)<bomSize ) return 0; | |
| 393 | - return memcmp(z, bom, bomSize)==0; | |
| 394 | -} | |
| 395 | - | |
| 396 | -/* | |
| 397 | -** This function returns non-zero if the blob starts with a UTF-16le or | |
| 398 | -** UTF-16be byte-order-mark (BOM). | |
| 399 | -*/ | |
| 400 | -int starts_with_utf16_bom(const Blob *pContent, int *pnByte){ | |
| 401 | - const char *z = blob_buffer(pContent); | |
| 402 | - int c1, c2; | |
| 403 | - | |
| 404 | - if( pnByte ) *pnByte = 2; | |
| 405 | - if( blob_size(pContent)<2 ) return 0; | |
| 406 | - c1 = z[0]; c2 = z[1]; | |
| 407 | - if( (c1==(char)0xff) && (c2==(char)0xfe) ){ | |
| 408 | - return 1; | |
| 409 | - }else if( (c1==(char)0xfe) && (c2==(char)0xff) ){ | |
| 410 | - return 1; | |
| 411 | - } | |
| 412 | - return 0; | |
| 413 | -} | |
| 414 | - | |
| 415 | -/* | |
| 416 | -** This function returns non-zero if the blob starts with a UTF-16le | |
| 417 | -** byte-order-mark (BOM). | |
| 418 | -*/ | |
| 419 | -int starts_with_utf16le_bom(const Blob *pContent, int *pnByte){ | |
| 420 | - const char *z = blob_buffer(pContent); | |
| 421 | - int c1, c2; | |
| 422 | - | |
| 423 | - if( pnByte ) *pnByte = 2; | |
| 424 | - if( blob_size(pContent)<2 ) return 0; | |
| 425 | - c1 = z[0]; c2 = z[1]; | |
| 426 | - if( (c1==(char)0xff) && (c2==(char)0xfe) ){ | |
| 427 | - return 1; | |
| 428 | - } | |
| 429 | - return 0; | |
| 430 | -} | |
| 431 | - | |
| 432 | -/* | |
| 433 | -** This function returns non-zero if the blob starts with a UTF-16be | |
| 434 | -** byte-order-mark (BOM). | |
| 435 | -*/ | |
| 436 | -int starts_with_utf16be_bom(const Blob *pContent, int *pnByte){ | |
| 437 | - const char *z = blob_buffer(pContent); | |
| 438 | - int c1, c2; | |
| 439 | - | |
| 440 | - if( pnByte ) *pnByte = 2; | |
| 441 | - if( blob_size(pContent)<2 ) return 0; | |
| 442 | - c1 = z[0]; c2 = z[1]; | |
| 443 | - if( (c1==(char)0xfe) && (c2==(char)0xff) ){ | |
| 444 | - return 1; | |
| 391 | + if( (blob_size(pContent)>=bomSize) | |
| 392 | + && (memcmp(z, bom, bomSize)==0) ){ | |
| 393 | + return bomSize; | |
| 394 | + } | |
| 395 | + /* Only accept UTF-16 BOM if the blob has an even number of bytes */ | |
| 396 | + if( (blob_size(pContent)<2) || (blob_size(pContent)&1) ) return 0; | |
| 397 | + c1 = *((unsigned short *)z); | |
| 398 | + if( (c1==0xfffe) || (c1==0xfeff) ){ | |
| 399 | + if( blob_size(pContent)>=4 ){ | |
| 400 | + /* For UTF-32 BOM, always return 0. */ | |
| 401 | + if( ((unsigned short *)z)[1] == 0 ) return 0; | |
| 402 | + } | |
| 403 | + return 2; | |
| 445 | 404 | } |
| 446 | 405 | return 0; |
| 447 | 406 | } |
| 448 | 407 | |
| 449 | 408 | /* |
| @@ -2407,11 +2366,11 @@ | ||
| 2407 | 2366 | if( zLimit==0 || zLimit[0]==0 ) zLimit = "-1"; |
| 2408 | 2367 | iLimit = atoi(zLimit); |
| 2409 | 2368 | showLog = find_option("log",0,0)!=0; |
| 2410 | 2369 | fileVers = find_option("filevers",0,0)!=0; |
| 2411 | 2370 | db_must_be_within_tree(); |
| 2412 | - if (g.argc<3) { | |
| 2371 | + if( g.argc<3 ){ | |
| 2413 | 2372 | usage("FILENAME"); |
| 2414 | 2373 | } |
| 2415 | 2374 | file_tree_name(g.argv[2], &treename, 1); |
| 2416 | 2375 | zFilename = blob_str(&treename); |
| 2417 | 2376 | fnid = db_int(0, "SELECT fnid FROM filename WHERE name=%Q", zFilename); |
| @@ -2421,11 +2380,11 @@ | ||
| 2421 | 2380 | fid = db_int(0, "SELECT rid FROM vfile WHERE pathname=%Q", zFilename); |
| 2422 | 2381 | if( fid==0 ){ |
| 2423 | 2382 | fossil_fatal("not part of current checkout: %s", zFilename); |
| 2424 | 2383 | } |
| 2425 | 2384 | cid = db_lget_int("checkout", 0); |
| 2426 | - if (cid == 0){ | |
| 2385 | + if( cid == 0 ){ | |
| 2427 | 2386 | fossil_fatal("Not in a checkout"); |
| 2428 | 2387 | } |
| 2429 | 2388 | if( iLimit<=0 ) iLimit = 1000000000; |
| 2430 | 2389 | compute_direct_ancestors(cid, iLimit); |
| 2431 | 2390 | mid = db_int(0, "SELECT mlink.mid FROM mlink, ancestor " |
| 2432 | 2391 |
| --- src/diff.c | |
| +++ src/diff.c | |
| @@ -378,72 +378,31 @@ | |
| 378 | if( pnByte ) *pnByte = 3; |
| 379 | return bom; |
| 380 | } |
| 381 | |
| 382 | /* |
| 383 | ** This function returns non-zero if the blob starts with a UTF-8 |
| 384 | ** byte-order-mark (BOM). |
| 385 | */ |
| 386 | int starts_with_utf8_bom(const Blob *pContent, int *pnByte){ |
| 387 | const char *z = blob_buffer(pContent); |
| 388 | int bomSize = 0; |
| 389 | const unsigned char *bom = get_utf8_bom(&bomSize); |
| 390 | |
| 391 | if( pnByte ) *pnByte = bomSize; |
| 392 | if( blob_size(pContent)<bomSize ) return 0; |
| 393 | return memcmp(z, bom, bomSize)==0; |
| 394 | } |
| 395 | |
| 396 | /* |
| 397 | ** This function returns non-zero if the blob starts with a UTF-16le or |
| 398 | ** UTF-16be byte-order-mark (BOM). |
| 399 | */ |
| 400 | int starts_with_utf16_bom(const Blob *pContent, int *pnByte){ |
| 401 | const char *z = blob_buffer(pContent); |
| 402 | int c1, c2; |
| 403 | |
| 404 | if( pnByte ) *pnByte = 2; |
| 405 | if( blob_size(pContent)<2 ) return 0; |
| 406 | c1 = z[0]; c2 = z[1]; |
| 407 | if( (c1==(char)0xff) && (c2==(char)0xfe) ){ |
| 408 | return 1; |
| 409 | }else if( (c1==(char)0xfe) && (c2==(char)0xff) ){ |
| 410 | return 1; |
| 411 | } |
| 412 | return 0; |
| 413 | } |
| 414 | |
| 415 | /* |
| 416 | ** This function returns non-zero if the blob starts with a UTF-16le |
| 417 | ** byte-order-mark (BOM). |
| 418 | */ |
| 419 | int starts_with_utf16le_bom(const Blob *pContent, int *pnByte){ |
| 420 | const char *z = blob_buffer(pContent); |
| 421 | int c1, c2; |
| 422 | |
| 423 | if( pnByte ) *pnByte = 2; |
| 424 | if( blob_size(pContent)<2 ) return 0; |
| 425 | c1 = z[0]; c2 = z[1]; |
| 426 | if( (c1==(char)0xff) && (c2==(char)0xfe) ){ |
| 427 | return 1; |
| 428 | } |
| 429 | return 0; |
| 430 | } |
| 431 | |
| 432 | /* |
| 433 | ** This function returns non-zero if the blob starts with a UTF-16be |
| 434 | ** byte-order-mark (BOM). |
| 435 | */ |
| 436 | int starts_with_utf16be_bom(const Blob *pContent, int *pnByte){ |
| 437 | const char *z = blob_buffer(pContent); |
| 438 | int c1, c2; |
| 439 | |
| 440 | if( pnByte ) *pnByte = 2; |
| 441 | if( blob_size(pContent)<2 ) return 0; |
| 442 | c1 = z[0]; c2 = z[1]; |
| 443 | if( (c1==(char)0xfe) && (c2==(char)0xff) ){ |
| 444 | return 1; |
| 445 | } |
| 446 | return 0; |
| 447 | } |
| 448 | |
| 449 | /* |
| @@ -2407,11 +2366,11 @@ | |
| 2407 | if( zLimit==0 || zLimit[0]==0 ) zLimit = "-1"; |
| 2408 | iLimit = atoi(zLimit); |
| 2409 | showLog = find_option("log",0,0)!=0; |
| 2410 | fileVers = find_option("filevers",0,0)!=0; |
| 2411 | db_must_be_within_tree(); |
| 2412 | if (g.argc<3) { |
| 2413 | usage("FILENAME"); |
| 2414 | } |
| 2415 | file_tree_name(g.argv[2], &treename, 1); |
| 2416 | zFilename = blob_str(&treename); |
| 2417 | fnid = db_int(0, "SELECT fnid FROM filename WHERE name=%Q", zFilename); |
| @@ -2421,11 +2380,11 @@ | |
| 2421 | fid = db_int(0, "SELECT rid FROM vfile WHERE pathname=%Q", zFilename); |
| 2422 | if( fid==0 ){ |
| 2423 | fossil_fatal("not part of current checkout: %s", zFilename); |
| 2424 | } |
| 2425 | cid = db_lget_int("checkout", 0); |
| 2426 | if (cid == 0){ |
| 2427 | fossil_fatal("Not in a checkout"); |
| 2428 | } |
| 2429 | if( iLimit<=0 ) iLimit = 1000000000; |
| 2430 | compute_direct_ancestors(cid, iLimit); |
| 2431 | mid = db_int(0, "SELECT mlink.mid FROM mlink, ancestor " |
| 2432 |
| --- src/diff.c | |
| +++ src/diff.c | |
| @@ -378,72 +378,31 @@ | |
| 378 | if( pnByte ) *pnByte = 3; |
| 379 | return bom; |
| 380 | } |
| 381 | |
| 382 | /* |
| 383 | ** This function returns detected BOM size if the blob starts with |
| 384 | ** a UTF-8, UTF-16le or UTF-16be byte-order-mark (BOM). |
| 385 | */ |
| 386 | int starts_with_bom(const Blob *pContent){ |
| 387 | const char *z = blob_buffer(pContent); |
| 388 | int c1, bomSize = 0; |
| 389 | const unsigned char *bom = get_utf8_bom(&bomSize); |
| 390 | |
| 391 | if( (blob_size(pContent)>=bomSize) |
| 392 | && (memcmp(z, bom, bomSize)==0) ){ |
| 393 | return bomSize; |
| 394 | } |
| 395 | /* Only accept UTF-16 BOM if the blob has an even number of bytes */ |
| 396 | if( (blob_size(pContent)<2) || (blob_size(pContent)&1) ) return 0; |
| 397 | c1 = *((unsigned short *)z); |
| 398 | if( (c1==0xfffe) || (c1==0xfeff) ){ |
| 399 | if( blob_size(pContent)>=4 ){ |
| 400 | /* For UTF-32 BOM, always return 0. */ |
| 401 | if( ((unsigned short *)z)[1] == 0 ) return 0; |
| 402 | } |
| 403 | return 2; |
| 404 | } |
| 405 | return 0; |
| 406 | } |
| 407 | |
| 408 | /* |
| @@ -2407,11 +2366,11 @@ | |
| 2366 | if( zLimit==0 || zLimit[0]==0 ) zLimit = "-1"; |
| 2367 | iLimit = atoi(zLimit); |
| 2368 | showLog = find_option("log",0,0)!=0; |
| 2369 | fileVers = find_option("filevers",0,0)!=0; |
| 2370 | db_must_be_within_tree(); |
| 2371 | if( g.argc<3 ){ |
| 2372 | usage("FILENAME"); |
| 2373 | } |
| 2374 | file_tree_name(g.argv[2], &treename, 1); |
| 2375 | zFilename = blob_str(&treename); |
| 2376 | fnid = db_int(0, "SELECT fnid FROM filename WHERE name=%Q", zFilename); |
| @@ -2421,11 +2380,11 @@ | |
| 2380 | fid = db_int(0, "SELECT rid FROM vfile WHERE pathname=%Q", zFilename); |
| 2381 | if( fid==0 ){ |
| 2382 | fossil_fatal("not part of current checkout: %s", zFilename); |
| 2383 | } |
| 2384 | cid = db_lget_int("checkout", 0); |
| 2385 | if( cid == 0 ){ |
| 2386 | fossil_fatal("Not in a checkout"); |
| 2387 | } |
| 2388 | if( iLimit<=0 ) iLimit = 1000000000; |
| 2389 | compute_direct_ancestors(cid, iLimit); |
| 2390 | mid = db_int(0, "SELECT mlink.mid FROM mlink, ancestor " |
| 2391 |
+7
-3
| --- src/doc.c | ||
| +++ src/doc.c | ||
| @@ -122,11 +122,13 @@ | ||
| 122 | 122 | { "deb", 3, "application/x-debian-package" }, |
| 123 | 123 | { "dir", 3, "application/x-director" }, |
| 124 | 124 | { "dl", 2, "video/dl" }, |
| 125 | 125 | { "dms", 3, "application/octet-stream" }, |
| 126 | 126 | { "doc", 3, "application/msword" }, |
| 127 | - { "docx", 4, "application/msword" }, | |
| 127 | + { "docx", 4, "application/vnd.openxmlformats-officedocument.wordprocessingml.document"}, | |
| 128 | + { "dot", 3, "application/msword" }, | |
| 129 | + { "dotx", 4, "application/vnd.openxmlformats-officedocument.wordprocessingml.template"}, | |
| 128 | 130 | { "drw", 3, "application/drafting" }, |
| 129 | 131 | { "dvi", 3, "application/x-dvi" }, |
| 130 | 132 | { "dwg", 3, "application/acad" }, |
| 131 | 133 | { "dxf", 3, "application/dxf" }, |
| 132 | 134 | { "dxr", 3, "application/x-director" }, |
| @@ -199,14 +201,16 @@ | ||
| 199 | 201 | { "pl", 2, "application/x-perl" }, |
| 200 | 202 | { "pm", 2, "application/x-perl" }, |
| 201 | 203 | { "png", 3, "image/png" }, |
| 202 | 204 | { "pnm", 3, "image/x-portable-anymap" }, |
| 203 | 205 | { "pot", 3, "application/mspowerpoint" }, |
| 206 | + { "potx", 4, "application/vnd.openxmlformats-officedocument.presentationml.template"}, | |
| 204 | 207 | { "ppm", 3, "image/x-portable-pixmap" }, |
| 205 | 208 | { "pps", 3, "application/mspowerpoint" }, |
| 209 | + { "ppsx", 4, "application/vnd.openxmlformats-officedocument.presentationml.slideshow"}, | |
| 206 | 210 | { "ppt", 3, "application/mspowerpoint" }, |
| 207 | - { "pptx", 4, "application/mspowerpoint" }, | |
| 211 | + { "pptx", 4, "application/vnd.openxmlformats-officedocument.presentationml.presentation"}, | |
| 208 | 212 | { "ppz", 3, "application/mspowerpoint" }, |
| 209 | 213 | { "pre", 3, "application/x-freelance" }, |
| 210 | 214 | { "prt", 3, "application/pro_eng" }, |
| 211 | 215 | { "ps", 2, "application/postscript" }, |
| 212 | 216 | { "qt", 2, "video/quicktime" }, |
| @@ -277,11 +281,11 @@ | ||
| 277 | 281 | { "xbm", 3, "image/x-xbitmap" }, |
| 278 | 282 | { "xlc", 3, "application/vnd.ms-excel" }, |
| 279 | 283 | { "xll", 3, "application/vnd.ms-excel" }, |
| 280 | 284 | { "xlm", 3, "application/vnd.ms-excel" }, |
| 281 | 285 | { "xls", 3, "application/vnd.ms-excel" }, |
| 282 | - { "xlsx", 4, "application/vnd.ms-excel" }, | |
| 286 | + { "xlsx", 4, "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"}, | |
| 283 | 287 | { "xlw", 3, "application/vnd.ms-excel" }, |
| 284 | 288 | { "xml", 3, "text/xml" }, |
| 285 | 289 | { "xpm", 3, "image/x-xpixmap" }, |
| 286 | 290 | { "xwd", 3, "image/x-xwindowdump" }, |
| 287 | 291 | { "xyz", 3, "chemical/x-pdb" }, |
| 288 | 292 |
| --- src/doc.c | |
| +++ src/doc.c | |
| @@ -122,11 +122,13 @@ | |
| 122 | { "deb", 3, "application/x-debian-package" }, |
| 123 | { "dir", 3, "application/x-director" }, |
| 124 | { "dl", 2, "video/dl" }, |
| 125 | { "dms", 3, "application/octet-stream" }, |
| 126 | { "doc", 3, "application/msword" }, |
| 127 | { "docx", 4, "application/msword" }, |
| 128 | { "drw", 3, "application/drafting" }, |
| 129 | { "dvi", 3, "application/x-dvi" }, |
| 130 | { "dwg", 3, "application/acad" }, |
| 131 | { "dxf", 3, "application/dxf" }, |
| 132 | { "dxr", 3, "application/x-director" }, |
| @@ -199,14 +201,16 @@ | |
| 199 | { "pl", 2, "application/x-perl" }, |
| 200 | { "pm", 2, "application/x-perl" }, |
| 201 | { "png", 3, "image/png" }, |
| 202 | { "pnm", 3, "image/x-portable-anymap" }, |
| 203 | { "pot", 3, "application/mspowerpoint" }, |
| 204 | { "ppm", 3, "image/x-portable-pixmap" }, |
| 205 | { "pps", 3, "application/mspowerpoint" }, |
| 206 | { "ppt", 3, "application/mspowerpoint" }, |
| 207 | { "pptx", 4, "application/mspowerpoint" }, |
| 208 | { "ppz", 3, "application/mspowerpoint" }, |
| 209 | { "pre", 3, "application/x-freelance" }, |
| 210 | { "prt", 3, "application/pro_eng" }, |
| 211 | { "ps", 2, "application/postscript" }, |
| 212 | { "qt", 2, "video/quicktime" }, |
| @@ -277,11 +281,11 @@ | |
| 277 | { "xbm", 3, "image/x-xbitmap" }, |
| 278 | { "xlc", 3, "application/vnd.ms-excel" }, |
| 279 | { "xll", 3, "application/vnd.ms-excel" }, |
| 280 | { "xlm", 3, "application/vnd.ms-excel" }, |
| 281 | { "xls", 3, "application/vnd.ms-excel" }, |
| 282 | { "xlsx", 4, "application/vnd.ms-excel" }, |
| 283 | { "xlw", 3, "application/vnd.ms-excel" }, |
| 284 | { "xml", 3, "text/xml" }, |
| 285 | { "xpm", 3, "image/x-xpixmap" }, |
| 286 | { "xwd", 3, "image/x-xwindowdump" }, |
| 287 | { "xyz", 3, "chemical/x-pdb" }, |
| 288 |
| --- src/doc.c | |
| +++ src/doc.c | |
| @@ -122,11 +122,13 @@ | |
| 122 | { "deb", 3, "application/x-debian-package" }, |
| 123 | { "dir", 3, "application/x-director" }, |
| 124 | { "dl", 2, "video/dl" }, |
| 125 | { "dms", 3, "application/octet-stream" }, |
| 126 | { "doc", 3, "application/msword" }, |
| 127 | { "docx", 4, "application/vnd.openxmlformats-officedocument.wordprocessingml.document"}, |
| 128 | { "dot", 3, "application/msword" }, |
| 129 | { "dotx", 4, "application/vnd.openxmlformats-officedocument.wordprocessingml.template"}, |
| 130 | { "drw", 3, "application/drafting" }, |
| 131 | { "dvi", 3, "application/x-dvi" }, |
| 132 | { "dwg", 3, "application/acad" }, |
| 133 | { "dxf", 3, "application/dxf" }, |
| 134 | { "dxr", 3, "application/x-director" }, |
| @@ -199,14 +201,16 @@ | |
| 201 | { "pl", 2, "application/x-perl" }, |
| 202 | { "pm", 2, "application/x-perl" }, |
| 203 | { "png", 3, "image/png" }, |
| 204 | { "pnm", 3, "image/x-portable-anymap" }, |
| 205 | { "pot", 3, "application/mspowerpoint" }, |
| 206 | { "potx", 4, "application/vnd.openxmlformats-officedocument.presentationml.template"}, |
| 207 | { "ppm", 3, "image/x-portable-pixmap" }, |
| 208 | { "pps", 3, "application/mspowerpoint" }, |
| 209 | { "ppsx", 4, "application/vnd.openxmlformats-officedocument.presentationml.slideshow"}, |
| 210 | { "ppt", 3, "application/mspowerpoint" }, |
| 211 | { "pptx", 4, "application/vnd.openxmlformats-officedocument.presentationml.presentation"}, |
| 212 | { "ppz", 3, "application/mspowerpoint" }, |
| 213 | { "pre", 3, "application/x-freelance" }, |
| 214 | { "prt", 3, "application/pro_eng" }, |
| 215 | { "ps", 2, "application/postscript" }, |
| 216 | { "qt", 2, "video/quicktime" }, |
| @@ -277,11 +281,11 @@ | |
| 281 | { "xbm", 3, "image/x-xbitmap" }, |
| 282 | { "xlc", 3, "application/vnd.ms-excel" }, |
| 283 | { "xll", 3, "application/vnd.ms-excel" }, |
| 284 | { "xlm", 3, "application/vnd.ms-excel" }, |
| 285 | { "xls", 3, "application/vnd.ms-excel" }, |
| 286 | { "xlsx", 4, "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"}, |
| 287 | { "xlw", 3, "application/vnd.ms-excel" }, |
| 288 | { "xml", 3, "text/xml" }, |
| 289 | { "xpm", 3, "image/x-xpixmap" }, |
| 290 | { "xwd", 3, "image/x-xwindowdump" }, |
| 291 | { "xyz", 3, "chemical/x-pdb" }, |
| 292 |
+52
-29
| --- src/file.c | ||
| +++ src/file.c | ||
| @@ -490,45 +490,68 @@ | ||
| 490 | 490 | ** * Does not contain two or more "/" characters in a row. |
| 491 | 491 | ** * Contains at least one character |
| 492 | 492 | ** |
| 493 | 493 | ** Invalid UTF8 characters result in a false return if bStrictUtf8 is |
| 494 | 494 | ** true. If bStrictUtf8 is false, invalid UTF8 characters are silently |
| 495 | -** ignored. | |
| 495 | +** ignored. See http://en.wikipedia.org/wiki/UTF-8#Invalid_byte_sequences | |
| 496 | +** and http://en.wikipedia.org/wiki/Unicode (for the noncharacters) | |
| 497 | +** | |
| 498 | +** The bStrictUtf8 flag is true for new inputs, but is false when parsing | |
| 499 | +** legacy manifests, for backwards compatibility. | |
| 496 | 500 | */ |
| 497 | 501 | int file_is_simple_pathname(const char *z, int bStrictUtf8){ |
| 498 | 502 | int i; |
| 499 | - char c = z[0]; | |
| 503 | + unsigned char c = (unsigned char) z[0]; | |
| 500 | 504 | char maskNonAscii = bStrictUtf8 ? 0x80 : 0x00; |
| 501 | 505 | if( c=='/' || c==0 ) return 0; |
| 502 | 506 | if( c=='.' ){ |
| 503 | 507 | if( z[1]=='/' || z[1]==0 ) return 0; |
| 504 | 508 | if( z[1]=='.' && (z[2]=='/' || z[2]==0) ) return 0; |
| 505 | 509 | } |
| 506 | - for(i=0; (c=z[i])!=0; i++){ | |
| 507 | - if( c & maskNonAscii ){ | |
| 508 | - if( (c & 0xf0) == 0xf0 ) { | |
| 509 | - /* Unicode characters > U+FFFF are not supported. | |
| 510 | - * Windows XP and earlier cannot handle them. | |
| 511 | - */ | |
| 512 | - return 0; | |
| 513 | - } | |
| 514 | - if( (c & 0xf0) == 0xe0 ) { | |
| 515 | - /* This is a 3-byte UTF-8 character */ | |
| 516 | - if ( (c & 0xfe) == 0xee ){ | |
| 517 | - /* Range U+E000 - U+FFFF (Starting with 0xee or 0xef in UTF-8 ) */ | |
| 518 | - if ( !(c & 1) || ((z[i+1] & 0xff) < 0xa4) ){ | |
| 519 | - /* Unicode character in the range U+E000 - U+F8FF are for | |
| 520 | - * private use, they shouldn't occur in filenames. */ | |
| 521 | - return 0; | |
| 522 | - } | |
| 523 | - }else if( ((c & 0xff) == 0xed) && ((z[i+1] & 0xe0) == 0xa0) ){ | |
| 524 | - /* Unicode character in the range U+D800 - U+DFFF are for | |
| 525 | - * surrogate pairs, they shouldn't occur in filenames. */ | |
| 526 | - return 0; | |
| 527 | - } | |
| 528 | - } | |
| 529 | - }else if( c=='\\' ){ | |
| 510 | + for(i=0; (c=(unsigned char)z[i])!=0; i++){ | |
| 511 | + if( c & maskNonAscii ){ | |
| 512 | + if( (z[++i]&0xc0)!=0x80 ){ | |
| 513 | + /* Invalid first continuation byte */ | |
| 514 | + return 0; | |
| 515 | + } | |
| 516 | + if( c<0xc2 ){ | |
| 517 | + /* Invalid 1-byte UTF-8 sequence, or 2-byte overlong form. */ | |
| 518 | + return 0; | |
| 519 | + }else if( (c&0xe0)==0xe0 ){ | |
| 520 | + /* 3-byte or more */ | |
| 521 | + int unicode; | |
| 522 | + if( c&0x10 ){ | |
| 523 | + /* Unicode characters > U+FFFF are not supported. | |
| 524 | + * Windows XP and earlier cannot handle them. | |
| 525 | + */ | |
| 526 | + return 0; | |
| 527 | + } | |
| 528 | + /* This is a 3-byte UTF-8 character */ | |
| 529 | + unicode = ((c&0x0f)<<12) + ((z[i]&0x3f)<<6) + (z[i+1]&0x3f); | |
| 530 | + if( unicode <= 0x07ff ){ | |
| 531 | + /* overlong form */ | |
| 532 | + return 0; | |
| 533 | + }else if( unicode>=0xe000 ){ | |
| 534 | + /* U+E000..U+FFFF */ | |
| 535 | + if( (unicode<=0xf8ff) || (unicode>=0xfffe) ){ | |
| 536 | + /* U+E000..U+F8FF are for private use. | |
| 537 | + * U+FFFE..U+FFFF are noncharacters. */ | |
| 538 | + return 0; | |
| 539 | + } else if( (unicode>=0xfdd0) && (unicode<=0xfdef) ){ | |
| 540 | + /* U+FDD0..U+FDEF are noncharacters. */ | |
| 541 | + return 0; | |
| 542 | + } | |
| 543 | + }else if( (unicode>=0xd800) && (unicode<=0xdfff) ){ | |
| 544 | + /* U+D800..U+DFFF are for surrogate pairs. */ | |
| 545 | + return 0; | |
| 546 | + } | |
| 547 | + if( (z[++i]&0xc0)!=0x80 ){ | |
| 548 | + /* Invalid second continuation byte */ | |
| 549 | + return 0; | |
| 550 | + } | |
| 551 | + } | |
| 552 | + }else if( bStrictUtf8 && (c=='\\') ){ | |
| 530 | 553 | return 0; |
| 531 | 554 | } |
| 532 | 555 | if( c=='/' ){ |
| 533 | 556 | if( z[i+1]=='/' ) return 0; |
| 534 | 557 | if( z[i+1]=='.' ){ |
| @@ -578,11 +601,11 @@ | ||
| 578 | 601 | if( z[i]=='\\' ) z[i] = '/'; |
| 579 | 602 | } |
| 580 | 603 | #endif |
| 581 | 604 | |
| 582 | 605 | /* Removing trailing "/" characters */ |
| 583 | - if ( !slash ){ | |
| 606 | + if( !slash ){ | |
| 584 | 607 | while( n>1 && z[n-1]=='/' ){ n--; } |
| 585 | 608 | } |
| 586 | 609 | |
| 587 | 610 | /* Remove duplicate '/' characters. Except, two // at the beginning |
| 588 | 611 | ** of a pathname is allowed since this is important on windows. */ |
| @@ -835,11 +858,11 @@ | ||
| 835 | 858 | if( zPwd[i]==0 ){ |
| 836 | 859 | blob_append(pOut, ".", 1); |
| 837 | 860 | }else{ |
| 838 | 861 | blob_append(pOut, "..", 2); |
| 839 | 862 | for(j=i+1; zPwd[j]; j++){ |
| 840 | - if( zPwd[j]=='/' ) { | |
| 863 | + if( zPwd[j]=='/' ){ | |
| 841 | 864 | blob_append(pOut, "/..", 3); |
| 842 | 865 | } |
| 843 | 866 | } |
| 844 | 867 | } |
| 845 | 868 | return; |
| @@ -852,11 +875,11 @@ | ||
| 852 | 875 | return; |
| 853 | 876 | } |
| 854 | 877 | while( zPath[i-1]!='/' ){ i--; } |
| 855 | 878 | blob_set(&tmp, "../"); |
| 856 | 879 | for(j=i; zPwd[j]; j++){ |
| 857 | - if( zPwd[j]=='/' ) { | |
| 880 | + if( zPwd[j]=='/' ){ | |
| 858 | 881 | blob_append(&tmp, "../", 3); |
| 859 | 882 | } |
| 860 | 883 | } |
| 861 | 884 | blob_append(&tmp, &zPath[i], -1); |
| 862 | 885 | blob_reset(pOut); |
| 863 | 886 |
| --- src/file.c | |
| +++ src/file.c | |
| @@ -490,45 +490,68 @@ | |
| 490 | ** * Does not contain two or more "/" characters in a row. |
| 491 | ** * Contains at least one character |
| 492 | ** |
| 493 | ** Invalid UTF8 characters result in a false return if bStrictUtf8 is |
| 494 | ** true. If bStrictUtf8 is false, invalid UTF8 characters are silently |
| 495 | ** ignored. |
| 496 | */ |
| 497 | int file_is_simple_pathname(const char *z, int bStrictUtf8){ |
| 498 | int i; |
| 499 | char c = z[0]; |
| 500 | char maskNonAscii = bStrictUtf8 ? 0x80 : 0x00; |
| 501 | if( c=='/' || c==0 ) return 0; |
| 502 | if( c=='.' ){ |
| 503 | if( z[1]=='/' || z[1]==0 ) return 0; |
| 504 | if( z[1]=='.' && (z[2]=='/' || z[2]==0) ) return 0; |
| 505 | } |
| 506 | for(i=0; (c=z[i])!=0; i++){ |
| 507 | if( c & maskNonAscii ){ |
| 508 | if( (c & 0xf0) == 0xf0 ) { |
| 509 | /* Unicode characters > U+FFFF are not supported. |
| 510 | * Windows XP and earlier cannot handle them. |
| 511 | */ |
| 512 | return 0; |
| 513 | } |
| 514 | if( (c & 0xf0) == 0xe0 ) { |
| 515 | /* This is a 3-byte UTF-8 character */ |
| 516 | if ( (c & 0xfe) == 0xee ){ |
| 517 | /* Range U+E000 - U+FFFF (Starting with 0xee or 0xef in UTF-8 ) */ |
| 518 | if ( !(c & 1) || ((z[i+1] & 0xff) < 0xa4) ){ |
| 519 | /* Unicode character in the range U+E000 - U+F8FF are for |
| 520 | * private use, they shouldn't occur in filenames. */ |
| 521 | return 0; |
| 522 | } |
| 523 | }else if( ((c & 0xff) == 0xed) && ((z[i+1] & 0xe0) == 0xa0) ){ |
| 524 | /* Unicode character in the range U+D800 - U+DFFF are for |
| 525 | * surrogate pairs, they shouldn't occur in filenames. */ |
| 526 | return 0; |
| 527 | } |
| 528 | } |
| 529 | }else if( c=='\\' ){ |
| 530 | return 0; |
| 531 | } |
| 532 | if( c=='/' ){ |
| 533 | if( z[i+1]=='/' ) return 0; |
| 534 | if( z[i+1]=='.' ){ |
| @@ -578,11 +601,11 @@ | |
| 578 | if( z[i]=='\\' ) z[i] = '/'; |
| 579 | } |
| 580 | #endif |
| 581 | |
| 582 | /* Removing trailing "/" characters */ |
| 583 | if ( !slash ){ |
| 584 | while( n>1 && z[n-1]=='/' ){ n--; } |
| 585 | } |
| 586 | |
| 587 | /* Remove duplicate '/' characters. Except, two // at the beginning |
| 588 | ** of a pathname is allowed since this is important on windows. */ |
| @@ -835,11 +858,11 @@ | |
| 835 | if( zPwd[i]==0 ){ |
| 836 | blob_append(pOut, ".", 1); |
| 837 | }else{ |
| 838 | blob_append(pOut, "..", 2); |
| 839 | for(j=i+1; zPwd[j]; j++){ |
| 840 | if( zPwd[j]=='/' ) { |
| 841 | blob_append(pOut, "/..", 3); |
| 842 | } |
| 843 | } |
| 844 | } |
| 845 | return; |
| @@ -852,11 +875,11 @@ | |
| 852 | return; |
| 853 | } |
| 854 | while( zPath[i-1]!='/' ){ i--; } |
| 855 | blob_set(&tmp, "../"); |
| 856 | for(j=i; zPwd[j]; j++){ |
| 857 | if( zPwd[j]=='/' ) { |
| 858 | blob_append(&tmp, "../", 3); |
| 859 | } |
| 860 | } |
| 861 | blob_append(&tmp, &zPath[i], -1); |
| 862 | blob_reset(pOut); |
| 863 |
| --- src/file.c | |
| +++ src/file.c | |
| @@ -490,45 +490,68 @@ | |
| 490 | ** * Does not contain two or more "/" characters in a row. |
| 491 | ** * Contains at least one character |
| 492 | ** |
| 493 | ** Invalid UTF8 characters result in a false return if bStrictUtf8 is |
| 494 | ** true. If bStrictUtf8 is false, invalid UTF8 characters are silently |
| 495 | ** ignored. See http://en.wikipedia.org/wiki/UTF-8#Invalid_byte_sequences |
| 496 | ** and http://en.wikipedia.org/wiki/Unicode (for the noncharacters) |
| 497 | ** |
| 498 | ** The bStrictUtf8 flag is true for new inputs, but is false when parsing |
| 499 | ** legacy manifests, for backwards compatibility. |
| 500 | */ |
| 501 | int file_is_simple_pathname(const char *z, int bStrictUtf8){ |
| 502 | int i; |
| 503 | unsigned char c = (unsigned char) z[0]; |
| 504 | char maskNonAscii = bStrictUtf8 ? 0x80 : 0x00; |
| 505 | if( c=='/' || c==0 ) return 0; |
| 506 | if( c=='.' ){ |
| 507 | if( z[1]=='/' || z[1]==0 ) return 0; |
| 508 | if( z[1]=='.' && (z[2]=='/' || z[2]==0) ) return 0; |
| 509 | } |
| 510 | for(i=0; (c=(unsigned char)z[i])!=0; i++){ |
| 511 | if( c & maskNonAscii ){ |
| 512 | if( (z[++i]&0xc0)!=0x80 ){ |
| 513 | /* Invalid first continuation byte */ |
| 514 | return 0; |
| 515 | } |
| 516 | if( c<0xc2 ){ |
| 517 | /* Invalid 1-byte UTF-8 sequence, or 2-byte overlong form. */ |
| 518 | return 0; |
| 519 | }else if( (c&0xe0)==0xe0 ){ |
| 520 | /* 3-byte or more */ |
| 521 | int unicode; |
| 522 | if( c&0x10 ){ |
| 523 | /* Unicode characters > U+FFFF are not supported. |
| 524 | * Windows XP and earlier cannot handle them. |
| 525 | */ |
| 526 | return 0; |
| 527 | } |
| 528 | /* This is a 3-byte UTF-8 character */ |
| 529 | unicode = ((c&0x0f)<<12) + ((z[i]&0x3f)<<6) + (z[i+1]&0x3f); |
| 530 | if( unicode <= 0x07ff ){ |
| 531 | /* overlong form */ |
| 532 | return 0; |
| 533 | }else if( unicode>=0xe000 ){ |
| 534 | /* U+E000..U+FFFF */ |
| 535 | if( (unicode<=0xf8ff) || (unicode>=0xfffe) ){ |
| 536 | /* U+E000..U+F8FF are for private use. |
| 537 | * U+FFFE..U+FFFF are noncharacters. */ |
| 538 | return 0; |
| 539 | } else if( (unicode>=0xfdd0) && (unicode<=0xfdef) ){ |
| 540 | /* U+FDD0..U+FDEF are noncharacters. */ |
| 541 | return 0; |
| 542 | } |
| 543 | }else if( (unicode>=0xd800) && (unicode<=0xdfff) ){ |
| 544 | /* U+D800..U+DFFF are for surrogate pairs. */ |
| 545 | return 0; |
| 546 | } |
| 547 | if( (z[++i]&0xc0)!=0x80 ){ |
| 548 | /* Invalid second continuation byte */ |
| 549 | return 0; |
| 550 | } |
| 551 | } |
| 552 | }else if( bStrictUtf8 && (c=='\\') ){ |
| 553 | return 0; |
| 554 | } |
| 555 | if( c=='/' ){ |
| 556 | if( z[i+1]=='/' ) return 0; |
| 557 | if( z[i+1]=='.' ){ |
| @@ -578,11 +601,11 @@ | |
| 601 | if( z[i]=='\\' ) z[i] = '/'; |
| 602 | } |
| 603 | #endif |
| 604 | |
| 605 | /* Removing trailing "/" characters */ |
| 606 | if( !slash ){ |
| 607 | while( n>1 && z[n-1]=='/' ){ n--; } |
| 608 | } |
| 609 | |
| 610 | /* Remove duplicate '/' characters. Except, two // at the beginning |
| 611 | ** of a pathname is allowed since this is important on windows. */ |
| @@ -835,11 +858,11 @@ | |
| 858 | if( zPwd[i]==0 ){ |
| 859 | blob_append(pOut, ".", 1); |
| 860 | }else{ |
| 861 | blob_append(pOut, "..", 2); |
| 862 | for(j=i+1; zPwd[j]; j++){ |
| 863 | if( zPwd[j]=='/' ){ |
| 864 | blob_append(pOut, "/..", 3); |
| 865 | } |
| 866 | } |
| 867 | } |
| 868 | return; |
| @@ -852,11 +875,11 @@ | |
| 875 | return; |
| 876 | } |
| 877 | while( zPath[i-1]!='/' ){ i--; } |
| 878 | blob_set(&tmp, "../"); |
| 879 | for(j=i; zPwd[j]; j++){ |
| 880 | if( zPwd[j]=='/' ){ |
| 881 | blob_append(&tmp, "../", 3); |
| 882 | } |
| 883 | } |
| 884 | blob_append(&tmp, &zPath[i], -1); |
| 885 | blob_reset(pOut); |
| 886 |
+6
-2
| --- src/http.c | ||
| +++ src/http.c | ||
| @@ -130,11 +130,11 @@ | ||
| 130 | 130 | ** |
| 131 | 131 | ** The server address is contain in the "g" global structure. The |
| 132 | 132 | ** url_parse() routine should have been called prior to this routine |
| 133 | 133 | ** in order to fill this structure appropriately. |
| 134 | 134 | */ |
| 135 | -int http_exchange(Blob *pSend, Blob *pReply, int useLogin){ | |
| 135 | +int http_exchange(Blob *pSend, Blob *pReply, int useLogin, int maxRedirect){ | |
| 136 | 136 | Blob login; /* The login card */ |
| 137 | 137 | Blob payload; /* The complete payload including login card */ |
| 138 | 138 | Blob hdr; /* The HTTP request header */ |
| 139 | 139 | int closeConnection; /* True to close the connection when done */ |
| 140 | 140 | int iLength; /* Length of the reply payload */ |
| @@ -231,10 +231,14 @@ | ||
| 231 | 231 | }else if( c=='k' || c=='K' ){ |
| 232 | 232 | closeConnection = 0; |
| 233 | 233 | } |
| 234 | 234 | }else if( rc==302 && fossil_strnicmp(zLine, "location:", 9)==0 ){ |
| 235 | 235 | int i, j; |
| 236 | + | |
| 237 | + if ( --maxRedirect == 0){ | |
| 238 | + fossil_fatal("redirect limit exceeded"); | |
| 239 | + } | |
| 236 | 240 | for(i=9; zLine[i] && zLine[i]==' '; i++){} |
| 237 | 241 | if( zLine[i]==0 ) fossil_fatal("malformed redirect: %s", zLine); |
| 238 | 242 | j = strlen(zLine) - 1; |
| 239 | 243 | while( j>4 && fossil_strcmp(&zLine[j-4],"/xfer")==0 ){ |
| 240 | 244 | j -= 4; |
| @@ -241,11 +245,11 @@ | ||
| 241 | 245 | zLine[j] = 0; |
| 242 | 246 | } |
| 243 | 247 | fossil_print("redirect to %s\n", &zLine[i]); |
| 244 | 248 | url_parse(&zLine[i]); |
| 245 | 249 | transport_close(); |
| 246 | - return http_exchange(pSend, pReply, useLogin); | |
| 250 | + return http_exchange(pSend, pReply, useLogin, maxRedirect); | |
| 247 | 251 | }else if( fossil_strnicmp(zLine, "content-type: ", 14)==0 ){ |
| 248 | 252 | if( fossil_strnicmp(&zLine[14], "application/x-fossil-debug", -1)==0 ){ |
| 249 | 253 | isCompressed = 0; |
| 250 | 254 | }else if( fossil_strnicmp(&zLine[14], |
| 251 | 255 | "application/x-fossil-uncompressed", -1)==0 ){ |
| 252 | 256 |
| --- src/http.c | |
| +++ src/http.c | |
| @@ -130,11 +130,11 @@ | |
| 130 | ** |
| 131 | ** The server address is contain in the "g" global structure. The |
| 132 | ** url_parse() routine should have been called prior to this routine |
| 133 | ** in order to fill this structure appropriately. |
| 134 | */ |
| 135 | int http_exchange(Blob *pSend, Blob *pReply, int useLogin){ |
| 136 | Blob login; /* The login card */ |
| 137 | Blob payload; /* The complete payload including login card */ |
| 138 | Blob hdr; /* The HTTP request header */ |
| 139 | int closeConnection; /* True to close the connection when done */ |
| 140 | int iLength; /* Length of the reply payload */ |
| @@ -231,10 +231,14 @@ | |
| 231 | }else if( c=='k' || c=='K' ){ |
| 232 | closeConnection = 0; |
| 233 | } |
| 234 | }else if( rc==302 && fossil_strnicmp(zLine, "location:", 9)==0 ){ |
| 235 | int i, j; |
| 236 | for(i=9; zLine[i] && zLine[i]==' '; i++){} |
| 237 | if( zLine[i]==0 ) fossil_fatal("malformed redirect: %s", zLine); |
| 238 | j = strlen(zLine) - 1; |
| 239 | while( j>4 && fossil_strcmp(&zLine[j-4],"/xfer")==0 ){ |
| 240 | j -= 4; |
| @@ -241,11 +245,11 @@ | |
| 241 | zLine[j] = 0; |
| 242 | } |
| 243 | fossil_print("redirect to %s\n", &zLine[i]); |
| 244 | url_parse(&zLine[i]); |
| 245 | transport_close(); |
| 246 | return http_exchange(pSend, pReply, useLogin); |
| 247 | }else if( fossil_strnicmp(zLine, "content-type: ", 14)==0 ){ |
| 248 | if( fossil_strnicmp(&zLine[14], "application/x-fossil-debug", -1)==0 ){ |
| 249 | isCompressed = 0; |
| 250 | }else if( fossil_strnicmp(&zLine[14], |
| 251 | "application/x-fossil-uncompressed", -1)==0 ){ |
| 252 |
| --- src/http.c | |
| +++ src/http.c | |
| @@ -130,11 +130,11 @@ | |
| 130 | ** |
| 131 | ** The server address is contain in the "g" global structure. The |
| 132 | ** url_parse() routine should have been called prior to this routine |
| 133 | ** in order to fill this structure appropriately. |
| 134 | */ |
| 135 | int http_exchange(Blob *pSend, Blob *pReply, int useLogin, int maxRedirect){ |
| 136 | Blob login; /* The login card */ |
| 137 | Blob payload; /* The complete payload including login card */ |
| 138 | Blob hdr; /* The HTTP request header */ |
| 139 | int closeConnection; /* True to close the connection when done */ |
| 140 | int iLength; /* Length of the reply payload */ |
| @@ -231,10 +231,14 @@ | |
| 231 | }else if( c=='k' || c=='K' ){ |
| 232 | closeConnection = 0; |
| 233 | } |
| 234 | }else if( rc==302 && fossil_strnicmp(zLine, "location:", 9)==0 ){ |
| 235 | int i, j; |
| 236 | |
| 237 | if ( --maxRedirect == 0){ |
| 238 | fossil_fatal("redirect limit exceeded"); |
| 239 | } |
| 240 | for(i=9; zLine[i] && zLine[i]==' '; i++){} |
| 241 | if( zLine[i]==0 ) fossil_fatal("malformed redirect: %s", zLine); |
| 242 | j = strlen(zLine) - 1; |
| 243 | while( j>4 && fossil_strcmp(&zLine[j-4],"/xfer")==0 ){ |
| 244 | j -= 4; |
| @@ -241,11 +245,11 @@ | |
| 245 | zLine[j] = 0; |
| 246 | } |
| 247 | fossil_print("redirect to %s\n", &zLine[i]); |
| 248 | url_parse(&zLine[i]); |
| 249 | transport_close(); |
| 250 | return http_exchange(pSend, pReply, useLogin, maxRedirect); |
| 251 | }else if( fossil_strnicmp(zLine, "content-type: ", 14)==0 ){ |
| 252 | if( fossil_strnicmp(&zLine[14], "application/x-fossil-debug", -1)==0 ){ |
| 253 | isCompressed = 0; |
| 254 | }else if( fossil_strnicmp(&zLine[14], |
| 255 | "application/x-fossil-uncompressed", -1)==0 ){ |
| 256 |
+51
-6
| --- src/http_transport.c | ||
| +++ src/http_transport.c | ||
| @@ -183,10 +183,11 @@ | ||
| 183 | 183 | ** and run an SSH command to talk to the remote machine. |
| 184 | 184 | */ |
| 185 | 185 | const char *zSsh; /* The base SSH command */ |
| 186 | 186 | Blob zCmd; /* The SSH command */ |
| 187 | 187 | char *zHost; /* The host name to contact */ |
| 188 | + int n; /* Size of prefix string */ | |
| 188 | 189 | |
| 189 | 190 | zSsh = db_get("ssh-command", zDefaultSshCmd); |
| 190 | 191 | blob_init(&zCmd, zSsh, -1); |
| 191 | 192 | if( g.urlPort!=g.urlDfltPort ){ |
| 192 | 193 | #ifdef __MINGW32__ |
| @@ -219,22 +220,63 @@ | ||
| 219 | 220 | } |
| 220 | 221 | #endif |
| 221 | 222 | }else{ |
| 222 | 223 | zHost = mprintf("%s", g.urlName); |
| 223 | 224 | } |
| 225 | + n = blob_size(&zCmd); | |
| 224 | 226 | blob_append(&zCmd, " ", 1); |
| 225 | 227 | shell_escape(&zCmd, zHost); |
| 226 | - fossil_print(" %s\n", zHost); /* Show the conclusion of the SSH command */ | |
| 228 | + if( g.urlShell ){ | |
| 229 | + blob_appendf(&zCmd, " %s", g.urlShell); | |
| 230 | + }else{ | |
| 231 | +#if defined(FOSSIL_ENABLE_SSH_FAR_SIDE) | |
| 232 | + /* The following works. But only if the fossil on the remote side | |
| 233 | + ** is recent enough to support the test-ssh-far-side command. That | |
| 234 | + ** command was added on 2013-02-06. We will leave this turned off | |
| 235 | + ** until most fossil servers have upgraded to that version or a later | |
| 236 | + ** version. The sync will still work as long as the shell on the far | |
| 237 | + ** side is bash and not tcsh. And if the default far side shell is | |
| 238 | + ** tcsh, then the shell=/bin/bash query parameter can be used as a | |
| 239 | + ** work-around. Enable this code after about a year... | |
| 240 | + */ | |
| 241 | + blob_appendf(&zCmd, " exec %s test-ssh-far-side", g.urlFossil); | |
| 242 | +#endif | |
| 243 | + } | |
| 244 | + fossil_print("%s\n", blob_str(&zCmd)+n); /* Show tail of SSH command */ | |
| 227 | 245 | free(zHost); |
| 228 | 246 | popen2(blob_str(&zCmd), &sshIn, &sshOut, &sshPid); |
| 229 | 247 | if( sshPid==0 ){ |
| 230 | 248 | fossil_fatal("cannot start ssh tunnel using [%b]", &zCmd); |
| 231 | 249 | } |
| 232 | 250 | blob_reset(&zCmd); |
| 233 | 251 | transport_ssh_startup(); |
| 234 | 252 | } |
| 235 | 253 | } |
| 254 | + | |
| 255 | +/* | |
| 256 | +** COMMAND: test-ssh-far-side | |
| 257 | +** | |
| 258 | +** Read lines of input text, one by one, and evaluate each line using | |
| 259 | +** system(). The ssh: sync protocol uses this on the far side of the | |
| 260 | +** SSH link. | |
| 261 | +*/ | |
| 262 | +void test_ssh_far_side_cmd(void){ | |
| 263 | + int i = 0; | |
| 264 | + int got; | |
| 265 | + char zLine[5000]; | |
| 266 | + while( i<sizeof(zLine) ){ | |
| 267 | + got = read(0, zLine+i, 1); | |
| 268 | + if( got==0 ) return; | |
| 269 | + if( zLine[i]=='\n' ){ | |
| 270 | + zLine[i] = 0; | |
| 271 | + system(zLine); | |
| 272 | + i = 0; | |
| 273 | + }else{ | |
| 274 | + i++; | |
| 275 | + } | |
| 276 | + } | |
| 277 | +} | |
| 236 | 278 | |
| 237 | 279 | /* |
| 238 | 280 | ** Open a connection to the server. The server is defined by the following |
| 239 | 281 | ** global variables: |
| 240 | 282 | ** |
| @@ -251,13 +293,13 @@ | ||
| 251 | 293 | Blob cmd; |
| 252 | 294 | blob_zero(&cmd); |
| 253 | 295 | shell_escape(&cmd, g.urlFossil); |
| 254 | 296 | blob_append(&cmd, " test-http ", -1); |
| 255 | 297 | shell_escape(&cmd, g.urlPath); |
| 256 | - /* printf("%s\n", blob_str(&cmd)); fflush(stdout); */ | |
| 257 | - fprintf(sshOut, "%s\n", blob_str(&cmd)); | |
| 298 | + fprintf(sshOut, "%s || true\n", blob_str(&cmd)); | |
| 258 | 299 | fflush(sshOut); |
| 300 | + if( g.fSshTrace ) printf("Sent: [%s]\n", blob_str(&cmd)); | |
| 259 | 301 | blob_reset(&cmd); |
| 260 | 302 | }else if( g.urlIsHttps ){ |
| 261 | 303 | #ifdef FOSSIL_ENABLE_SSL |
| 262 | 304 | rc = ssl_open(); |
| 263 | 305 | if( rc==0 ) transport.isOpen = 1; |
| @@ -403,11 +445,10 @@ | ||
| 403 | 445 | int got; |
| 404 | 446 | if( sshIn ){ |
| 405 | 447 | int x; |
| 406 | 448 | int wanted = N; |
| 407 | 449 | got = 0; |
| 408 | - /* printf("want %d bytes...\n", wanted); fflush(stdout); */ | |
| 409 | 450 | while( wanted>0 ){ |
| 410 | 451 | x = read(sshIn, &zBuf[got], wanted); |
| 411 | 452 | if( x<=0 ) break; |
| 412 | 453 | got += x; |
| 413 | 454 | wanted -= x; |
| @@ -438,11 +479,14 @@ | ||
| 438 | 479 | int transport_receive(char *zBuf, int N){ |
| 439 | 480 | int onHand; /* Bytes current held in the transport buffer */ |
| 440 | 481 | int nByte = 0; /* Bytes of content received */ |
| 441 | 482 | |
| 442 | 483 | onHand = transport.nUsed - transport.iCursor; |
| 443 | - /* printf("request %d with %d on hand\n", N, onHand); fflush(stdout); */ | |
| 484 | + if( g.fSshTrace){ | |
| 485 | + printf("Reading %d bytes with %d on hand... ", N, onHand); | |
| 486 | + fflush(stdout); | |
| 487 | + } | |
| 444 | 488 | if( onHand>0 ){ |
| 445 | 489 | int toMove = onHand; |
| 446 | 490 | if( toMove>N ) toMove = N; |
| 447 | 491 | /* printf("bytes on hand: %d of %d\n", toMove, N); fflush(stdout); */ |
| 448 | 492 | memcpy(zBuf, &transport.pBuf[transport.iCursor], toMove); |
| @@ -460,10 +504,11 @@ | ||
| 460 | 504 | if( got>0 ){ |
| 461 | 505 | nByte += got; |
| 462 | 506 | transport.nRcvd += got; |
| 463 | 507 | } |
| 464 | 508 | } |
| 509 | + if( g.fSshTrace ) printf("Got %d bytes\n", nByte); | |
| 465 | 510 | return nByte; |
| 466 | 511 | } |
| 467 | 512 | |
| 468 | 513 | /* |
| 469 | 514 | ** Load up to N new bytes of content into the transport.pBuf buffer. |
| @@ -532,11 +577,11 @@ | ||
| 532 | 577 | } |
| 533 | 578 | break; |
| 534 | 579 | } |
| 535 | 580 | i++; |
| 536 | 581 | } |
| 537 | - /* printf("Got line: [%s]\n", &transport.pBuf[iStart]); */ | |
| 582 | + if( g.fSshTrace ) printf("Got line: [%s]\n", &transport.pBuf[iStart]); | |
| 538 | 583 | return &transport.pBuf[iStart]; |
| 539 | 584 | } |
| 540 | 585 | |
| 541 | 586 | void transport_global_shutdown(void){ |
| 542 | 587 | if( g.urlIsSsh && sshPid ){ |
| 543 | 588 |
| --- src/http_transport.c | |
| +++ src/http_transport.c | |
| @@ -183,10 +183,11 @@ | |
| 183 | ** and run an SSH command to talk to the remote machine. |
| 184 | */ |
| 185 | const char *zSsh; /* The base SSH command */ |
| 186 | Blob zCmd; /* The SSH command */ |
| 187 | char *zHost; /* The host name to contact */ |
| 188 | |
| 189 | zSsh = db_get("ssh-command", zDefaultSshCmd); |
| 190 | blob_init(&zCmd, zSsh, -1); |
| 191 | if( g.urlPort!=g.urlDfltPort ){ |
| 192 | #ifdef __MINGW32__ |
| @@ -219,22 +220,63 @@ | |
| 219 | } |
| 220 | #endif |
| 221 | }else{ |
| 222 | zHost = mprintf("%s", g.urlName); |
| 223 | } |
| 224 | blob_append(&zCmd, " ", 1); |
| 225 | shell_escape(&zCmd, zHost); |
| 226 | fossil_print(" %s\n", zHost); /* Show the conclusion of the SSH command */ |
| 227 | free(zHost); |
| 228 | popen2(blob_str(&zCmd), &sshIn, &sshOut, &sshPid); |
| 229 | if( sshPid==0 ){ |
| 230 | fossil_fatal("cannot start ssh tunnel using [%b]", &zCmd); |
| 231 | } |
| 232 | blob_reset(&zCmd); |
| 233 | transport_ssh_startup(); |
| 234 | } |
| 235 | } |
| 236 | |
| 237 | /* |
| 238 | ** Open a connection to the server. The server is defined by the following |
| 239 | ** global variables: |
| 240 | ** |
| @@ -251,13 +293,13 @@ | |
| 251 | Blob cmd; |
| 252 | blob_zero(&cmd); |
| 253 | shell_escape(&cmd, g.urlFossil); |
| 254 | blob_append(&cmd, " test-http ", -1); |
| 255 | shell_escape(&cmd, g.urlPath); |
| 256 | /* printf("%s\n", blob_str(&cmd)); fflush(stdout); */ |
| 257 | fprintf(sshOut, "%s\n", blob_str(&cmd)); |
| 258 | fflush(sshOut); |
| 259 | blob_reset(&cmd); |
| 260 | }else if( g.urlIsHttps ){ |
| 261 | #ifdef FOSSIL_ENABLE_SSL |
| 262 | rc = ssl_open(); |
| 263 | if( rc==0 ) transport.isOpen = 1; |
| @@ -403,11 +445,10 @@ | |
| 403 | int got; |
| 404 | if( sshIn ){ |
| 405 | int x; |
| 406 | int wanted = N; |
| 407 | got = 0; |
| 408 | /* printf("want %d bytes...\n", wanted); fflush(stdout); */ |
| 409 | while( wanted>0 ){ |
| 410 | x = read(sshIn, &zBuf[got], wanted); |
| 411 | if( x<=0 ) break; |
| 412 | got += x; |
| 413 | wanted -= x; |
| @@ -438,11 +479,14 @@ | |
| 438 | int transport_receive(char *zBuf, int N){ |
| 439 | int onHand; /* Bytes current held in the transport buffer */ |
| 440 | int nByte = 0; /* Bytes of content received */ |
| 441 | |
| 442 | onHand = transport.nUsed - transport.iCursor; |
| 443 | /* printf("request %d with %d on hand\n", N, onHand); fflush(stdout); */ |
| 444 | if( onHand>0 ){ |
| 445 | int toMove = onHand; |
| 446 | if( toMove>N ) toMove = N; |
| 447 | /* printf("bytes on hand: %d of %d\n", toMove, N); fflush(stdout); */ |
| 448 | memcpy(zBuf, &transport.pBuf[transport.iCursor], toMove); |
| @@ -460,10 +504,11 @@ | |
| 460 | if( got>0 ){ |
| 461 | nByte += got; |
| 462 | transport.nRcvd += got; |
| 463 | } |
| 464 | } |
| 465 | return nByte; |
| 466 | } |
| 467 | |
| 468 | /* |
| 469 | ** Load up to N new bytes of content into the transport.pBuf buffer. |
| @@ -532,11 +577,11 @@ | |
| 532 | } |
| 533 | break; |
| 534 | } |
| 535 | i++; |
| 536 | } |
| 537 | /* printf("Got line: [%s]\n", &transport.pBuf[iStart]); */ |
| 538 | return &transport.pBuf[iStart]; |
| 539 | } |
| 540 | |
| 541 | void transport_global_shutdown(void){ |
| 542 | if( g.urlIsSsh && sshPid ){ |
| 543 |
| --- src/http_transport.c | |
| +++ src/http_transport.c | |
| @@ -183,10 +183,11 @@ | |
| 183 | ** and run an SSH command to talk to the remote machine. |
| 184 | */ |
| 185 | const char *zSsh; /* The base SSH command */ |
| 186 | Blob zCmd; /* The SSH command */ |
| 187 | char *zHost; /* The host name to contact */ |
| 188 | int n; /* Size of prefix string */ |
| 189 | |
| 190 | zSsh = db_get("ssh-command", zDefaultSshCmd); |
| 191 | blob_init(&zCmd, zSsh, -1); |
| 192 | if( g.urlPort!=g.urlDfltPort ){ |
| 193 | #ifdef __MINGW32__ |
| @@ -219,22 +220,63 @@ | |
| 220 | } |
| 221 | #endif |
| 222 | }else{ |
| 223 | zHost = mprintf("%s", g.urlName); |
| 224 | } |
| 225 | n = blob_size(&zCmd); |
| 226 | blob_append(&zCmd, " ", 1); |
| 227 | shell_escape(&zCmd, zHost); |
| 228 | if( g.urlShell ){ |
| 229 | blob_appendf(&zCmd, " %s", g.urlShell); |
| 230 | }else{ |
| 231 | #if defined(FOSSIL_ENABLE_SSH_FAR_SIDE) |
| 232 | /* The following works. But only if the fossil on the remote side |
| 233 | ** is recent enough to support the test-ssh-far-side command. That |
| 234 | ** command was added on 2013-02-06. We will leave this turned off |
| 235 | ** until most fossil servers have upgraded to that version or a later |
| 236 | ** version. The sync will still work as long as the shell on the far |
| 237 | ** side is bash and not tcsh. And if the default far side shell is |
| 238 | ** tcsh, then the shell=/bin/bash query parameter can be used as a |
| 239 | ** work-around. Enable this code after about a year... |
| 240 | */ |
| 241 | blob_appendf(&zCmd, " exec %s test-ssh-far-side", g.urlFossil); |
| 242 | #endif |
| 243 | } |
| 244 | fossil_print("%s\n", blob_str(&zCmd)+n); /* Show tail of SSH command */ |
| 245 | free(zHost); |
| 246 | popen2(blob_str(&zCmd), &sshIn, &sshOut, &sshPid); |
| 247 | if( sshPid==0 ){ |
| 248 | fossil_fatal("cannot start ssh tunnel using [%b]", &zCmd); |
| 249 | } |
| 250 | blob_reset(&zCmd); |
| 251 | transport_ssh_startup(); |
| 252 | } |
| 253 | } |
| 254 | |
| 255 | /* |
| 256 | ** COMMAND: test-ssh-far-side |
| 257 | ** |
| 258 | ** Read lines of input text, one by one, and evaluate each line using |
| 259 | ** system(). The ssh: sync protocol uses this on the far side of the |
| 260 | ** SSH link. |
| 261 | */ |
| 262 | void test_ssh_far_side_cmd(void){ |
| 263 | int i = 0; |
| 264 | int got; |
| 265 | char zLine[5000]; |
| 266 | while( i<sizeof(zLine) ){ |
| 267 | got = read(0, zLine+i, 1); |
| 268 | if( got==0 ) return; |
| 269 | if( zLine[i]=='\n' ){ |
| 270 | zLine[i] = 0; |
| 271 | system(zLine); |
| 272 | i = 0; |
| 273 | }else{ |
| 274 | i++; |
| 275 | } |
| 276 | } |
| 277 | } |
| 278 | |
| 279 | /* |
| 280 | ** Open a connection to the server. The server is defined by the following |
| 281 | ** global variables: |
| 282 | ** |
| @@ -251,13 +293,13 @@ | |
| 293 | Blob cmd; |
| 294 | blob_zero(&cmd); |
| 295 | shell_escape(&cmd, g.urlFossil); |
| 296 | blob_append(&cmd, " test-http ", -1); |
| 297 | shell_escape(&cmd, g.urlPath); |
| 298 | fprintf(sshOut, "%s || true\n", blob_str(&cmd)); |
| 299 | fflush(sshOut); |
| 300 | if( g.fSshTrace ) printf("Sent: [%s]\n", blob_str(&cmd)); |
| 301 | blob_reset(&cmd); |
| 302 | }else if( g.urlIsHttps ){ |
| 303 | #ifdef FOSSIL_ENABLE_SSL |
| 304 | rc = ssl_open(); |
| 305 | if( rc==0 ) transport.isOpen = 1; |
| @@ -403,11 +445,10 @@ | |
| 445 | int got; |
| 446 | if( sshIn ){ |
| 447 | int x; |
| 448 | int wanted = N; |
| 449 | got = 0; |
| 450 | while( wanted>0 ){ |
| 451 | x = read(sshIn, &zBuf[got], wanted); |
| 452 | if( x<=0 ) break; |
| 453 | got += x; |
| 454 | wanted -= x; |
| @@ -438,11 +479,14 @@ | |
| 479 | int transport_receive(char *zBuf, int N){ |
| 480 | int onHand; /* Bytes current held in the transport buffer */ |
| 481 | int nByte = 0; /* Bytes of content received */ |
| 482 | |
| 483 | onHand = transport.nUsed - transport.iCursor; |
| 484 | if( g.fSshTrace){ |
| 485 | printf("Reading %d bytes with %d on hand... ", N, onHand); |
| 486 | fflush(stdout); |
| 487 | } |
| 488 | if( onHand>0 ){ |
| 489 | int toMove = onHand; |
| 490 | if( toMove>N ) toMove = N; |
| 491 | /* printf("bytes on hand: %d of %d\n", toMove, N); fflush(stdout); */ |
| 492 | memcpy(zBuf, &transport.pBuf[transport.iCursor], toMove); |
| @@ -460,10 +504,11 @@ | |
| 504 | if( got>0 ){ |
| 505 | nByte += got; |
| 506 | transport.nRcvd += got; |
| 507 | } |
| 508 | } |
| 509 | if( g.fSshTrace ) printf("Got %d bytes\n", nByte); |
| 510 | return nByte; |
| 511 | } |
| 512 | |
| 513 | /* |
| 514 | ** Load up to N new bytes of content into the transport.pBuf buffer. |
| @@ -532,11 +577,11 @@ | |
| 577 | } |
| 578 | break; |
| 579 | } |
| 580 | i++; |
| 581 | } |
| 582 | if( g.fSshTrace ) printf("Got line: [%s]\n", &transport.pBuf[iStart]); |
| 583 | return &transport.pBuf[iStart]; |
| 584 | } |
| 585 | |
| 586 | void transport_global_shutdown(void){ |
| 587 | if( g.urlIsSsh && sshPid ){ |
| 588 |
+1
-1
| --- src/json_detail.h | ||
| +++ src/json_detail.h | ||
| @@ -199,11 +199,11 @@ | ||
| 199 | 199 | char const * requestId; |
| 200 | 200 | char const * resultCode; |
| 201 | 201 | char const * resultText; |
| 202 | 202 | char const * timestamp; |
| 203 | 203 | } FossilJsonKeys_; |
| 204 | -const FossilJsonKeys_ FossilJsonKeys; | |
| 204 | +extern const FossilJsonKeys_ FossilJsonKeys; | |
| 205 | 205 | |
| 206 | 206 | /* |
| 207 | 207 | ** A page/command dispatch helper for fossil_json_f() implementations. |
| 208 | 208 | ** pages must be an array of JsonPageDef commands which we can |
| 209 | 209 | ** dispatch. The final item in the array MUST have a NULL name |
| 210 | 210 |
| --- src/json_detail.h | |
| +++ src/json_detail.h | |
| @@ -199,11 +199,11 @@ | |
| 199 | char const * requestId; |
| 200 | char const * resultCode; |
| 201 | char const * resultText; |
| 202 | char const * timestamp; |
| 203 | } FossilJsonKeys_; |
| 204 | const FossilJsonKeys_ FossilJsonKeys; |
| 205 | |
| 206 | /* |
| 207 | ** A page/command dispatch helper for fossil_json_f() implementations. |
| 208 | ** pages must be an array of JsonPageDef commands which we can |
| 209 | ** dispatch. The final item in the array MUST have a NULL name |
| 210 |
| --- src/json_detail.h | |
| +++ src/json_detail.h | |
| @@ -199,11 +199,11 @@ | |
| 199 | char const * requestId; |
| 200 | char const * resultCode; |
| 201 | char const * resultText; |
| 202 | char const * timestamp; |
| 203 | } FossilJsonKeys_; |
| 204 | extern const FossilJsonKeys_ FossilJsonKeys; |
| 205 | |
| 206 | /* |
| 207 | ** A page/command dispatch helper for fossil_json_f() implementations. |
| 208 | ** pages must be an array of JsonPageDef commands which we can |
| 209 | ** dispatch. The final item in the array MUST have a NULL name |
| 210 |
+3
-2
| --- src/main.c | ||
| +++ src/main.c | ||
| @@ -170,11 +170,12 @@ | ||
| 170 | 170 | char *urlPath; /* Pathname for http: */ |
| 171 | 171 | char *urlUser; /* User id for http: */ |
| 172 | 172 | char *urlPasswd; /* Password for http: */ |
| 173 | 173 | char *urlCanonical; /* Canonical representation of the URL */ |
| 174 | 174 | char *urlProxyAuth; /* Proxy-Authorizer: string */ |
| 175 | - char *urlFossil; /* The path of the ?fossil=path suffix on ssh: */ | |
| 175 | + char *urlFossil; /* The fossil query parameter on ssh: */ | |
| 176 | + char *urlShell; /* The shell query parameter on ssh: */ | |
| 176 | 177 | int dontKeepUrl; /* Do not persist the URL */ |
| 177 | 178 | |
| 178 | 179 | const char *zLogin; /* Login name. "" if not logged in. */ |
| 179 | 180 | const char *zSSLIdentity; /* Value of --ssl-identity option, filename of SSL client identity */ |
| 180 | 181 | int useLocalauth; /* No login required if from 127.0.0.1 */ |
| @@ -963,11 +964,11 @@ | ||
| 963 | 964 | ** |
| 964 | 965 | ** Display information on how to use COMMAND. To display a list of |
| 965 | 966 | ** available commands one of: |
| 966 | 967 | ** |
| 967 | 968 | ** %fossil help Show common commands |
| 968 | -** %fossil help --all Show both command and auxiliary commands | |
| 969 | +** %fossil help --all Show both common and auxiliary commands | |
| 969 | 970 | ** %fossil help --test Show test commands only |
| 970 | 971 | ** %fossil help --aux Show auxiliary commands only |
| 971 | 972 | */ |
| 972 | 973 | void help_cmd(void){ |
| 973 | 974 | int rc, idx; |
| 974 | 975 |
| --- src/main.c | |
| +++ src/main.c | |
| @@ -170,11 +170,12 @@ | |
| 170 | char *urlPath; /* Pathname for http: */ |
| 171 | char *urlUser; /* User id for http: */ |
| 172 | char *urlPasswd; /* Password for http: */ |
| 173 | char *urlCanonical; /* Canonical representation of the URL */ |
| 174 | char *urlProxyAuth; /* Proxy-Authorizer: string */ |
| 175 | char *urlFossil; /* The path of the ?fossil=path suffix on ssh: */ |
| 176 | int dontKeepUrl; /* Do not persist the URL */ |
| 177 | |
| 178 | const char *zLogin; /* Login name. "" if not logged in. */ |
| 179 | const char *zSSLIdentity; /* Value of --ssl-identity option, filename of SSL client identity */ |
| 180 | int useLocalauth; /* No login required if from 127.0.0.1 */ |
| @@ -963,11 +964,11 @@ | |
| 963 | ** |
| 964 | ** Display information on how to use COMMAND. To display a list of |
| 965 | ** available commands one of: |
| 966 | ** |
| 967 | ** %fossil help Show common commands |
| 968 | ** %fossil help --all Show both command and auxiliary commands |
| 969 | ** %fossil help --test Show test commands only |
| 970 | ** %fossil help --aux Show auxiliary commands only |
| 971 | */ |
| 972 | void help_cmd(void){ |
| 973 | int rc, idx; |
| 974 |
| --- src/main.c | |
| +++ src/main.c | |
| @@ -170,11 +170,12 @@ | |
| 170 | char *urlPath; /* Pathname for http: */ |
| 171 | char *urlUser; /* User id for http: */ |
| 172 | char *urlPasswd; /* Password for http: */ |
| 173 | char *urlCanonical; /* Canonical representation of the URL */ |
| 174 | char *urlProxyAuth; /* Proxy-Authorizer: string */ |
| 175 | char *urlFossil; /* The fossil query parameter on ssh: */ |
| 176 | char *urlShell; /* The shell query parameter on ssh: */ |
| 177 | int dontKeepUrl; /* Do not persist the URL */ |
| 178 | |
| 179 | const char *zLogin; /* Login name. "" if not logged in. */ |
| 180 | const char *zSSLIdentity; /* Value of --ssl-identity option, filename of SSL client identity */ |
| 181 | int useLocalauth; /* No login required if from 127.0.0.1 */ |
| @@ -963,11 +964,11 @@ | |
| 964 | ** |
| 965 | ** Display information on how to use COMMAND. To display a list of |
| 966 | ** available commands one of: |
| 967 | ** |
| 968 | ** %fossil help Show common commands |
| 969 | ** %fossil help --all Show both common and auxiliary commands |
| 970 | ** %fossil help --test Show test commands only |
| 971 | ** %fossil help --aux Show auxiliary commands only |
| 972 | */ |
| 973 | void help_cmd(void){ |
| 974 | int rc, idx; |
| 975 |
+1
-1
| --- src/main.mk | ||
| +++ src/main.mk | ||
| @@ -1146,11 +1146,11 @@ | ||
| 1146 | 1146 | $(OBJDIR)/th_tcl.o: $(SRCDIR)/th_tcl.c |
| 1147 | 1147 | $(XTCC) -c $(SRCDIR)/th_tcl.c -o $(OBJDIR)/th_tcl.o |
| 1148 | 1148 | |
| 1149 | 1149 | |
| 1150 | 1150 | $(OBJDIR)/cson_amalgamation.o: $(SRCDIR)/cson_amalgamation.c |
| 1151 | - $(XTCC) -c $(SRCDIR)/cson_amalgamation.c -o $(OBJDIR)/cson_amalgamation.o -DCSON_FOSSIL_MODE | |
| 1151 | + $(XTCC) -c $(SRCDIR)/cson_amalgamation.c -o $(OBJDIR)/cson_amalgamation.o | |
| 1152 | 1152 | |
| 1153 | 1153 | # |
| 1154 | 1154 | # The list of all the targets that do not correspond to real files. This stops |
| 1155 | 1155 | # 'make' from getting confused when someone makes an error in a rule. |
| 1156 | 1156 | # |
| 1157 | 1157 |
| --- src/main.mk | |
| +++ src/main.mk | |
| @@ -1146,11 +1146,11 @@ | |
| 1146 | $(OBJDIR)/th_tcl.o: $(SRCDIR)/th_tcl.c |
| 1147 | $(XTCC) -c $(SRCDIR)/th_tcl.c -o $(OBJDIR)/th_tcl.o |
| 1148 | |
| 1149 | |
| 1150 | $(OBJDIR)/cson_amalgamation.o: $(SRCDIR)/cson_amalgamation.c |
| 1151 | $(XTCC) -c $(SRCDIR)/cson_amalgamation.c -o $(OBJDIR)/cson_amalgamation.o -DCSON_FOSSIL_MODE |
| 1152 | |
| 1153 | # |
| 1154 | # The list of all the targets that do not correspond to real files. This stops |
| 1155 | # 'make' from getting confused when someone makes an error in a rule. |
| 1156 | # |
| 1157 |
| --- src/main.mk | |
| +++ src/main.mk | |
| @@ -1146,11 +1146,11 @@ | |
| 1146 | $(OBJDIR)/th_tcl.o: $(SRCDIR)/th_tcl.c |
| 1147 | $(XTCC) -c $(SRCDIR)/th_tcl.c -o $(OBJDIR)/th_tcl.o |
| 1148 | |
| 1149 | |
| 1150 | $(OBJDIR)/cson_amalgamation.o: $(SRCDIR)/cson_amalgamation.c |
| 1151 | $(XTCC) -c $(SRCDIR)/cson_amalgamation.c -o $(OBJDIR)/cson_amalgamation.o |
| 1152 | |
| 1153 | # |
| 1154 | # The list of all the targets that do not correspond to real files. This stops |
| 1155 | # 'make' from getting confused when someone makes an error in a rule. |
| 1156 | # |
| 1157 |
+34
-15
| --- src/makemake.tcl | ||
| +++ src/makemake.tcl | ||
| @@ -308,11 +308,11 @@ | ||
| 308 | 308 | writeln "\t\$(XTCC) -c \$(SRCDIR)/th_tcl.c -o \$(OBJDIR)/th_tcl.o\n" |
| 309 | 309 | |
| 310 | 310 | set opt {} |
| 311 | 311 | writeln { |
| 312 | 312 | $(OBJDIR)/cson_amalgamation.o: $(SRCDIR)/cson_amalgamation.c |
| 313 | - $(XTCC) -c $(SRCDIR)/cson_amalgamation.c -o $(OBJDIR)/cson_amalgamation.o -DCSON_FOSSIL_MODE | |
| 313 | + $(XTCC) -c $(SRCDIR)/cson_amalgamation.c -o $(OBJDIR)/cson_amalgamation.o | |
| 314 | 314 | |
| 315 | 315 | # |
| 316 | 316 | # The list of all the targets that do not correspond to real files. This stops |
| 317 | 317 | # 'make' from getting confused when someone makes an error in a rule. |
| 318 | 318 | # |
| @@ -340,15 +340,15 @@ | ||
| 340 | 340 | # |
| 341 | 341 | # This file is automatically generated. Instead of editing this |
| 342 | 342 | # file, edit "makemake.tcl" then run "tclsh makemake.tcl" |
| 343 | 343 | # to regenerate this file. |
| 344 | 344 | # |
| 345 | -# This is a makefile for use on Windows/Linux/Darwin/Cygwin using MinGW or | |
| 346 | -# MinGW-w64. | |
| 345 | +# This is a makefile for use on Cygwin/Darwin/FreeBSD/Linux/Windows using | |
| 346 | +# MinGW or MinGW-w64. | |
| 347 | 347 | # |
| 348 | 348 | |
| 349 | -#### Select one of MinGW, MinGW-64 (32-bit) or MinGW-w64 (64-bit) compilers. | |
| 349 | +#### Select one of MinGW, MinGW-w64 (32-bit) or MinGW-w64 (64-bit) compilers. | |
| 350 | 350 | # By default, this is an empty string (i.e. use the native compiler). |
| 351 | 351 | # |
| 352 | 352 | PREFIX = |
| 353 | 353 | # PREFIX = mingw32- |
| 354 | 354 | # PREFIX = i686-pc-mingw32- |
| @@ -694,11 +694,11 @@ | ||
| 694 | 694 | ifdef FOSSIL_ENABLE_TCL |
| 695 | 695 | EXTRAOBJ += $(OBJDIR)/th_tcl.o |
| 696 | 696 | endif |
| 697 | 697 | |
| 698 | 698 | zlib: |
| 699 | - make -C $(ZLIBDIR) PREFIX=$(PREFIX) -f win32/Makefile.gcc libz.a | |
| 699 | + $(MAKE) -C $(ZLIBDIR) PREFIX=$(PREFIX) -f win32/Makefile.gcc libz.a | |
| 700 | 700 | |
| 701 | 701 | $(APPNAME): $(OBJDIR)/headers $(OBJ) $(EXTRAOBJ) $(OBJDIR)/fossil.o zlib |
| 702 | 702 | $(TCC) -o $(APPNAME) $(OBJ) $(EXTRAOBJ) $(LIB) $(OBJDIR)/fossil.o |
| 703 | 703 | |
| 704 | 704 | # This rule prevents make from using its default rules to try build |
| @@ -751,11 +751,11 @@ | ||
| 751 | 751 | set opt $SQLITE_OPTIONS |
| 752 | 752 | writeln "\t\$(XTCC) $opt -c \$(SRCDIR)/sqlite3.c -o \$(OBJDIR)/sqlite3.o\n" |
| 753 | 753 | |
| 754 | 754 | set opt {} |
| 755 | 755 | writeln "\$(OBJDIR)/cson_amalgamation.o:\t\$(SRCDIR)/cson_amalgamation.c" |
| 756 | -writeln "\t\$(XTCC) $opt -c \$(SRCDIR)/cson_amalgamation.c -o \$(OBJDIR)/cson_amalgamation.o -DCSON_FOSSIL_MODE\n" | |
| 756 | +writeln "\t\$(XTCC) $opt -c \$(SRCDIR)/cson_amalgamation.c -o \$(OBJDIR)/cson_amalgamation.o\n" | |
| 757 | 757 | writeln "\$(OBJDIR)/json.o \$(OBJDIR)/json_artifact.o \$(OBJDIR)/json_branch.o \$(OBJDIR)/json_config.o \$(OBJDIR)/json_diff.o \$(OBJDIR)/json_dir.o \$(OBJDIR)/jsos_finfo.o \$(OBJDIR)/json_login.o \$(OBJDIR)/json_query.o \$(OBJDIR)/json_report.o \$(OBJDIR)/json_tag.o \$(OBJDIR)/json_timeline.o \$(OBJDIR)/json_user.o \$(OBJDIR)/json_wiki.o : \$(SRCDIR)/json_detail.h\n" |
| 758 | 758 | |
| 759 | 759 | writeln "\$(OBJDIR)/shell.o:\t\$(SRCDIR)/shell.c \$(SRCDIR)/sqlite3.h" |
| 760 | 760 | set opt {-Dmain=sqlite3_shell} |
| 761 | 761 | append opt " -DSQLITE_OMIT_LOAD_EXTENSION=1" |
| @@ -959,18 +959,35 @@ | ||
| 959 | 959 | |
| 960 | 960 | # zlib options |
| 961 | 961 | ZINCDIR = $(B)\compat\zlib |
| 962 | 962 | ZLIBDIR = $(B)\compat\zlib |
| 963 | 963 | ZLIB = zlib.lib |
| 964 | + | |
| 965 | +# Uncomment to enable JSON API | |
| 966 | +# FOSSIL_ENABLE_JSON = 1 | |
| 967 | + | |
| 968 | +# Uncomment to enable markdown support | |
| 969 | +# FOSSIL_ENABLE_MARKDOWN = 1 | |
| 964 | 970 | |
| 965 | 971 | INCL = -I. -I$(SRCDIR) -I$B\win\include -I$(ZINCDIR) |
| 966 | 972 | |
| 967 | 973 | CFLAGS = -nologo -MT -O2 |
| 968 | 974 | BCC = $(CC) $(CFLAGS) |
| 969 | 975 | TCC = $(CC) -c $(CFLAGS) $(MSCDEF) $(SSL) $(INCL) |
| 976 | +RCC = rc -D_WIN32 -D_MSC_VER $(INCL) | |
| 970 | 977 | LIBS = $(ZLIB) ws2_32.lib advapi32.lib $(SSLLIB) |
| 971 | 978 | LIBDIR = -LIBPATH:$(ZLIBDIR) |
| 979 | + | |
| 980 | +!ifdef FOSSIL_ENABLE_JSON | |
| 981 | +TCC = $(TCC) -DFOSSIL_ENABLE_JSON | |
| 982 | +RCC = $(RCC) -DFOSSIL_ENABLE_JSON | |
| 983 | +!endif | |
| 984 | + | |
| 985 | +!ifdef FOSSIL_ENABLE_MARKDOWN | |
| 986 | +TCC = $(TCC) -DFOSSIL_ENABLE_MARKDOWN | |
| 987 | +RCC = $(RCC) -DFOSSIL_ENABLE_MARKDOWN | |
| 988 | +!endif | |
| 972 | 989 | } |
| 973 | 990 | regsub -all {[-]D} $SQLITE_OPTIONS {/D} MSC_SQLITE_OPTIONS |
| 974 | 991 | set j " \\\n " |
| 975 | 992 | writeln "SQLITE_OPTIONS = [join $MSC_SQLITE_OPTIONS $j]\n" |
| 976 | 993 | writeln -nonewline "SRC = " |
| @@ -981,24 +998,22 @@ | ||
| 981 | 998 | writeln -nonewline " " |
| 982 | 999 | } |
| 983 | 1000 | writeln -nonewline "${s}_.c"; incr i |
| 984 | 1001 | } |
| 985 | 1002 | writeln "\n" |
| 1003 | +set AdditionalObj [list shell sqlite3 th th_lang cson_amalgamation] | |
| 986 | 1004 | writeln -nonewline "OBJ = " |
| 987 | 1005 | set i 0 |
| 988 | -foreach s [lsort $src] { | |
| 1006 | +foreach s [lsort [concat $src $AdditionalObj]] { | |
| 989 | 1007 | if {$i > 0} { |
| 990 | 1008 | writeln " \\" |
| 991 | 1009 | writeln -nonewline " " |
| 992 | 1010 | } |
| 993 | 1011 | writeln -nonewline "\$(OX)\\$s\$O"; incr i |
| 994 | 1012 | } |
| 995 | 1013 | writeln " \\" |
| 996 | -writeln " \$(OX)\\shell\$O \\" | |
| 997 | -writeln " \$(OX)\\sqlite3\$O \\" | |
| 998 | -writeln " \$(OX)\\th\$O \\" | |
| 999 | -writeln " \$(OX)\\th_lang\$O" | |
| 1014 | +writeln -nonewline " \$(OX)\\fossil.res\n" | |
| 1000 | 1015 | writeln { |
| 1001 | 1016 | APPNAME = $(OX)\fossil$(E) |
| 1002 | 1017 | |
| 1003 | 1018 | all: $(OX) $(APPNAME) |
| 1004 | 1019 | |
| @@ -1006,15 +1021,15 @@ | ||
| 1006 | 1021 | @echo Building zlib from "$(ZLIBDIR)"... |
| 1007 | 1022 | @pushd "$(ZLIBDIR)" && nmake /f win32\Makefile.msc $(ZLIB) && popd |
| 1008 | 1023 | |
| 1009 | 1024 | $(APPNAME) : translate$E mkindex$E headers $(OBJ) $(OX)\linkopts zlib |
| 1010 | 1025 | cd $(OX) |
| 1011 | - link /NODEFAULTLIB:msvcrt -OUT:$@ $(LIBDIR) Wsetargv.obj @linkopts | |
| 1026 | + link /NODEFAULTLIB:msvcrt -OUT:$@ $(LIBDIR) Wsetargv.obj fossil.res @linkopts | |
| 1012 | 1027 | |
| 1013 | 1028 | $(OX)\linkopts: $B\win\Makefile.msc} |
| 1014 | 1029 | set redir {>} |
| 1015 | -foreach s [lsort [concat $src {shell sqlite3 th th_lang}]] { | |
| 1030 | +foreach s [lsort [concat $src $AdditionalObj]] { | |
| 1016 | 1031 | writeln "\techo \$(OX)\\$s.obj $redir \$@" |
| 1017 | 1032 | set redir {>>} |
| 1018 | 1033 | } |
| 1019 | 1034 | writeln "\techo \$(LIBS) >> \$@\n\n" |
| 1020 | 1035 | |
| @@ -1047,12 +1062,12 @@ | ||
| 1047 | 1062 | $(OX)\th_lang$O : $(SRCDIR)\th_lang.c |
| 1048 | 1063 | $(TCC) /Fo$@ -c $** |
| 1049 | 1064 | |
| 1050 | 1065 | VERSION.h : mkversion$E $B\manifest.uuid $B\manifest $B\VERSION |
| 1051 | 1066 | $** > $@ |
| 1052 | -$(OBJDIR)\cson_amalgamation.h : $(SRCDIR)\cson_amalgamation.h | |
| 1053 | - cp $(SRCDIR)\cson_amalgamation.h $@ | |
| 1067 | +$(OX)\cson_amalgamation$O : $(SRCDIR)\cson_amalgamation.c | |
| 1068 | + $(TCC) /Fo$@ -c $** | |
| 1054 | 1069 | |
| 1055 | 1070 | page_index.h: mkindex$E $(SRC) |
| 1056 | 1071 | $** > $@ |
| 1057 | 1072 | |
| 1058 | 1073 | clean: |
| @@ -1062,10 +1077,11 @@ | ||
| 1062 | 1077 | -del *.h |
| 1063 | 1078 | -del *.map |
| 1064 | 1079 | -del *.manifest |
| 1065 | 1080 | -del headers |
| 1066 | 1081 | -del linkopts |
| 1082 | + -del *.res | |
| 1067 | 1083 | |
| 1068 | 1084 | realclean: clean |
| 1069 | 1085 | -del $(APPNAME) |
| 1070 | 1086 | -del translate$E |
| 1071 | 1087 | -del mkindex$E |
| @@ -1092,10 +1108,13 @@ | ||
| 1092 | 1108 | writeln "\$(OX)\\$s\$O : ${s}_.c ${s}.h" |
| 1093 | 1109 | writeln "\t\$(TCC) /Fo\$@ -c ${s}_.c\n" |
| 1094 | 1110 | writeln "${s}_.c : \$(SRCDIR)\\$s.c" |
| 1095 | 1111 | writeln "\ttranslate\$E \$** > \$@\n" |
| 1096 | 1112 | } |
| 1113 | + | |
| 1114 | +writeln "fossil.res : \$B\\win\\fossil.rc" | |
| 1115 | +writeln "\t\$(RCC) -fo \$@ \$**" | |
| 1097 | 1116 | |
| 1098 | 1117 | writeln "headers: makeheaders\$E page_index.h VERSION.h" |
| 1099 | 1118 | writeln -nonewline "\tmakeheaders\$E " |
| 1100 | 1119 | set i 0 |
| 1101 | 1120 | foreach s [lsort $src] { |
| 1102 | 1121 |
| --- src/makemake.tcl | |
| +++ src/makemake.tcl | |
| @@ -308,11 +308,11 @@ | |
| 308 | writeln "\t\$(XTCC) -c \$(SRCDIR)/th_tcl.c -o \$(OBJDIR)/th_tcl.o\n" |
| 309 | |
| 310 | set opt {} |
| 311 | writeln { |
| 312 | $(OBJDIR)/cson_amalgamation.o: $(SRCDIR)/cson_amalgamation.c |
| 313 | $(XTCC) -c $(SRCDIR)/cson_amalgamation.c -o $(OBJDIR)/cson_amalgamation.o -DCSON_FOSSIL_MODE |
| 314 | |
| 315 | # |
| 316 | # The list of all the targets that do not correspond to real files. This stops |
| 317 | # 'make' from getting confused when someone makes an error in a rule. |
| 318 | # |
| @@ -340,15 +340,15 @@ | |
| 340 | # |
| 341 | # This file is automatically generated. Instead of editing this |
| 342 | # file, edit "makemake.tcl" then run "tclsh makemake.tcl" |
| 343 | # to regenerate this file. |
| 344 | # |
| 345 | # This is a makefile for use on Windows/Linux/Darwin/Cygwin using MinGW or |
| 346 | # MinGW-w64. |
| 347 | # |
| 348 | |
| 349 | #### Select one of MinGW, MinGW-64 (32-bit) or MinGW-w64 (64-bit) compilers. |
| 350 | # By default, this is an empty string (i.e. use the native compiler). |
| 351 | # |
| 352 | PREFIX = |
| 353 | # PREFIX = mingw32- |
| 354 | # PREFIX = i686-pc-mingw32- |
| @@ -694,11 +694,11 @@ | |
| 694 | ifdef FOSSIL_ENABLE_TCL |
| 695 | EXTRAOBJ += $(OBJDIR)/th_tcl.o |
| 696 | endif |
| 697 | |
| 698 | zlib: |
| 699 | make -C $(ZLIBDIR) PREFIX=$(PREFIX) -f win32/Makefile.gcc libz.a |
| 700 | |
| 701 | $(APPNAME): $(OBJDIR)/headers $(OBJ) $(EXTRAOBJ) $(OBJDIR)/fossil.o zlib |
| 702 | $(TCC) -o $(APPNAME) $(OBJ) $(EXTRAOBJ) $(LIB) $(OBJDIR)/fossil.o |
| 703 | |
| 704 | # This rule prevents make from using its default rules to try build |
| @@ -751,11 +751,11 @@ | |
| 751 | set opt $SQLITE_OPTIONS |
| 752 | writeln "\t\$(XTCC) $opt -c \$(SRCDIR)/sqlite3.c -o \$(OBJDIR)/sqlite3.o\n" |
| 753 | |
| 754 | set opt {} |
| 755 | writeln "\$(OBJDIR)/cson_amalgamation.o:\t\$(SRCDIR)/cson_amalgamation.c" |
| 756 | writeln "\t\$(XTCC) $opt -c \$(SRCDIR)/cson_amalgamation.c -o \$(OBJDIR)/cson_amalgamation.o -DCSON_FOSSIL_MODE\n" |
| 757 | writeln "\$(OBJDIR)/json.o \$(OBJDIR)/json_artifact.o \$(OBJDIR)/json_branch.o \$(OBJDIR)/json_config.o \$(OBJDIR)/json_diff.o \$(OBJDIR)/json_dir.o \$(OBJDIR)/jsos_finfo.o \$(OBJDIR)/json_login.o \$(OBJDIR)/json_query.o \$(OBJDIR)/json_report.o \$(OBJDIR)/json_tag.o \$(OBJDIR)/json_timeline.o \$(OBJDIR)/json_user.o \$(OBJDIR)/json_wiki.o : \$(SRCDIR)/json_detail.h\n" |
| 758 | |
| 759 | writeln "\$(OBJDIR)/shell.o:\t\$(SRCDIR)/shell.c \$(SRCDIR)/sqlite3.h" |
| 760 | set opt {-Dmain=sqlite3_shell} |
| 761 | append opt " -DSQLITE_OMIT_LOAD_EXTENSION=1" |
| @@ -959,18 +959,35 @@ | |
| 959 | |
| 960 | # zlib options |
| 961 | ZINCDIR = $(B)\compat\zlib |
| 962 | ZLIBDIR = $(B)\compat\zlib |
| 963 | ZLIB = zlib.lib |
| 964 | |
| 965 | INCL = -I. -I$(SRCDIR) -I$B\win\include -I$(ZINCDIR) |
| 966 | |
| 967 | CFLAGS = -nologo -MT -O2 |
| 968 | BCC = $(CC) $(CFLAGS) |
| 969 | TCC = $(CC) -c $(CFLAGS) $(MSCDEF) $(SSL) $(INCL) |
| 970 | LIBS = $(ZLIB) ws2_32.lib advapi32.lib $(SSLLIB) |
| 971 | LIBDIR = -LIBPATH:$(ZLIBDIR) |
| 972 | } |
| 973 | regsub -all {[-]D} $SQLITE_OPTIONS {/D} MSC_SQLITE_OPTIONS |
| 974 | set j " \\\n " |
| 975 | writeln "SQLITE_OPTIONS = [join $MSC_SQLITE_OPTIONS $j]\n" |
| 976 | writeln -nonewline "SRC = " |
| @@ -981,24 +998,22 @@ | |
| 981 | writeln -nonewline " " |
| 982 | } |
| 983 | writeln -nonewline "${s}_.c"; incr i |
| 984 | } |
| 985 | writeln "\n" |
| 986 | writeln -nonewline "OBJ = " |
| 987 | set i 0 |
| 988 | foreach s [lsort $src] { |
| 989 | if {$i > 0} { |
| 990 | writeln " \\" |
| 991 | writeln -nonewline " " |
| 992 | } |
| 993 | writeln -nonewline "\$(OX)\\$s\$O"; incr i |
| 994 | } |
| 995 | writeln " \\" |
| 996 | writeln " \$(OX)\\shell\$O \\" |
| 997 | writeln " \$(OX)\\sqlite3\$O \\" |
| 998 | writeln " \$(OX)\\th\$O \\" |
| 999 | writeln " \$(OX)\\th_lang\$O" |
| 1000 | writeln { |
| 1001 | APPNAME = $(OX)\fossil$(E) |
| 1002 | |
| 1003 | all: $(OX) $(APPNAME) |
| 1004 | |
| @@ -1006,15 +1021,15 @@ | |
| 1006 | @echo Building zlib from "$(ZLIBDIR)"... |
| 1007 | @pushd "$(ZLIBDIR)" && nmake /f win32\Makefile.msc $(ZLIB) && popd |
| 1008 | |
| 1009 | $(APPNAME) : translate$E mkindex$E headers $(OBJ) $(OX)\linkopts zlib |
| 1010 | cd $(OX) |
| 1011 | link /NODEFAULTLIB:msvcrt -OUT:$@ $(LIBDIR) Wsetargv.obj @linkopts |
| 1012 | |
| 1013 | $(OX)\linkopts: $B\win\Makefile.msc} |
| 1014 | set redir {>} |
| 1015 | foreach s [lsort [concat $src {shell sqlite3 th th_lang}]] { |
| 1016 | writeln "\techo \$(OX)\\$s.obj $redir \$@" |
| 1017 | set redir {>>} |
| 1018 | } |
| 1019 | writeln "\techo \$(LIBS) >> \$@\n\n" |
| 1020 | |
| @@ -1047,12 +1062,12 @@ | |
| 1047 | $(OX)\th_lang$O : $(SRCDIR)\th_lang.c |
| 1048 | $(TCC) /Fo$@ -c $** |
| 1049 | |
| 1050 | VERSION.h : mkversion$E $B\manifest.uuid $B\manifest $B\VERSION |
| 1051 | $** > $@ |
| 1052 | $(OBJDIR)\cson_amalgamation.h : $(SRCDIR)\cson_amalgamation.h |
| 1053 | cp $(SRCDIR)\cson_amalgamation.h $@ |
| 1054 | |
| 1055 | page_index.h: mkindex$E $(SRC) |
| 1056 | $** > $@ |
| 1057 | |
| 1058 | clean: |
| @@ -1062,10 +1077,11 @@ | |
| 1062 | -del *.h |
| 1063 | -del *.map |
| 1064 | -del *.manifest |
| 1065 | -del headers |
| 1066 | -del linkopts |
| 1067 | |
| 1068 | realclean: clean |
| 1069 | -del $(APPNAME) |
| 1070 | -del translate$E |
| 1071 | -del mkindex$E |
| @@ -1092,10 +1108,13 @@ | |
| 1092 | writeln "\$(OX)\\$s\$O : ${s}_.c ${s}.h" |
| 1093 | writeln "\t\$(TCC) /Fo\$@ -c ${s}_.c\n" |
| 1094 | writeln "${s}_.c : \$(SRCDIR)\\$s.c" |
| 1095 | writeln "\ttranslate\$E \$** > \$@\n" |
| 1096 | } |
| 1097 | |
| 1098 | writeln "headers: makeheaders\$E page_index.h VERSION.h" |
| 1099 | writeln -nonewline "\tmakeheaders\$E " |
| 1100 | set i 0 |
| 1101 | foreach s [lsort $src] { |
| 1102 |
| --- src/makemake.tcl | |
| +++ src/makemake.tcl | |
| @@ -308,11 +308,11 @@ | |
| 308 | writeln "\t\$(XTCC) -c \$(SRCDIR)/th_tcl.c -o \$(OBJDIR)/th_tcl.o\n" |
| 309 | |
| 310 | set opt {} |
| 311 | writeln { |
| 312 | $(OBJDIR)/cson_amalgamation.o: $(SRCDIR)/cson_amalgamation.c |
| 313 | $(XTCC) -c $(SRCDIR)/cson_amalgamation.c -o $(OBJDIR)/cson_amalgamation.o |
| 314 | |
| 315 | # |
| 316 | # The list of all the targets that do not correspond to real files. This stops |
| 317 | # 'make' from getting confused when someone makes an error in a rule. |
| 318 | # |
| @@ -340,15 +340,15 @@ | |
| 340 | # |
| 341 | # This file is automatically generated. Instead of editing this |
| 342 | # file, edit "makemake.tcl" then run "tclsh makemake.tcl" |
| 343 | # to regenerate this file. |
| 344 | # |
| 345 | # This is a makefile for use on Cygwin/Darwin/FreeBSD/Linux/Windows using |
| 346 | # MinGW or MinGW-w64. |
| 347 | # |
| 348 | |
| 349 | #### Select one of MinGW, MinGW-w64 (32-bit) or MinGW-w64 (64-bit) compilers. |
| 350 | # By default, this is an empty string (i.e. use the native compiler). |
| 351 | # |
| 352 | PREFIX = |
| 353 | # PREFIX = mingw32- |
| 354 | # PREFIX = i686-pc-mingw32- |
| @@ -694,11 +694,11 @@ | |
| 694 | ifdef FOSSIL_ENABLE_TCL |
| 695 | EXTRAOBJ += $(OBJDIR)/th_tcl.o |
| 696 | endif |
| 697 | |
| 698 | zlib: |
| 699 | $(MAKE) -C $(ZLIBDIR) PREFIX=$(PREFIX) -f win32/Makefile.gcc libz.a |
| 700 | |
| 701 | $(APPNAME): $(OBJDIR)/headers $(OBJ) $(EXTRAOBJ) $(OBJDIR)/fossil.o zlib |
| 702 | $(TCC) -o $(APPNAME) $(OBJ) $(EXTRAOBJ) $(LIB) $(OBJDIR)/fossil.o |
| 703 | |
| 704 | # This rule prevents make from using its default rules to try build |
| @@ -751,11 +751,11 @@ | |
| 751 | set opt $SQLITE_OPTIONS |
| 752 | writeln "\t\$(XTCC) $opt -c \$(SRCDIR)/sqlite3.c -o \$(OBJDIR)/sqlite3.o\n" |
| 753 | |
| 754 | set opt {} |
| 755 | writeln "\$(OBJDIR)/cson_amalgamation.o:\t\$(SRCDIR)/cson_amalgamation.c" |
| 756 | writeln "\t\$(XTCC) $opt -c \$(SRCDIR)/cson_amalgamation.c -o \$(OBJDIR)/cson_amalgamation.o\n" |
| 757 | writeln "\$(OBJDIR)/json.o \$(OBJDIR)/json_artifact.o \$(OBJDIR)/json_branch.o \$(OBJDIR)/json_config.o \$(OBJDIR)/json_diff.o \$(OBJDIR)/json_dir.o \$(OBJDIR)/jsos_finfo.o \$(OBJDIR)/json_login.o \$(OBJDIR)/json_query.o \$(OBJDIR)/json_report.o \$(OBJDIR)/json_tag.o \$(OBJDIR)/json_timeline.o \$(OBJDIR)/json_user.o \$(OBJDIR)/json_wiki.o : \$(SRCDIR)/json_detail.h\n" |
| 758 | |
| 759 | writeln "\$(OBJDIR)/shell.o:\t\$(SRCDIR)/shell.c \$(SRCDIR)/sqlite3.h" |
| 760 | set opt {-Dmain=sqlite3_shell} |
| 761 | append opt " -DSQLITE_OMIT_LOAD_EXTENSION=1" |
| @@ -959,18 +959,35 @@ | |
| 959 | |
| 960 | # zlib options |
| 961 | ZINCDIR = $(B)\compat\zlib |
| 962 | ZLIBDIR = $(B)\compat\zlib |
| 963 | ZLIB = zlib.lib |
| 964 | |
| 965 | # Uncomment to enable JSON API |
| 966 | # FOSSIL_ENABLE_JSON = 1 |
| 967 | |
| 968 | # Uncomment to enable markdown support |
| 969 | # FOSSIL_ENABLE_MARKDOWN = 1 |
| 970 | |
| 971 | INCL = -I. -I$(SRCDIR) -I$B\win\include -I$(ZINCDIR) |
| 972 | |
| 973 | CFLAGS = -nologo -MT -O2 |
| 974 | BCC = $(CC) $(CFLAGS) |
| 975 | TCC = $(CC) -c $(CFLAGS) $(MSCDEF) $(SSL) $(INCL) |
| 976 | RCC = rc -D_WIN32 -D_MSC_VER $(INCL) |
| 977 | LIBS = $(ZLIB) ws2_32.lib advapi32.lib $(SSLLIB) |
| 978 | LIBDIR = -LIBPATH:$(ZLIBDIR) |
| 979 | |
| 980 | !ifdef FOSSIL_ENABLE_JSON |
| 981 | TCC = $(TCC) -DFOSSIL_ENABLE_JSON |
| 982 | RCC = $(RCC) -DFOSSIL_ENABLE_JSON |
| 983 | !endif |
| 984 | |
| 985 | !ifdef FOSSIL_ENABLE_MARKDOWN |
| 986 | TCC = $(TCC) -DFOSSIL_ENABLE_MARKDOWN |
| 987 | RCC = $(RCC) -DFOSSIL_ENABLE_MARKDOWN |
| 988 | !endif |
| 989 | } |
| 990 | regsub -all {[-]D} $SQLITE_OPTIONS {/D} MSC_SQLITE_OPTIONS |
| 991 | set j " \\\n " |
| 992 | writeln "SQLITE_OPTIONS = [join $MSC_SQLITE_OPTIONS $j]\n" |
| 993 | writeln -nonewline "SRC = " |
| @@ -981,24 +998,22 @@ | |
| 998 | writeln -nonewline " " |
| 999 | } |
| 1000 | writeln -nonewline "${s}_.c"; incr i |
| 1001 | } |
| 1002 | writeln "\n" |
| 1003 | set AdditionalObj [list shell sqlite3 th th_lang cson_amalgamation] |
| 1004 | writeln -nonewline "OBJ = " |
| 1005 | set i 0 |
| 1006 | foreach s [lsort [concat $src $AdditionalObj]] { |
| 1007 | if {$i > 0} { |
| 1008 | writeln " \\" |
| 1009 | writeln -nonewline " " |
| 1010 | } |
| 1011 | writeln -nonewline "\$(OX)\\$s\$O"; incr i |
| 1012 | } |
| 1013 | writeln " \\" |
| 1014 | writeln -nonewline " \$(OX)\\fossil.res\n" |
| 1015 | writeln { |
| 1016 | APPNAME = $(OX)\fossil$(E) |
| 1017 | |
| 1018 | all: $(OX) $(APPNAME) |
| 1019 | |
| @@ -1006,15 +1021,15 @@ | |
| 1021 | @echo Building zlib from "$(ZLIBDIR)"... |
| 1022 | @pushd "$(ZLIBDIR)" && nmake /f win32\Makefile.msc $(ZLIB) && popd |
| 1023 | |
| 1024 | $(APPNAME) : translate$E mkindex$E headers $(OBJ) $(OX)\linkopts zlib |
| 1025 | cd $(OX) |
| 1026 | link /NODEFAULTLIB:msvcrt -OUT:$@ $(LIBDIR) Wsetargv.obj fossil.res @linkopts |
| 1027 | |
| 1028 | $(OX)\linkopts: $B\win\Makefile.msc} |
| 1029 | set redir {>} |
| 1030 | foreach s [lsort [concat $src $AdditionalObj]] { |
| 1031 | writeln "\techo \$(OX)\\$s.obj $redir \$@" |
| 1032 | set redir {>>} |
| 1033 | } |
| 1034 | writeln "\techo \$(LIBS) >> \$@\n\n" |
| 1035 | |
| @@ -1047,12 +1062,12 @@ | |
| 1062 | $(OX)\th_lang$O : $(SRCDIR)\th_lang.c |
| 1063 | $(TCC) /Fo$@ -c $** |
| 1064 | |
| 1065 | VERSION.h : mkversion$E $B\manifest.uuid $B\manifest $B\VERSION |
| 1066 | $** > $@ |
| 1067 | $(OX)\cson_amalgamation$O : $(SRCDIR)\cson_amalgamation.c |
| 1068 | $(TCC) /Fo$@ -c $** |
| 1069 | |
| 1070 | page_index.h: mkindex$E $(SRC) |
| 1071 | $** > $@ |
| 1072 | |
| 1073 | clean: |
| @@ -1062,10 +1077,11 @@ | |
| 1077 | -del *.h |
| 1078 | -del *.map |
| 1079 | -del *.manifest |
| 1080 | -del headers |
| 1081 | -del linkopts |
| 1082 | -del *.res |
| 1083 | |
| 1084 | realclean: clean |
| 1085 | -del $(APPNAME) |
| 1086 | -del translate$E |
| 1087 | -del mkindex$E |
| @@ -1092,10 +1108,13 @@ | |
| 1108 | writeln "\$(OX)\\$s\$O : ${s}_.c ${s}.h" |
| 1109 | writeln "\t\$(TCC) /Fo\$@ -c ${s}_.c\n" |
| 1110 | writeln "${s}_.c : \$(SRCDIR)\\$s.c" |
| 1111 | writeln "\ttranslate\$E \$** > \$@\n" |
| 1112 | } |
| 1113 | |
| 1114 | writeln "fossil.res : \$B\\win\\fossil.rc" |
| 1115 | writeln "\t\$(RCC) -fo \$@ \$**" |
| 1116 | |
| 1117 | writeln "headers: makeheaders\$E page_index.h VERSION.h" |
| 1118 | writeln -nonewline "\tmakeheaders\$E " |
| 1119 | set i 0 |
| 1120 | foreach s [lsort $src] { |
| 1121 |
+1
-1
| --- src/printf.c | ||
| +++ src/printf.c | ||
| @@ -848,11 +848,11 @@ | ||
| 848 | 848 | fwrite(z, 1, n, toStdErr ? stderr : stdout); |
| 849 | 849 | fflush(toStdErr ? stderr : stdout); |
| 850 | 850 | } |
| 851 | 851 | |
| 852 | 852 | /* |
| 853 | -** Force the the standard output cursor to move to the beginning | |
| 853 | +** Force the standard output cursor to move to the beginning | |
| 854 | 854 | ** of a line, if it is not there already. |
| 855 | 855 | */ |
| 856 | 856 | void fossil_force_newline(void){ |
| 857 | 857 | if( g.cgiOutput==0 && stdoutAtBOL==0 ) fossil_puts("\n", 0); |
| 858 | 858 | } |
| 859 | 859 |
| --- src/printf.c | |
| +++ src/printf.c | |
| @@ -848,11 +848,11 @@ | |
| 848 | fwrite(z, 1, n, toStdErr ? stderr : stdout); |
| 849 | fflush(toStdErr ? stderr : stdout); |
| 850 | } |
| 851 | |
| 852 | /* |
| 853 | ** Force the the standard output cursor to move to the beginning |
| 854 | ** of a line, if it is not there already. |
| 855 | */ |
| 856 | void fossil_force_newline(void){ |
| 857 | if( g.cgiOutput==0 && stdoutAtBOL==0 ) fossil_puts("\n", 0); |
| 858 | } |
| 859 |
| --- src/printf.c | |
| +++ src/printf.c | |
| @@ -848,11 +848,11 @@ | |
| 848 | fwrite(z, 1, n, toStdErr ? stderr : stdout); |
| 849 | fflush(toStdErr ? stderr : stdout); |
| 850 | } |
| 851 | |
| 852 | /* |
| 853 | ** Force the standard output cursor to move to the beginning |
| 854 | ** of a line, if it is not there already. |
| 855 | */ |
| 856 | void fossil_force_newline(void){ |
| 857 | if( g.cgiOutput==0 && stdoutAtBOL==0 ) fossil_puts("\n", 0); |
| 858 | } |
| 859 |
+8
-3
| --- src/rebuild.c | ||
| +++ src/rebuild.c | ||
| @@ -524,10 +524,11 @@ | ||
| 524 | 524 | ** --noverify Skip the verification of changes to the BLOB table |
| 525 | 525 | ** --pagesize N Set the database pagesize to N. (512..65536 and power of 2) |
| 526 | 526 | ** --randomize Scan artifacts in a random order |
| 527 | 527 | ** --vacuum Run VACUUM on the database after rebuilding |
| 528 | 528 | ** --deanalyze Remove ANALYZE tables from the database |
| 529 | +** --analyze Run ANALYZE on the database after rebuilding | |
| 529 | 530 | ** --wal Set Write-Ahead-Log journalling mode on the database |
| 530 | 531 | ** --stats Show artifact statistics after rebuilding |
| 531 | 532 | ** |
| 532 | 533 | ** See also: deconstruct, reconstruct |
| 533 | 534 | */ |
| @@ -540,19 +541,21 @@ | ||
| 540 | 541 | const char *zPagesize; |
| 541 | 542 | int newPagesize = 0; |
| 542 | 543 | int activateWal; |
| 543 | 544 | int runVacuum; |
| 544 | 545 | int runDeanalyze; |
| 546 | + int runAnalyze; | |
| 545 | 547 | int runCompress; |
| 546 | 548 | int showStats; |
| 547 | 549 | |
| 548 | 550 | omitVerify = find_option("noverify",0,0)!=0; |
| 549 | 551 | forceFlag = find_option("force","f",0)!=0; |
| 550 | 552 | randomizeFlag = find_option("randomize", 0, 0)!=0; |
| 551 | 553 | doClustering = find_option("cluster", 0, 0)!=0; |
| 552 | 554 | runVacuum = find_option("vacuum",0,0)!=0; |
| 553 | 555 | runDeanalyze = find_option("deanalyze",0,0)!=0; |
| 556 | + runAnalyze = find_option("analyze",0,0)!=0; | |
| 554 | 557 | runCompress = find_option("compress",0,0)!=0; |
| 555 | 558 | zPagesize = find_option("pagesize",0,1); |
| 556 | 559 | showStats = find_option("stats",0,0)!=0; |
| 557 | 560 | if( zPagesize ){ |
| 558 | 561 | newPagesize = atoi(zPagesize); |
| @@ -605,22 +608,24 @@ | ||
| 605 | 608 | } |
| 606 | 609 | if( runDeanalyze ){ |
| 607 | 610 | db_multi_exec("DROP TABLE IF EXISTS sqlite_stat1;" |
| 608 | 611 | "DROP TABLE IF EXISTS sqlite_stat3;"); |
| 609 | 612 | } |
| 613 | + if( runAnalyze ){ | |
| 614 | + fossil_print("Analyzing the database... "); fflush(stdout); | |
| 615 | + db_multi_exec("ANALYZE;"); | |
| 616 | + fossil_print("done\n"); | |
| 617 | + } | |
| 610 | 618 | if( runVacuum ){ |
| 611 | 619 | fossil_print("Vacuuming the database... "); fflush(stdout); |
| 612 | 620 | db_multi_exec("VACUUM"); |
| 613 | 621 | fossil_print("done\n"); |
| 614 | 622 | } |
| 615 | 623 | if( activateWal ){ |
| 616 | 624 | db_multi_exec("PRAGMA journal_mode=WAL;"); |
| 617 | 625 | } |
| 618 | 626 | } |
| 619 | - fossil_print("Analyzing the database... "); fflush(stdout); | |
| 620 | - db_multi_exec("analyze"); | |
| 621 | - fossil_print("done\n"); | |
| 622 | 627 | if( showStats ){ |
| 623 | 628 | static struct { int idx; const char *zLabel; } aStat[] = { |
| 624 | 629 | { CFTYPE_ANY, "Artifacts:" }, |
| 625 | 630 | { CFTYPE_MANIFEST, "Manifests:" }, |
| 626 | 631 | { CFTYPE_CLUSTER, "Clusters:" }, |
| 627 | 632 |
| --- src/rebuild.c | |
| +++ src/rebuild.c | |
| @@ -524,10 +524,11 @@ | |
| 524 | ** --noverify Skip the verification of changes to the BLOB table |
| 525 | ** --pagesize N Set the database pagesize to N. (512..65536 and power of 2) |
| 526 | ** --randomize Scan artifacts in a random order |
| 527 | ** --vacuum Run VACUUM on the database after rebuilding |
| 528 | ** --deanalyze Remove ANALYZE tables from the database |
| 529 | ** --wal Set Write-Ahead-Log journalling mode on the database |
| 530 | ** --stats Show artifact statistics after rebuilding |
| 531 | ** |
| 532 | ** See also: deconstruct, reconstruct |
| 533 | */ |
| @@ -540,19 +541,21 @@ | |
| 540 | const char *zPagesize; |
| 541 | int newPagesize = 0; |
| 542 | int activateWal; |
| 543 | int runVacuum; |
| 544 | int runDeanalyze; |
| 545 | int runCompress; |
| 546 | int showStats; |
| 547 | |
| 548 | omitVerify = find_option("noverify",0,0)!=0; |
| 549 | forceFlag = find_option("force","f",0)!=0; |
| 550 | randomizeFlag = find_option("randomize", 0, 0)!=0; |
| 551 | doClustering = find_option("cluster", 0, 0)!=0; |
| 552 | runVacuum = find_option("vacuum",0,0)!=0; |
| 553 | runDeanalyze = find_option("deanalyze",0,0)!=0; |
| 554 | runCompress = find_option("compress",0,0)!=0; |
| 555 | zPagesize = find_option("pagesize",0,1); |
| 556 | showStats = find_option("stats",0,0)!=0; |
| 557 | if( zPagesize ){ |
| 558 | newPagesize = atoi(zPagesize); |
| @@ -605,22 +608,24 @@ | |
| 605 | } |
| 606 | if( runDeanalyze ){ |
| 607 | db_multi_exec("DROP TABLE IF EXISTS sqlite_stat1;" |
| 608 | "DROP TABLE IF EXISTS sqlite_stat3;"); |
| 609 | } |
| 610 | if( runVacuum ){ |
| 611 | fossil_print("Vacuuming the database... "); fflush(stdout); |
| 612 | db_multi_exec("VACUUM"); |
| 613 | fossil_print("done\n"); |
| 614 | } |
| 615 | if( activateWal ){ |
| 616 | db_multi_exec("PRAGMA journal_mode=WAL;"); |
| 617 | } |
| 618 | } |
| 619 | fossil_print("Analyzing the database... "); fflush(stdout); |
| 620 | db_multi_exec("analyze"); |
| 621 | fossil_print("done\n"); |
| 622 | if( showStats ){ |
| 623 | static struct { int idx; const char *zLabel; } aStat[] = { |
| 624 | { CFTYPE_ANY, "Artifacts:" }, |
| 625 | { CFTYPE_MANIFEST, "Manifests:" }, |
| 626 | { CFTYPE_CLUSTER, "Clusters:" }, |
| 627 |
| --- src/rebuild.c | |
| +++ src/rebuild.c | |
| @@ -524,10 +524,11 @@ | |
| 524 | ** --noverify Skip the verification of changes to the BLOB table |
| 525 | ** --pagesize N Set the database pagesize to N. (512..65536 and power of 2) |
| 526 | ** --randomize Scan artifacts in a random order |
| 527 | ** --vacuum Run VACUUM on the database after rebuilding |
| 528 | ** --deanalyze Remove ANALYZE tables from the database |
| 529 | ** --analyze Run ANALYZE on the database after rebuilding |
| 530 | ** --wal Set Write-Ahead-Log journalling mode on the database |
| 531 | ** --stats Show artifact statistics after rebuilding |
| 532 | ** |
| 533 | ** See also: deconstruct, reconstruct |
| 534 | */ |
| @@ -540,19 +541,21 @@ | |
| 541 | const char *zPagesize; |
| 542 | int newPagesize = 0; |
| 543 | int activateWal; |
| 544 | int runVacuum; |
| 545 | int runDeanalyze; |
| 546 | int runAnalyze; |
| 547 | int runCompress; |
| 548 | int showStats; |
| 549 | |
| 550 | omitVerify = find_option("noverify",0,0)!=0; |
| 551 | forceFlag = find_option("force","f",0)!=0; |
| 552 | randomizeFlag = find_option("randomize", 0, 0)!=0; |
| 553 | doClustering = find_option("cluster", 0, 0)!=0; |
| 554 | runVacuum = find_option("vacuum",0,0)!=0; |
| 555 | runDeanalyze = find_option("deanalyze",0,0)!=0; |
| 556 | runAnalyze = find_option("analyze",0,0)!=0; |
| 557 | runCompress = find_option("compress",0,0)!=0; |
| 558 | zPagesize = find_option("pagesize",0,1); |
| 559 | showStats = find_option("stats",0,0)!=0; |
| 560 | if( zPagesize ){ |
| 561 | newPagesize = atoi(zPagesize); |
| @@ -605,22 +608,24 @@ | |
| 608 | } |
| 609 | if( runDeanalyze ){ |
| 610 | db_multi_exec("DROP TABLE IF EXISTS sqlite_stat1;" |
| 611 | "DROP TABLE IF EXISTS sqlite_stat3;"); |
| 612 | } |
| 613 | if( runAnalyze ){ |
| 614 | fossil_print("Analyzing the database... "); fflush(stdout); |
| 615 | db_multi_exec("ANALYZE;"); |
| 616 | fossil_print("done\n"); |
| 617 | } |
| 618 | if( runVacuum ){ |
| 619 | fossil_print("Vacuuming the database... "); fflush(stdout); |
| 620 | db_multi_exec("VACUUM"); |
| 621 | fossil_print("done\n"); |
| 622 | } |
| 623 | if( activateWal ){ |
| 624 | db_multi_exec("PRAGMA journal_mode=WAL;"); |
| 625 | } |
| 626 | } |
| 627 | if( showStats ){ |
| 628 | static struct { int idx; const char *zLabel; } aStat[] = { |
| 629 | { CFTYPE_ANY, "Artifacts:" }, |
| 630 | { CFTYPE_MANIFEST, "Manifests:" }, |
| 631 | { CFTYPE_CLUSTER, "Clusters:" }, |
| 632 |
+9
| --- src/setup.c | ||
| +++ src/setup.c | ||
| @@ -917,10 +917,19 @@ | ||
| 917 | 917 | @ to this many bytes, uncompressed. If the client requires more data |
| 918 | 918 | @ than this, then the client will issue multiple HTTP requests. |
| 919 | 919 | @ Values below 1 million are not recommended. 5 million is a |
| 920 | 920 | @ reasonable number.</p> |
| 921 | 921 | |
| 922 | + @ <hr /> | |
| 923 | + entry_attribute("Download time limit", 11, "max-download-time", "mxdwnt", | |
| 924 | + "30"); | |
| 925 | + | |
| 926 | + @ <p>Fossil tries to spend less than this many seconds gathering | |
| 927 | + @ the out-bound data of sync, clone, and pull packets. | |
| 928 | + @ If the client request takes longer, a partial reply is given similar | |
| 929 | + @ to the download packet limit. 30s is a reasonable default.</p> | |
| 930 | + | |
| 922 | 931 | @ <hr /> |
| 923 | 932 | onoff_attribute( |
| 924 | 933 | "Enable hyperlinks for \"nobody\" based on User-Agent and Javascript", |
| 925 | 934 | "auto-hyperlink", "autohyperlink", 1); |
| 926 | 935 | @ <p>Enable hyperlinks (the equivalent of the "h" permission) for all users |
| 927 | 936 |
| --- src/setup.c | |
| +++ src/setup.c | |
| @@ -917,10 +917,19 @@ | |
| 917 | @ to this many bytes, uncompressed. If the client requires more data |
| 918 | @ than this, then the client will issue multiple HTTP requests. |
| 919 | @ Values below 1 million are not recommended. 5 million is a |
| 920 | @ reasonable number.</p> |
| 921 | |
| 922 | @ <hr /> |
| 923 | onoff_attribute( |
| 924 | "Enable hyperlinks for \"nobody\" based on User-Agent and Javascript", |
| 925 | "auto-hyperlink", "autohyperlink", 1); |
| 926 | @ <p>Enable hyperlinks (the equivalent of the "h" permission) for all users |
| 927 |
| --- src/setup.c | |
| +++ src/setup.c | |
| @@ -917,10 +917,19 @@ | |
| 917 | @ to this many bytes, uncompressed. If the client requires more data |
| 918 | @ than this, then the client will issue multiple HTTP requests. |
| 919 | @ Values below 1 million are not recommended. 5 million is a |
| 920 | @ reasonable number.</p> |
| 921 | |
| 922 | @ <hr /> |
| 923 | entry_attribute("Download time limit", 11, "max-download-time", "mxdwnt", |
| 924 | "30"); |
| 925 | |
| 926 | @ <p>Fossil tries to spend less than this many seconds gathering |
| 927 | @ the out-bound data of sync, clone, and pull packets. |
| 928 | @ If the client request takes longer, a partial reply is given similar |
| 929 | @ to the download packet limit. 30s is a reasonable default.</p> |
| 930 | |
| 931 | @ <hr /> |
| 932 | onoff_attribute( |
| 933 | "Enable hyperlinks for \"nobody\" based on User-Agent and Javascript", |
| 934 | "auto-hyperlink", "autohyperlink", 1); |
| 935 | @ <p>Enable hyperlinks (the equivalent of the "h" permission) for all users |
| 936 |
+8
-1
| --- src/stat.c | ||
| +++ src/stat.c | ||
| @@ -140,11 +140,18 @@ | ||
| 140 | 140 | } |
| 141 | 141 | |
| 142 | 142 | /* |
| 143 | 143 | ** COMMAND: dbstat* |
| 144 | 144 | ** |
| 145 | -** Show statistics and global information about the repository. | |
| 145 | +** Usage: %fossil dbstat ?-brief | -b? | |
| 146 | +** | |
| 147 | +** Shows statistics and global information about the repository. | |
| 148 | +** | |
| 149 | +** The (-brief|-b) option removes any "long-running" statistics, namely | |
| 150 | +** those whose calculations are known to slow down as the repository | |
| 151 | +** grows. | |
| 152 | +** | |
| 146 | 153 | */ |
| 147 | 154 | void dbstat_cmd(void){ |
| 148 | 155 | i64 t, fsize; |
| 149 | 156 | int n, m; |
| 150 | 157 | int szMax, szAvg; |
| 151 | 158 |
| --- src/stat.c | |
| +++ src/stat.c | |
| @@ -140,11 +140,18 @@ | |
| 140 | } |
| 141 | |
| 142 | /* |
| 143 | ** COMMAND: dbstat* |
| 144 | ** |
| 145 | ** Show statistics and global information about the repository. |
| 146 | */ |
| 147 | void dbstat_cmd(void){ |
| 148 | i64 t, fsize; |
| 149 | int n, m; |
| 150 | int szMax, szAvg; |
| 151 |
| --- src/stat.c | |
| +++ src/stat.c | |
| @@ -140,11 +140,18 @@ | |
| 140 | } |
| 141 | |
| 142 | /* |
| 143 | ** COMMAND: dbstat* |
| 144 | ** |
| 145 | ** Usage: %fossil dbstat ?-brief | -b? |
| 146 | ** |
| 147 | ** Shows statistics and global information about the repository. |
| 148 | ** |
| 149 | ** The (-brief|-b) option removes any "long-running" statistics, namely |
| 150 | ** those whose calculations are known to slow down as the repository |
| 151 | ** grows. |
| 152 | ** |
| 153 | */ |
| 154 | void dbstat_cmd(void){ |
| 155 | i64 t, fsize; |
| 156 | int n, m; |
| 157 | int szMax, szAvg; |
| 158 |
+25
-6
| --- src/update.c | ||
| +++ src/update.c | ||
| @@ -667,10 +667,13 @@ | ||
| 667 | 667 | ** Usage: %fossil revert ?-r REVISION? ?FILE ...? |
| 668 | 668 | ** |
| 669 | 669 | ** Revert to the current repository version of FILE, or to |
| 670 | 670 | ** the version associated with baseline REVISION if the -r flag |
| 671 | 671 | ** appears. |
| 672 | +** | |
| 673 | +** If FILE was part of a rename operation, both the original file | |
| 674 | +** and the renamed file are reverted. | |
| 672 | 675 | ** |
| 673 | 676 | ** Revert all files if no file name is provided. |
| 674 | 677 | ** |
| 675 | 678 | ** If a file is reverted accidently, it can be restored using |
| 676 | 679 | ** the "fossil undo" command. |
| @@ -706,11 +709,22 @@ | ||
| 706 | 709 | if( g.argc>2 ){ |
| 707 | 710 | for(i=2; i<g.argc; i++){ |
| 708 | 711 | Blob fname; |
| 709 | 712 | zFile = mprintf("%/", g.argv[i]); |
| 710 | 713 | file_tree_name(zFile, &fname, 1); |
| 711 | - db_multi_exec("REPLACE INTO torevert VALUES(%B)", &fname); | |
| 714 | + db_multi_exec( | |
| 715 | + "REPLACE INTO torevert VALUES(%B);" | |
| 716 | + "INSERT OR IGNORE INTO torevert" | |
| 717 | + " SELECT pathname" | |
| 718 | + " FROM vfile" | |
| 719 | + " WHERE origname IN(%B)" | |
| 720 | + " UNION ALL" | |
| 721 | + " SELECT origname" | |
| 722 | + " FROM vfile" | |
| 723 | + " WHERE pathname IN(%B) AND origname IS NOT NULL;", | |
| 724 | + &fname, &fname, &fname | |
| 725 | + ); | |
| 712 | 726 | blob_reset(&fname); |
| 713 | 727 | } |
| 714 | 728 | }else{ |
| 715 | 729 | int vid; |
| 716 | 730 | vid = db_lget_int("checkout", 0); |
| @@ -748,11 +762,17 @@ | ||
| 748 | 762 | }else{ |
| 749 | 763 | undo_save(zFile); |
| 750 | 764 | file_delete(zFull); |
| 751 | 765 | fossil_print("DELETE: %s\n", zFile); |
| 752 | 766 | } |
| 753 | - db_multi_exec("DELETE FROM vfile WHERE pathname=%Q", zFile); | |
| 767 | + db_multi_exec( | |
| 768 | + "UPDATE vfile" | |
| 769 | + " SET pathname=origname, origname=NULL" | |
| 770 | + " WHERE pathname=%Q AND origname!=pathname AND origname IS NOT NULL;" | |
| 771 | + "DELETE FROM vfile WHERE pathname=%Q", | |
| 772 | + zFile, zFile | |
| 773 | + ); | |
| 754 | 774 | }else{ |
| 755 | 775 | sqlite3_int64 mtime; |
| 756 | 776 | undo_save(zFile); |
| 757 | 777 | if( file_wd_size(zFull)>=0 && (isLink || file_wd_islink(zFull)) ){ |
| 758 | 778 | file_delete(zFull); |
| @@ -765,18 +785,17 @@ | ||
| 765 | 785 | file_wd_setexe(zFull, isExe); |
| 766 | 786 | fossil_print("REVERTED: %s\n", zFile); |
| 767 | 787 | mtime = file_wd_mtime(zFull); |
| 768 | 788 | db_multi_exec( |
| 769 | 789 | "UPDATE vfile" |
| 770 | - " SET mtime=%lld, chnged=0, deleted=0, isexe=%d, islink=%d,mrid=rid," | |
| 771 | - " pathname=coalesce(origname,pathname), origname=NULL" | |
| 772 | - " WHERE pathname=%Q", | |
| 773 | - mtime, isExe, isLink, zFile | |
| 790 | + " SET mtime=%lld, chnged=0, deleted=0, isexe=%d, islink=%d,mrid=rid" | |
| 791 | + " WHERE pathname=%Q OR origname=%Q", | |
| 792 | + mtime, isExe, isLink, zFile, zFile | |
| 774 | 793 | ); |
| 775 | 794 | } |
| 776 | 795 | blob_reset(&record); |
| 777 | 796 | free(zFull); |
| 778 | 797 | } |
| 779 | 798 | db_finalize(&q); |
| 780 | 799 | undo_finish(); |
| 781 | 800 | db_end_transaction(0); |
| 782 | 801 | } |
| 783 | 802 |
| --- src/update.c | |
| +++ src/update.c | |
| @@ -667,10 +667,13 @@ | |
| 667 | ** Usage: %fossil revert ?-r REVISION? ?FILE ...? |
| 668 | ** |
| 669 | ** Revert to the current repository version of FILE, or to |
| 670 | ** the version associated with baseline REVISION if the -r flag |
| 671 | ** appears. |
| 672 | ** |
| 673 | ** Revert all files if no file name is provided. |
| 674 | ** |
| 675 | ** If a file is reverted accidently, it can be restored using |
| 676 | ** the "fossil undo" command. |
| @@ -706,11 +709,22 @@ | |
| 706 | if( g.argc>2 ){ |
| 707 | for(i=2; i<g.argc; i++){ |
| 708 | Blob fname; |
| 709 | zFile = mprintf("%/", g.argv[i]); |
| 710 | file_tree_name(zFile, &fname, 1); |
| 711 | db_multi_exec("REPLACE INTO torevert VALUES(%B)", &fname); |
| 712 | blob_reset(&fname); |
| 713 | } |
| 714 | }else{ |
| 715 | int vid; |
| 716 | vid = db_lget_int("checkout", 0); |
| @@ -748,11 +762,17 @@ | |
| 748 | }else{ |
| 749 | undo_save(zFile); |
| 750 | file_delete(zFull); |
| 751 | fossil_print("DELETE: %s\n", zFile); |
| 752 | } |
| 753 | db_multi_exec("DELETE FROM vfile WHERE pathname=%Q", zFile); |
| 754 | }else{ |
| 755 | sqlite3_int64 mtime; |
| 756 | undo_save(zFile); |
| 757 | if( file_wd_size(zFull)>=0 && (isLink || file_wd_islink(zFull)) ){ |
| 758 | file_delete(zFull); |
| @@ -765,18 +785,17 @@ | |
| 765 | file_wd_setexe(zFull, isExe); |
| 766 | fossil_print("REVERTED: %s\n", zFile); |
| 767 | mtime = file_wd_mtime(zFull); |
| 768 | db_multi_exec( |
| 769 | "UPDATE vfile" |
| 770 | " SET mtime=%lld, chnged=0, deleted=0, isexe=%d, islink=%d,mrid=rid," |
| 771 | " pathname=coalesce(origname,pathname), origname=NULL" |
| 772 | " WHERE pathname=%Q", |
| 773 | mtime, isExe, isLink, zFile |
| 774 | ); |
| 775 | } |
| 776 | blob_reset(&record); |
| 777 | free(zFull); |
| 778 | } |
| 779 | db_finalize(&q); |
| 780 | undo_finish(); |
| 781 | db_end_transaction(0); |
| 782 | } |
| 783 |
| --- src/update.c | |
| +++ src/update.c | |
| @@ -667,10 +667,13 @@ | |
| 667 | ** Usage: %fossil revert ?-r REVISION? ?FILE ...? |
| 668 | ** |
| 669 | ** Revert to the current repository version of FILE, or to |
| 670 | ** the version associated with baseline REVISION if the -r flag |
| 671 | ** appears. |
| 672 | ** |
| 673 | ** If FILE was part of a rename operation, both the original file |
| 674 | ** and the renamed file are reverted. |
| 675 | ** |
| 676 | ** Revert all files if no file name is provided. |
| 677 | ** |
| 678 | ** If a file is reverted accidently, it can be restored using |
| 679 | ** the "fossil undo" command. |
| @@ -706,11 +709,22 @@ | |
| 709 | if( g.argc>2 ){ |
| 710 | for(i=2; i<g.argc; i++){ |
| 711 | Blob fname; |
| 712 | zFile = mprintf("%/", g.argv[i]); |
| 713 | file_tree_name(zFile, &fname, 1); |
| 714 | db_multi_exec( |
| 715 | "REPLACE INTO torevert VALUES(%B);" |
| 716 | "INSERT OR IGNORE INTO torevert" |
| 717 | " SELECT pathname" |
| 718 | " FROM vfile" |
| 719 | " WHERE origname IN(%B)" |
| 720 | " UNION ALL" |
| 721 | " SELECT origname" |
| 722 | " FROM vfile" |
| 723 | " WHERE pathname IN(%B) AND origname IS NOT NULL;", |
| 724 | &fname, &fname, &fname |
| 725 | ); |
| 726 | blob_reset(&fname); |
| 727 | } |
| 728 | }else{ |
| 729 | int vid; |
| 730 | vid = db_lget_int("checkout", 0); |
| @@ -748,11 +762,17 @@ | |
| 762 | }else{ |
| 763 | undo_save(zFile); |
| 764 | file_delete(zFull); |
| 765 | fossil_print("DELETE: %s\n", zFile); |
| 766 | } |
| 767 | db_multi_exec( |
| 768 | "UPDATE vfile" |
| 769 | " SET pathname=origname, origname=NULL" |
| 770 | " WHERE pathname=%Q AND origname!=pathname AND origname IS NOT NULL;" |
| 771 | "DELETE FROM vfile WHERE pathname=%Q", |
| 772 | zFile, zFile |
| 773 | ); |
| 774 | }else{ |
| 775 | sqlite3_int64 mtime; |
| 776 | undo_save(zFile); |
| 777 | if( file_wd_size(zFull)>=0 && (isLink || file_wd_islink(zFull)) ){ |
| 778 | file_delete(zFull); |
| @@ -765,18 +785,17 @@ | |
| 785 | file_wd_setexe(zFull, isExe); |
| 786 | fossil_print("REVERTED: %s\n", zFile); |
| 787 | mtime = file_wd_mtime(zFull); |
| 788 | db_multi_exec( |
| 789 | "UPDATE vfile" |
| 790 | " SET mtime=%lld, chnged=0, deleted=0, isexe=%d, islink=%d,mrid=rid" |
| 791 | " WHERE pathname=%Q OR origname=%Q", |
| 792 | mtime, isExe, isLink, zFile, zFile |
| 793 | ); |
| 794 | } |
| 795 | blob_reset(&record); |
| 796 | free(zFull); |
| 797 | } |
| 798 | db_finalize(&q); |
| 799 | undo_finish(); |
| 800 | db_end_transaction(0); |
| 801 | } |
| 802 |
+10
-1
| --- src/url.c | ||
| +++ src/url.c | ||
| @@ -63,10 +63,11 @@ | ||
| 63 | 63 | || strncmp(zUrl, "ssh://", 6)==0 |
| 64 | 64 | ){ |
| 65 | 65 | int iStart; |
| 66 | 66 | char *zLogin; |
| 67 | 67 | char *zExe; |
| 68 | + char cQuerySep = '?'; | |
| 68 | 69 | |
| 69 | 70 | g.urlIsFile = 0; |
| 70 | 71 | if( zUrl[4]=='s' ){ |
| 71 | 72 | g.urlIsHttps = 1; |
| 72 | 73 | g.urlProtocol = "https"; |
| @@ -75,10 +76,11 @@ | ||
| 75 | 76 | }else if( zUrl[0]=='s' ){ |
| 76 | 77 | g.urlIsSsh = 1; |
| 77 | 78 | g.urlProtocol = "ssh"; |
| 78 | 79 | g.urlDfltPort = 22; |
| 79 | 80 | g.urlFossil = "fossil"; |
| 81 | + g.urlShell = 0; | |
| 80 | 82 | iStart = 6; |
| 81 | 83 | }else{ |
| 82 | 84 | g.urlIsHttps = 0; |
| 83 | 85 | g.urlProtocol = "http"; |
| 84 | 86 | g.urlDfltPort = 80; |
| @@ -144,11 +146,18 @@ | ||
| 144 | 146 | i++; |
| 145 | 147 | } |
| 146 | 148 | if( fossil_strcmp(zName,"fossil")==0 ){ |
| 147 | 149 | g.urlFossil = zValue; |
| 148 | 150 | dehttpize(g.urlFossil); |
| 149 | - zExe = mprintf("?fossil=%T", g.urlFossil); | |
| 151 | + zExe = mprintf("%cfossil=%T", cQuerySep, g.urlFossil); | |
| 152 | + cQuerySep = '&'; | |
| 153 | + } | |
| 154 | + if( fossil_strcmp(zName,"shell")==0 ){ | |
| 155 | + g.urlShell = zValue; | |
| 156 | + dehttpize(g.urlShell); | |
| 157 | + zExe = mprintf("%cshell=%T", cQuerySep, g.urlFossil); | |
| 158 | + cQuerySep = '&'; | |
| 150 | 159 | } |
| 151 | 160 | } |
| 152 | 161 | |
| 153 | 162 | dehttpize(g.urlPath); |
| 154 | 163 | if( g.urlDfltPort==g.urlPort ){ |
| 155 | 164 |
| --- src/url.c | |
| +++ src/url.c | |
| @@ -63,10 +63,11 @@ | |
| 63 | || strncmp(zUrl, "ssh://", 6)==0 |
| 64 | ){ |
| 65 | int iStart; |
| 66 | char *zLogin; |
| 67 | char *zExe; |
| 68 | |
| 69 | g.urlIsFile = 0; |
| 70 | if( zUrl[4]=='s' ){ |
| 71 | g.urlIsHttps = 1; |
| 72 | g.urlProtocol = "https"; |
| @@ -75,10 +76,11 @@ | |
| 75 | }else if( zUrl[0]=='s' ){ |
| 76 | g.urlIsSsh = 1; |
| 77 | g.urlProtocol = "ssh"; |
| 78 | g.urlDfltPort = 22; |
| 79 | g.urlFossil = "fossil"; |
| 80 | iStart = 6; |
| 81 | }else{ |
| 82 | g.urlIsHttps = 0; |
| 83 | g.urlProtocol = "http"; |
| 84 | g.urlDfltPort = 80; |
| @@ -144,11 +146,18 @@ | |
| 144 | i++; |
| 145 | } |
| 146 | if( fossil_strcmp(zName,"fossil")==0 ){ |
| 147 | g.urlFossil = zValue; |
| 148 | dehttpize(g.urlFossil); |
| 149 | zExe = mprintf("?fossil=%T", g.urlFossil); |
| 150 | } |
| 151 | } |
| 152 | |
| 153 | dehttpize(g.urlPath); |
| 154 | if( g.urlDfltPort==g.urlPort ){ |
| 155 |
| --- src/url.c | |
| +++ src/url.c | |
| @@ -63,10 +63,11 @@ | |
| 63 | || strncmp(zUrl, "ssh://", 6)==0 |
| 64 | ){ |
| 65 | int iStart; |
| 66 | char *zLogin; |
| 67 | char *zExe; |
| 68 | char cQuerySep = '?'; |
| 69 | |
| 70 | g.urlIsFile = 0; |
| 71 | if( zUrl[4]=='s' ){ |
| 72 | g.urlIsHttps = 1; |
| 73 | g.urlProtocol = "https"; |
| @@ -75,10 +76,11 @@ | |
| 76 | }else if( zUrl[0]=='s' ){ |
| 77 | g.urlIsSsh = 1; |
| 78 | g.urlProtocol = "ssh"; |
| 79 | g.urlDfltPort = 22; |
| 80 | g.urlFossil = "fossil"; |
| 81 | g.urlShell = 0; |
| 82 | iStart = 6; |
| 83 | }else{ |
| 84 | g.urlIsHttps = 0; |
| 85 | g.urlProtocol = "http"; |
| 86 | g.urlDfltPort = 80; |
| @@ -144,11 +146,18 @@ | |
| 146 | i++; |
| 147 | } |
| 148 | if( fossil_strcmp(zName,"fossil")==0 ){ |
| 149 | g.urlFossil = zValue; |
| 150 | dehttpize(g.urlFossil); |
| 151 | zExe = mprintf("%cfossil=%T", cQuerySep, g.urlFossil); |
| 152 | cQuerySep = '&'; |
| 153 | } |
| 154 | if( fossil_strcmp(zName,"shell")==0 ){ |
| 155 | g.urlShell = zValue; |
| 156 | dehttpize(g.urlShell); |
| 157 | zExe = mprintf("%cshell=%T", cQuerySep, g.urlFossil); |
| 158 | cQuerySep = '&'; |
| 159 | } |
| 160 | } |
| 161 | |
| 162 | dehttpize(g.urlPath); |
| 163 | if( g.urlDfltPort==g.urlPort ){ |
| 164 |
+19
-3
| --- src/xfer.c | ||
| +++ src/xfer.c | ||
| @@ -18,10 +18,18 @@ | ||
| 18 | 18 | ** This file contains code to implement the file transfer protocol. |
| 19 | 19 | */ |
| 20 | 20 | #include "config.h" |
| 21 | 21 | #include "xfer.h" |
| 22 | 22 | |
| 23 | +#include <time.h> | |
| 24 | + | |
| 25 | +/* | |
| 26 | +** Maximum number of HTTP redirects that any http_exchange() call will | |
| 27 | +** follow before throwing a fatal error. Most browsers use a limit of 20. | |
| 28 | +*/ | |
| 29 | +#define MAX_REDIRECTS 20 | |
| 30 | + | |
| 23 | 31 | /* |
| 24 | 32 | ** This structure holds information about the current state of either |
| 25 | 33 | ** a client or a server that is participating in xfer. |
| 26 | 34 | */ |
| 27 | 35 | typedef struct Xfer Xfer; |
| @@ -40,10 +48,11 @@ | ||
| 40 | 48 | int nDeltaRcvd; /* Number of deltas received */ |
| 41 | 49 | int nDanglingFile; /* Number of dangling deltas received */ |
| 42 | 50 | int mxSend; /* Stop sending "file" with pOut reaches this size */ |
| 43 | 51 | u8 syncPrivate; /* True to enable syncing private content */ |
| 44 | 52 | u8 nextIsPrivate; /* If true, next "file" received is a private */ |
| 53 | + time_t maxTime; /* Time when this transfer should be finished */ | |
| 45 | 54 | }; |
| 46 | 55 | |
| 47 | 56 | |
| 48 | 57 | /* |
| 49 | 58 | ** The input blob contains a UUID. Convert it into a record ID. |
| @@ -393,11 +402,12 @@ | ||
| 393 | 402 | } |
| 394 | 403 | if( uuid_is_shunned(blob_str(pUuid)) ){ |
| 395 | 404 | blob_reset(&uuid); |
| 396 | 405 | return; |
| 397 | 406 | } |
| 398 | - if( pXfer->mxSend<=blob_size(pXfer->pOut) ){ | |
| 407 | + if( (pXfer->maxTime != -1 && time(NULL) >= pXfer->maxTime) || | |
| 408 | + pXfer->mxSend<=blob_size(pXfer->pOut) ){ | |
| 399 | 409 | const char *zFormat = isPriv ? "igot %b 1\n" : "igot %b\n"; |
| 400 | 410 | blob_appendf(pXfer->pOut, zFormat, pUuid); |
| 401 | 411 | pXfer->nIGotSent++; |
| 402 | 412 | blob_reset(&uuid); |
| 403 | 413 | return; |
| @@ -867,10 +877,13 @@ | ||
| 867 | 877 | } |
| 868 | 878 | blob_zero(&xfer.err); |
| 869 | 879 | xfer.pIn = &g.cgiIn; |
| 870 | 880 | xfer.pOut = cgi_output_blob(); |
| 871 | 881 | xfer.mxSend = db_get_int("max-download", 5000000); |
| 882 | + xfer.maxTime = db_get_int("max-download-time", 30); | |
| 883 | + if( xfer.maxTime<1 ) xfer.maxTime = 1; | |
| 884 | + xfer.maxTime += time(NULL); | |
| 872 | 885 | g.xferPanic = 1; |
| 873 | 886 | |
| 874 | 887 | db_begin_transaction(); |
| 875 | 888 | db_multi_exec( |
| 876 | 889 | "CREATE TEMP TABLE onremote(rid INTEGER PRIMARY KEY);" |
| @@ -1034,11 +1047,12 @@ | ||
| 1034 | 1047 | if( iVers>=3 ){ |
| 1035 | 1048 | cgi_set_content_type("application/x-fossil-uncompressed"); |
| 1036 | 1049 | } |
| 1037 | 1050 | blob_is_int(&xfer.aToken[2], &seqno); |
| 1038 | 1051 | max = db_int(0, "SELECT max(rid) FROM blob"); |
| 1039 | - while( xfer.mxSend>blob_size(xfer.pOut) && seqno<=max ){ | |
| 1052 | + while( xfer.mxSend>blob_size(xfer.pOut) && seqno<=max){ | |
| 1053 | + if( time(NULL) >= xfer.maxTime ) break; | |
| 1040 | 1054 | if( iVers>=3 ){ |
| 1041 | 1055 | send_compressed_file(&xfer, seqno); |
| 1042 | 1056 | }else{ |
| 1043 | 1057 | send_file(&xfer, seqno, 0, 1); |
| 1044 | 1058 | } |
| @@ -1328,10 +1342,11 @@ | ||
| 1328 | 1342 | socket_global_init(); |
| 1329 | 1343 | memset(&xfer, 0, sizeof(xfer)); |
| 1330 | 1344 | xfer.pIn = &recv; |
| 1331 | 1345 | xfer.pOut = &send; |
| 1332 | 1346 | xfer.mxSend = db_get_int("max-upload", 250000); |
| 1347 | + xfer.maxTime = -1; | |
| 1333 | 1348 | if( syncFlags & SYNC_PRIVATE ){ |
| 1334 | 1349 | g.perm.Private = 1; |
| 1335 | 1350 | xfer.syncPrivate = 1; |
| 1336 | 1351 | } |
| 1337 | 1352 | |
| @@ -1471,11 +1486,12 @@ | ||
| 1471 | 1486 | xfer.nIGotSent = 0; |
| 1472 | 1487 | if( syncFlags & SYNC_VERBOSE ){ |
| 1473 | 1488 | fossil_print("waiting for server..."); |
| 1474 | 1489 | } |
| 1475 | 1490 | fflush(stdout); |
| 1476 | - if( http_exchange(&send, &recv, (syncFlags & SYNC_CLONE)==0 || nCycle>0) ){ | |
| 1491 | + if( http_exchange(&send, &recv, (syncFlags & SYNC_CLONE)==0 || nCycle>0, | |
| 1492 | + MAX_REDIRECTS) ){ | |
| 1477 | 1493 | nErr++; |
| 1478 | 1494 | break; |
| 1479 | 1495 | } |
| 1480 | 1496 | lastPctDone = -1; |
| 1481 | 1497 | blob_reset(&send); |
| 1482 | 1498 | |
| 1483 | 1499 | ADDED test/revert.test |
| --- src/xfer.c | |
| +++ src/xfer.c | |
| @@ -18,10 +18,18 @@ | |
| 18 | ** This file contains code to implement the file transfer protocol. |
| 19 | */ |
| 20 | #include "config.h" |
| 21 | #include "xfer.h" |
| 22 | |
| 23 | /* |
| 24 | ** This structure holds information about the current state of either |
| 25 | ** a client or a server that is participating in xfer. |
| 26 | */ |
| 27 | typedef struct Xfer Xfer; |
| @@ -40,10 +48,11 @@ | |
| 40 | int nDeltaRcvd; /* Number of deltas received */ |
| 41 | int nDanglingFile; /* Number of dangling deltas received */ |
| 42 | int mxSend; /* Stop sending "file" with pOut reaches this size */ |
| 43 | u8 syncPrivate; /* True to enable syncing private content */ |
| 44 | u8 nextIsPrivate; /* If true, next "file" received is a private */ |
| 45 | }; |
| 46 | |
| 47 | |
| 48 | /* |
| 49 | ** The input blob contains a UUID. Convert it into a record ID. |
| @@ -393,11 +402,12 @@ | |
| 393 | } |
| 394 | if( uuid_is_shunned(blob_str(pUuid)) ){ |
| 395 | blob_reset(&uuid); |
| 396 | return; |
| 397 | } |
| 398 | if( pXfer->mxSend<=blob_size(pXfer->pOut) ){ |
| 399 | const char *zFormat = isPriv ? "igot %b 1\n" : "igot %b\n"; |
| 400 | blob_appendf(pXfer->pOut, zFormat, pUuid); |
| 401 | pXfer->nIGotSent++; |
| 402 | blob_reset(&uuid); |
| 403 | return; |
| @@ -867,10 +877,13 @@ | |
| 867 | } |
| 868 | blob_zero(&xfer.err); |
| 869 | xfer.pIn = &g.cgiIn; |
| 870 | xfer.pOut = cgi_output_blob(); |
| 871 | xfer.mxSend = db_get_int("max-download", 5000000); |
| 872 | g.xferPanic = 1; |
| 873 | |
| 874 | db_begin_transaction(); |
| 875 | db_multi_exec( |
| 876 | "CREATE TEMP TABLE onremote(rid INTEGER PRIMARY KEY);" |
| @@ -1034,11 +1047,12 @@ | |
| 1034 | if( iVers>=3 ){ |
| 1035 | cgi_set_content_type("application/x-fossil-uncompressed"); |
| 1036 | } |
| 1037 | blob_is_int(&xfer.aToken[2], &seqno); |
| 1038 | max = db_int(0, "SELECT max(rid) FROM blob"); |
| 1039 | while( xfer.mxSend>blob_size(xfer.pOut) && seqno<=max ){ |
| 1040 | if( iVers>=3 ){ |
| 1041 | send_compressed_file(&xfer, seqno); |
| 1042 | }else{ |
| 1043 | send_file(&xfer, seqno, 0, 1); |
| 1044 | } |
| @@ -1328,10 +1342,11 @@ | |
| 1328 | socket_global_init(); |
| 1329 | memset(&xfer, 0, sizeof(xfer)); |
| 1330 | xfer.pIn = &recv; |
| 1331 | xfer.pOut = &send; |
| 1332 | xfer.mxSend = db_get_int("max-upload", 250000); |
| 1333 | if( syncFlags & SYNC_PRIVATE ){ |
| 1334 | g.perm.Private = 1; |
| 1335 | xfer.syncPrivate = 1; |
| 1336 | } |
| 1337 | |
| @@ -1471,11 +1486,12 @@ | |
| 1471 | xfer.nIGotSent = 0; |
| 1472 | if( syncFlags & SYNC_VERBOSE ){ |
| 1473 | fossil_print("waiting for server..."); |
| 1474 | } |
| 1475 | fflush(stdout); |
| 1476 | if( http_exchange(&send, &recv, (syncFlags & SYNC_CLONE)==0 || nCycle>0) ){ |
| 1477 | nErr++; |
| 1478 | break; |
| 1479 | } |
| 1480 | lastPctDone = -1; |
| 1481 | blob_reset(&send); |
| 1482 | |
| 1483 | DDED test/revert.test |
| --- src/xfer.c | |
| +++ src/xfer.c | |
| @@ -18,10 +18,18 @@ | |
| 18 | ** This file contains code to implement the file transfer protocol. |
| 19 | */ |
| 20 | #include "config.h" |
| 21 | #include "xfer.h" |
| 22 | |
| 23 | #include <time.h> |
| 24 | |
| 25 | /* |
| 26 | ** Maximum number of HTTP redirects that any http_exchange() call will |
| 27 | ** follow before throwing a fatal error. Most browsers use a limit of 20. |
| 28 | */ |
| 29 | #define MAX_REDIRECTS 20 |
| 30 | |
| 31 | /* |
| 32 | ** This structure holds information about the current state of either |
| 33 | ** a client or a server that is participating in xfer. |
| 34 | */ |
| 35 | typedef struct Xfer Xfer; |
| @@ -40,10 +48,11 @@ | |
| 48 | int nDeltaRcvd; /* Number of deltas received */ |
| 49 | int nDanglingFile; /* Number of dangling deltas received */ |
| 50 | int mxSend; /* Stop sending "file" with pOut reaches this size */ |
| 51 | u8 syncPrivate; /* True to enable syncing private content */ |
| 52 | u8 nextIsPrivate; /* If true, next "file" received is a private */ |
| 53 | time_t maxTime; /* Time when this transfer should be finished */ |
| 54 | }; |
| 55 | |
| 56 | |
| 57 | /* |
| 58 | ** The input blob contains a UUID. Convert it into a record ID. |
| @@ -393,11 +402,12 @@ | |
| 402 | } |
| 403 | if( uuid_is_shunned(blob_str(pUuid)) ){ |
| 404 | blob_reset(&uuid); |
| 405 | return; |
| 406 | } |
| 407 | if( (pXfer->maxTime != -1 && time(NULL) >= pXfer->maxTime) || |
| 408 | pXfer->mxSend<=blob_size(pXfer->pOut) ){ |
| 409 | const char *zFormat = isPriv ? "igot %b 1\n" : "igot %b\n"; |
| 410 | blob_appendf(pXfer->pOut, zFormat, pUuid); |
| 411 | pXfer->nIGotSent++; |
| 412 | blob_reset(&uuid); |
| 413 | return; |
| @@ -867,10 +877,13 @@ | |
| 877 | } |
| 878 | blob_zero(&xfer.err); |
| 879 | xfer.pIn = &g.cgiIn; |
| 880 | xfer.pOut = cgi_output_blob(); |
| 881 | xfer.mxSend = db_get_int("max-download", 5000000); |
| 882 | xfer.maxTime = db_get_int("max-download-time", 30); |
| 883 | if( xfer.maxTime<1 ) xfer.maxTime = 1; |
| 884 | xfer.maxTime += time(NULL); |
| 885 | g.xferPanic = 1; |
| 886 | |
| 887 | db_begin_transaction(); |
| 888 | db_multi_exec( |
| 889 | "CREATE TEMP TABLE onremote(rid INTEGER PRIMARY KEY);" |
| @@ -1034,11 +1047,12 @@ | |
| 1047 | if( iVers>=3 ){ |
| 1048 | cgi_set_content_type("application/x-fossil-uncompressed"); |
| 1049 | } |
| 1050 | blob_is_int(&xfer.aToken[2], &seqno); |
| 1051 | max = db_int(0, "SELECT max(rid) FROM blob"); |
| 1052 | while( xfer.mxSend>blob_size(xfer.pOut) && seqno<=max){ |
| 1053 | if( time(NULL) >= xfer.maxTime ) break; |
| 1054 | if( iVers>=3 ){ |
| 1055 | send_compressed_file(&xfer, seqno); |
| 1056 | }else{ |
| 1057 | send_file(&xfer, seqno, 0, 1); |
| 1058 | } |
| @@ -1328,10 +1342,11 @@ | |
| 1342 | socket_global_init(); |
| 1343 | memset(&xfer, 0, sizeof(xfer)); |
| 1344 | xfer.pIn = &recv; |
| 1345 | xfer.pOut = &send; |
| 1346 | xfer.mxSend = db_get_int("max-upload", 250000); |
| 1347 | xfer.maxTime = -1; |
| 1348 | if( syncFlags & SYNC_PRIVATE ){ |
| 1349 | g.perm.Private = 1; |
| 1350 | xfer.syncPrivate = 1; |
| 1351 | } |
| 1352 | |
| @@ -1471,11 +1486,12 @@ | |
| 1486 | xfer.nIGotSent = 0; |
| 1487 | if( syncFlags & SYNC_VERBOSE ){ |
| 1488 | fossil_print("waiting for server..."); |
| 1489 | } |
| 1490 | fflush(stdout); |
| 1491 | if( http_exchange(&send, &recv, (syncFlags & SYNC_CLONE)==0 || nCycle>0, |
| 1492 | MAX_REDIRECTS) ){ |
| 1493 | nErr++; |
| 1494 | break; |
| 1495 | } |
| 1496 | lastPctDone = -1; |
| 1497 | blob_reset(&send); |
| 1498 | |
| 1499 | DDED test/revert.test |
+26
| --- a/test/revert.test | ||
| +++ b/test/revert.test | ||
| @@ -0,0 +1,26 @@ | ||
| 1 | +puts res=$# Fossil will write dexec rm f1po_init# Copytcatch {exec $::exec mvitory} $res]} { | |
| 2 | + puts stderr "Cannot ris test within anif {[llength $args] % 2} { | |
| 3 | + set revertArgs [lindex $args 0] | |
| 4 | + set args [lrange $args 1 end] | |
| 5 | + } else { | |
| 6 | + set revertArgs {} | |
| 7 | + }VERTED: f3 | |
| 8 | + DELETE:j@Uy,1X@Se,4:: f0G@YW,21@UT,3:ED:1w@WW,3:ED:3t@YT,G:ED: f3 | |
| 9 | + DELETE:K@hF,O@YG:ED: f3 | |
| 10 | + DELETE:K@hF,O@Yl,1 | |
| 11 | + DELETE:a@nd,1WvoIq;-testnormalize-status-list] | |
| 12 | + set r] | |
| 13 | + if {$result ne $expected} { | |
| 14 | + set passed 0 | |
| 15 | + protOut " Expected:\n [join $expected "\n "]" | |
| 16 | + protOut " Got:\n [joh {exec $::fossilexe info} res | |
| 17 | +if {![regexp {use --repository} $res]} { | |
| 18 | + puts stderr "Cannot run this test within an open checkout" | |
| 19 | + return | |
| 20 | +} | |
| 21 | +repo_init# Copytcatch {exec $::fossilexe info} res | |
| 22 | +if {![regexp {use --repository} $res]} { | |
| 23 | + puts stderr "Cannot run this test witt# Copytcatch {exec $::fossilexe info} res | |
| 24 | +if {![regexp {use --repository} $res]} { | |
| 25 | + put12 f03 f1 {exec $::fossilexe info}t# Copytcatch {exec $::foss4 f2 {exec $::ft# Copytcatch {exec $::foss5 f3 {exec $::fossilexe info} res | |
| 26 | +if {![re |
| --- a/test/revert.test | |
| +++ b/test/revert.test | |
| @@ -0,0 +1,26 @@ | |
| --- a/test/revert.test | |
| +++ b/test/revert.test | |
| @@ -0,0 +1,26 @@ | |
| 1 | puts res=$# Fossil will write dexec rm f1po_init# Copytcatch {exec $::exec mvitory} $res]} { |
| 2 | puts stderr "Cannot ris test within anif {[llength $args] % 2} { |
| 3 | set revertArgs [lindex $args 0] |
| 4 | set args [lrange $args 1 end] |
| 5 | } else { |
| 6 | set revertArgs {} |
| 7 | }VERTED: f3 |
| 8 | DELETE:j@Uy,1X@Se,4:: f0G@YW,21@UT,3:ED:1w@WW,3:ED:3t@YT,G:ED: f3 |
| 9 | DELETE:K@hF,O@YG:ED: f3 |
| 10 | DELETE:K@hF,O@Yl,1 |
| 11 | DELETE:a@nd,1WvoIq;-testnormalize-status-list] |
| 12 | set r] |
| 13 | if {$result ne $expected} { |
| 14 | set passed 0 |
| 15 | protOut " Expected:\n [join $expected "\n "]" |
| 16 | protOut " Got:\n [joh {exec $::fossilexe info} res |
| 17 | if {![regexp {use --repository} $res]} { |
| 18 | puts stderr "Cannot run this test within an open checkout" |
| 19 | return |
| 20 | } |
| 21 | repo_init# Copytcatch {exec $::fossilexe info} res |
| 22 | if {![regexp {use --repository} $res]} { |
| 23 | puts stderr "Cannot run this test witt# Copytcatch {exec $::fossilexe info} res |
| 24 | if {![regexp {use --repository} $res]} { |
| 25 | put12 f03 f1 {exec $::fossilexe info}t# Copytcatch {exec $::foss4 f2 {exec $::ft# Copytcatch {exec $::foss5 f3 {exec $::fossilexe info} res |
| 26 | if {![re |
+5
-5
| --- win/Makefile.mingw | ||
| +++ win/Makefile.mingw | ||
| @@ -6,15 +6,15 @@ | ||
| 6 | 6 | # |
| 7 | 7 | # This file is automatically generated. Instead of editing this |
| 8 | 8 | # file, edit "makemake.tcl" then run "tclsh makemake.tcl" |
| 9 | 9 | # to regenerate this file. |
| 10 | 10 | # |
| 11 | -# This is a makefile for use on Windows/Linux/Darwin/Cygwin using MinGW or | |
| 12 | -# MinGW-w64. | |
| 11 | +# This is a makefile for use on Cygwin/Darwin/FreeBSD/Linux/Windows using | |
| 12 | +# MinGW or MinGW-w64. | |
| 13 | 13 | # |
| 14 | 14 | |
| 15 | -#### Select one of MinGW, MinGW-64 (32-bit) or MinGW-w64 (64-bit) compilers. | |
| 15 | +#### Select one of MinGW, MinGW-w64 (32-bit) or MinGW-w64 (64-bit) compilers. | |
| 16 | 16 | # By default, this is an empty string (i.e. use the native compiler). |
| 17 | 17 | # |
| 18 | 18 | PREFIX = |
| 19 | 19 | # PREFIX = mingw32- |
| 20 | 20 | # PREFIX = i686-pc-mingw32- |
| @@ -657,11 +657,11 @@ | ||
| 657 | 657 | ifdef FOSSIL_ENABLE_TCL |
| 658 | 658 | EXTRAOBJ += $(OBJDIR)/th_tcl.o |
| 659 | 659 | endif |
| 660 | 660 | |
| 661 | 661 | zlib: |
| 662 | - make -C $(ZLIBDIR) PREFIX=$(PREFIX) -f win32/Makefile.gcc libz.a | |
| 662 | + $(MAKE) -C $(ZLIBDIR) PREFIX=$(PREFIX) -f win32/Makefile.gcc libz.a | |
| 663 | 663 | |
| 664 | 664 | $(APPNAME): $(OBJDIR)/headers $(OBJ) $(EXTRAOBJ) $(OBJDIR)/fossil.o zlib |
| 665 | 665 | $(TCC) -o $(APPNAME) $(OBJ) $(EXTRAOBJ) $(LIB) $(OBJDIR)/fossil.o |
| 666 | 666 | |
| 667 | 667 | # This rule prevents make from using its default rules to try build |
| @@ -1633,11 +1633,11 @@ | ||
| 1633 | 1633 | |
| 1634 | 1634 | $(OBJDIR)/sqlite3.o: $(SRCDIR)/sqlite3.c |
| 1635 | 1635 | $(XTCC) -DSQLITE_OMIT_LOAD_EXTENSION=1 -DSQLITE_THREADSAFE=0 -DSQLITE_DEFAULT_FILE_FORMAT=4 -DSQLITE_ENABLE_STAT3 -Dlocaltime=fossil_localtime -DSQLITE_ENABLE_LOCKING_STYLE=0 -c $(SRCDIR)/sqlite3.c -o $(OBJDIR)/sqlite3.o |
| 1636 | 1636 | |
| 1637 | 1637 | $(OBJDIR)/cson_amalgamation.o: $(SRCDIR)/cson_amalgamation.c |
| 1638 | - $(XTCC) -c $(SRCDIR)/cson_amalgamation.c -o $(OBJDIR)/cson_amalgamation.o -DCSON_FOSSIL_MODE | |
| 1638 | + $(XTCC) -c $(SRCDIR)/cson_amalgamation.c -o $(OBJDIR)/cson_amalgamation.o | |
| 1639 | 1639 | |
| 1640 | 1640 | $(OBJDIR)/json.o $(OBJDIR)/json_artifact.o $(OBJDIR)/json_branch.o $(OBJDIR)/json_config.o $(OBJDIR)/json_diff.o $(OBJDIR)/json_dir.o $(OBJDIR)/jsos_finfo.o $(OBJDIR)/json_login.o $(OBJDIR)/json_query.o $(OBJDIR)/json_report.o $(OBJDIR)/json_tag.o $(OBJDIR)/json_timeline.o $(OBJDIR)/json_user.o $(OBJDIR)/json_wiki.o : $(SRCDIR)/json_detail.h |
| 1641 | 1641 | |
| 1642 | 1642 | $(OBJDIR)/shell.o: $(SRCDIR)/shell.c $(SRCDIR)/sqlite3.h |
| 1643 | 1643 | $(XTCC) -Dmain=sqlite3_shell -DSQLITE_OMIT_LOAD_EXTENSION=1 -c $(SRCDIR)/shell.c -o $(OBJDIR)/shell.o |
| 1644 | 1644 |
| --- win/Makefile.mingw | |
| +++ win/Makefile.mingw | |
| @@ -6,15 +6,15 @@ | |
| 6 | # |
| 7 | # This file is automatically generated. Instead of editing this |
| 8 | # file, edit "makemake.tcl" then run "tclsh makemake.tcl" |
| 9 | # to regenerate this file. |
| 10 | # |
| 11 | # This is a makefile for use on Windows/Linux/Darwin/Cygwin using MinGW or |
| 12 | # MinGW-w64. |
| 13 | # |
| 14 | |
| 15 | #### Select one of MinGW, MinGW-64 (32-bit) or MinGW-w64 (64-bit) compilers. |
| 16 | # By default, this is an empty string (i.e. use the native compiler). |
| 17 | # |
| 18 | PREFIX = |
| 19 | # PREFIX = mingw32- |
| 20 | # PREFIX = i686-pc-mingw32- |
| @@ -657,11 +657,11 @@ | |
| 657 | ifdef FOSSIL_ENABLE_TCL |
| 658 | EXTRAOBJ += $(OBJDIR)/th_tcl.o |
| 659 | endif |
| 660 | |
| 661 | zlib: |
| 662 | make -C $(ZLIBDIR) PREFIX=$(PREFIX) -f win32/Makefile.gcc libz.a |
| 663 | |
| 664 | $(APPNAME): $(OBJDIR)/headers $(OBJ) $(EXTRAOBJ) $(OBJDIR)/fossil.o zlib |
| 665 | $(TCC) -o $(APPNAME) $(OBJ) $(EXTRAOBJ) $(LIB) $(OBJDIR)/fossil.o |
| 666 | |
| 667 | # This rule prevents make from using its default rules to try build |
| @@ -1633,11 +1633,11 @@ | |
| 1633 | |
| 1634 | $(OBJDIR)/sqlite3.o: $(SRCDIR)/sqlite3.c |
| 1635 | $(XTCC) -DSQLITE_OMIT_LOAD_EXTENSION=1 -DSQLITE_THREADSAFE=0 -DSQLITE_DEFAULT_FILE_FORMAT=4 -DSQLITE_ENABLE_STAT3 -Dlocaltime=fossil_localtime -DSQLITE_ENABLE_LOCKING_STYLE=0 -c $(SRCDIR)/sqlite3.c -o $(OBJDIR)/sqlite3.o |
| 1636 | |
| 1637 | $(OBJDIR)/cson_amalgamation.o: $(SRCDIR)/cson_amalgamation.c |
| 1638 | $(XTCC) -c $(SRCDIR)/cson_amalgamation.c -o $(OBJDIR)/cson_amalgamation.o -DCSON_FOSSIL_MODE |
| 1639 | |
| 1640 | $(OBJDIR)/json.o $(OBJDIR)/json_artifact.o $(OBJDIR)/json_branch.o $(OBJDIR)/json_config.o $(OBJDIR)/json_diff.o $(OBJDIR)/json_dir.o $(OBJDIR)/jsos_finfo.o $(OBJDIR)/json_login.o $(OBJDIR)/json_query.o $(OBJDIR)/json_report.o $(OBJDIR)/json_tag.o $(OBJDIR)/json_timeline.o $(OBJDIR)/json_user.o $(OBJDIR)/json_wiki.o : $(SRCDIR)/json_detail.h |
| 1641 | |
| 1642 | $(OBJDIR)/shell.o: $(SRCDIR)/shell.c $(SRCDIR)/sqlite3.h |
| 1643 | $(XTCC) -Dmain=sqlite3_shell -DSQLITE_OMIT_LOAD_EXTENSION=1 -c $(SRCDIR)/shell.c -o $(OBJDIR)/shell.o |
| 1644 |
| --- win/Makefile.mingw | |
| +++ win/Makefile.mingw | |
| @@ -6,15 +6,15 @@ | |
| 6 | # |
| 7 | # This file is automatically generated. Instead of editing this |
| 8 | # file, edit "makemake.tcl" then run "tclsh makemake.tcl" |
| 9 | # to regenerate this file. |
| 10 | # |
| 11 | # This is a makefile for use on Cygwin/Darwin/FreeBSD/Linux/Windows using |
| 12 | # MinGW or MinGW-w64. |
| 13 | # |
| 14 | |
| 15 | #### Select one of MinGW, MinGW-w64 (32-bit) or MinGW-w64 (64-bit) compilers. |
| 16 | # By default, this is an empty string (i.e. use the native compiler). |
| 17 | # |
| 18 | PREFIX = |
| 19 | # PREFIX = mingw32- |
| 20 | # PREFIX = i686-pc-mingw32- |
| @@ -657,11 +657,11 @@ | |
| 657 | ifdef FOSSIL_ENABLE_TCL |
| 658 | EXTRAOBJ += $(OBJDIR)/th_tcl.o |
| 659 | endif |
| 660 | |
| 661 | zlib: |
| 662 | $(MAKE) -C $(ZLIBDIR) PREFIX=$(PREFIX) -f win32/Makefile.gcc libz.a |
| 663 | |
| 664 | $(APPNAME): $(OBJDIR)/headers $(OBJ) $(EXTRAOBJ) $(OBJDIR)/fossil.o zlib |
| 665 | $(TCC) -o $(APPNAME) $(OBJ) $(EXTRAOBJ) $(LIB) $(OBJDIR)/fossil.o |
| 666 | |
| 667 | # This rule prevents make from using its default rules to try build |
| @@ -1633,11 +1633,11 @@ | |
| 1633 | |
| 1634 | $(OBJDIR)/sqlite3.o: $(SRCDIR)/sqlite3.c |
| 1635 | $(XTCC) -DSQLITE_OMIT_LOAD_EXTENSION=1 -DSQLITE_THREADSAFE=0 -DSQLITE_DEFAULT_FILE_FORMAT=4 -DSQLITE_ENABLE_STAT3 -Dlocaltime=fossil_localtime -DSQLITE_ENABLE_LOCKING_STYLE=0 -c $(SRCDIR)/sqlite3.c -o $(OBJDIR)/sqlite3.o |
| 1636 | |
| 1637 | $(OBJDIR)/cson_amalgamation.o: $(SRCDIR)/cson_amalgamation.c |
| 1638 | $(XTCC) -c $(SRCDIR)/cson_amalgamation.c -o $(OBJDIR)/cson_amalgamation.o |
| 1639 | |
| 1640 | $(OBJDIR)/json.o $(OBJDIR)/json_artifact.o $(OBJDIR)/json_branch.o $(OBJDIR)/json_config.o $(OBJDIR)/json_diff.o $(OBJDIR)/json_dir.o $(OBJDIR)/jsos_finfo.o $(OBJDIR)/json_login.o $(OBJDIR)/json_query.o $(OBJDIR)/json_report.o $(OBJDIR)/json_tag.o $(OBJDIR)/json_timeline.o $(OBJDIR)/json_user.o $(OBJDIR)/json_wiki.o : $(SRCDIR)/json_detail.h |
| 1641 | |
| 1642 | $(OBJDIR)/shell.o: $(SRCDIR)/shell.c $(SRCDIR)/sqlite3.h |
| 1643 | $(XTCC) -Dmain=sqlite3_shell -DSQLITE_OMIT_LOAD_EXTENSION=1 -c $(SRCDIR)/shell.c -o $(OBJDIR)/shell.o |
| 1644 |
+5
-5
| --- win/Makefile.mingw.mistachkin | ||
| +++ win/Makefile.mingw.mistachkin | ||
| @@ -6,15 +6,15 @@ | ||
| 6 | 6 | # |
| 7 | 7 | # This file is automatically generated. Instead of editing this |
| 8 | 8 | # file, edit "makemake.tcl" then run "tclsh makemake.tcl" |
| 9 | 9 | # to regenerate this file. |
| 10 | 10 | # |
| 11 | -# This is a makefile for use on Windows/Linux/Darwin/Cygwin using MinGW or | |
| 12 | -# MinGW-w64. | |
| 11 | +# This is a makefile for use on Cygwin/Darwin/FreeBSD/Linux/Windows using | |
| 12 | +# MinGW or MinGW-w64. | |
| 13 | 13 | # |
| 14 | 14 | |
| 15 | -#### Select one of MinGW, MinGW-64 (32-bit) or MinGW-w64 (64-bit) compilers. | |
| 15 | +#### Select one of MinGW, MinGW-w64 (32-bit) or MinGW-w64 (64-bit) compilers. | |
| 16 | 16 | # By default, this is an empty string (i.e. use the native compiler). |
| 17 | 17 | # |
| 18 | 18 | PREFIX = |
| 19 | 19 | # PREFIX = mingw32- |
| 20 | 20 | # PREFIX = i686-pc-mingw32- |
| @@ -657,11 +657,11 @@ | ||
| 657 | 657 | ifdef FOSSIL_ENABLE_TCL |
| 658 | 658 | EXTRAOBJ += $(OBJDIR)/th_tcl.o |
| 659 | 659 | endif |
| 660 | 660 | |
| 661 | 661 | zlib: |
| 662 | - make -C $(ZLIBDIR) PREFIX=$(PREFIX) -f win32/Makefile.gcc libz.a | |
| 662 | + $(MAKE) -C $(ZLIBDIR) PREFIX=$(PREFIX) -f win32/Makefile.gcc libz.a | |
| 663 | 663 | |
| 664 | 664 | $(APPNAME): $(OBJDIR)/headers $(OBJ) $(EXTRAOBJ) $(OBJDIR)/fossil.o zlib |
| 665 | 665 | $(TCC) -o $(APPNAME) $(OBJ) $(EXTRAOBJ) $(LIB) $(OBJDIR)/fossil.o |
| 666 | 666 | |
| 667 | 667 | # This rule prevents make from using its default rules to try build |
| @@ -1633,11 +1633,11 @@ | ||
| 1633 | 1633 | |
| 1634 | 1634 | $(OBJDIR)/sqlite3.o: $(SRCDIR)/sqlite3.c |
| 1635 | 1635 | $(XTCC) -DSQLITE_OMIT_LOAD_EXTENSION=1 -DSQLITE_THREADSAFE=0 -DSQLITE_DEFAULT_FILE_FORMAT=4 -DSQLITE_ENABLE_STAT3 -Dlocaltime=fossil_localtime -DSQLITE_ENABLE_LOCKING_STYLE=0 -c $(SRCDIR)/sqlite3.c -o $(OBJDIR)/sqlite3.o |
| 1636 | 1636 | |
| 1637 | 1637 | $(OBJDIR)/cson_amalgamation.o: $(SRCDIR)/cson_amalgamation.c |
| 1638 | - $(XTCC) -c $(SRCDIR)/cson_amalgamation.c -o $(OBJDIR)/cson_amalgamation.o -DCSON_FOSSIL_MODE | |
| 1638 | + $(XTCC) -c $(SRCDIR)/cson_amalgamation.c -o $(OBJDIR)/cson_amalgamation.o | |
| 1639 | 1639 | |
| 1640 | 1640 | $(OBJDIR)/json.o $(OBJDIR)/json_artifact.o $(OBJDIR)/json_branch.o $(OBJDIR)/json_config.o $(OBJDIR)/json_diff.o $(OBJDIR)/json_dir.o $(OBJDIR)/jsos_finfo.o $(OBJDIR)/json_login.o $(OBJDIR)/json_query.o $(OBJDIR)/json_report.o $(OBJDIR)/json_tag.o $(OBJDIR)/json_timeline.o $(OBJDIR)/json_user.o $(OBJDIR)/json_wiki.o : $(SRCDIR)/json_detail.h |
| 1641 | 1641 | |
| 1642 | 1642 | $(OBJDIR)/shell.o: $(SRCDIR)/shell.c $(SRCDIR)/sqlite3.h |
| 1643 | 1643 | $(XTCC) -Dmain=sqlite3_shell -DSQLITE_OMIT_LOAD_EXTENSION=1 -c $(SRCDIR)/shell.c -o $(OBJDIR)/shell.o |
| 1644 | 1644 |
| --- win/Makefile.mingw.mistachkin | |
| +++ win/Makefile.mingw.mistachkin | |
| @@ -6,15 +6,15 @@ | |
| 6 | # |
| 7 | # This file is automatically generated. Instead of editing this |
| 8 | # file, edit "makemake.tcl" then run "tclsh makemake.tcl" |
| 9 | # to regenerate this file. |
| 10 | # |
| 11 | # This is a makefile for use on Windows/Linux/Darwin/Cygwin using MinGW or |
| 12 | # MinGW-w64. |
| 13 | # |
| 14 | |
| 15 | #### Select one of MinGW, MinGW-64 (32-bit) or MinGW-w64 (64-bit) compilers. |
| 16 | # By default, this is an empty string (i.e. use the native compiler). |
| 17 | # |
| 18 | PREFIX = |
| 19 | # PREFIX = mingw32- |
| 20 | # PREFIX = i686-pc-mingw32- |
| @@ -657,11 +657,11 @@ | |
| 657 | ifdef FOSSIL_ENABLE_TCL |
| 658 | EXTRAOBJ += $(OBJDIR)/th_tcl.o |
| 659 | endif |
| 660 | |
| 661 | zlib: |
| 662 | make -C $(ZLIBDIR) PREFIX=$(PREFIX) -f win32/Makefile.gcc libz.a |
| 663 | |
| 664 | $(APPNAME): $(OBJDIR)/headers $(OBJ) $(EXTRAOBJ) $(OBJDIR)/fossil.o zlib |
| 665 | $(TCC) -o $(APPNAME) $(OBJ) $(EXTRAOBJ) $(LIB) $(OBJDIR)/fossil.o |
| 666 | |
| 667 | # This rule prevents make from using its default rules to try build |
| @@ -1633,11 +1633,11 @@ | |
| 1633 | |
| 1634 | $(OBJDIR)/sqlite3.o: $(SRCDIR)/sqlite3.c |
| 1635 | $(XTCC) -DSQLITE_OMIT_LOAD_EXTENSION=1 -DSQLITE_THREADSAFE=0 -DSQLITE_DEFAULT_FILE_FORMAT=4 -DSQLITE_ENABLE_STAT3 -Dlocaltime=fossil_localtime -DSQLITE_ENABLE_LOCKING_STYLE=0 -c $(SRCDIR)/sqlite3.c -o $(OBJDIR)/sqlite3.o |
| 1636 | |
| 1637 | $(OBJDIR)/cson_amalgamation.o: $(SRCDIR)/cson_amalgamation.c |
| 1638 | $(XTCC) -c $(SRCDIR)/cson_amalgamation.c -o $(OBJDIR)/cson_amalgamation.o -DCSON_FOSSIL_MODE |
| 1639 | |
| 1640 | $(OBJDIR)/json.o $(OBJDIR)/json_artifact.o $(OBJDIR)/json_branch.o $(OBJDIR)/json_config.o $(OBJDIR)/json_diff.o $(OBJDIR)/json_dir.o $(OBJDIR)/jsos_finfo.o $(OBJDIR)/json_login.o $(OBJDIR)/json_query.o $(OBJDIR)/json_report.o $(OBJDIR)/json_tag.o $(OBJDIR)/json_timeline.o $(OBJDIR)/json_user.o $(OBJDIR)/json_wiki.o : $(SRCDIR)/json_detail.h |
| 1641 | |
| 1642 | $(OBJDIR)/shell.o: $(SRCDIR)/shell.c $(SRCDIR)/sqlite3.h |
| 1643 | $(XTCC) -Dmain=sqlite3_shell -DSQLITE_OMIT_LOAD_EXTENSION=1 -c $(SRCDIR)/shell.c -o $(OBJDIR)/shell.o |
| 1644 |
| --- win/Makefile.mingw.mistachkin | |
| +++ win/Makefile.mingw.mistachkin | |
| @@ -6,15 +6,15 @@ | |
| 6 | # |
| 7 | # This file is automatically generated. Instead of editing this |
| 8 | # file, edit "makemake.tcl" then run "tclsh makemake.tcl" |
| 9 | # to regenerate this file. |
| 10 | # |
| 11 | # This is a makefile for use on Cygwin/Darwin/FreeBSD/Linux/Windows using |
| 12 | # MinGW or MinGW-w64. |
| 13 | # |
| 14 | |
| 15 | #### Select one of MinGW, MinGW-w64 (32-bit) or MinGW-w64 (64-bit) compilers. |
| 16 | # By default, this is an empty string (i.e. use the native compiler). |
| 17 | # |
| 18 | PREFIX = |
| 19 | # PREFIX = mingw32- |
| 20 | # PREFIX = i686-pc-mingw32- |
| @@ -657,11 +657,11 @@ | |
| 657 | ifdef FOSSIL_ENABLE_TCL |
| 658 | EXTRAOBJ += $(OBJDIR)/th_tcl.o |
| 659 | endif |
| 660 | |
| 661 | zlib: |
| 662 | $(MAKE) -C $(ZLIBDIR) PREFIX=$(PREFIX) -f win32/Makefile.gcc libz.a |
| 663 | |
| 664 | $(APPNAME): $(OBJDIR)/headers $(OBJ) $(EXTRAOBJ) $(OBJDIR)/fossil.o zlib |
| 665 | $(TCC) -o $(APPNAME) $(OBJ) $(EXTRAOBJ) $(LIB) $(OBJDIR)/fossil.o |
| 666 | |
| 667 | # This rule prevents make from using its default rules to try build |
| @@ -1633,11 +1633,11 @@ | |
| 1633 | |
| 1634 | $(OBJDIR)/sqlite3.o: $(SRCDIR)/sqlite3.c |
| 1635 | $(XTCC) -DSQLITE_OMIT_LOAD_EXTENSION=1 -DSQLITE_THREADSAFE=0 -DSQLITE_DEFAULT_FILE_FORMAT=4 -DSQLITE_ENABLE_STAT3 -Dlocaltime=fossil_localtime -DSQLITE_ENABLE_LOCKING_STYLE=0 -c $(SRCDIR)/sqlite3.c -o $(OBJDIR)/sqlite3.o |
| 1636 | |
| 1637 | $(OBJDIR)/cson_amalgamation.o: $(SRCDIR)/cson_amalgamation.c |
| 1638 | $(XTCC) -c $(SRCDIR)/cson_amalgamation.c -o $(OBJDIR)/cson_amalgamation.o |
| 1639 | |
| 1640 | $(OBJDIR)/json.o $(OBJDIR)/json_artifact.o $(OBJDIR)/json_branch.o $(OBJDIR)/json_config.o $(OBJDIR)/json_diff.o $(OBJDIR)/json_dir.o $(OBJDIR)/jsos_finfo.o $(OBJDIR)/json_login.o $(OBJDIR)/json_query.o $(OBJDIR)/json_report.o $(OBJDIR)/json_tag.o $(OBJDIR)/json_timeline.o $(OBJDIR)/json_user.o $(OBJDIR)/json_wiki.o : $(SRCDIR)/json_detail.h |
| 1641 | |
| 1642 | $(OBJDIR)/shell.o: $(SRCDIR)/shell.c $(SRCDIR)/sqlite3.h |
| 1643 | $(XTCC) -Dmain=sqlite3_shell -DSQLITE_OMIT_LOAD_EXTENSION=1 -c $(SRCDIR)/shell.c -o $(OBJDIR)/shell.o |
| 1644 |
+30
-7
| --- win/Makefile.msc | ||
| +++ win/Makefile.msc | ||
| @@ -22,18 +22,35 @@ | ||
| 22 | 22 | |
| 23 | 23 | # zlib options |
| 24 | 24 | ZINCDIR = $(B)\compat\zlib |
| 25 | 25 | ZLIBDIR = $(B)\compat\zlib |
| 26 | 26 | ZLIB = zlib.lib |
| 27 | + | |
| 28 | +# Uncomment to enable JSON API | |
| 29 | +# FOSSIL_ENABLE_JSON = 1 | |
| 30 | + | |
| 31 | +# Uncomment to enable markdown support | |
| 32 | +# FOSSIL_ENABLE_MARKDOWN = 1 | |
| 27 | 33 | |
| 28 | 34 | INCL = -I. -I$(SRCDIR) -I$B\win\include -I$(ZINCDIR) |
| 29 | 35 | |
| 30 | 36 | CFLAGS = -nologo -MT -O2 |
| 31 | 37 | BCC = $(CC) $(CFLAGS) |
| 32 | 38 | TCC = $(CC) -c $(CFLAGS) $(MSCDEF) $(SSL) $(INCL) |
| 39 | +RCC = rc -D_WIN32 -D_MSC_VER $(INCL) | |
| 33 | 40 | LIBS = $(ZLIB) ws2_32.lib advapi32.lib $(SSLLIB) |
| 34 | 41 | LIBDIR = -LIBPATH:$(ZLIBDIR) |
| 42 | + | |
| 43 | +!ifdef FOSSIL_ENABLE_JSON | |
| 44 | +TCC = $(TCC) -DFOSSIL_ENABLE_JSON | |
| 45 | +RCC = $(RCC) -DFOSSIL_ENABLE_JSON | |
| 46 | +!endif | |
| 47 | + | |
| 48 | +!ifdef FOSSIL_ENABLE_MARKDOWN | |
| 49 | +TCC = $(TCC) -DFOSSIL_ENABLE_MARKDOWN | |
| 50 | +RCC = $(RCC) -DFOSSIL_ENABLE_MARKDOWN | |
| 51 | +!endif | |
| 35 | 52 | |
| 36 | 53 | SQLITE_OPTIONS = /DSQLITE_OMIT_LOAD_EXTENSION=1 \ |
| 37 | 54 | /DSQLITE_THREADSAFE=0 \ |
| 38 | 55 | /DSQLITE_DEFAULT_FILE_FORMAT=4 \ |
| 39 | 56 | /DSQLITE_ENABLE_STAT3 \ |
| @@ -160,10 +177,11 @@ | ||
| 160 | 177 | $(OX)\clearsign$O \ |
| 161 | 178 | $(OX)\clone$O \ |
| 162 | 179 | $(OX)\comformat$O \ |
| 163 | 180 | $(OX)\configure$O \ |
| 164 | 181 | $(OX)\content$O \ |
| 182 | + $(OX)\cson_amalgamation$O \ | |
| 165 | 183 | $(OX)\db$O \ |
| 166 | 184 | $(OX)\delta$O \ |
| 167 | 185 | $(OX)\deltacmd$O \ |
| 168 | 186 | $(OX)\descendants$O \ |
| 169 | 187 | $(OX)\diff$O \ |
| @@ -219,19 +237,23 @@ | ||
| 219 | 237 | $(OX)\rss$O \ |
| 220 | 238 | $(OX)\schema$O \ |
| 221 | 239 | $(OX)\search$O \ |
| 222 | 240 | $(OX)\setup$O \ |
| 223 | 241 | $(OX)\sha1$O \ |
| 242 | + $(OX)\shell$O \ | |
| 224 | 243 | $(OX)\shun$O \ |
| 225 | 244 | $(OX)\skins$O \ |
| 226 | 245 | $(OX)\sqlcmd$O \ |
| 246 | + $(OX)\sqlite3$O \ | |
| 227 | 247 | $(OX)\stash$O \ |
| 228 | 248 | $(OX)\stat$O \ |
| 229 | 249 | $(OX)\style$O \ |
| 230 | 250 | $(OX)\sync$O \ |
| 231 | 251 | $(OX)\tag$O \ |
| 232 | 252 | $(OX)\tar$O \ |
| 253 | + $(OX)\th$O \ | |
| 254 | + $(OX)\th_lang$O \ | |
| 233 | 255 | $(OX)\th_main$O \ |
| 234 | 256 | $(OX)\timeline$O \ |
| 235 | 257 | $(OX)\tkt$O \ |
| 236 | 258 | $(OX)\tktsetup$O \ |
| 237 | 259 | $(OX)\undo$O \ |
| @@ -247,14 +269,11 @@ | ||
| 247 | 269 | $(OX)\winhttp$O \ |
| 248 | 270 | $(OX)\wysiwyg$O \ |
| 249 | 271 | $(OX)\xfer$O \ |
| 250 | 272 | $(OX)\xfersetup$O \ |
| 251 | 273 | $(OX)\zip$O \ |
| 252 | - $(OX)\shell$O \ | |
| 253 | - $(OX)\sqlite3$O \ | |
| 254 | - $(OX)\th$O \ | |
| 255 | - $(OX)\th_lang$O | |
| 274 | + $(OX)\fossil.res | |
| 256 | 275 | |
| 257 | 276 | APPNAME = $(OX)\fossil$(E) |
| 258 | 277 | |
| 259 | 278 | all: $(OX) $(APPNAME) |
| 260 | 279 | |
| @@ -262,11 +281,11 @@ | ||
| 262 | 281 | @echo Building zlib from "$(ZLIBDIR)"... |
| 263 | 282 | @pushd "$(ZLIBDIR)" && nmake /f win32\Makefile.msc $(ZLIB) && popd |
| 264 | 283 | |
| 265 | 284 | $(APPNAME) : translate$E mkindex$E headers $(OBJ) $(OX)\linkopts zlib |
| 266 | 285 | cd $(OX) |
| 267 | - link /NODEFAULTLIB:msvcrt -OUT:$@ $(LIBDIR) Wsetargv.obj @linkopts | |
| 286 | + link /NODEFAULTLIB:msvcrt -OUT:$@ $(LIBDIR) Wsetargv.obj fossil.res @linkopts | |
| 268 | 287 | |
| 269 | 288 | $(OX)\linkopts: $B\win\Makefile.msc |
| 270 | 289 | echo $(OX)\add.obj > $@ |
| 271 | 290 | echo $(OX)\allrepo.obj >> $@ |
| 272 | 291 | echo $(OX)\attach.obj >> $@ |
| @@ -282,10 +301,11 @@ | ||
| 282 | 301 | echo $(OX)\clearsign.obj >> $@ |
| 283 | 302 | echo $(OX)\clone.obj >> $@ |
| 284 | 303 | echo $(OX)\comformat.obj >> $@ |
| 285 | 304 | echo $(OX)\configure.obj >> $@ |
| 286 | 305 | echo $(OX)\content.obj >> $@ |
| 306 | + echo $(OX)\cson_amalgamation.obj >> $@ | |
| 287 | 307 | echo $(OX)\db.obj >> $@ |
| 288 | 308 | echo $(OX)\delta.obj >> $@ |
| 289 | 309 | echo $(OX)\deltacmd.obj >> $@ |
| 290 | 310 | echo $(OX)\descendants.obj >> $@ |
| 291 | 311 | echo $(OX)\diff.obj >> $@ |
| @@ -407,12 +427,12 @@ | ||
| 407 | 427 | $(OX)\th_lang$O : $(SRCDIR)\th_lang.c |
| 408 | 428 | $(TCC) /Fo$@ -c $** |
| 409 | 429 | |
| 410 | 430 | VERSION.h : mkversion$E $B\manifest.uuid $B\manifest $B\VERSION |
| 411 | 431 | $** > $@ |
| 412 | -$(OBJDIR)\cson_amalgamation.h : $(SRCDIR)\cson_amalgamation.h | |
| 413 | - cp $(SRCDIR)\cson_amalgamation.h $@ | |
| 432 | +$(OX)\cson_amalgamation$O : $(SRCDIR)\cson_amalgamation.c | |
| 433 | + $(TCC) /Fo$@ -c $** | |
| 414 | 434 | |
| 415 | 435 | page_index.h: mkindex$E $(SRC) |
| 416 | 436 | $** > $@ |
| 417 | 437 | |
| 418 | 438 | clean: |
| @@ -422,10 +442,11 @@ | ||
| 422 | 442 | -del *.h |
| 423 | 443 | -del *.map |
| 424 | 444 | -del *.manifest |
| 425 | 445 | -del headers |
| 426 | 446 | -del linkopts |
| 447 | + -del *.res | |
| 427 | 448 | |
| 428 | 449 | realclean: clean |
| 429 | 450 | -del $(APPNAME) |
| 430 | 451 | -del translate$E |
| 431 | 452 | -del mkindex$E |
| @@ -1070,10 +1091,12 @@ | ||
| 1070 | 1091 | $(TCC) /Fo$@ -c zip_.c |
| 1071 | 1092 | |
| 1072 | 1093 | zip_.c : $(SRCDIR)\zip.c |
| 1073 | 1094 | translate$E $** > $@ |
| 1074 | 1095 | |
| 1096 | +fossil.res : $B\win\fossil.rc | |
| 1097 | + $(RCC) -fo $@ $** | |
| 1075 | 1098 | headers: makeheaders$E page_index.h VERSION.h |
| 1076 | 1099 | makeheaders$E add_.c:add.h \ |
| 1077 | 1100 | allrepo_.c:allrepo.h \ |
| 1078 | 1101 | attach_.c:attach.h \ |
| 1079 | 1102 | bag_.c:bag.h \ |
| 1080 | 1103 |
| --- win/Makefile.msc | |
| +++ win/Makefile.msc | |
| @@ -22,18 +22,35 @@ | |
| 22 | |
| 23 | # zlib options |
| 24 | ZINCDIR = $(B)\compat\zlib |
| 25 | ZLIBDIR = $(B)\compat\zlib |
| 26 | ZLIB = zlib.lib |
| 27 | |
| 28 | INCL = -I. -I$(SRCDIR) -I$B\win\include -I$(ZINCDIR) |
| 29 | |
| 30 | CFLAGS = -nologo -MT -O2 |
| 31 | BCC = $(CC) $(CFLAGS) |
| 32 | TCC = $(CC) -c $(CFLAGS) $(MSCDEF) $(SSL) $(INCL) |
| 33 | LIBS = $(ZLIB) ws2_32.lib advapi32.lib $(SSLLIB) |
| 34 | LIBDIR = -LIBPATH:$(ZLIBDIR) |
| 35 | |
| 36 | SQLITE_OPTIONS = /DSQLITE_OMIT_LOAD_EXTENSION=1 \ |
| 37 | /DSQLITE_THREADSAFE=0 \ |
| 38 | /DSQLITE_DEFAULT_FILE_FORMAT=4 \ |
| 39 | /DSQLITE_ENABLE_STAT3 \ |
| @@ -160,10 +177,11 @@ | |
| 160 | $(OX)\clearsign$O \ |
| 161 | $(OX)\clone$O \ |
| 162 | $(OX)\comformat$O \ |
| 163 | $(OX)\configure$O \ |
| 164 | $(OX)\content$O \ |
| 165 | $(OX)\db$O \ |
| 166 | $(OX)\delta$O \ |
| 167 | $(OX)\deltacmd$O \ |
| 168 | $(OX)\descendants$O \ |
| 169 | $(OX)\diff$O \ |
| @@ -219,19 +237,23 @@ | |
| 219 | $(OX)\rss$O \ |
| 220 | $(OX)\schema$O \ |
| 221 | $(OX)\search$O \ |
| 222 | $(OX)\setup$O \ |
| 223 | $(OX)\sha1$O \ |
| 224 | $(OX)\shun$O \ |
| 225 | $(OX)\skins$O \ |
| 226 | $(OX)\sqlcmd$O \ |
| 227 | $(OX)\stash$O \ |
| 228 | $(OX)\stat$O \ |
| 229 | $(OX)\style$O \ |
| 230 | $(OX)\sync$O \ |
| 231 | $(OX)\tag$O \ |
| 232 | $(OX)\tar$O \ |
| 233 | $(OX)\th_main$O \ |
| 234 | $(OX)\timeline$O \ |
| 235 | $(OX)\tkt$O \ |
| 236 | $(OX)\tktsetup$O \ |
| 237 | $(OX)\undo$O \ |
| @@ -247,14 +269,11 @@ | |
| 247 | $(OX)\winhttp$O \ |
| 248 | $(OX)\wysiwyg$O \ |
| 249 | $(OX)\xfer$O \ |
| 250 | $(OX)\xfersetup$O \ |
| 251 | $(OX)\zip$O \ |
| 252 | $(OX)\shell$O \ |
| 253 | $(OX)\sqlite3$O \ |
| 254 | $(OX)\th$O \ |
| 255 | $(OX)\th_lang$O |
| 256 | |
| 257 | APPNAME = $(OX)\fossil$(E) |
| 258 | |
| 259 | all: $(OX) $(APPNAME) |
| 260 | |
| @@ -262,11 +281,11 @@ | |
| 262 | @echo Building zlib from "$(ZLIBDIR)"... |
| 263 | @pushd "$(ZLIBDIR)" && nmake /f win32\Makefile.msc $(ZLIB) && popd |
| 264 | |
| 265 | $(APPNAME) : translate$E mkindex$E headers $(OBJ) $(OX)\linkopts zlib |
| 266 | cd $(OX) |
| 267 | link /NODEFAULTLIB:msvcrt -OUT:$@ $(LIBDIR) Wsetargv.obj @linkopts |
| 268 | |
| 269 | $(OX)\linkopts: $B\win\Makefile.msc |
| 270 | echo $(OX)\add.obj > $@ |
| 271 | echo $(OX)\allrepo.obj >> $@ |
| 272 | echo $(OX)\attach.obj >> $@ |
| @@ -282,10 +301,11 @@ | |
| 282 | echo $(OX)\clearsign.obj >> $@ |
| 283 | echo $(OX)\clone.obj >> $@ |
| 284 | echo $(OX)\comformat.obj >> $@ |
| 285 | echo $(OX)\configure.obj >> $@ |
| 286 | echo $(OX)\content.obj >> $@ |
| 287 | echo $(OX)\db.obj >> $@ |
| 288 | echo $(OX)\delta.obj >> $@ |
| 289 | echo $(OX)\deltacmd.obj >> $@ |
| 290 | echo $(OX)\descendants.obj >> $@ |
| 291 | echo $(OX)\diff.obj >> $@ |
| @@ -407,12 +427,12 @@ | |
| 407 | $(OX)\th_lang$O : $(SRCDIR)\th_lang.c |
| 408 | $(TCC) /Fo$@ -c $** |
| 409 | |
| 410 | VERSION.h : mkversion$E $B\manifest.uuid $B\manifest $B\VERSION |
| 411 | $** > $@ |
| 412 | $(OBJDIR)\cson_amalgamation.h : $(SRCDIR)\cson_amalgamation.h |
| 413 | cp $(SRCDIR)\cson_amalgamation.h $@ |
| 414 | |
| 415 | page_index.h: mkindex$E $(SRC) |
| 416 | $** > $@ |
| 417 | |
| 418 | clean: |
| @@ -422,10 +442,11 @@ | |
| 422 | -del *.h |
| 423 | -del *.map |
| 424 | -del *.manifest |
| 425 | -del headers |
| 426 | -del linkopts |
| 427 | |
| 428 | realclean: clean |
| 429 | -del $(APPNAME) |
| 430 | -del translate$E |
| 431 | -del mkindex$E |
| @@ -1070,10 +1091,12 @@ | |
| 1070 | $(TCC) /Fo$@ -c zip_.c |
| 1071 | |
| 1072 | zip_.c : $(SRCDIR)\zip.c |
| 1073 | translate$E $** > $@ |
| 1074 | |
| 1075 | headers: makeheaders$E page_index.h VERSION.h |
| 1076 | makeheaders$E add_.c:add.h \ |
| 1077 | allrepo_.c:allrepo.h \ |
| 1078 | attach_.c:attach.h \ |
| 1079 | bag_.c:bag.h \ |
| 1080 |
| --- win/Makefile.msc | |
| +++ win/Makefile.msc | |
| @@ -22,18 +22,35 @@ | |
| 22 | |
| 23 | # zlib options |
| 24 | ZINCDIR = $(B)\compat\zlib |
| 25 | ZLIBDIR = $(B)\compat\zlib |
| 26 | ZLIB = zlib.lib |
| 27 | |
| 28 | # Uncomment to enable JSON API |
| 29 | # FOSSIL_ENABLE_JSON = 1 |
| 30 | |
| 31 | # Uncomment to enable markdown support |
| 32 | # FOSSIL_ENABLE_MARKDOWN = 1 |
| 33 | |
| 34 | INCL = -I. -I$(SRCDIR) -I$B\win\include -I$(ZINCDIR) |
| 35 | |
| 36 | CFLAGS = -nologo -MT -O2 |
| 37 | BCC = $(CC) $(CFLAGS) |
| 38 | TCC = $(CC) -c $(CFLAGS) $(MSCDEF) $(SSL) $(INCL) |
| 39 | RCC = rc -D_WIN32 -D_MSC_VER $(INCL) |
| 40 | LIBS = $(ZLIB) ws2_32.lib advapi32.lib $(SSLLIB) |
| 41 | LIBDIR = -LIBPATH:$(ZLIBDIR) |
| 42 | |
| 43 | !ifdef FOSSIL_ENABLE_JSON |
| 44 | TCC = $(TCC) -DFOSSIL_ENABLE_JSON |
| 45 | RCC = $(RCC) -DFOSSIL_ENABLE_JSON |
| 46 | !endif |
| 47 | |
| 48 | !ifdef FOSSIL_ENABLE_MARKDOWN |
| 49 | TCC = $(TCC) -DFOSSIL_ENABLE_MARKDOWN |
| 50 | RCC = $(RCC) -DFOSSIL_ENABLE_MARKDOWN |
| 51 | !endif |
| 52 | |
| 53 | SQLITE_OPTIONS = /DSQLITE_OMIT_LOAD_EXTENSION=1 \ |
| 54 | /DSQLITE_THREADSAFE=0 \ |
| 55 | /DSQLITE_DEFAULT_FILE_FORMAT=4 \ |
| 56 | /DSQLITE_ENABLE_STAT3 \ |
| @@ -160,10 +177,11 @@ | |
| 177 | $(OX)\clearsign$O \ |
| 178 | $(OX)\clone$O \ |
| 179 | $(OX)\comformat$O \ |
| 180 | $(OX)\configure$O \ |
| 181 | $(OX)\content$O \ |
| 182 | $(OX)\cson_amalgamation$O \ |
| 183 | $(OX)\db$O \ |
| 184 | $(OX)\delta$O \ |
| 185 | $(OX)\deltacmd$O \ |
| 186 | $(OX)\descendants$O \ |
| 187 | $(OX)\diff$O \ |
| @@ -219,19 +237,23 @@ | |
| 237 | $(OX)\rss$O \ |
| 238 | $(OX)\schema$O \ |
| 239 | $(OX)\search$O \ |
| 240 | $(OX)\setup$O \ |
| 241 | $(OX)\sha1$O \ |
| 242 | $(OX)\shell$O \ |
| 243 | $(OX)\shun$O \ |
| 244 | $(OX)\skins$O \ |
| 245 | $(OX)\sqlcmd$O \ |
| 246 | $(OX)\sqlite3$O \ |
| 247 | $(OX)\stash$O \ |
| 248 | $(OX)\stat$O \ |
| 249 | $(OX)\style$O \ |
| 250 | $(OX)\sync$O \ |
| 251 | $(OX)\tag$O \ |
| 252 | $(OX)\tar$O \ |
| 253 | $(OX)\th$O \ |
| 254 | $(OX)\th_lang$O \ |
| 255 | $(OX)\th_main$O \ |
| 256 | $(OX)\timeline$O \ |
| 257 | $(OX)\tkt$O \ |
| 258 | $(OX)\tktsetup$O \ |
| 259 | $(OX)\undo$O \ |
| @@ -247,14 +269,11 @@ | |
| 269 | $(OX)\winhttp$O \ |
| 270 | $(OX)\wysiwyg$O \ |
| 271 | $(OX)\xfer$O \ |
| 272 | $(OX)\xfersetup$O \ |
| 273 | $(OX)\zip$O \ |
| 274 | $(OX)\fossil.res |
| 275 | |
| 276 | APPNAME = $(OX)\fossil$(E) |
| 277 | |
| 278 | all: $(OX) $(APPNAME) |
| 279 | |
| @@ -262,11 +281,11 @@ | |
| 281 | @echo Building zlib from "$(ZLIBDIR)"... |
| 282 | @pushd "$(ZLIBDIR)" && nmake /f win32\Makefile.msc $(ZLIB) && popd |
| 283 | |
| 284 | $(APPNAME) : translate$E mkindex$E headers $(OBJ) $(OX)\linkopts zlib |
| 285 | cd $(OX) |
| 286 | link /NODEFAULTLIB:msvcrt -OUT:$@ $(LIBDIR) Wsetargv.obj fossil.res @linkopts |
| 287 | |
| 288 | $(OX)\linkopts: $B\win\Makefile.msc |
| 289 | echo $(OX)\add.obj > $@ |
| 290 | echo $(OX)\allrepo.obj >> $@ |
| 291 | echo $(OX)\attach.obj >> $@ |
| @@ -282,10 +301,11 @@ | |
| 301 | echo $(OX)\clearsign.obj >> $@ |
| 302 | echo $(OX)\clone.obj >> $@ |
| 303 | echo $(OX)\comformat.obj >> $@ |
| 304 | echo $(OX)\configure.obj >> $@ |
| 305 | echo $(OX)\content.obj >> $@ |
| 306 | echo $(OX)\cson_amalgamation.obj >> $@ |
| 307 | echo $(OX)\db.obj >> $@ |
| 308 | echo $(OX)\delta.obj >> $@ |
| 309 | echo $(OX)\deltacmd.obj >> $@ |
| 310 | echo $(OX)\descendants.obj >> $@ |
| 311 | echo $(OX)\diff.obj >> $@ |
| @@ -407,12 +427,12 @@ | |
| 427 | $(OX)\th_lang$O : $(SRCDIR)\th_lang.c |
| 428 | $(TCC) /Fo$@ -c $** |
| 429 | |
| 430 | VERSION.h : mkversion$E $B\manifest.uuid $B\manifest $B\VERSION |
| 431 | $** > $@ |
| 432 | $(OX)\cson_amalgamation$O : $(SRCDIR)\cson_amalgamation.c |
| 433 | $(TCC) /Fo$@ -c $** |
| 434 | |
| 435 | page_index.h: mkindex$E $(SRC) |
| 436 | $** > $@ |
| 437 | |
| 438 | clean: |
| @@ -422,10 +442,11 @@ | |
| 442 | -del *.h |
| 443 | -del *.map |
| 444 | -del *.manifest |
| 445 | -del headers |
| 446 | -del linkopts |
| 447 | -del *.res |
| 448 | |
| 449 | realclean: clean |
| 450 | -del $(APPNAME) |
| 451 | -del translate$E |
| 452 | -del mkindex$E |
| @@ -1070,10 +1091,12 @@ | |
| 1091 | $(TCC) /Fo$@ -c zip_.c |
| 1092 | |
| 1093 | zip_.c : $(SRCDIR)\zip.c |
| 1094 | translate$E $** > $@ |
| 1095 | |
| 1096 | fossil.res : $B\win\fossil.rc |
| 1097 | $(RCC) -fo $@ $** |
| 1098 | headers: makeheaders$E page_index.h VERSION.h |
| 1099 | makeheaders$E add_.c:add.h \ |
| 1100 | allrepo_.c:allrepo.h \ |
| 1101 | attach_.c:attach.h \ |
| 1102 | bag_.c:bag.h \ |
| 1103 |
+3
-3
| --- win/include/dirent.h | ||
| +++ win/include/dirent.h | ||
| @@ -866,18 +866,18 @@ | ||
| 866 | 866 | /* Set errno variable */ |
| 867 | 867 | static void |
| 868 | 868 | dirent_set_errno( |
| 869 | 869 | int error) |
| 870 | 870 | { |
| 871 | -#if defined(_MSC_VER) | |
| 871 | +#if defined(_MSC_VER) && _MSC_VER >= 1400 | |
| 872 | 872 | |
| 873 | - /* Microsoft Visual Studio */ | |
| 873 | + /* Microsoft Visual Studio 2005 and later */ | |
| 874 | 874 | _set_errno (error); |
| 875 | 875 | |
| 876 | 876 | #else |
| 877 | 877 | |
| 878 | - /* Non-Microsoft compiler */ | |
| 878 | + /* Non-Microsoft compiler or older Microsoft compiler */ | |
| 879 | 879 | errno = error; |
| 880 | 880 | |
| 881 | 881 | #endif |
| 882 | 882 | } |
| 883 | 883 | |
| 884 | 884 |
| --- win/include/dirent.h | |
| +++ win/include/dirent.h | |
| @@ -866,18 +866,18 @@ | |
| 866 | /* Set errno variable */ |
| 867 | static void |
| 868 | dirent_set_errno( |
| 869 | int error) |
| 870 | { |
| 871 | #if defined(_MSC_VER) |
| 872 | |
| 873 | /* Microsoft Visual Studio */ |
| 874 | _set_errno (error); |
| 875 | |
| 876 | #else |
| 877 | |
| 878 | /* Non-Microsoft compiler */ |
| 879 | errno = error; |
| 880 | |
| 881 | #endif |
| 882 | } |
| 883 | |
| 884 |
| --- win/include/dirent.h | |
| +++ win/include/dirent.h | |
| @@ -866,18 +866,18 @@ | |
| 866 | /* Set errno variable */ |
| 867 | static void |
| 868 | dirent_set_errno( |
| 869 | int error) |
| 870 | { |
| 871 | #if defined(_MSC_VER) && _MSC_VER >= 1400 |
| 872 | |
| 873 | /* Microsoft Visual Studio 2005 and later */ |
| 874 | _set_errno (error); |
| 875 | |
| 876 | #else |
| 877 | |
| 878 | /* Non-Microsoft compiler or older Microsoft compiler */ |
| 879 | errno = error; |
| 880 | |
| 881 | #endif |
| 882 | } |
| 883 | |
| 884 |
+2
-2
| --- www/build.wiki | ||
| +++ www/build.wiki | ||
| @@ -54,11 +54,11 @@ | ||
| 54 | 54 | </ol> |
| 55 | 55 | |
| 56 | 56 | <h2>2.0 Compiling</h2> |
| 57 | 57 | |
| 58 | 58 | <ol> |
| 59 | -<li value="6"> | |
| 59 | +<li value="5"> | |
| 60 | 60 | <p>Unpack the ZIP or tarball you downloaded then |
| 61 | 61 | <b>cd</b> into the directory created.</p></li> |
| 62 | 62 | |
| 63 | 63 | <li><i>(Optional, unix only)</i> |
| 64 | 64 | Run <b>./configure</b> to construct a makefile. |
| @@ -101,11 +101,11 @@ | ||
| 101 | 101 | </ol> |
| 102 | 102 | |
| 103 | 103 | <h2>3.0 Installing</h2> |
| 104 | 104 | |
| 105 | 105 | <ol> |
| 106 | -<li value="9"> | |
| 106 | +<li value="8"> | |
| 107 | 107 | <p>The finished binary is named "fossil" (or "fossil.exe" on windows). |
| 108 | 108 | Put this binary in a |
| 109 | 109 | directory that is somewhere on your PATH environment variable. |
| 110 | 110 | It does not matter where.</p> |
| 111 | 111 | |
| 112 | 112 |
| --- www/build.wiki | |
| +++ www/build.wiki | |
| @@ -54,11 +54,11 @@ | |
| 54 | </ol> |
| 55 | |
| 56 | <h2>2.0 Compiling</h2> |
| 57 | |
| 58 | <ol> |
| 59 | <li value="6"> |
| 60 | <p>Unpack the ZIP or tarball you downloaded then |
| 61 | <b>cd</b> into the directory created.</p></li> |
| 62 | |
| 63 | <li><i>(Optional, unix only)</i> |
| 64 | Run <b>./configure</b> to construct a makefile. |
| @@ -101,11 +101,11 @@ | |
| 101 | </ol> |
| 102 | |
| 103 | <h2>3.0 Installing</h2> |
| 104 | |
| 105 | <ol> |
| 106 | <li value="9"> |
| 107 | <p>The finished binary is named "fossil" (or "fossil.exe" on windows). |
| 108 | Put this binary in a |
| 109 | directory that is somewhere on your PATH environment variable. |
| 110 | It does not matter where.</p> |
| 111 | |
| 112 |
| --- www/build.wiki | |
| +++ www/build.wiki | |
| @@ -54,11 +54,11 @@ | |
| 54 | </ol> |
| 55 | |
| 56 | <h2>2.0 Compiling</h2> |
| 57 | |
| 58 | <ol> |
| 59 | <li value="5"> |
| 60 | <p>Unpack the ZIP or tarball you downloaded then |
| 61 | <b>cd</b> into the directory created.</p></li> |
| 62 | |
| 63 | <li><i>(Optional, unix only)</i> |
| 64 | Run <b>./configure</b> to construct a makefile. |
| @@ -101,11 +101,11 @@ | |
| 101 | </ol> |
| 102 | |
| 103 | <h2>3.0 Installing</h2> |
| 104 | |
| 105 | <ol> |
| 106 | <li value="8"> |
| 107 | <p>The finished binary is named "fossil" (or "fossil.exe" on windows). |
| 108 | Put this binary in a |
| 109 | directory that is somewhere on your PATH environment variable. |
| 110 | It does not matter where.</p> |
| 111 | |
| 112 |