Fossil SCM

merge trunk

jan.nijtmans 2014-05-02 09:34 invalid-utf8 merge
Commit 39375fa3b655f9053025ed3e6fbe047a102eb03c
+3 -3
--- src/allrepo.c
+++ src/allrepo.c
@@ -155,11 +155,11 @@
155155
int dryRunFlag = 0;
156156
int showFile = find_option("showfile",0,0)!=0;
157157
int stopOnError = find_option("dontstop",0,0)==0;
158158
int rc;
159159
int nToDel = 0;
160
-
160
+
161161
dryRunFlag = find_option("dry-run","n",0)!=0;
162162
if( !dryRunFlag ){
163163
dryRunFlag = find_option("test",0,0)!=0; /* deprecated */
164164
}
165165
@@ -282,11 +282,11 @@
282282
);
283283
}
284284
db_multi_exec("CREATE TEMP TABLE todel(x TEXT)");
285285
while( db_step(&q)==SQLITE_ROW ){
286286
const char *zFilename = db_column_text(&q, 0);
287
- if( file_access(zFilename, 0)
287
+ if( file_access(zFilename, F_OK)
288288
|| !file_is_canonical(zFilename)
289289
|| (useCheckouts && file_isdir(zFilename)!=1)
290290
){
291291
db_multi_exec("INSERT INTO todel VALUES(%Q)", db_column_text(&q, 1));
292292
nToDel++;
@@ -312,11 +312,11 @@
312312
if( stopOnError && rc ){
313313
break;
314314
}
315315
}
316316
db_finalize(&q);
317
-
317
+
318318
/* If any repositories whose names appear in the ~/.fossil file could not
319319
** be found, remove those names from the ~/.fossil file.
320320
*/
321321
if( nToDel>0 ){
322322
const char *zSql = "DELETE FROM global_config WHERE name IN toDel";
323323
324324
ADDED src/cache.c
--- src/allrepo.c
+++ src/allrepo.c
@@ -155,11 +155,11 @@
155 int dryRunFlag = 0;
156 int showFile = find_option("showfile",0,0)!=0;
157 int stopOnError = find_option("dontstop",0,0)==0;
158 int rc;
159 int nToDel = 0;
160
161 dryRunFlag = find_option("dry-run","n",0)!=0;
162 if( !dryRunFlag ){
163 dryRunFlag = find_option("test",0,0)!=0; /* deprecated */
164 }
165
@@ -282,11 +282,11 @@
282 );
283 }
284 db_multi_exec("CREATE TEMP TABLE todel(x TEXT)");
285 while( db_step(&q)==SQLITE_ROW ){
286 const char *zFilename = db_column_text(&q, 0);
287 if( file_access(zFilename, 0)
288 || !file_is_canonical(zFilename)
289 || (useCheckouts && file_isdir(zFilename)!=1)
290 ){
291 db_multi_exec("INSERT INTO todel VALUES(%Q)", db_column_text(&q, 1));
292 nToDel++;
@@ -312,11 +312,11 @@
312 if( stopOnError && rc ){
313 break;
314 }
315 }
316 db_finalize(&q);
317
318 /* If any repositories whose names appear in the ~/.fossil file could not
319 ** be found, remove those names from the ~/.fossil file.
320 */
321 if( nToDel>0 ){
322 const char *zSql = "DELETE FROM global_config WHERE name IN toDel";
323
324 DDED src/cache.c
--- src/allrepo.c
+++ src/allrepo.c
@@ -155,11 +155,11 @@
155 int dryRunFlag = 0;
156 int showFile = find_option("showfile",0,0)!=0;
157 int stopOnError = find_option("dontstop",0,0)==0;
158 int rc;
159 int nToDel = 0;
160
161 dryRunFlag = find_option("dry-run","n",0)!=0;
162 if( !dryRunFlag ){
163 dryRunFlag = find_option("test",0,0)!=0; /* deprecated */
164 }
165
@@ -282,11 +282,11 @@
282 );
283 }
284 db_multi_exec("CREATE TEMP TABLE todel(x TEXT)");
285 while( db_step(&q)==SQLITE_ROW ){
286 const char *zFilename = db_column_text(&q, 0);
287 if( file_access(zFilename, F_OK)
288 || !file_is_canonical(zFilename)
289 || (useCheckouts && file_isdir(zFilename)!=1)
290 ){
291 db_multi_exec("INSERT INTO todel VALUES(%Q)", db_column_text(&q, 1));
292 nToDel++;
@@ -312,11 +312,11 @@
312 if( stopOnError && rc ){
313 break;
314 }
315 }
316 db_finalize(&q);
317
318 /* If any repositories whose names appear in the ~/.fossil file could not
319 ** be found, remove those names from the ~/.fossil file.
320 */
321 if( nToDel>0 ){
322 const char *zSql = "DELETE FROM global_config WHERE name IN toDel";
323
324 DDED src/cache.c
--- a/src/cache.c
+++ b/src/cache.c
@@ -0,0 +1,7 @@
1
+ S"cache""cache"statooter(get_ooter(_getpagerc = S"cache""cache"s "sz INT,""tm INT,""nref INT"Number of uses */
2
+ ");"
3
+ S"cache""cache"(_getpage */tm));S"cache""cache"statooter(get__ooter soge */tm));S"cache""cache"statooter(get__ooter so S"cache""cache"statooter(get_ooter(_getpagerc = S"cache""cache"s "sz INT,""tm INT,""nref INT"Number of uses */
4
+ ");"
5
+ S"cache""cache"(_getpage */tm));S"cache""cache"statooter(get__ooter so
6
+ ;S"cache""cache"statooter(get__ooter soge */tm));S"cache""cache"statooter(get S"cache""cache"sta t {
7
+ @ <li><p>%h()
--- a/src/cache.c
+++ b/src/cache.c
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
--- a/src/cache.c
+++ b/src/cache.c
@@ -0,0 +1,7 @@
1 S"cache""cache"statooter(get_ooter(_getpagerc = S"cache""cache"s "sz INT,""tm INT,""nref INT"Number of uses */
2 ");"
3 S"cache""cache"(_getpage */tm));S"cache""cache"statooter(get__ooter soge */tm));S"cache""cache"statooter(get__ooter so S"cache""cache"statooter(get_ooter(_getpagerc = S"cache""cache"s "sz INT,""tm INT,""nref INT"Number of uses */
4 ");"
5 S"cache""cache"(_getpage */tm));S"cache""cache"statooter(get__ooter so
6 ;S"cache""cache"statooter(get__ooter soge */tm));S"cache""cache"statooter(get S"cache""cache"sta t {
7 @ <li><p>%h()
+2 -2
--- src/checkin.c
+++ src/checkin.c
@@ -86,11 +86,11 @@
8686
}
8787
blob_append(report, zPrefix, nPrefix);
8888
if( isDeleted ){
8989
blob_appendf(report, "DELETED %s\n", zDisplayName);
9090
}else if( !file_wd_isfile_or_link(zFullName) ){
91
- if( file_access(zFullName, 0)==0 ){
91
+ if( file_access(zFullName, F_OK)==0 ){
9292
blob_appendf(report, "NOT_A_FILE %s\n", zDisplayName);
9393
if( missingIsFatal ){
9494
fossil_warning("not a file: %s", zDisplayName);
9595
nErr++;
9696
}
@@ -327,11 +327,11 @@
327327
if( isNew ){
328328
type = "ADDED ";
329329
}else if( isDeleted ){
330330
type = "DELETED ";
331331
}else if( !file_wd_isfile_or_link(zFullName) ){
332
- if( file_access(zFullName, 0)==0 ){
332
+ if( file_access(zFullName, F_OK)==0 ){
333333
type = "NOT_A_FILE ";
334334
}else{
335335
type = "MISSING ";
336336
}
337337
}else if( chnged ){
338338
--- src/checkin.c
+++ src/checkin.c
@@ -86,11 +86,11 @@
86 }
87 blob_append(report, zPrefix, nPrefix);
88 if( isDeleted ){
89 blob_appendf(report, "DELETED %s\n", zDisplayName);
90 }else if( !file_wd_isfile_or_link(zFullName) ){
91 if( file_access(zFullName, 0)==0 ){
92 blob_appendf(report, "NOT_A_FILE %s\n", zDisplayName);
93 if( missingIsFatal ){
94 fossil_warning("not a file: %s", zDisplayName);
95 nErr++;
96 }
@@ -327,11 +327,11 @@
327 if( isNew ){
328 type = "ADDED ";
329 }else if( isDeleted ){
330 type = "DELETED ";
331 }else if( !file_wd_isfile_or_link(zFullName) ){
332 if( file_access(zFullName, 0)==0 ){
333 type = "NOT_A_FILE ";
334 }else{
335 type = "MISSING ";
336 }
337 }else if( chnged ){
338
--- src/checkin.c
+++ src/checkin.c
@@ -86,11 +86,11 @@
86 }
87 blob_append(report, zPrefix, nPrefix);
88 if( isDeleted ){
89 blob_appendf(report, "DELETED %s\n", zDisplayName);
90 }else if( !file_wd_isfile_or_link(zFullName) ){
91 if( file_access(zFullName, F_OK)==0 ){
92 blob_appendf(report, "NOT_A_FILE %s\n", zDisplayName);
93 if( missingIsFatal ){
94 fossil_warning("not a file: %s", zDisplayName);
95 nErr++;
96 }
@@ -327,11 +327,11 @@
327 if( isNew ){
328 type = "ADDED ";
329 }else if( isDeleted ){
330 type = "DELETED ";
331 }else if( !file_wd_isfile_or_link(zFullName) ){
332 if( file_access(zFullName, F_OK)==0 ){
333 type = "NOT_A_FILE ";
334 }else{
335 type = "MISSING ";
336 }
337 }else if( chnged ){
338
+2 -2
--- src/checkin.c
+++ src/checkin.c
@@ -86,11 +86,11 @@
8686
}
8787
blob_append(report, zPrefix, nPrefix);
8888
if( isDeleted ){
8989
blob_appendf(report, "DELETED %s\n", zDisplayName);
9090
}else if( !file_wd_isfile_or_link(zFullName) ){
91
- if( file_access(zFullName, 0)==0 ){
91
+ if( file_access(zFullName, F_OK)==0 ){
9292
blob_appendf(report, "NOT_A_FILE %s\n", zDisplayName);
9393
if( missingIsFatal ){
9494
fossil_warning("not a file: %s", zDisplayName);
9595
nErr++;
9696
}
@@ -327,11 +327,11 @@
327327
if( isNew ){
328328
type = "ADDED ";
329329
}else if( isDeleted ){
330330
type = "DELETED ";
331331
}else if( !file_wd_isfile_or_link(zFullName) ){
332
- if( file_access(zFullName, 0)==0 ){
332
+ if( file_access(zFullName, F_OK)==0 ){
333333
type = "NOT_A_FILE ";
334334
}else{
335335
type = "MISSING ";
336336
}
337337
}else if( chnged ){
338338
--- src/checkin.c
+++ src/checkin.c
@@ -86,11 +86,11 @@
86 }
87 blob_append(report, zPrefix, nPrefix);
88 if( isDeleted ){
89 blob_appendf(report, "DELETED %s\n", zDisplayName);
90 }else if( !file_wd_isfile_or_link(zFullName) ){
91 if( file_access(zFullName, 0)==0 ){
92 blob_appendf(report, "NOT_A_FILE %s\n", zDisplayName);
93 if( missingIsFatal ){
94 fossil_warning("not a file: %s", zDisplayName);
95 nErr++;
96 }
@@ -327,11 +327,11 @@
327 if( isNew ){
328 type = "ADDED ";
329 }else if( isDeleted ){
330 type = "DELETED ";
331 }else if( !file_wd_isfile_or_link(zFullName) ){
332 if( file_access(zFullName, 0)==0 ){
333 type = "NOT_A_FILE ";
334 }else{
335 type = "MISSING ";
336 }
337 }else if( chnged ){
338
--- src/checkin.c
+++ src/checkin.c
@@ -86,11 +86,11 @@
86 }
87 blob_append(report, zPrefix, nPrefix);
88 if( isDeleted ){
89 blob_appendf(report, "DELETED %s\n", zDisplayName);
90 }else if( !file_wd_isfile_or_link(zFullName) ){
91 if( file_access(zFullName, F_OK)==0 ){
92 blob_appendf(report, "NOT_A_FILE %s\n", zDisplayName);
93 if( missingIsFatal ){
94 fossil_warning("not a file: %s", zDisplayName);
95 nErr++;
96 }
@@ -327,11 +327,11 @@
327 if( isNew ){
328 type = "ADDED ";
329 }else if( isDeleted ){
330 type = "DELETED ";
331 }else if( !file_wd_isfile_or_link(zFullName) ){
332 if( file_access(zFullName, F_OK)==0 ){
333 type = "NOT_A_FILE ";
334 }else{
335 type = "MISSING ";
336 }
337 }else if( chnged ){
338
+3 -3
--- src/db.c
+++ src/db.c
@@ -1004,11 +1004,11 @@
10041004
if( zDbName==0 ){
10051005
db_err("unable to find the name of a repository database");
10061006
}
10071007
}
10081008
if( file_access(zDbName, R_OK) || file_size(zDbName)<1024 ){
1009
- if( file_access(zDbName, 0) ){
1009
+ if( file_access(zDbName, F_OK) ){
10101010
#ifdef FOSSIL_ENABLE_JSON
10111011
g.json.resultCode = FSL_JSON_E_DB_NOT_FOUND;
10121012
#endif
10131013
fossil_panic("repository does not exist or"
10141014
" is in an unreadable directory: %s", zDbName);
@@ -1138,11 +1138,11 @@
11381138
if( g.argc!=3 ){
11391139
usage("PATHNAME");
11401140
}
11411141
file_canonical_name(g.argv[2], &repo, 0);
11421142
zRepo = blob_str(&repo);
1143
- if( file_access(zRepo, 0) ){
1143
+ if( file_access(zRepo, F_OK) ){
11441144
fossil_fatal("no such file: %s", zRepo);
11451145
}
11461146
if( db_open_local(zRepo)==0 ){
11471147
fossil_fatal("not in a local checkout");
11481148
return;
@@ -2513,11 +2513,11 @@
25132513
zOrigSql += j+6;
25142514
j = -1;
25152515
}
25162516
}
25172517
blob_append(&newSql, zOrigSql, -1);
2518
- blob_appendf(&allSql,
2518
+ blob_appendf(&allSql,
25192519
"ALTER TABLE %s RENAME TO x_%s;\n"
25202520
"%s WITHOUT ROWID;\n"
25212521
"INSERT INTO %s SELECT * FROM x_%s;\n"
25222522
"DROP TABLE x_%s;\n",
25232523
zTName, zTName, blob_str(&newSql), zTName, zTName, zTName
25242524
--- src/db.c
+++ src/db.c
@@ -1004,11 +1004,11 @@
1004 if( zDbName==0 ){
1005 db_err("unable to find the name of a repository database");
1006 }
1007 }
1008 if( file_access(zDbName, R_OK) || file_size(zDbName)<1024 ){
1009 if( file_access(zDbName, 0) ){
1010 #ifdef FOSSIL_ENABLE_JSON
1011 g.json.resultCode = FSL_JSON_E_DB_NOT_FOUND;
1012 #endif
1013 fossil_panic("repository does not exist or"
1014 " is in an unreadable directory: %s", zDbName);
@@ -1138,11 +1138,11 @@
1138 if( g.argc!=3 ){
1139 usage("PATHNAME");
1140 }
1141 file_canonical_name(g.argv[2], &repo, 0);
1142 zRepo = blob_str(&repo);
1143 if( file_access(zRepo, 0) ){
1144 fossil_fatal("no such file: %s", zRepo);
1145 }
1146 if( db_open_local(zRepo)==0 ){
1147 fossil_fatal("not in a local checkout");
1148 return;
@@ -2513,11 +2513,11 @@
2513 zOrigSql += j+6;
2514 j = -1;
2515 }
2516 }
2517 blob_append(&newSql, zOrigSql, -1);
2518 blob_appendf(&allSql,
2519 "ALTER TABLE %s RENAME TO x_%s;\n"
2520 "%s WITHOUT ROWID;\n"
2521 "INSERT INTO %s SELECT * FROM x_%s;\n"
2522 "DROP TABLE x_%s;\n",
2523 zTName, zTName, blob_str(&newSql), zTName, zTName, zTName
2524
--- src/db.c
+++ src/db.c
@@ -1004,11 +1004,11 @@
1004 if( zDbName==0 ){
1005 db_err("unable to find the name of a repository database");
1006 }
1007 }
1008 if( file_access(zDbName, R_OK) || file_size(zDbName)<1024 ){
1009 if( file_access(zDbName, F_OK) ){
1010 #ifdef FOSSIL_ENABLE_JSON
1011 g.json.resultCode = FSL_JSON_E_DB_NOT_FOUND;
1012 #endif
1013 fossil_panic("repository does not exist or"
1014 " is in an unreadable directory: %s", zDbName);
@@ -1138,11 +1138,11 @@
1138 if( g.argc!=3 ){
1139 usage("PATHNAME");
1140 }
1141 file_canonical_name(g.argv[2], &repo, 0);
1142 zRepo = blob_str(&repo);
1143 if( file_access(zRepo, F_OK) ){
1144 fossil_fatal("no such file: %s", zRepo);
1145 }
1146 if( db_open_local(zRepo)==0 ){
1147 fossil_fatal("not in a local checkout");
1148 return;
@@ -2513,11 +2513,11 @@
2513 zOrigSql += j+6;
2514 j = -1;
2515 }
2516 }
2517 blob_append(&newSql, zOrigSql, -1);
2518 blob_appendf(&allSql,
2519 "ALTER TABLE %s RENAME TO x_%s;\n"
2520 "%s WITHOUT ROWID;\n"
2521 "INSERT INTO %s SELECT * FROM x_%s;\n"
2522 "DROP TABLE x_%s;\n",
2523 zTName, zTName, blob_str(&newSql), zTName, zTName, zTName
2524
+2 -2
--- src/diff.c
+++ src/diff.c
@@ -220,12 +220,12 @@
220220
*/
221221
222222
static int same_dline_ignore_allws(const DLine *pA, const DLine *pB){
223223
int a = pA->indent, b = pB->indent;
224224
if( pA->h==pB->h ){
225
- while( a<pA->n && b<pB->n ){
226
- if( pA->z[a++] != pB->z[b++] ) return 0;
225
+ while( a<pA->n || b<pB->n ){
226
+ if( a<pA->n && b<pB->n && pA->z[a++] != pB->z[b++] ) return 0;
227227
while( a<pA->n && fossil_isspace(pA->z[a])) ++a;
228228
while( b<pB->n && fossil_isspace(pB->z[b])) ++b;
229229
}
230230
return pA->n-a == pB->n-b;
231231
}
232232
--- src/diff.c
+++ src/diff.c
@@ -220,12 +220,12 @@
220 */
221
222 static int same_dline_ignore_allws(const DLine *pA, const DLine *pB){
223 int a = pA->indent, b = pB->indent;
224 if( pA->h==pB->h ){
225 while( a<pA->n && b<pB->n ){
226 if( pA->z[a++] != pB->z[b++] ) return 0;
227 while( a<pA->n && fossil_isspace(pA->z[a])) ++a;
228 while( b<pB->n && fossil_isspace(pB->z[b])) ++b;
229 }
230 return pA->n-a == pB->n-b;
231 }
232
--- src/diff.c
+++ src/diff.c
@@ -220,12 +220,12 @@
220 */
221
222 static int same_dline_ignore_allws(const DLine *pA, const DLine *pB){
223 int a = pA->indent, b = pB->indent;
224 if( pA->h==pB->h ){
225 while( a<pA->n || b<pB->n ){
226 if( a<pA->n && b<pB->n && pA->z[a++] != pB->z[b++] ) return 0;
227 while( a<pA->n && fossil_isspace(pA->z[a])) ++a;
228 while( b<pB->n && fossil_isspace(pB->z[b])) ++b;
229 }
230 return pA->n-a == pB->n-b;
231 }
232
+2 -2
--- src/diffcmd.c
+++ src/diffcmd.c
@@ -171,11 +171,11 @@
171171
** zFile2 */
172172
blob_zero(&nameFile1);
173173
do{
174174
blob_reset(&nameFile1);
175175
blob_appendf(&nameFile1, "%s~%d", zFile2, cnt++);
176
- }while( file_access(blob_str(&nameFile1),0)==0 );
176
+ }while( file_access(blob_str(&nameFile1),F_OK)==0 );
177177
blob_write_to_file(pFile1, blob_str(&nameFile1));
178178
179179
/* Construct the external diff command */
180180
blob_zero(&cmd);
181181
blob_appendf(&cmd, "%s ", zDiffCmd);
@@ -385,11 +385,11 @@
385385
char *zToFree = zFullName;
386386
int showDiff = 1;
387387
if( isDeleted ){
388388
fossil_print("DELETED %s\n", zPathname);
389389
if( !asNewFile ){ showDiff = 0; zFullName = NULL_DEVICE; }
390
- }else if( file_access(zFullName, 0) ){
390
+ }else if( file_access(zFullName, F_OK) ){
391391
fossil_print("MISSING %s\n", zPathname);
392392
if( !asNewFile ){ showDiff = 0; }
393393
}else if( isNew ){
394394
fossil_print("ADDED %s\n", zPathname);
395395
srcid = 0;
396396
--- src/diffcmd.c
+++ src/diffcmd.c
@@ -171,11 +171,11 @@
171 ** zFile2 */
172 blob_zero(&nameFile1);
173 do{
174 blob_reset(&nameFile1);
175 blob_appendf(&nameFile1, "%s~%d", zFile2, cnt++);
176 }while( file_access(blob_str(&nameFile1),0)==0 );
177 blob_write_to_file(pFile1, blob_str(&nameFile1));
178
179 /* Construct the external diff command */
180 blob_zero(&cmd);
181 blob_appendf(&cmd, "%s ", zDiffCmd);
@@ -385,11 +385,11 @@
385 char *zToFree = zFullName;
386 int showDiff = 1;
387 if( isDeleted ){
388 fossil_print("DELETED %s\n", zPathname);
389 if( !asNewFile ){ showDiff = 0; zFullName = NULL_DEVICE; }
390 }else if( file_access(zFullName, 0) ){
391 fossil_print("MISSING %s\n", zPathname);
392 if( !asNewFile ){ showDiff = 0; }
393 }else if( isNew ){
394 fossil_print("ADDED %s\n", zPathname);
395 srcid = 0;
396
--- src/diffcmd.c
+++ src/diffcmd.c
@@ -171,11 +171,11 @@
171 ** zFile2 */
172 blob_zero(&nameFile1);
173 do{
174 blob_reset(&nameFile1);
175 blob_appendf(&nameFile1, "%s~%d", zFile2, cnt++);
176 }while( file_access(blob_str(&nameFile1),F_OK)==0 );
177 blob_write_to_file(pFile1, blob_str(&nameFile1));
178
179 /* Construct the external diff command */
180 blob_zero(&cmd);
181 blob_appendf(&cmd, "%s ", zDiffCmd);
@@ -385,11 +385,11 @@
385 char *zToFree = zFullName;
386 int showDiff = 1;
387 if( isDeleted ){
388 fossil_print("DELETED %s\n", zPathname);
389 if( !asNewFile ){ showDiff = 0; zFullName = NULL_DEVICE; }
390 }else if( file_access(zFullName, F_OK) ){
391 fossil_print("MISSING %s\n", zPathname);
392 if( !asNewFile ){ showDiff = 0; }
393 }else if( isNew ){
394 fossil_print("ADDED %s\n", zPathname);
395 srcid = 0;
396
+15 -13
--- src/file.c
+++ src/file.c
@@ -79,23 +79,23 @@
7979
** Fill stat buf with information received from stat() or lstat().
8080
** lstat() is called on Unix if isWd is TRUE and allow-symlinks setting is on.
8181
**
8282
*/
8383
static int fossil_stat(const char *zFilename, struct fossilStat *buf, int isWd){
84
-#if !defined(_WIN32)
8584
int rc;
86
- char *zMbcs = fossil_utf8_to_filename(zFilename);
85
+ void *zMbcs = fossil_utf8_to_filename(zFilename);
86
+#if !defined(_WIN32)
8787
if( isWd && g.allowSymlinks ){
8888
rc = lstat(zMbcs, buf);
8989
}else{
9090
rc = stat(zMbcs, buf);
9191
}
92
+#else
93
+ rc = win32_stat(zMbcs, buf, isWd);
94
+#endif
9295
fossil_filename_free(zMbcs);
9396
return rc;
94
-#else
95
- return win32_stat(zFilename, buf, isWd);
96
-#endif
9797
}
9898
9999
/*
100100
** Fill in the fileStat variable for the file named zFilename.
101101
** If zFilename==0, then use the previous value of fileStat if
@@ -316,38 +316,40 @@
316316
317317
/*
318318
** Wrapper around the access() system call.
319319
*/
320320
int file_access(const char *zFilename, int flags){
321
+ int rc;
322
+ void *zMbcs = fossil_utf8_to_filename(zFilename);
321323
#ifdef _WIN32
322
- return win32_access(zFilename, flags);
324
+ rc = win32_access(zMbcs, flags);
323325
#else
324
- char *zMbcs = fossil_utf8_to_filename(zFilename);
325
- int rc = access(zMbcs, flags);
326
+ rc = access(zMbcs, flags);
327
+#endif
326328
fossil_filename_free(zMbcs);
327329
return rc;
328
-#endif
329330
}
330331
331332
/*
332333
** Wrapper around the chdir() system call.
333334
** If bChroot=1, do a chroot to this dir as well
334335
** (UNIX only)
335336
*/
336337
int file_chdir(const char *zChDir, int bChroot){
338
+ int rc;
339
+ void *zPath = fossil_utf8_to_filename(zChDir);
337340
#ifdef _WIN32
338
- return win32_chdir(zChDir, bChroot);
341
+ rc = win32_chdir(zPath, bChroot);
339342
#else
340
- char *zPath = fossil_utf8_to_filename(zChDir);
341
- int rc = chdir(zPath);
343
+ rc = chdir(zPath);
342344
if( !rc && bChroot ){
343345
rc = chroot(zPath);
344346
if( !rc ) rc = chdir("/");
345347
}
348
+#endif
346349
fossil_filename_free(zPath);
347350
return rc;
348
-#endif
349351
}
350352
351353
/*
352354
** Find an unused filename similar to zBase with zSuffix appended.
353355
**
354356
--- src/file.c
+++ src/file.c
@@ -79,23 +79,23 @@
79 ** Fill stat buf with information received from stat() or lstat().
80 ** lstat() is called on Unix if isWd is TRUE and allow-symlinks setting is on.
81 **
82 */
83 static int fossil_stat(const char *zFilename, struct fossilStat *buf, int isWd){
84 #if !defined(_WIN32)
85 int rc;
86 char *zMbcs = fossil_utf8_to_filename(zFilename);
 
87 if( isWd && g.allowSymlinks ){
88 rc = lstat(zMbcs, buf);
89 }else{
90 rc = stat(zMbcs, buf);
91 }
 
 
 
92 fossil_filename_free(zMbcs);
93 return rc;
94 #else
95 return win32_stat(zFilename, buf, isWd);
96 #endif
97 }
98
99 /*
100 ** Fill in the fileStat variable for the file named zFilename.
101 ** If zFilename==0, then use the previous value of fileStat if
@@ -316,38 +316,40 @@
316
317 /*
318 ** Wrapper around the access() system call.
319 */
320 int file_access(const char *zFilename, int flags){
 
 
321 #ifdef _WIN32
322 return win32_access(zFilename, flags);
323 #else
324 char *zMbcs = fossil_utf8_to_filename(zFilename);
325 int rc = access(zMbcs, flags);
326 fossil_filename_free(zMbcs);
327 return rc;
328 #endif
329 }
330
331 /*
332 ** Wrapper around the chdir() system call.
333 ** If bChroot=1, do a chroot to this dir as well
334 ** (UNIX only)
335 */
336 int file_chdir(const char *zChDir, int bChroot){
 
 
337 #ifdef _WIN32
338 return win32_chdir(zChDir, bChroot);
339 #else
340 char *zPath = fossil_utf8_to_filename(zChDir);
341 int rc = chdir(zPath);
342 if( !rc && bChroot ){
343 rc = chroot(zPath);
344 if( !rc ) rc = chdir("/");
345 }
 
346 fossil_filename_free(zPath);
347 return rc;
348 #endif
349 }
350
351 /*
352 ** Find an unused filename similar to zBase with zSuffix appended.
353 **
354
--- src/file.c
+++ src/file.c
@@ -79,23 +79,23 @@
79 ** Fill stat buf with information received from stat() or lstat().
80 ** lstat() is called on Unix if isWd is TRUE and allow-symlinks setting is on.
81 **
82 */
83 static int fossil_stat(const char *zFilename, struct fossilStat *buf, int isWd){
 
84 int rc;
85 void *zMbcs = fossil_utf8_to_filename(zFilename);
86 #if !defined(_WIN32)
87 if( isWd && g.allowSymlinks ){
88 rc = lstat(zMbcs, buf);
89 }else{
90 rc = stat(zMbcs, buf);
91 }
92 #else
93 rc = win32_stat(zMbcs, buf, isWd);
94 #endif
95 fossil_filename_free(zMbcs);
96 return rc;
 
 
 
97 }
98
99 /*
100 ** Fill in the fileStat variable for the file named zFilename.
101 ** If zFilename==0, then use the previous value of fileStat if
@@ -316,38 +316,40 @@
316
317 /*
318 ** Wrapper around the access() system call.
319 */
320 int file_access(const char *zFilename, int flags){
321 int rc;
322 void *zMbcs = fossil_utf8_to_filename(zFilename);
323 #ifdef _WIN32
324 rc = win32_access(zMbcs, flags);
325 #else
326 rc = access(zMbcs, flags);
327 #endif
328 fossil_filename_free(zMbcs);
329 return rc;
 
330 }
331
332 /*
333 ** Wrapper around the chdir() system call.
334 ** If bChroot=1, do a chroot to this dir as well
335 ** (UNIX only)
336 */
337 int file_chdir(const char *zChDir, int bChroot){
338 int rc;
339 void *zPath = fossil_utf8_to_filename(zChDir);
340 #ifdef _WIN32
341 rc = win32_chdir(zPath, bChroot);
342 #else
343 rc = chdir(zPath);
 
344 if( !rc && bChroot ){
345 rc = chroot(zPath);
346 if( !rc ) rc = chdir("/");
347 }
348 #endif
349 fossil_filename_free(zPath);
350 return rc;
 
351 }
352
353 /*
354 ** Find an unused filename similar to zBase with zSuffix appended.
355 **
356
-15
--- src/import.c
+++ src/import.c
@@ -575,37 +575,22 @@
575575
fossil_free(gg.zMark);
576576
gg.zMark = fossil_strdup(&zLine[5]);
577577
}else
578578
if( memcmp(zLine, "tagger ", 7)==0 || memcmp(zLine, "committer ",10)==0 ){
579579
sqlite3_int64 secSince1970;
580
- int hastz;
581
- char tzdir;
582
- int tz;
583580
for(i=0; zLine[i] && zLine[i]!='<'; i++){}
584581
if( zLine[i]==0 ) goto malformed_line;
585582
z = &zLine[i+1];
586583
for(i=i+1; zLine[i] && zLine[i]!='>'; i++){}
587584
if( zLine[i]==0 ) goto malformed_line;
588585
zLine[i] = 0;
589586
fossil_free(gg.zUser);
590587
gg.zUser = fossil_strdup(z);
591588
secSince1970 = 0;
592
-
593
- /* We don't use sscanf here because of int64 portability issues. */
594589
for(i=i+2; fossil_isdigit(zLine[i]); i++){
595590
secSince1970 = secSince1970*10 + zLine[i] - '0';
596591
}
597
-
598
- /* Read in optional timezone modifier (we don't know if it's strictly
599
- * optional, but better to be sure). */
600
- tzdir = '+';
601
- tz = 0;
602
- hastz = sscanf(&zLine[i], " %c%d", &tzdir, &tz);
603
- if ((hastz == 1) || (hastz > 2)) goto malformed_line;
604
- secSince1970 += ((tzdir == '-') ? -1 : 1) *
605
- ((tz/100)*3600 + (tz%100)*60);
606
-
607592
fossil_free(gg.zDate);
608593
gg.zDate = db_text(0, "SELECT datetime(%lld, 'unixepoch')", secSince1970);
609594
gg.zDate[10] = 'T';
610595
}else
611596
if( memcmp(zLine, "from ", 5)==0 ){
612597
--- src/import.c
+++ src/import.c
@@ -575,37 +575,22 @@
575 fossil_free(gg.zMark);
576 gg.zMark = fossil_strdup(&zLine[5]);
577 }else
578 if( memcmp(zLine, "tagger ", 7)==0 || memcmp(zLine, "committer ",10)==0 ){
579 sqlite3_int64 secSince1970;
580 int hastz;
581 char tzdir;
582 int tz;
583 for(i=0; zLine[i] && zLine[i]!='<'; i++){}
584 if( zLine[i]==0 ) goto malformed_line;
585 z = &zLine[i+1];
586 for(i=i+1; zLine[i] && zLine[i]!='>'; i++){}
587 if( zLine[i]==0 ) goto malformed_line;
588 zLine[i] = 0;
589 fossil_free(gg.zUser);
590 gg.zUser = fossil_strdup(z);
591 secSince1970 = 0;
592
593 /* We don't use sscanf here because of int64 portability issues. */
594 for(i=i+2; fossil_isdigit(zLine[i]); i++){
595 secSince1970 = secSince1970*10 + zLine[i] - '0';
596 }
597
598 /* Read in optional timezone modifier (we don't know if it's strictly
599 * optional, but better to be sure). */
600 tzdir = '+';
601 tz = 0;
602 hastz = sscanf(&zLine[i], " %c%d", &tzdir, &tz);
603 if ((hastz == 1) || (hastz > 2)) goto malformed_line;
604 secSince1970 += ((tzdir == '-') ? -1 : 1) *
605 ((tz/100)*3600 + (tz%100)*60);
606
607 fossil_free(gg.zDate);
608 gg.zDate = db_text(0, "SELECT datetime(%lld, 'unixepoch')", secSince1970);
609 gg.zDate[10] = 'T';
610 }else
611 if( memcmp(zLine, "from ", 5)==0 ){
612
--- src/import.c
+++ src/import.c
@@ -575,37 +575,22 @@
575 fossil_free(gg.zMark);
576 gg.zMark = fossil_strdup(&zLine[5]);
577 }else
578 if( memcmp(zLine, "tagger ", 7)==0 || memcmp(zLine, "committer ",10)==0 ){
579 sqlite3_int64 secSince1970;
 
 
 
580 for(i=0; zLine[i] && zLine[i]!='<'; i++){}
581 if( zLine[i]==0 ) goto malformed_line;
582 z = &zLine[i+1];
583 for(i=i+1; zLine[i] && zLine[i]!='>'; i++){}
584 if( zLine[i]==0 ) goto malformed_line;
585 zLine[i] = 0;
586 fossil_free(gg.zUser);
587 gg.zUser = fossil_strdup(z);
588 secSince1970 = 0;
 
 
589 for(i=i+2; fossil_isdigit(zLine[i]); i++){
590 secSince1970 = secSince1970*10 + zLine[i] - '0';
591 }
 
 
 
 
 
 
 
 
 
 
592 fossil_free(gg.zDate);
593 gg.zDate = db_text(0, "SELECT datetime(%lld, 'unixepoch')", secSince1970);
594 gg.zDate[10] = 'T';
595 }else
596 if( memcmp(zLine, "from ", 5)==0 ){
597
--- src/json_status.c
+++ src/json_status.c
@@ -69,11 +69,11 @@
6969
zTmp = db_text(0, "SELECT uuid FROM blob WHERE rid=%d", vid);
7070
cson_object_set(tmpO, "uuid", json_new_string(zTmp) );
7171
free(zTmp);
7272
7373
cson_object_set( tmpO, "tags", json_tags_for_checkin_rid(vid, 0) );
74
-
74
+
7575
/* FIXME: optimize the datetime/timestamp queries into 1 query. */
7676
zTmp = db_text(0, "SELECT datetime(mtime) || "
7777
"' UTC' FROM event WHERE objid=%d",
7878
vid);
7979
cson_object_set(tmpO, "datetime", json_new_string(zTmp));
@@ -115,11 +115,11 @@
115115
zStatus = "new" /* maintenance reminder: MUST come
116116
BEFORE the isChnged checks. */;
117117
}else if( isRenamed ){
118118
zStatus = "renamed";
119119
}else if( !file_wd_isfile_or_link(zFullName) ){
120
- if( file_access(zFullName, 0)==0 ){
120
+ if( file_access(zFullName, F_OK)==0 ){
121121
zStatus = "notAFile";
122122
++nErr;
123123
}else{
124124
zStatus = "missing";
125125
++nErr;
@@ -137,11 +137,11 @@
137137
zStatus = "conflict";
138138
}else{
139139
zStatus = "edited";
140140
}
141141
}
142
-
142
+
143143
oFile = cson_new_object();
144144
cson_array_append( aFiles, cson_object_value(oFile) );
145145
/* optimization potential: move these keys into cson_strings
146146
to take advantage of refcounting. */
147147
cson_object_set( oFile, "name", json_new_string( zPathname ) );
148148
--- src/json_status.c
+++ src/json_status.c
@@ -69,11 +69,11 @@
69 zTmp = db_text(0, "SELECT uuid FROM blob WHERE rid=%d", vid);
70 cson_object_set(tmpO, "uuid", json_new_string(zTmp) );
71 free(zTmp);
72
73 cson_object_set( tmpO, "tags", json_tags_for_checkin_rid(vid, 0) );
74
75 /* FIXME: optimize the datetime/timestamp queries into 1 query. */
76 zTmp = db_text(0, "SELECT datetime(mtime) || "
77 "' UTC' FROM event WHERE objid=%d",
78 vid);
79 cson_object_set(tmpO, "datetime", json_new_string(zTmp));
@@ -115,11 +115,11 @@
115 zStatus = "new" /* maintenance reminder: MUST come
116 BEFORE the isChnged checks. */;
117 }else if( isRenamed ){
118 zStatus = "renamed";
119 }else if( !file_wd_isfile_or_link(zFullName) ){
120 if( file_access(zFullName, 0)==0 ){
121 zStatus = "notAFile";
122 ++nErr;
123 }else{
124 zStatus = "missing";
125 ++nErr;
@@ -137,11 +137,11 @@
137 zStatus = "conflict";
138 }else{
139 zStatus = "edited";
140 }
141 }
142
143 oFile = cson_new_object();
144 cson_array_append( aFiles, cson_object_value(oFile) );
145 /* optimization potential: move these keys into cson_strings
146 to take advantage of refcounting. */
147 cson_object_set( oFile, "name", json_new_string( zPathname ) );
148
--- src/json_status.c
+++ src/json_status.c
@@ -69,11 +69,11 @@
69 zTmp = db_text(0, "SELECT uuid FROM blob WHERE rid=%d", vid);
70 cson_object_set(tmpO, "uuid", json_new_string(zTmp) );
71 free(zTmp);
72
73 cson_object_set( tmpO, "tags", json_tags_for_checkin_rid(vid, 0) );
74
75 /* FIXME: optimize the datetime/timestamp queries into 1 query. */
76 zTmp = db_text(0, "SELECT datetime(mtime) || "
77 "' UTC' FROM event WHERE objid=%d",
78 vid);
79 cson_object_set(tmpO, "datetime", json_new_string(zTmp));
@@ -115,11 +115,11 @@
115 zStatus = "new" /* maintenance reminder: MUST come
116 BEFORE the isChnged checks. */;
117 }else if( isRenamed ){
118 zStatus = "renamed";
119 }else if( !file_wd_isfile_or_link(zFullName) ){
120 if( file_access(zFullName, F_OK)==0 ){
121 zStatus = "notAFile";
122 ++nErr;
123 }else{
124 zStatus = "missing";
125 ++nErr;
@@ -137,11 +137,11 @@
137 zStatus = "conflict";
138 }else{
139 zStatus = "edited";
140 }
141 }
142
143 oFile = cson_new_object();
144 cson_array_append( aFiles, cson_object_value(oFile) );
145 /* optimization potential: move these keys into cson_strings
146 to take advantage of refcounting. */
147 cson_object_set( oFile, "name", json_new_string( zPathname ) );
148
+2 -2
--- src/login.c
+++ src/login.c
@@ -1293,12 +1293,12 @@
12931293
@ </span></p>
12941294
}else{
12951295
char *zPw = sha1_shared_secret(blob_str(&passwd), blob_str(&login), 0);
12961296
int uid;
12971297
db_multi_exec(
1298
- "INSERT INTO user(login,pw,cap,info)"
1299
- "VALUES(%B,%Q,%B,%B)",
1298
+ "INSERT INTO user(login,pw,cap,info,mtime)"
1299
+ "VALUES(%B,%Q,%B,%B,strftime('%s','now'))",
13001300
&login, zPw, &caps, &contact
13011301
);
13021302
free(zPw);
13031303
13041304
/* The user is registered, now just log him in. */
13051305
--- src/login.c
+++ src/login.c
@@ -1293,12 +1293,12 @@
1293 @ </span></p>
1294 }else{
1295 char *zPw = sha1_shared_secret(blob_str(&passwd), blob_str(&login), 0);
1296 int uid;
1297 db_multi_exec(
1298 "INSERT INTO user(login,pw,cap,info)"
1299 "VALUES(%B,%Q,%B,%B)",
1300 &login, zPw, &caps, &contact
1301 );
1302 free(zPw);
1303
1304 /* The user is registered, now just log him in. */
1305
--- src/login.c
+++ src/login.c
@@ -1293,12 +1293,12 @@
1293 @ </span></p>
1294 }else{
1295 char *zPw = sha1_shared_secret(blob_str(&passwd), blob_str(&login), 0);
1296 int uid;
1297 db_multi_exec(
1298 "INSERT INTO user(login,pw,cap,info,mtime)"
1299 "VALUES(%B,%Q,%B,%B,strftime('%s','now'))",
1300 &login, zPw, &caps, &contact
1301 );
1302 free(zPw);
1303
1304 /* The user is registered, now just log him in. */
1305
+34 -32
--- src/lookslike.c
+++ src/lookslike.c
@@ -157,20 +157,18 @@
157157
c = *z;
158158
while( --n>0 ){
159159
c2 = c;
160160
c = *++z;
161161
if( c2>=0x80 ){
162
- if( (c2!=0xc0) || (c!=0x80) ){
163
- if( ((c2==0xf4) && (c>=0x90)) ||
164
- (c2<0xc2) || (c2>0xf4) || ((c&0xc0)!=0x80) ){
165
- return 1; /* Invalid UTF-8 */
166
- }
162
+ if( ((c2<0xc2) || (c2>=0xf4) || ((c&0xc0)!=0x80)) &&
163
+ (((c2!=0xf4) || (c>=0x90)) && ((c2!=0xc0) || (c!=0x80))) ){
164
+ return LOOK_INVALID; /* Invalid UTF-8 */
167165
}
168166
c = (c2 >= 0xe0) ? (c2<<1)+1 : ' ';
169167
}
170168
}
171
- return c>=0x80; /* Last byte must be ASCII. */
169
+ return (c>=0x80) ? LOOK_INVALID : 0; /* Last byte must be ASCII. */
172170
}
173171
174172
175173
/*
176174
** Define the type needed to represent a Unicode (UTF-16) character.
@@ -233,15 +231,14 @@
233231
int looks_like_utf16(const Blob *pContent, int bReverse, int stopFlags){
234232
const WCHAR_T *z = (WCHAR_T *)blob_buffer(pContent);
235233
unsigned int n = blob_size(pContent);
236234
int j, c, flags = LOOK_NONE; /* Assume UTF-16 text, prove otherwise */
237235
238
- if( n==0 ) return flags; /* Empty file -> text */
239236
if( n%sizeof(WCHAR_T) ){
240237
flags |= LOOK_ODD; /* Odd number of bytes -> binary (UTF-8?) */
241
- if( n<sizeof(WCHAR_T) ) return flags; /* One byte -> binary (UTF-8?) */
242238
}
239
+ if( n<sizeof(WCHAR_T) ) return flags; /* Zero or One byte -> binary (UTF-8?) */
243240
c = *z;
244241
if( bReverse ){
245242
c = UTF16_SWAP(c);
246243
}
247244
if( c==0 ){
@@ -252,15 +249,12 @@
252249
flags |= LOOK_LONE_CR; /* More chars, next char is not LF */
253250
}
254251
}
255252
j = (c!='\n');
256253
if( !j ) flags |= (LOOK_LF | LOOK_LONE_LF); /* Found LF as first char */
257
- while( 1 ){
254
+ while( !(flags&stopFlags) && ((n-=sizeof(WCHAR_T))>=sizeof(WCHAR_T)) ){
258255
int c2 = c;
259
- if( flags&stopFlags ) break;
260
- n -= sizeof(WCHAR_T);
261
- if( n<sizeof(WCHAR_T) ) break;
262256
c = *++z;
263257
if( bReverse ){
264258
c = UTF16_SWAP(c);
265259
}
266260
++j;
@@ -368,40 +362,48 @@
368362
** COMMAND: test-looks-like-utf
369363
**
370364
** Usage: %fossil test-looks-like-utf FILENAME
371365
**
372366
** Options:
367
+** -n|--limit <num> Repeat looks-like function <num> times, for
368
+** performance measurement. Default = 1;
373369
** --utf8 Ignoring BOM and file size, force UTF-8 checking
374370
** --utf16 Ignoring BOM and file size, force UTF-16 checking
375371
**
376372
** FILENAME is the name of a file to check for textual content in the UTF-8
377373
** and/or UTF-16 encodings.
378374
*/
379375
void looks_like_utf_test_cmd(void){
380
- Blob blob; /* the contents of the specified file */
381
- int fUtf8; /* return value of starts_with_utf8_bom() */
382
- int fUtf16; /* return value of starts_with_utf16_bom() */
383
- int fUnicode; /* return value of could_be_utf16() */
384
- int lookFlags; /* output flags from looks_like_utf8/utf16() */
376
+ Blob blob; /* the contents of the specified file */
377
+ int fUtf8 = 0; /* return value of starts_with_utf8_bom() */
378
+ int fUtf16 = 0; /* return value of starts_with_utf16_bom() */
379
+ int fUnicode = 0; /* return value of could_be_utf16() */
380
+ int lookFlags = 0; /* output flags from looks_like_utf8/utf16() */
385381
int bRevUtf16 = 0; /* non-zero -> UTF-16 byte order reversed */
386
- int bRevUnicode = 0; /* non-zero -> UTF-16 byte order reversed */
387382
int fForceUtf8 = find_option("utf8",0,0)!=0;
388383
int fForceUtf16 = find_option("utf16",0,0)!=0;
389
- if( g.argc!=3 ) usage("FILENAME");
390
- blob_read_from_file(&blob, g.argv[2]);
391
- fUtf8 = starts_with_utf8_bom(&blob, 0);
392
- fUtf16 = starts_with_utf16_bom(&blob, 0, &bRevUtf16);
393
- if( fForceUtf8 ){
394
- fUnicode = 0;
395
- }else{
396
- fUnicode = could_be_utf16(&blob, &bRevUnicode) || fForceUtf16;
397
- }
398
- if( fUnicode ){
399
- lookFlags = looks_like_utf16(&blob, bRevUnicode, 0);
400
- }else{
401
- lookFlags = looks_like_utf8(&blob, 0);
402
- if (invalid_utf8(&blob)) lookFlags |= LOOK_INVALID;
384
+ const char *zCount = find_option("limit","n",1);
385
+ int nRepeat = 1;
386
+
387
+ if( g.argc!=3 ) usage("FILENAME");
388
+ if( zCount ){
389
+ nRepeat = atoi(zCount);
390
+ }
391
+ blob_read_from_file(&blob, g.argv[2]);
392
+ while( --nRepeat >= 0 ){
393
+ fUtf8 = starts_with_utf8_bom(&blob, 0);
394
+ fUtf16 = starts_with_utf16_bom(&blob, 0, &bRevUtf16);
395
+ if( fForceUtf8 ){
396
+ fUnicode = 0;
397
+ }else{
398
+ fUnicode = could_be_utf16(&blob, 0) || fForceUtf16;
399
+ }
400
+ if( fUnicode ){
401
+ lookFlags = looks_like_utf16(&blob, bRevUtf16, 0);
402
+ }else{
403
+ lookFlags = looks_like_utf8(&blob, 0)|invalid_utf8(&blob);
404
+ }
403405
}
404406
fossil_print("File \"%s\" has %d bytes.\n",g.argv[2],blob_size(&blob));
405407
fossil_print("Starts with UTF-8 BOM: %s\n",fUtf8?"yes":"no");
406408
fossil_print("Starts with UTF-16 BOM: %s\n",
407409
fUtf16?(bRevUtf16?"reversed":"yes"):"no");
408410
--- src/lookslike.c
+++ src/lookslike.c
@@ -157,20 +157,18 @@
157 c = *z;
158 while( --n>0 ){
159 c2 = c;
160 c = *++z;
161 if( c2>=0x80 ){
162 if( (c2!=0xc0) || (c!=0x80) ){
163 if( ((c2==0xf4) && (c>=0x90)) ||
164 (c2<0xc2) || (c2>0xf4) || ((c&0xc0)!=0x80) ){
165 return 1; /* Invalid UTF-8 */
166 }
167 }
168 c = (c2 >= 0xe0) ? (c2<<1)+1 : ' ';
169 }
170 }
171 return c>=0x80; /* Last byte must be ASCII. */
172 }
173
174
175 /*
176 ** Define the type needed to represent a Unicode (UTF-16) character.
@@ -233,15 +231,14 @@
233 int looks_like_utf16(const Blob *pContent, int bReverse, int stopFlags){
234 const WCHAR_T *z = (WCHAR_T *)blob_buffer(pContent);
235 unsigned int n = blob_size(pContent);
236 int j, c, flags = LOOK_NONE; /* Assume UTF-16 text, prove otherwise */
237
238 if( n==0 ) return flags; /* Empty file -> text */
239 if( n%sizeof(WCHAR_T) ){
240 flags |= LOOK_ODD; /* Odd number of bytes -> binary (UTF-8?) */
241 if( n<sizeof(WCHAR_T) ) return flags; /* One byte -> binary (UTF-8?) */
242 }
 
243 c = *z;
244 if( bReverse ){
245 c = UTF16_SWAP(c);
246 }
247 if( c==0 ){
@@ -252,15 +249,12 @@
252 flags |= LOOK_LONE_CR; /* More chars, next char is not LF */
253 }
254 }
255 j = (c!='\n');
256 if( !j ) flags |= (LOOK_LF | LOOK_LONE_LF); /* Found LF as first char */
257 while( 1 ){
258 int c2 = c;
259 if( flags&stopFlags ) break;
260 n -= sizeof(WCHAR_T);
261 if( n<sizeof(WCHAR_T) ) break;
262 c = *++z;
263 if( bReverse ){
264 c = UTF16_SWAP(c);
265 }
266 ++j;
@@ -368,40 +362,48 @@
368 ** COMMAND: test-looks-like-utf
369 **
370 ** Usage: %fossil test-looks-like-utf FILENAME
371 **
372 ** Options:
 
 
373 ** --utf8 Ignoring BOM and file size, force UTF-8 checking
374 ** --utf16 Ignoring BOM and file size, force UTF-16 checking
375 **
376 ** FILENAME is the name of a file to check for textual content in the UTF-8
377 ** and/or UTF-16 encodings.
378 */
379 void looks_like_utf_test_cmd(void){
380 Blob blob; /* the contents of the specified file */
381 int fUtf8; /* return value of starts_with_utf8_bom() */
382 int fUtf16; /* return value of starts_with_utf16_bom() */
383 int fUnicode; /* return value of could_be_utf16() */
384 int lookFlags; /* output flags from looks_like_utf8/utf16() */
385 int bRevUtf16 = 0; /* non-zero -> UTF-16 byte order reversed */
386 int bRevUnicode = 0; /* non-zero -> UTF-16 byte order reversed */
387 int fForceUtf8 = find_option("utf8",0,0)!=0;
388 int fForceUtf16 = find_option("utf16",0,0)!=0;
389 if( g.argc!=3 ) usage("FILENAME");
390 blob_read_from_file(&blob, g.argv[2]);
391 fUtf8 = starts_with_utf8_bom(&blob, 0);
392 fUtf16 = starts_with_utf16_bom(&blob, 0, &bRevUtf16);
393 if( fForceUtf8 ){
394 fUnicode = 0;
395 }else{
396 fUnicode = could_be_utf16(&blob, &bRevUnicode) || fForceUtf16;
397 }
398 if( fUnicode ){
399 lookFlags = looks_like_utf16(&blob, bRevUnicode, 0);
400 }else{
401 lookFlags = looks_like_utf8(&blob, 0);
402 if (invalid_utf8(&blob)) lookFlags |= LOOK_INVALID;
 
 
 
 
 
 
 
403 }
404 fossil_print("File \"%s\" has %d bytes.\n",g.argv[2],blob_size(&blob));
405 fossil_print("Starts with UTF-8 BOM: %s\n",fUtf8?"yes":"no");
406 fossil_print("Starts with UTF-16 BOM: %s\n",
407 fUtf16?(bRevUtf16?"reversed":"yes"):"no");
408
--- src/lookslike.c
+++ src/lookslike.c
@@ -157,20 +157,18 @@
157 c = *z;
158 while( --n>0 ){
159 c2 = c;
160 c = *++z;
161 if( c2>=0x80 ){
162 if( ((c2<0xc2) || (c2>=0xf4) || ((c&0xc0)!=0x80)) &&
163 (((c2!=0xf4) || (c>=0x90)) && ((c2!=0xc0) || (c!=0x80))) ){
164 return LOOK_INVALID; /* Invalid UTF-8 */
 
 
165 }
166 c = (c2 >= 0xe0) ? (c2<<1)+1 : ' ';
167 }
168 }
169 return (c>=0x80) ? LOOK_INVALID : 0; /* Last byte must be ASCII. */
170 }
171
172
173 /*
174 ** Define the type needed to represent a Unicode (UTF-16) character.
@@ -233,15 +231,14 @@
231 int looks_like_utf16(const Blob *pContent, int bReverse, int stopFlags){
232 const WCHAR_T *z = (WCHAR_T *)blob_buffer(pContent);
233 unsigned int n = blob_size(pContent);
234 int j, c, flags = LOOK_NONE; /* Assume UTF-16 text, prove otherwise */
235
 
236 if( n%sizeof(WCHAR_T) ){
237 flags |= LOOK_ODD; /* Odd number of bytes -> binary (UTF-8?) */
 
238 }
239 if( n<sizeof(WCHAR_T) ) return flags; /* Zero or One byte -> binary (UTF-8?) */
240 c = *z;
241 if( bReverse ){
242 c = UTF16_SWAP(c);
243 }
244 if( c==0 ){
@@ -252,15 +249,12 @@
249 flags |= LOOK_LONE_CR; /* More chars, next char is not LF */
250 }
251 }
252 j = (c!='\n');
253 if( !j ) flags |= (LOOK_LF | LOOK_LONE_LF); /* Found LF as first char */
254 while( !(flags&stopFlags) && ((n-=sizeof(WCHAR_T))>=sizeof(WCHAR_T)) ){
255 int c2 = c;
 
 
 
256 c = *++z;
257 if( bReverse ){
258 c = UTF16_SWAP(c);
259 }
260 ++j;
@@ -368,40 +362,48 @@
362 ** COMMAND: test-looks-like-utf
363 **
364 ** Usage: %fossil test-looks-like-utf FILENAME
365 **
366 ** Options:
367 ** -n|--limit <num> Repeat looks-like function <num> times, for
368 ** performance measurement. Default = 1;
369 ** --utf8 Ignoring BOM and file size, force UTF-8 checking
370 ** --utf16 Ignoring BOM and file size, force UTF-16 checking
371 **
372 ** FILENAME is the name of a file to check for textual content in the UTF-8
373 ** and/or UTF-16 encodings.
374 */
375 void looks_like_utf_test_cmd(void){
376 Blob blob; /* the contents of the specified file */
377 int fUtf8 = 0; /* return value of starts_with_utf8_bom() */
378 int fUtf16 = 0; /* return value of starts_with_utf16_bom() */
379 int fUnicode = 0; /* return value of could_be_utf16() */
380 int lookFlags = 0; /* output flags from looks_like_utf8/utf16() */
381 int bRevUtf16 = 0; /* non-zero -> UTF-16 byte order reversed */
 
382 int fForceUtf8 = find_option("utf8",0,0)!=0;
383 int fForceUtf16 = find_option("utf16",0,0)!=0;
384 const char *zCount = find_option("limit","n",1);
385 int nRepeat = 1;
386
387 if( g.argc!=3 ) usage("FILENAME");
388 if( zCount ){
389 nRepeat = atoi(zCount);
390 }
391 blob_read_from_file(&blob, g.argv[2]);
392 while( --nRepeat >= 0 ){
393 fUtf8 = starts_with_utf8_bom(&blob, 0);
394 fUtf16 = starts_with_utf16_bom(&blob, 0, &bRevUtf16);
395 if( fForceUtf8 ){
396 fUnicode = 0;
397 }else{
398 fUnicode = could_be_utf16(&blob, 0) || fForceUtf16;
399 }
400 if( fUnicode ){
401 lookFlags = looks_like_utf16(&blob, bRevUtf16, 0);
402 }else{
403 lookFlags = looks_like_utf8(&blob, 0)|invalid_utf8(&blob);
404 }
405 }
406 fossil_print("File \"%s\" has %d bytes.\n",g.argv[2],blob_size(&blob));
407 fossil_print("Starts with UTF-8 BOM: %s\n",fUtf8?"yes":"no");
408 fossil_print("Starts with UTF-16 BOM: %s\n",
409 fUtf16?(bRevUtf16?"reversed":"yes"):"no");
410
+3
--- src/main.c
+++ src/main.c
@@ -1266,10 +1266,13 @@
12661266
}
12671267
i = setgid(sStat.st_gid);
12681268
i = i || setuid(sStat.st_uid);
12691269
if(i){
12701270
fossil_fatal("setgid/uid() failed with errno %d", errno);
1271
+ }
1272
+ if( g.db==0 && file_isfile(zRepo) ){
1273
+ db_open_repository(zRepo);
12711274
}
12721275
}
12731276
#endif
12741277
return zRepo;
12751278
}
12761279
--- src/main.c
+++ src/main.c
@@ -1266,10 +1266,13 @@
1266 }
1267 i = setgid(sStat.st_gid);
1268 i = i || setuid(sStat.st_uid);
1269 if(i){
1270 fossil_fatal("setgid/uid() failed with errno %d", errno);
 
 
 
1271 }
1272 }
1273 #endif
1274 return zRepo;
1275 }
1276
--- src/main.c
+++ src/main.c
@@ -1266,10 +1266,13 @@
1266 }
1267 i = setgid(sStat.st_gid);
1268 i = i || setuid(sStat.st_uid);
1269 if(i){
1270 fossil_fatal("setgid/uid() failed with errno %d", errno);
1271 }
1272 if( g.db==0 && file_isfile(zRepo) ){
1273 db_open_repository(zRepo);
1274 }
1275 }
1276 #endif
1277 return zRepo;
1278 }
1279
+11 -1
--- src/main.mk
+++ src/main.mk
@@ -20,10 +20,11 @@
2020
$(SRCDIR)/bag.c \
2121
$(SRCDIR)/bisect.c \
2222
$(SRCDIR)/blob.c \
2323
$(SRCDIR)/branch.c \
2424
$(SRCDIR)/browse.c \
25
+ $(SRCDIR)/cache.c \
2526
$(SRCDIR)/captcha.c \
2627
$(SRCDIR)/cgi.c \
2728
$(SRCDIR)/checkin.c \
2829
$(SRCDIR)/checkout.c \
2930
$(SRCDIR)/clearsign.c \
@@ -131,10 +132,11 @@
131132
$(OBJDIR)/bag_.c \
132133
$(OBJDIR)/bisect_.c \
133134
$(OBJDIR)/blob_.c \
134135
$(OBJDIR)/branch_.c \
135136
$(OBJDIR)/browse_.c \
137
+ $(OBJDIR)/cache_.c \
136138
$(OBJDIR)/captcha_.c \
137139
$(OBJDIR)/cgi_.c \
138140
$(OBJDIR)/checkin_.c \
139141
$(OBJDIR)/checkout_.c \
140142
$(OBJDIR)/clearsign_.c \
@@ -242,10 +244,11 @@
242244
$(OBJDIR)/bag.o \
243245
$(OBJDIR)/bisect.o \
244246
$(OBJDIR)/blob.o \
245247
$(OBJDIR)/branch.o \
246248
$(OBJDIR)/browse.o \
249
+ $(OBJDIR)/cache.o \
247250
$(OBJDIR)/captcha.o \
248251
$(OBJDIR)/cgi.o \
249252
$(OBJDIR)/checkin.o \
250253
$(OBJDIR)/checkout.o \
251254
$(OBJDIR)/clearsign.o \
@@ -418,11 +421,11 @@
418421
419422
420423
$(OBJDIR)/page_index.h: $(TRANS_SRC) $(OBJDIR)/mkindex
421424
$(OBJDIR)/mkindex $(TRANS_SRC) >$@
422425
$(OBJDIR)/headers: $(OBJDIR)/page_index.h $(OBJDIR)/makeheaders $(OBJDIR)/VERSION.h
423
- $(OBJDIR)/makeheaders $(OBJDIR)/add_.c:$(OBJDIR)/add.h $(OBJDIR)/allrepo_.c:$(OBJDIR)/allrepo.h $(OBJDIR)/attach_.c:$(OBJDIR)/attach.h $(OBJDIR)/bag_.c:$(OBJDIR)/bag.h $(OBJDIR)/bisect_.c:$(OBJDIR)/bisect.h $(OBJDIR)/blob_.c:$(OBJDIR)/blob.h $(OBJDIR)/branch_.c:$(OBJDIR)/branch.h $(OBJDIR)/browse_.c:$(OBJDIR)/browse.h $(OBJDIR)/captcha_.c:$(OBJDIR)/captcha.h $(OBJDIR)/cgi_.c:$(OBJDIR)/cgi.h $(OBJDIR)/checkin_.c:$(OBJDIR)/checkin.h $(OBJDIR)/checkout_.c:$(OBJDIR)/checkout.h $(OBJDIR)/clearsign_.c:$(OBJDIR)/clearsign.h $(OBJDIR)/clone_.c:$(OBJDIR)/clone.h $(OBJDIR)/comformat_.c:$(OBJDIR)/comformat.h $(OBJDIR)/configure_.c:$(OBJDIR)/configure.h $(OBJDIR)/content_.c:$(OBJDIR)/content.h $(OBJDIR)/db_.c:$(OBJDIR)/db.h $(OBJDIR)/delta_.c:$(OBJDIR)/delta.h $(OBJDIR)/deltacmd_.c:$(OBJDIR)/deltacmd.h $(OBJDIR)/descendants_.c:$(OBJDIR)/descendants.h $(OBJDIR)/diff_.c:$(OBJDIR)/diff.h $(OBJDIR)/diffcmd_.c:$(OBJDIR)/diffcmd.h $(OBJDIR)/doc_.c:$(OBJDIR)/doc.h $(OBJDIR)/encode_.c:$(OBJDIR)/encode.h $(OBJDIR)/event_.c:$(OBJDIR)/event.h $(OBJDIR)/export_.c:$(OBJDIR)/export.h $(OBJDIR)/file_.c:$(OBJDIR)/file.h $(OBJDIR)/finfo_.c:$(OBJDIR)/finfo.h $(OBJDIR)/glob_.c:$(OBJDIR)/glob.h $(OBJDIR)/graph_.c:$(OBJDIR)/graph.h $(OBJDIR)/gzip_.c:$(OBJDIR)/gzip.h $(OBJDIR)/http_.c:$(OBJDIR)/http.h $(OBJDIR)/http_socket_.c:$(OBJDIR)/http_socket.h $(OBJDIR)/http_ssl_.c:$(OBJDIR)/http_ssl.h $(OBJDIR)/http_transport_.c:$(OBJDIR)/http_transport.h $(OBJDIR)/import_.c:$(OBJDIR)/import.h $(OBJDIR)/info_.c:$(OBJDIR)/info.h $(OBJDIR)/json_.c:$(OBJDIR)/json.h $(OBJDIR)/json_artifact_.c:$(OBJDIR)/json_artifact.h $(OBJDIR)/json_branch_.c:$(OBJDIR)/json_branch.h $(OBJDIR)/json_config_.c:$(OBJDIR)/json_config.h $(OBJDIR)/json_diff_.c:$(OBJDIR)/json_diff.h $(OBJDIR)/json_dir_.c:$(OBJDIR)/json_dir.h $(OBJDIR)/json_finfo_.c:$(OBJDIR)/json_finfo.h $(OBJDIR)/json_login_.c:$(OBJDIR)/json_login.h $(OBJDIR)/json_query_.c:$(OBJDIR)/json_query.h $(OBJDIR)/json_report_.c:$(OBJDIR)/json_report.h $(OBJDIR)/json_status_.c:$(OBJDIR)/json_status.h $(OBJDIR)/json_tag_.c:$(OBJDIR)/json_tag.h $(OBJDIR)/json_timeline_.c:$(OBJDIR)/json_timeline.h $(OBJDIR)/json_user_.c:$(OBJDIR)/json_user.h $(OBJDIR)/json_wiki_.c:$(OBJDIR)/json_wiki.h $(OBJDIR)/leaf_.c:$(OBJDIR)/leaf.h $(OBJDIR)/loadctrl_.c:$(OBJDIR)/loadctrl.h $(OBJDIR)/login_.c:$(OBJDIR)/login.h $(OBJDIR)/lookslike_.c:$(OBJDIR)/lookslike.h $(OBJDIR)/main_.c:$(OBJDIR)/main.h $(OBJDIR)/manifest_.c:$(OBJDIR)/manifest.h $(OBJDIR)/markdown_.c:$(OBJDIR)/markdown.h $(OBJDIR)/markdown_html_.c:$(OBJDIR)/markdown_html.h $(OBJDIR)/md5_.c:$(OBJDIR)/md5.h $(OBJDIR)/merge_.c:$(OBJDIR)/merge.h $(OBJDIR)/merge3_.c:$(OBJDIR)/merge3.h $(OBJDIR)/moderate_.c:$(OBJDIR)/moderate.h $(OBJDIR)/name_.c:$(OBJDIR)/name.h $(OBJDIR)/path_.c:$(OBJDIR)/path.h $(OBJDIR)/pivot_.c:$(OBJDIR)/pivot.h $(OBJDIR)/popen_.c:$(OBJDIR)/popen.h $(OBJDIR)/pqueue_.c:$(OBJDIR)/pqueue.h $(OBJDIR)/printf_.c:$(OBJDIR)/printf.h $(OBJDIR)/rebuild_.c:$(OBJDIR)/rebuild.h $(OBJDIR)/regexp_.c:$(OBJDIR)/regexp.h $(OBJDIR)/report_.c:$(OBJDIR)/report.h $(OBJDIR)/rss_.c:$(OBJDIR)/rss.h $(OBJDIR)/schema_.c:$(OBJDIR)/schema.h $(OBJDIR)/search_.c:$(OBJDIR)/search.h $(OBJDIR)/setup_.c:$(OBJDIR)/setup.h $(OBJDIR)/sha1_.c:$(OBJDIR)/sha1.h $(OBJDIR)/shun_.c:$(OBJDIR)/shun.h $(OBJDIR)/skins_.c:$(OBJDIR)/skins.h $(OBJDIR)/sqlcmd_.c:$(OBJDIR)/sqlcmd.h $(OBJDIR)/stash_.c:$(OBJDIR)/stash.h $(OBJDIR)/stat_.c:$(OBJDIR)/stat.h $(OBJDIR)/style_.c:$(OBJDIR)/style.h $(OBJDIR)/sync_.c:$(OBJDIR)/sync.h $(OBJDIR)/tag_.c:$(OBJDIR)/tag.h $(OBJDIR)/tar_.c:$(OBJDIR)/tar.h $(OBJDIR)/th_main_.c:$(OBJDIR)/th_main.h $(OBJDIR)/timeline_.c:$(OBJDIR)/timeline.h $(OBJDIR)/tkt_.c:$(OBJDIR)/tkt.h $(OBJDIR)/tktsetup_.c:$(OBJDIR)/tktsetup.h $(OBJDIR)/undo_.c:$(OBJDIR)/undo.h $(OBJDIR)/unicode_.c:$(OBJDIR)/unicode.h $(OBJDIR)/update_.c:$(OBJDIR)/update.h $(OBJDIR)/url_.c:$(OBJDIR)/url.h $(OBJDIR)/user_.c:$(OBJDIR)/user.h $(OBJDIR)/utf8_.c:$(OBJDIR)/utf8.h $(OBJDIR)/util_.c:$(OBJDIR)/util.h $(OBJDIR)/verify_.c:$(OBJDIR)/verify.h $(OBJDIR)/vfile_.c:$(OBJDIR)/vfile.h $(OBJDIR)/wiki_.c:$(OBJDIR)/wiki.h $(OBJDIR)/wikiformat_.c:$(OBJDIR)/wikiformat.h $(OBJDIR)/winfile_.c:$(OBJDIR)/winfile.h $(OBJDIR)/winhttp_.c:$(OBJDIR)/winhttp.h $(OBJDIR)/wysiwyg_.c:$(OBJDIR)/wysiwyg.h $(OBJDIR)/xfer_.c:$(OBJDIR)/xfer.h $(OBJDIR)/xfersetup_.c:$(OBJDIR)/xfersetup.h $(OBJDIR)/zip_.c:$(OBJDIR)/zip.h $(SRCDIR)/sqlite3.h $(SRCDIR)/th.h $(OBJDIR)/VERSION.h
426
+ $(OBJDIR)/makeheaders $(OBJDIR)/add_.c:$(OBJDIR)/add.h $(OBJDIR)/allrepo_.c:$(OBJDIR)/allrepo.h $(OBJDIR)/attach_.c:$(OBJDIR)/attach.h $(OBJDIR)/bag_.c:$(OBJDIR)/bag.h $(OBJDIR)/bisect_.c:$(OBJDIR)/bisect.h $(OBJDIR)/blob_.c:$(OBJDIR)/blob.h $(OBJDIR)/branch_.c:$(OBJDIR)/branch.h $(OBJDIR)/browse_.c:$(OBJDIR)/browse.h $(OBJDIR)/cache_.c:$(OBJDIR)/cache.h $(OBJDIR)/captcha_.c:$(OBJDIR)/captcha.h $(OBJDIR)/cgi_.c:$(OBJDIR)/cgi.h $(OBJDIR)/checkin_.c:$(OBJDIR)/checkin.h $(OBJDIR)/checkout_.c:$(OBJDIR)/checkout.h $(OBJDIR)/clearsign_.c:$(OBJDIR)/clearsign.h $(OBJDIR)/clone_.c:$(OBJDIR)/clone.h $(OBJDIR)/comformat_.c:$(OBJDIR)/comformat.h $(OBJDIR)/configure_.c:$(OBJDIR)/configure.h $(OBJDIR)/content_.c:$(OBJDIR)/content.h $(OBJDIR)/db_.c:$(OBJDIR)/db.h $(OBJDIR)/delta_.c:$(OBJDIR)/delta.h $(OBJDIR)/deltacmd_.c:$(OBJDIR)/deltacmd.h $(OBJDIR)/descendants_.c:$(OBJDIR)/descendants.h $(OBJDIR)/diff_.c:$(OBJDIR)/diff.h $(OBJDIR)/diffcmd_.c:$(OBJDIR)/diffcmd.h $(OBJDIR)/doc_.c:$(OBJDIR)/doc.h $(OBJDIR)/encode_.c:$(OBJDIR)/encode.h $(OBJDIR)/event_.c:$(OBJDIR)/event.h $(OBJDIR)/export_.c:$(OBJDIR)/export.h $(OBJDIR)/file_.c:$(OBJDIR)/file.h $(OBJDIR)/finfo_.c:$(OBJDIR)/finfo.h $(OBJDIR)/glob_.c:$(OBJDIR)/glob.h $(OBJDIR)/graph_.c:$(OBJDIR)/graph.h $(OBJDIR)/gzip_.c:$(OBJDIR)/gzip.h $(OBJDIR)/http_.c:$(OBJDIR)/http.h $(OBJDIR)/http_socket_.c:$(OBJDIR)/http_socket.h $(OBJDIR)/http_ssl_.c:$(OBJDIR)/http_ssl.h $(OBJDIR)/http_transport_.c:$(OBJDIR)/http_transport.h $(OBJDIR)/import_.c:$(OBJDIR)/import.h $(OBJDIR)/info_.c:$(OBJDIR)/info.h $(OBJDIR)/json_.c:$(OBJDIR)/json.h $(OBJDIR)/json_artifact_.c:$(OBJDIR)/json_artifact.h $(OBJDIR)/json_branch_.c:$(OBJDIR)/json_branch.h $(OBJDIR)/json_config_.c:$(OBJDIR)/json_config.h $(OBJDIR)/json_diff_.c:$(OBJDIR)/json_diff.h $(OBJDIR)/json_dir_.c:$(OBJDIR)/json_dir.h $(OBJDIR)/json_finfo_.c:$(OBJDIR)/json_finfo.h $(OBJDIR)/json_login_.c:$(OBJDIR)/json_login.h $(OBJDIR)/json_query_.c:$(OBJDIR)/json_query.h $(OBJDIR)/json_report_.c:$(OBJDIR)/json_report.h $(OBJDIR)/json_status_.c:$(OBJDIR)/json_status.h $(OBJDIR)/json_tag_.c:$(OBJDIR)/json_tag.h $(OBJDIR)/json_timeline_.c:$(OBJDIR)/json_timeline.h $(OBJDIR)/json_user_.c:$(OBJDIR)/json_user.h $(OBJDIR)/json_wiki_.c:$(OBJDIR)/json_wiki.h $(OBJDIR)/leaf_.c:$(OBJDIR)/leaf.h $(OBJDIR)/loadctrl_.c:$(OBJDIR)/loadctrl.h $(OBJDIR)/login_.c:$(OBJDIR)/login.h $(OBJDIR)/lookslike_.c:$(OBJDIR)/lookslike.h $(OBJDIR)/main_.c:$(OBJDIR)/main.h $(OBJDIR)/manifest_.c:$(OBJDIR)/manifest.h $(OBJDIR)/markdown_.c:$(OBJDIR)/markdown.h $(OBJDIR)/markdown_html_.c:$(OBJDIR)/markdown_html.h $(OBJDIR)/md5_.c:$(OBJDIR)/md5.h $(OBJDIR)/merge_.c:$(OBJDIR)/merge.h $(OBJDIR)/merge3_.c:$(OBJDIR)/merge3.h $(OBJDIR)/moderate_.c:$(OBJDIR)/moderate.h $(OBJDIR)/name_.c:$(OBJDIR)/name.h $(OBJDIR)/path_.c:$(OBJDIR)/path.h $(OBJDIR)/pivot_.c:$(OBJDIR)/pivot.h $(OBJDIR)/popen_.c:$(OBJDIR)/popen.h $(OBJDIR)/pqueue_.c:$(OBJDIR)/pqueue.h $(OBJDIR)/printf_.c:$(OBJDIR)/printf.h $(OBJDIR)/rebuild_.c:$(OBJDIR)/rebuild.h $(OBJDIR)/regexp_.c:$(OBJDIR)/regexp.h $(OBJDIR)/report_.c:$(OBJDIR)/report.h $(OBJDIR)/rss_.c:$(OBJDIR)/rss.h $(OBJDIR)/schema_.c:$(OBJDIR)/schema.h $(OBJDIR)/search_.c:$(OBJDIR)/search.h $(OBJDIR)/setup_.c:$(OBJDIR)/setup.h $(OBJDIR)/sha1_.c:$(OBJDIR)/sha1.h $(OBJDIR)/shun_.c:$(OBJDIR)/shun.h $(OBJDIR)/skins_.c:$(OBJDIR)/skins.h $(OBJDIR)/sqlcmd_.c:$(OBJDIR)/sqlcmd.h $(OBJDIR)/stash_.c:$(OBJDIR)/stash.h $(OBJDIR)/stat_.c:$(OBJDIR)/stat.h $(OBJDIR)/style_.c:$(OBJDIR)/style.h $(OBJDIR)/sync_.c:$(OBJDIR)/sync.h $(OBJDIR)/tag_.c:$(OBJDIR)/tag.h $(OBJDIR)/tar_.c:$(OBJDIR)/tar.h $(OBJDIR)/th_main_.c:$(OBJDIR)/th_main.h $(OBJDIR)/timeline_.c:$(OBJDIR)/timeline.h $(OBJDIR)/tkt_.c:$(OBJDIR)/tkt.h $(OBJDIR)/tktsetup_.c:$(OBJDIR)/tktsetup.h $(OBJDIR)/undo_.c:$(OBJDIR)/undo.h $(OBJDIR)/unicode_.c:$(OBJDIR)/unicode.h $(OBJDIR)/update_.c:$(OBJDIR)/update.h $(OBJDIR)/url_.c:$(OBJDIR)/url.h $(OBJDIR)/user_.c:$(OBJDIR)/user.h $(OBJDIR)/utf8_.c:$(OBJDIR)/utf8.h $(OBJDIR)/util_.c:$(OBJDIR)/util.h $(OBJDIR)/verify_.c:$(OBJDIR)/verify.h $(OBJDIR)/vfile_.c:$(OBJDIR)/vfile.h $(OBJDIR)/wiki_.c:$(OBJDIR)/wiki.h $(OBJDIR)/wikiformat_.c:$(OBJDIR)/wikiformat.h $(OBJDIR)/winfile_.c:$(OBJDIR)/winfile.h $(OBJDIR)/winhttp_.c:$(OBJDIR)/winhttp.h $(OBJDIR)/wysiwyg_.c:$(OBJDIR)/wysiwyg.h $(OBJDIR)/xfer_.c:$(OBJDIR)/xfer.h $(OBJDIR)/xfersetup_.c:$(OBJDIR)/xfersetup.h $(OBJDIR)/zip_.c:$(OBJDIR)/zip.h $(SRCDIR)/sqlite3.h $(SRCDIR)/th.h $(OBJDIR)/VERSION.h
424427
touch $(OBJDIR)/headers
425428
$(OBJDIR)/headers: Makefile
426429
$(OBJDIR)/json.o $(OBJDIR)/json_artifact.o $(OBJDIR)/json_branch.o $(OBJDIR)/json_config.o $(OBJDIR)/json_diff.o $(OBJDIR)/json_dir.o $(OBJDIR)/json_finfo.o $(OBJDIR)/json_login.o $(OBJDIR)/json_query.o $(OBJDIR)/json_report.o $(OBJDIR)/json_status.o $(OBJDIR)/json_tag.o $(OBJDIR)/json_timeline.o $(OBJDIR)/json_user.o $(OBJDIR)/json_wiki.o : $(SRCDIR)/json_detail.h
427430
Makefile:
428431
$(OBJDIR)/add_.c: $(SRCDIR)/add.c $(OBJDIR)/translate
@@ -479,10 +482,17 @@
479482
480483
$(OBJDIR)/browse.o: $(OBJDIR)/browse_.c $(OBJDIR)/browse.h $(SRCDIR)/config.h
481484
$(XTCC) -o $(OBJDIR)/browse.o -c $(OBJDIR)/browse_.c
482485
483486
$(OBJDIR)/browse.h: $(OBJDIR)/headers
487
+$(OBJDIR)/cache_.c: $(SRCDIR)/cache.c $(OBJDIR)/translate
488
+ $(OBJDIR)/translate $(SRCDIR)/cache.c >$(OBJDIR)/cache_.c
489
+
490
+$(OBJDIR)/cache.o: $(OBJDIR)/cache_.c $(OBJDIR)/cache.h $(SRCDIR)/config.h
491
+ $(XTCC) -o $(OBJDIR)/cache.o -c $(OBJDIR)/cache_.c
492
+
493
+$(OBJDIR)/cache.h: $(OBJDIR)/headers
484494
$(OBJDIR)/captcha_.c: $(SRCDIR)/captcha.c $(OBJDIR)/translate
485495
$(OBJDIR)/translate $(SRCDIR)/captcha.c >$(OBJDIR)/captcha_.c
486496
487497
$(OBJDIR)/captcha.o: $(OBJDIR)/captcha_.c $(OBJDIR)/captcha.h $(SRCDIR)/config.h
488498
$(XTCC) -o $(OBJDIR)/captcha.o -c $(OBJDIR)/captcha_.c
489499
--- src/main.mk
+++ src/main.mk
@@ -20,10 +20,11 @@
20 $(SRCDIR)/bag.c \
21 $(SRCDIR)/bisect.c \
22 $(SRCDIR)/blob.c \
23 $(SRCDIR)/branch.c \
24 $(SRCDIR)/browse.c \
 
25 $(SRCDIR)/captcha.c \
26 $(SRCDIR)/cgi.c \
27 $(SRCDIR)/checkin.c \
28 $(SRCDIR)/checkout.c \
29 $(SRCDIR)/clearsign.c \
@@ -131,10 +132,11 @@
131 $(OBJDIR)/bag_.c \
132 $(OBJDIR)/bisect_.c \
133 $(OBJDIR)/blob_.c \
134 $(OBJDIR)/branch_.c \
135 $(OBJDIR)/browse_.c \
 
136 $(OBJDIR)/captcha_.c \
137 $(OBJDIR)/cgi_.c \
138 $(OBJDIR)/checkin_.c \
139 $(OBJDIR)/checkout_.c \
140 $(OBJDIR)/clearsign_.c \
@@ -242,10 +244,11 @@
242 $(OBJDIR)/bag.o \
243 $(OBJDIR)/bisect.o \
244 $(OBJDIR)/blob.o \
245 $(OBJDIR)/branch.o \
246 $(OBJDIR)/browse.o \
 
247 $(OBJDIR)/captcha.o \
248 $(OBJDIR)/cgi.o \
249 $(OBJDIR)/checkin.o \
250 $(OBJDIR)/checkout.o \
251 $(OBJDIR)/clearsign.o \
@@ -418,11 +421,11 @@
418
419
420 $(OBJDIR)/page_index.h: $(TRANS_SRC) $(OBJDIR)/mkindex
421 $(OBJDIR)/mkindex $(TRANS_SRC) >$@
422 $(OBJDIR)/headers: $(OBJDIR)/page_index.h $(OBJDIR)/makeheaders $(OBJDIR)/VERSION.h
423 $(OBJDIR)/makeheaders $(OBJDIR)/add_.c:$(OBJDIR)/add.h $(OBJDIR)/allrepo_.c:$(OBJDIR)/allrepo.h $(OBJDIR)/attach_.c:$(OBJDIR)/attach.h $(OBJDIR)/bag_.c:$(OBJDIR)/bag.h $(OBJDIR)/bisect_.c:$(OBJDIR)/bisect.h $(OBJDIR)/blob_.c:$(OBJDIR)/blob.h $(OBJDIR)/branch_.c:$(OBJDIR)/branch.h $(OBJDIR)/browse_.c:$(OBJDIR)/browse.h $(OBJDIR)/captcha_.c:$(OBJDIR)/captcha.h $(OBJDIR)/cgi_.c:$(OBJDIR)/cgi.h $(OBJDIR)/checkin_.c:$(OBJDIR)/checkin.h $(OBJDIR)/checkout_.c:$(OBJDIR)/checkout.h $(OBJDIR)/clearsign_.c:$(OBJDIR)/clearsign.h $(OBJDIR)/clone_.c:$(OBJDIR)/clone.h $(OBJDIR)/comformat_.c:$(OBJDIR)/comformat.h $(OBJDIR)/configure_.c:$(OBJDIR)/configure.h $(OBJDIR)/content_.c:$(OBJDIR)/content.h $(OBJDIR)/db_.c:$(OBJDIR)/db.h $(OBJDIR)/delta_.c:$(OBJDIR)/delta.h $(OBJDIR)/deltacmd_.c:$(OBJDIR)/deltacmd.h $(OBJDIR)/descendants_.c:$(OBJDIR)/descendants.h $(OBJDIR)/diff_.c:$(OBJDIR)/diff.h $(OBJDIR)/diffcmd_.c:$(OBJDIR)/diffcmd.h $(OBJDIR)/doc_.c:$(OBJDIR)/doc.h $(OBJDIR)/encode_.c:$(OBJDIR)/encode.h $(OBJDIR)/event_.c:$(OBJDIR)/event.h $(OBJDIR)/export_.c:$(OBJDIR)/export.h $(OBJDIR)/file_.c:$(OBJDIR)/file.h $(OBJDIR)/finfo_.c:$(OBJDIR)/finfo.h $(OBJDIR)/glob_.c:$(OBJDIR)/glob.h $(OBJDIR)/graph_.c:$(OBJDIR)/graph.h $(OBJDIR)/gzip_.c:$(OBJDIR)/gzip.h $(OBJDIR)/http_.c:$(OBJDIR)/http.h $(OBJDIR)/http_socket_.c:$(OBJDIR)/http_socket.h $(OBJDIR)/http_ssl_.c:$(OBJDIR)/http_ssl.h $(OBJDIR)/http_transport_.c:$(OBJDIR)/http_transport.h $(OBJDIR)/import_.c:$(OBJDIR)/import.h $(OBJDIR)/info_.c:$(OBJDIR)/info.h $(OBJDIR)/json_.c:$(OBJDIR)/json.h $(OBJDIR)/json_artifact_.c:$(OBJDIR)/json_artifact.h $(OBJDIR)/json_branch_.c:$(OBJDIR)/json_branch.h $(OBJDIR)/json_config_.c:$(OBJDIR)/json_config.h $(OBJDIR)/json_diff_.c:$(OBJDIR)/json_diff.h $(OBJDIR)/json_dir_.c:$(OBJDIR)/json_dir.h $(OBJDIR)/json_finfo_.c:$(OBJDIR)/json_finfo.h $(OBJDIR)/json_login_.c:$(OBJDIR)/json_login.h $(OBJDIR)/json_query_.c:$(OBJDIR)/json_query.h $(OBJDIR)/json_report_.c:$(OBJDIR)/json_report.h $(OBJDIR)/json_status_.c:$(OBJDIR)/json_status.h $(OBJDIR)/json_tag_.c:$(OBJDIR)/json_tag.h $(OBJDIR)/json_timeline_.c:$(OBJDIR)/json_timeline.h $(OBJDIR)/json_user_.c:$(OBJDIR)/json_user.h $(OBJDIR)/json_wiki_.c:$(OBJDIR)/json_wiki.h $(OBJDIR)/leaf_.c:$(OBJDIR)/leaf.h $(OBJDIR)/loadctrl_.c:$(OBJDIR)/loadctrl.h $(OBJDIR)/login_.c:$(OBJDIR)/login.h $(OBJDIR)/lookslike_.c:$(OBJDIR)/lookslike.h $(OBJDIR)/main_.c:$(OBJDIR)/main.h $(OBJDIR)/manifest_.c:$(OBJDIR)/manifest.h $(OBJDIR)/markdown_.c:$(OBJDIR)/markdown.h $(OBJDIR)/markdown_html_.c:$(OBJDIR)/markdown_html.h $(OBJDIR)/md5_.c:$(OBJDIR)/md5.h $(OBJDIR)/merge_.c:$(OBJDIR)/merge.h $(OBJDIR)/merge3_.c:$(OBJDIR)/merge3.h $(OBJDIR)/moderate_.c:$(OBJDIR)/moderate.h $(OBJDIR)/name_.c:$(OBJDIR)/name.h $(OBJDIR)/path_.c:$(OBJDIR)/path.h $(OBJDIR)/pivot_.c:$(OBJDIR)/pivot.h $(OBJDIR)/popen_.c:$(OBJDIR)/popen.h $(OBJDIR)/pqueue_.c:$(OBJDIR)/pqueue.h $(OBJDIR)/printf_.c:$(OBJDIR)/printf.h $(OBJDIR)/rebuild_.c:$(OBJDIR)/rebuild.h $(OBJDIR)/regexp_.c:$(OBJDIR)/regexp.h $(OBJDIR)/report_.c:$(OBJDIR)/report.h $(OBJDIR)/rss_.c:$(OBJDIR)/rss.h $(OBJDIR)/schema_.c:$(OBJDIR)/schema.h $(OBJDIR)/search_.c:$(OBJDIR)/search.h $(OBJDIR)/setup_.c:$(OBJDIR)/setup.h $(OBJDIR)/sha1_.c:$(OBJDIR)/sha1.h $(OBJDIR)/shun_.c:$(OBJDIR)/shun.h $(OBJDIR)/skins_.c:$(OBJDIR)/skins.h $(OBJDIR)/sqlcmd_.c:$(OBJDIR)/sqlcmd.h $(OBJDIR)/stash_.c:$(OBJDIR)/stash.h $(OBJDIR)/stat_.c:$(OBJDIR)/stat.h $(OBJDIR)/style_.c:$(OBJDIR)/style.h $(OBJDIR)/sync_.c:$(OBJDIR)/sync.h $(OBJDIR)/tag_.c:$(OBJDIR)/tag.h $(OBJDIR)/tar_.c:$(OBJDIR)/tar.h $(OBJDIR)/th_main_.c:$(OBJDIR)/th_main.h $(OBJDIR)/timeline_.c:$(OBJDIR)/timeline.h $(OBJDIR)/tkt_.c:$(OBJDIR)/tkt.h $(OBJDIR)/tktsetup_.c:$(OBJDIR)/tktsetup.h $(OBJDIR)/undo_.c:$(OBJDIR)/undo.h $(OBJDIR)/unicode_.c:$(OBJDIR)/unicode.h $(OBJDIR)/update_.c:$(OBJDIR)/update.h $(OBJDIR)/url_.c:$(OBJDIR)/url.h $(OBJDIR)/user_.c:$(OBJDIR)/user.h $(OBJDIR)/utf8_.c:$(OBJDIR)/utf8.h $(OBJDIR)/util_.c:$(OBJDIR)/util.h $(OBJDIR)/verify_.c:$(OBJDIR)/verify.h $(OBJDIR)/vfile_.c:$(OBJDIR)/vfile.h $(OBJDIR)/wiki_.c:$(OBJDIR)/wiki.h $(OBJDIR)/wikiformat_.c:$(OBJDIR)/wikiformat.h $(OBJDIR)/winfile_.c:$(OBJDIR)/winfile.h $(OBJDIR)/winhttp_.c:$(OBJDIR)/winhttp.h $(OBJDIR)/wysiwyg_.c:$(OBJDIR)/wysiwyg.h $(OBJDIR)/xfer_.c:$(OBJDIR)/xfer.h $(OBJDIR)/xfersetup_.c:$(OBJDIR)/xfersetup.h $(OBJDIR)/zip_.c:$(OBJDIR)/zip.h $(SRCDIR)/sqlite3.h $(SRCDIR)/th.h $(OBJDIR)/VERSION.h
424 touch $(OBJDIR)/headers
425 $(OBJDIR)/headers: Makefile
426 $(OBJDIR)/json.o $(OBJDIR)/json_artifact.o $(OBJDIR)/json_branch.o $(OBJDIR)/json_config.o $(OBJDIR)/json_diff.o $(OBJDIR)/json_dir.o $(OBJDIR)/json_finfo.o $(OBJDIR)/json_login.o $(OBJDIR)/json_query.o $(OBJDIR)/json_report.o $(OBJDIR)/json_status.o $(OBJDIR)/json_tag.o $(OBJDIR)/json_timeline.o $(OBJDIR)/json_user.o $(OBJDIR)/json_wiki.o : $(SRCDIR)/json_detail.h
427 Makefile:
428 $(OBJDIR)/add_.c: $(SRCDIR)/add.c $(OBJDIR)/translate
@@ -479,10 +482,17 @@
479
480 $(OBJDIR)/browse.o: $(OBJDIR)/browse_.c $(OBJDIR)/browse.h $(SRCDIR)/config.h
481 $(XTCC) -o $(OBJDIR)/browse.o -c $(OBJDIR)/browse_.c
482
483 $(OBJDIR)/browse.h: $(OBJDIR)/headers
 
 
 
 
 
 
 
484 $(OBJDIR)/captcha_.c: $(SRCDIR)/captcha.c $(OBJDIR)/translate
485 $(OBJDIR)/translate $(SRCDIR)/captcha.c >$(OBJDIR)/captcha_.c
486
487 $(OBJDIR)/captcha.o: $(OBJDIR)/captcha_.c $(OBJDIR)/captcha.h $(SRCDIR)/config.h
488 $(XTCC) -o $(OBJDIR)/captcha.o -c $(OBJDIR)/captcha_.c
489
--- src/main.mk
+++ src/main.mk
@@ -20,10 +20,11 @@
20 $(SRCDIR)/bag.c \
21 $(SRCDIR)/bisect.c \
22 $(SRCDIR)/blob.c \
23 $(SRCDIR)/branch.c \
24 $(SRCDIR)/browse.c \
25 $(SRCDIR)/cache.c \
26 $(SRCDIR)/captcha.c \
27 $(SRCDIR)/cgi.c \
28 $(SRCDIR)/checkin.c \
29 $(SRCDIR)/checkout.c \
30 $(SRCDIR)/clearsign.c \
@@ -131,10 +132,11 @@
132 $(OBJDIR)/bag_.c \
133 $(OBJDIR)/bisect_.c \
134 $(OBJDIR)/blob_.c \
135 $(OBJDIR)/branch_.c \
136 $(OBJDIR)/browse_.c \
137 $(OBJDIR)/cache_.c \
138 $(OBJDIR)/captcha_.c \
139 $(OBJDIR)/cgi_.c \
140 $(OBJDIR)/checkin_.c \
141 $(OBJDIR)/checkout_.c \
142 $(OBJDIR)/clearsign_.c \
@@ -242,10 +244,11 @@
244 $(OBJDIR)/bag.o \
245 $(OBJDIR)/bisect.o \
246 $(OBJDIR)/blob.o \
247 $(OBJDIR)/branch.o \
248 $(OBJDIR)/browse.o \
249 $(OBJDIR)/cache.o \
250 $(OBJDIR)/captcha.o \
251 $(OBJDIR)/cgi.o \
252 $(OBJDIR)/checkin.o \
253 $(OBJDIR)/checkout.o \
254 $(OBJDIR)/clearsign.o \
@@ -418,11 +421,11 @@
421
422
423 $(OBJDIR)/page_index.h: $(TRANS_SRC) $(OBJDIR)/mkindex
424 $(OBJDIR)/mkindex $(TRANS_SRC) >$@
425 $(OBJDIR)/headers: $(OBJDIR)/page_index.h $(OBJDIR)/makeheaders $(OBJDIR)/VERSION.h
426 $(OBJDIR)/makeheaders $(OBJDIR)/add_.c:$(OBJDIR)/add.h $(OBJDIR)/allrepo_.c:$(OBJDIR)/allrepo.h $(OBJDIR)/attach_.c:$(OBJDIR)/attach.h $(OBJDIR)/bag_.c:$(OBJDIR)/bag.h $(OBJDIR)/bisect_.c:$(OBJDIR)/bisect.h $(OBJDIR)/blob_.c:$(OBJDIR)/blob.h $(OBJDIR)/branch_.c:$(OBJDIR)/branch.h $(OBJDIR)/browse_.c:$(OBJDIR)/browse.h $(OBJDIR)/cache_.c:$(OBJDIR)/cache.h $(OBJDIR)/captcha_.c:$(OBJDIR)/captcha.h $(OBJDIR)/cgi_.c:$(OBJDIR)/cgi.h $(OBJDIR)/checkin_.c:$(OBJDIR)/checkin.h $(OBJDIR)/checkout_.c:$(OBJDIR)/checkout.h $(OBJDIR)/clearsign_.c:$(OBJDIR)/clearsign.h $(OBJDIR)/clone_.c:$(OBJDIR)/clone.h $(OBJDIR)/comformat_.c:$(OBJDIR)/comformat.h $(OBJDIR)/configure_.c:$(OBJDIR)/configure.h $(OBJDIR)/content_.c:$(OBJDIR)/content.h $(OBJDIR)/db_.c:$(OBJDIR)/db.h $(OBJDIR)/delta_.c:$(OBJDIR)/delta.h $(OBJDIR)/deltacmd_.c:$(OBJDIR)/deltacmd.h $(OBJDIR)/descendants_.c:$(OBJDIR)/descendants.h $(OBJDIR)/diff_.c:$(OBJDIR)/diff.h $(OBJDIR)/diffcmd_.c:$(OBJDIR)/diffcmd.h $(OBJDIR)/doc_.c:$(OBJDIR)/doc.h $(OBJDIR)/encode_.c:$(OBJDIR)/encode.h $(OBJDIR)/event_.c:$(OBJDIR)/event.h $(OBJDIR)/export_.c:$(OBJDIR)/export.h $(OBJDIR)/file_.c:$(OBJDIR)/file.h $(OBJDIR)/finfo_.c:$(OBJDIR)/finfo.h $(OBJDIR)/glob_.c:$(OBJDIR)/glob.h $(OBJDIR)/graph_.c:$(OBJDIR)/graph.h $(OBJDIR)/gzip_.c:$(OBJDIR)/gzip.h $(OBJDIR)/http_.c:$(OBJDIR)/http.h $(OBJDIR)/http_socket_.c:$(OBJDIR)/http_socket.h $(OBJDIR)/http_ssl_.c:$(OBJDIR)/http_ssl.h $(OBJDIR)/http_transport_.c:$(OBJDIR)/http_transport.h $(OBJDIR)/import_.c:$(OBJDIR)/import.h $(OBJDIR)/info_.c:$(OBJDIR)/info.h $(OBJDIR)/json_.c:$(OBJDIR)/json.h $(OBJDIR)/json_artifact_.c:$(OBJDIR)/json_artifact.h $(OBJDIR)/json_branch_.c:$(OBJDIR)/json_branch.h $(OBJDIR)/json_config_.c:$(OBJDIR)/json_config.h $(OBJDIR)/json_diff_.c:$(OBJDIR)/json_diff.h $(OBJDIR)/json_dir_.c:$(OBJDIR)/json_dir.h $(OBJDIR)/json_finfo_.c:$(OBJDIR)/json_finfo.h $(OBJDIR)/json_login_.c:$(OBJDIR)/json_login.h $(OBJDIR)/json_query_.c:$(OBJDIR)/json_query.h $(OBJDIR)/json_report_.c:$(OBJDIR)/json_report.h $(OBJDIR)/json_status_.c:$(OBJDIR)/json_status.h $(OBJDIR)/json_tag_.c:$(OBJDIR)/json_tag.h $(OBJDIR)/json_timeline_.c:$(OBJDIR)/json_timeline.h $(OBJDIR)/json_user_.c:$(OBJDIR)/json_user.h $(OBJDIR)/json_wiki_.c:$(OBJDIR)/json_wiki.h $(OBJDIR)/leaf_.c:$(OBJDIR)/leaf.h $(OBJDIR)/loadctrl_.c:$(OBJDIR)/loadctrl.h $(OBJDIR)/login_.c:$(OBJDIR)/login.h $(OBJDIR)/lookslike_.c:$(OBJDIR)/lookslike.h $(OBJDIR)/main_.c:$(OBJDIR)/main.h $(OBJDIR)/manifest_.c:$(OBJDIR)/manifest.h $(OBJDIR)/markdown_.c:$(OBJDIR)/markdown.h $(OBJDIR)/markdown_html_.c:$(OBJDIR)/markdown_html.h $(OBJDIR)/md5_.c:$(OBJDIR)/md5.h $(OBJDIR)/merge_.c:$(OBJDIR)/merge.h $(OBJDIR)/merge3_.c:$(OBJDIR)/merge3.h $(OBJDIR)/moderate_.c:$(OBJDIR)/moderate.h $(OBJDIR)/name_.c:$(OBJDIR)/name.h $(OBJDIR)/path_.c:$(OBJDIR)/path.h $(OBJDIR)/pivot_.c:$(OBJDIR)/pivot.h $(OBJDIR)/popen_.c:$(OBJDIR)/popen.h $(OBJDIR)/pqueue_.c:$(OBJDIR)/pqueue.h $(OBJDIR)/printf_.c:$(OBJDIR)/printf.h $(OBJDIR)/rebuild_.c:$(OBJDIR)/rebuild.h $(OBJDIR)/regexp_.c:$(OBJDIR)/regexp.h $(OBJDIR)/report_.c:$(OBJDIR)/report.h $(OBJDIR)/rss_.c:$(OBJDIR)/rss.h $(OBJDIR)/schema_.c:$(OBJDIR)/schema.h $(OBJDIR)/search_.c:$(OBJDIR)/search.h $(OBJDIR)/setup_.c:$(OBJDIR)/setup.h $(OBJDIR)/sha1_.c:$(OBJDIR)/sha1.h $(OBJDIR)/shun_.c:$(OBJDIR)/shun.h $(OBJDIR)/skins_.c:$(OBJDIR)/skins.h $(OBJDIR)/sqlcmd_.c:$(OBJDIR)/sqlcmd.h $(OBJDIR)/stash_.c:$(OBJDIR)/stash.h $(OBJDIR)/stat_.c:$(OBJDIR)/stat.h $(OBJDIR)/style_.c:$(OBJDIR)/style.h $(OBJDIR)/sync_.c:$(OBJDIR)/sync.h $(OBJDIR)/tag_.c:$(OBJDIR)/tag.h $(OBJDIR)/tar_.c:$(OBJDIR)/tar.h $(OBJDIR)/th_main_.c:$(OBJDIR)/th_main.h $(OBJDIR)/timeline_.c:$(OBJDIR)/timeline.h $(OBJDIR)/tkt_.c:$(OBJDIR)/tkt.h $(OBJDIR)/tktsetup_.c:$(OBJDIR)/tktsetup.h $(OBJDIR)/undo_.c:$(OBJDIR)/undo.h $(OBJDIR)/unicode_.c:$(OBJDIR)/unicode.h $(OBJDIR)/update_.c:$(OBJDIR)/update.h $(OBJDIR)/url_.c:$(OBJDIR)/url.h $(OBJDIR)/user_.c:$(OBJDIR)/user.h $(OBJDIR)/utf8_.c:$(OBJDIR)/utf8.h $(OBJDIR)/util_.c:$(OBJDIR)/util.h $(OBJDIR)/verify_.c:$(OBJDIR)/verify.h $(OBJDIR)/vfile_.c:$(OBJDIR)/vfile.h $(OBJDIR)/wiki_.c:$(OBJDIR)/wiki.h $(OBJDIR)/wikiformat_.c:$(OBJDIR)/wikiformat.h $(OBJDIR)/winfile_.c:$(OBJDIR)/winfile.h $(OBJDIR)/winhttp_.c:$(OBJDIR)/winhttp.h $(OBJDIR)/wysiwyg_.c:$(OBJDIR)/wysiwyg.h $(OBJDIR)/xfer_.c:$(OBJDIR)/xfer.h $(OBJDIR)/xfersetup_.c:$(OBJDIR)/xfersetup.h $(OBJDIR)/zip_.c:$(OBJDIR)/zip.h $(SRCDIR)/sqlite3.h $(SRCDIR)/th.h $(OBJDIR)/VERSION.h
427 touch $(OBJDIR)/headers
428 $(OBJDIR)/headers: Makefile
429 $(OBJDIR)/json.o $(OBJDIR)/json_artifact.o $(OBJDIR)/json_branch.o $(OBJDIR)/json_config.o $(OBJDIR)/json_diff.o $(OBJDIR)/json_dir.o $(OBJDIR)/json_finfo.o $(OBJDIR)/json_login.o $(OBJDIR)/json_query.o $(OBJDIR)/json_report.o $(OBJDIR)/json_status.o $(OBJDIR)/json_tag.o $(OBJDIR)/json_timeline.o $(OBJDIR)/json_user.o $(OBJDIR)/json_wiki.o : $(SRCDIR)/json_detail.h
430 Makefile:
431 $(OBJDIR)/add_.c: $(SRCDIR)/add.c $(OBJDIR)/translate
@@ -479,10 +482,17 @@
482
483 $(OBJDIR)/browse.o: $(OBJDIR)/browse_.c $(OBJDIR)/browse.h $(SRCDIR)/config.h
484 $(XTCC) -o $(OBJDIR)/browse.o -c $(OBJDIR)/browse_.c
485
486 $(OBJDIR)/browse.h: $(OBJDIR)/headers
487 $(OBJDIR)/cache_.c: $(SRCDIR)/cache.c $(OBJDIR)/translate
488 $(OBJDIR)/translate $(SRCDIR)/cache.c >$(OBJDIR)/cache_.c
489
490 $(OBJDIR)/cache.o: $(OBJDIR)/cache_.c $(OBJDIR)/cache.h $(SRCDIR)/config.h
491 $(XTCC) -o $(OBJDIR)/cache.o -c $(OBJDIR)/cache_.c
492
493 $(OBJDIR)/cache.h: $(OBJDIR)/headers
494 $(OBJDIR)/captcha_.c: $(SRCDIR)/captcha.c $(OBJDIR)/translate
495 $(OBJDIR)/translate $(SRCDIR)/captcha.c >$(OBJDIR)/captcha_.c
496
497 $(OBJDIR)/captcha.o: $(OBJDIR)/captcha_.c $(OBJDIR)/captcha.h $(SRCDIR)/config.h
498 $(XTCC) -o $(OBJDIR)/captcha.o -c $(OBJDIR)/captcha_.c
499
+19 -2
--- src/makemake.tcl
+++ src/makemake.tcl
@@ -24,10 +24,11 @@
2424
bag
2525
bisect
2626
blob
2727
branch
2828
browse
29
+ cache
2930
captcha
3031
cgi
3132
checkin
3233
checkout
3334
clearsign
@@ -154,11 +155,11 @@
154155
}
155156
156157
# Options used to compile the included SQLite shell on Windows.
157158
#
158159
set SHELL_WIN32_OPTIONS $SHELL_OPTIONS
159
-lappend SHELL_WIN32_OPTIONS -Daccess=win32_access
160
+lappend SHELL_WIN32_OPTIONS -Daccess=file_access
160161
lappend SHELL_WIN32_OPTIONS -Dgetenv=fossil_getenv
161162
lappend SHELL_WIN32_OPTIONS -Dfopen=fossil_fopen
162163
163164
# Name of the final application
164165
#
@@ -419,10 +420,14 @@
419420
# FOSSIL_ENABLE_TCL_STUBS = 1
420421
421422
#### Load Tcl using the private stubs mechanism
422423
#
423424
# FOSSIL_ENABLE_TCL_PRIVATE_STUBS = 1
425
+
426
+#### Use 'system' sqlite
427
+#
428
+# USE_SYSTEM_SQLITE = 1
424429
425430
#### Use the Tcl source directory instead of the install directory?
426431
# This is useful when Tcl has been compiled statically with MinGW.
427432
#
428433
FOSSIL_TCL_SOURCE = 1
@@ -566,10 +571,14 @@
566571
567572
# MinGW: If available, use the Unicode capable runtime startup code.
568573
ifndef MINGW_IS_32BIT_ONLY
569574
LIB += -municode
570575
endif
576
+
577
+ifdef USE_SYSTEM_SQLITE
578
+LIB += -lsqlite3
579
+endif
571580
572581
# OpenSSL: Add the necessary libraries required, if enabled.
573582
ifdef FOSSIL_ENABLE_SSL
574583
LIB += -lssl -lcrypto -lgdi32
575584
endif
@@ -712,12 +721,20 @@
712721
$(TCLSH) $(SRCDIR)/../test/tester.tcl $(APPNAME)
713722
714723
$(OBJDIR)/VERSION.h: $(SRCDIR)/../manifest.uuid $(SRCDIR)/../manifest $(VERSION)
715724
$(VERSION) $(SRCDIR)/../manifest.uuid $(SRCDIR)/../manifest $(SRCDIR)/../VERSION >$(OBJDIR)/VERSION.h
716725
726
+# The USE_SYSTEM_SQLITE variable may be undefined, set to 0, or set
727
+# to 1. If it is set to 1, then there is no need to build or link
728
+# the sqlite3.o object. Instead, the system sqlite will be linked
729
+# using -lsqlite3.
730
+SQLITE3_OBJ.1 =
731
+SQLITE3_OBJ.0 = $(OBJDIR)/sqlite3.o
732
+SQLITE3_OBJ. = $(SQLITE3_OBJ.0)
733
+
717734
EXTRAOBJ = \
718
- $(OBJDIR)/sqlite3.o \
735
+ $(SQLITE3_OBJ.$(USE_SYSTEM_SQLITE)) \
719736
$(OBJDIR)/shell.o \
720737
$(OBJDIR)/th.o \
721738
$(OBJDIR)/th_lang.o \
722739
$(OBJDIR)/th_tcl.o \
723740
$(OBJDIR)/cson_amalgamation.o
724741
--- src/makemake.tcl
+++ src/makemake.tcl
@@ -24,10 +24,11 @@
24 bag
25 bisect
26 blob
27 branch
28 browse
 
29 captcha
30 cgi
31 checkin
32 checkout
33 clearsign
@@ -154,11 +155,11 @@
154 }
155
156 # Options used to compile the included SQLite shell on Windows.
157 #
158 set SHELL_WIN32_OPTIONS $SHELL_OPTIONS
159 lappend SHELL_WIN32_OPTIONS -Daccess=win32_access
160 lappend SHELL_WIN32_OPTIONS -Dgetenv=fossil_getenv
161 lappend SHELL_WIN32_OPTIONS -Dfopen=fossil_fopen
162
163 # Name of the final application
164 #
@@ -419,10 +420,14 @@
419 # FOSSIL_ENABLE_TCL_STUBS = 1
420
421 #### Load Tcl using the private stubs mechanism
422 #
423 # FOSSIL_ENABLE_TCL_PRIVATE_STUBS = 1
 
 
 
 
424
425 #### Use the Tcl source directory instead of the install directory?
426 # This is useful when Tcl has been compiled statically with MinGW.
427 #
428 FOSSIL_TCL_SOURCE = 1
@@ -566,10 +571,14 @@
566
567 # MinGW: If available, use the Unicode capable runtime startup code.
568 ifndef MINGW_IS_32BIT_ONLY
569 LIB += -municode
570 endif
 
 
 
 
571
572 # OpenSSL: Add the necessary libraries required, if enabled.
573 ifdef FOSSIL_ENABLE_SSL
574 LIB += -lssl -lcrypto -lgdi32
575 endif
@@ -712,12 +721,20 @@
712 $(TCLSH) $(SRCDIR)/../test/tester.tcl $(APPNAME)
713
714 $(OBJDIR)/VERSION.h: $(SRCDIR)/../manifest.uuid $(SRCDIR)/../manifest $(VERSION)
715 $(VERSION) $(SRCDIR)/../manifest.uuid $(SRCDIR)/../manifest $(SRCDIR)/../VERSION >$(OBJDIR)/VERSION.h
716
 
 
 
 
 
 
 
 
717 EXTRAOBJ = \
718 $(OBJDIR)/sqlite3.o \
719 $(OBJDIR)/shell.o \
720 $(OBJDIR)/th.o \
721 $(OBJDIR)/th_lang.o \
722 $(OBJDIR)/th_tcl.o \
723 $(OBJDIR)/cson_amalgamation.o
724
--- src/makemake.tcl
+++ src/makemake.tcl
@@ -24,10 +24,11 @@
24 bag
25 bisect
26 blob
27 branch
28 browse
29 cache
30 captcha
31 cgi
32 checkin
33 checkout
34 clearsign
@@ -154,11 +155,11 @@
155 }
156
157 # Options used to compile the included SQLite shell on Windows.
158 #
159 set SHELL_WIN32_OPTIONS $SHELL_OPTIONS
160 lappend SHELL_WIN32_OPTIONS -Daccess=file_access
161 lappend SHELL_WIN32_OPTIONS -Dgetenv=fossil_getenv
162 lappend SHELL_WIN32_OPTIONS -Dfopen=fossil_fopen
163
164 # Name of the final application
165 #
@@ -419,10 +420,14 @@
420 # FOSSIL_ENABLE_TCL_STUBS = 1
421
422 #### Load Tcl using the private stubs mechanism
423 #
424 # FOSSIL_ENABLE_TCL_PRIVATE_STUBS = 1
425
426 #### Use 'system' sqlite
427 #
428 # USE_SYSTEM_SQLITE = 1
429
430 #### Use the Tcl source directory instead of the install directory?
431 # This is useful when Tcl has been compiled statically with MinGW.
432 #
433 FOSSIL_TCL_SOURCE = 1
@@ -566,10 +571,14 @@
571
572 # MinGW: If available, use the Unicode capable runtime startup code.
573 ifndef MINGW_IS_32BIT_ONLY
574 LIB += -municode
575 endif
576
577 ifdef USE_SYSTEM_SQLITE
578 LIB += -lsqlite3
579 endif
580
581 # OpenSSL: Add the necessary libraries required, if enabled.
582 ifdef FOSSIL_ENABLE_SSL
583 LIB += -lssl -lcrypto -lgdi32
584 endif
@@ -712,12 +721,20 @@
721 $(TCLSH) $(SRCDIR)/../test/tester.tcl $(APPNAME)
722
723 $(OBJDIR)/VERSION.h: $(SRCDIR)/../manifest.uuid $(SRCDIR)/../manifest $(VERSION)
724 $(VERSION) $(SRCDIR)/../manifest.uuid $(SRCDIR)/../manifest $(SRCDIR)/../VERSION >$(OBJDIR)/VERSION.h
725
726 # The USE_SYSTEM_SQLITE variable may be undefined, set to 0, or set
727 # to 1. If it is set to 1, then there is no need to build or link
728 # the sqlite3.o object. Instead, the system sqlite will be linked
729 # using -lsqlite3.
730 SQLITE3_OBJ.1 =
731 SQLITE3_OBJ.0 = $(OBJDIR)/sqlite3.o
732 SQLITE3_OBJ. = $(SQLITE3_OBJ.0)
733
734 EXTRAOBJ = \
735 $(SQLITE3_OBJ.$(USE_SYSTEM_SQLITE)) \
736 $(OBJDIR)/shell.o \
737 $(OBJDIR)/th.o \
738 $(OBJDIR)/th_lang.o \
739 $(OBJDIR)/th_tcl.o \
740 $(OBJDIR)/cson_amalgamation.o
741
+58
--- src/path.c
+++ src/path.c
@@ -382,10 +382,15 @@
382382
int i; /* Loop counter */
383383
Stmt q1; /* Query of name changes */
384384
385385
*pnChng = 0;
386386
*aiChng = 0;
387
+ if(0==iFrom){
388
+ fossil_fatal("Invalid 'from' RID: 0");
389
+ }else if(0==iTo){
390
+ fossil_fatal("Invalid 'to' RID: 0");
391
+ }
387392
if( iFrom==iTo ) return;
388393
path_reset();
389394
p = path_shortest(iFrom, iTo, 1, revOk==0);
390395
if( p==0 ) return;
391396
path_reverse_path();
@@ -509,5 +514,58 @@
509514
fossil_free(aChng);
510515
g.argv += 2;
511516
g.argc -= 2;
512517
}
513518
}
519
+
520
+/* Query to extract all rename operations */
521
+static const char zRenameQuery[] =
522
+@ SELECT
523
+@ datetime(event.mtime),
524
+@ F.name AS old_name,
525
+@ T.name AS new_name,
526
+@ blob.uuid
527
+@ FROM mlink, filename F, filename T, event, blob
528
+@ WHERE coalesce(mlink.pfnid,0)!=0 AND mlink.pfnid!=mlink.fnid
529
+@ AND F.fnid=mlink.pfnid
530
+@ AND T.fnid=mlink.fnid
531
+@ AND event.objid=mlink.mid
532
+@ AND event.type='ci'
533
+@ AND blob.rid=mlink.mid
534
+@ ORDER BY 1 DESC, 2;
535
+;
536
+
537
+/*
538
+** WEBPAGE: test-rename-list
539
+**
540
+** Print a list of all file rename operations throughout history.
541
+** This page is intended for for testing purposes only and may change
542
+** or be discontinued without notice.
543
+*/
544
+void test_rename_list_page(void){
545
+ Stmt q;
546
+
547
+ login_check_credentials();
548
+ if( !g.perm.Read ){ login_needed(); return; }
549
+ style_header("List Of File Name Changes");
550
+ @ <h3>NB: Experimental Page</h3>
551
+ @ <table border="1" width="100%%">
552
+ @ <tr><th>Date &amp; Time</th>
553
+ @ <th>Old Name</th>
554
+ @ <th>New Name</th>
555
+ @ <th>Check-in</th></tr>
556
+ db_prepare(&q, zRenameQuery);
557
+ while( db_step(&q)==SQLITE_ROW ){
558
+ const char *zDate = db_column_text(&q, 0);
559
+ const char *zOld = db_column_text(&q, 1);
560
+ const char *zNew = db_column_text(&q, 2);
561
+ const char *zUuid = db_column_text(&q, 3);
562
+ @ <tr>
563
+ @ <td>%z(href("%R/timeline?c=%t",zDate))%s(zDate)</a></td>
564
+ @ <td>%z(href("%R/finfo?name=%t",zOld))%h(zOld)</a></td>
565
+ @ <td>%z(href("%R/finfo?name=%t",zNew))%h(zNew)</a></td>
566
+ @ <td>%z(href("%R/info/%s",zUuid))%S(zUuid)</a></td></tr>
567
+ }
568
+ @ </table>
569
+ db_finalize(&q);
570
+ style_footer();
571
+}
514572
--- src/path.c
+++ src/path.c
@@ -382,10 +382,15 @@
382 int i; /* Loop counter */
383 Stmt q1; /* Query of name changes */
384
385 *pnChng = 0;
386 *aiChng = 0;
 
 
 
 
 
387 if( iFrom==iTo ) return;
388 path_reset();
389 p = path_shortest(iFrom, iTo, 1, revOk==0);
390 if( p==0 ) return;
391 path_reverse_path();
@@ -509,5 +514,58 @@
509 fossil_free(aChng);
510 g.argv += 2;
511 g.argc -= 2;
512 }
513 }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
514
--- src/path.c
+++ src/path.c
@@ -382,10 +382,15 @@
382 int i; /* Loop counter */
383 Stmt q1; /* Query of name changes */
384
385 *pnChng = 0;
386 *aiChng = 0;
387 if(0==iFrom){
388 fossil_fatal("Invalid 'from' RID: 0");
389 }else if(0==iTo){
390 fossil_fatal("Invalid 'to' RID: 0");
391 }
392 if( iFrom==iTo ) return;
393 path_reset();
394 p = path_shortest(iFrom, iTo, 1, revOk==0);
395 if( p==0 ) return;
396 path_reverse_path();
@@ -509,5 +514,58 @@
514 fossil_free(aChng);
515 g.argv += 2;
516 g.argc -= 2;
517 }
518 }
519
520 /* Query to extract all rename operations */
521 static const char zRenameQuery[] =
522 @ SELECT
523 @ datetime(event.mtime),
524 @ F.name AS old_name,
525 @ T.name AS new_name,
526 @ blob.uuid
527 @ FROM mlink, filename F, filename T, event, blob
528 @ WHERE coalesce(mlink.pfnid,0)!=0 AND mlink.pfnid!=mlink.fnid
529 @ AND F.fnid=mlink.pfnid
530 @ AND T.fnid=mlink.fnid
531 @ AND event.objid=mlink.mid
532 @ AND event.type='ci'
533 @ AND blob.rid=mlink.mid
534 @ ORDER BY 1 DESC, 2;
535 ;
536
537 /*
538 ** WEBPAGE: test-rename-list
539 **
540 ** Print a list of all file rename operations throughout history.
541 ** This page is intended for for testing purposes only and may change
542 ** or be discontinued without notice.
543 */
544 void test_rename_list_page(void){
545 Stmt q;
546
547 login_check_credentials();
548 if( !g.perm.Read ){ login_needed(); return; }
549 style_header("List Of File Name Changes");
550 @ <h3>NB: Experimental Page</h3>
551 @ <table border="1" width="100%%">
552 @ <tr><th>Date &amp; Time</th>
553 @ <th>Old Name</th>
554 @ <th>New Name</th>
555 @ <th>Check-in</th></tr>
556 db_prepare(&q, zRenameQuery);
557 while( db_step(&q)==SQLITE_ROW ){
558 const char *zDate = db_column_text(&q, 0);
559 const char *zOld = db_column_text(&q, 1);
560 const char *zNew = db_column_text(&q, 2);
561 const char *zUuid = db_column_text(&q, 3);
562 @ <tr>
563 @ <td>%z(href("%R/timeline?c=%t",zDate))%s(zDate)</a></td>
564 @ <td>%z(href("%R/finfo?name=%t",zOld))%h(zOld)</a></td>
565 @ <td>%z(href("%R/finfo?name=%t",zNew))%h(zNew)</a></td>
566 @ <td>%z(href("%R/info/%s",zUuid))%S(zUuid)</a></td></tr>
567 }
568 @ </table>
569 db_finalize(&q);
570 style_footer();
571 }
572
--- src/rebuild.c
+++ src/rebuild.c
@@ -370,10 +370,13 @@
370370
" WHERE rid IN (SELECT rid FROM shun JOIN blob USING(uuid))"
371371
);
372372
db_multi_exec(
373373
"DELETE FROM config WHERE name IN ('remote-code', 'remote-maxid')"
374374
);
375
+ db_multi_exec(
376
+ "UPDATE user SET mtime=strftime('%%s','now') WHERE mtime IS NULL"
377
+ );
375378
376379
/* The following should be count(*) instead of max(rid). max(rid) is
377380
** an adequate approximation, however, and is much faster for large
378381
** repositories. */
379382
totalSize = db_int(0, "SELECT max(rid) FROM blob");
380383
--- src/rebuild.c
+++ src/rebuild.c
@@ -370,10 +370,13 @@
370 " WHERE rid IN (SELECT rid FROM shun JOIN blob USING(uuid))"
371 );
372 db_multi_exec(
373 "DELETE FROM config WHERE name IN ('remote-code', 'remote-maxid')"
374 );
 
 
 
375
376 /* The following should be count(*) instead of max(rid). max(rid) is
377 ** an adequate approximation, however, and is much faster for large
378 ** repositories. */
379 totalSize = db_int(0, "SELECT max(rid) FROM blob");
380
--- src/rebuild.c
+++ src/rebuild.c
@@ -370,10 +370,13 @@
370 " WHERE rid IN (SELECT rid FROM shun JOIN blob USING(uuid))"
371 );
372 db_multi_exec(
373 "DELETE FROM config WHERE name IN ('remote-code', 'remote-maxid')"
374 );
375 db_multi_exec(
376 "UPDATE user SET mtime=strftime('%%s','now') WHERE mtime IS NULL"
377 );
378
379 /* The following should be count(*) instead of max(rid). max(rid) is
380 ** an adequate approximation, however, and is much faster for large
381 ** repositories. */
382 totalSize = db_int(0, "SELECT max(rid) FROM blob");
383
+10
--- src/sha1.c
+++ src/sha1.c
@@ -3,10 +3,19 @@
33
*/
44
#include "config.h"
55
#include <sys/types.h>
66
#include "sha1.h"
77
8
+#ifdef FOSSIL_ENABLE_SSL
9
+
10
+# include <openssl/sha.h>
11
+# define SHA1Context SHA_CTX
12
+# define SHA1Init SHA1_Init
13
+# define SHA1Update SHA1_Update
14
+# define SHA1Final(a,b) SHA1_Final(b,a)
15
+
16
+#else
817
918
/*
1019
** The SHA1 implementation below is adapted from:
1120
**
1221
** $NetBSD: sha1.c,v 1.6 2009/11/06 20:31:18 joerg Exp $
@@ -198,10 +207,11 @@
198207
for (i = 0; i < 20; i++)
199208
digest[i] = (unsigned char)
200209
((context->state[i>>2] >> ((3-(i & 3)) * 8) ) & 255);
201210
}
202211
}
212
+#endif
203213
204214
205215
/*
206216
** Convert a digest into base-16. digest should be declared as
207217
** "unsigned char digest[20]" in the calling function. The SHA1
208218
--- src/sha1.c
+++ src/sha1.c
@@ -3,10 +3,19 @@
3 */
4 #include "config.h"
5 #include <sys/types.h>
6 #include "sha1.h"
7
 
 
 
 
 
 
 
 
 
8
9 /*
10 ** The SHA1 implementation below is adapted from:
11 **
12 ** $NetBSD: sha1.c,v 1.6 2009/11/06 20:31:18 joerg Exp $
@@ -198,10 +207,11 @@
198 for (i = 0; i < 20; i++)
199 digest[i] = (unsigned char)
200 ((context->state[i>>2] >> ((3-(i & 3)) * 8) ) & 255);
201 }
202 }
 
203
204
205 /*
206 ** Convert a digest into base-16. digest should be declared as
207 ** "unsigned char digest[20]" in the calling function. The SHA1
208
--- src/sha1.c
+++ src/sha1.c
@@ -3,10 +3,19 @@
3 */
4 #include "config.h"
5 #include <sys/types.h>
6 #include "sha1.h"
7
8 #ifdef FOSSIL_ENABLE_SSL
9
10 # include <openssl/sha.h>
11 # define SHA1Context SHA_CTX
12 # define SHA1Init SHA1_Init
13 # define SHA1Update SHA1_Update
14 # define SHA1Final(a,b) SHA1_Final(b,a)
15
16 #else
17
18 /*
19 ** The SHA1 implementation below is adapted from:
20 **
21 ** $NetBSD: sha1.c,v 1.6 2009/11/06 20:31:18 joerg Exp $
@@ -198,10 +207,11 @@
207 for (i = 0; i < 20; i++)
208 digest[i] = (unsigned char)
209 ((context->state[i>>2] >> ((3-(i & 3)) * 8) ) & 255);
210 }
211 }
212 #endif
213
214
215 /*
216 ** Convert a digest into base-16. digest should be declared as
217 ** "unsigned char digest[20]" in the calling function. The SHA1
218
+2 -1
--- src/stat.c
+++ src/stat.c
@@ -25,11 +25,11 @@
2525
2626
/*
2727
** For a sufficiently large integer, provide an alternative
2828
** representation as MB or GB or TB.
2929
*/
30
-static void bigSizeName(int nOut, char *zOut, sqlite3_int64 v){
30
+void bigSizeName(int nOut, char *zOut, sqlite3_int64 v){
3131
if( v<100000 ){
3232
sqlite3_snprintf(nOut, zOut, "%lld bytes", v);
3333
}else if( v<1000000000 ){
3434
sqlite3_snprintf(nOut, zOut, "%lld bytes (%.1fMB)",
3535
v, (double)v/1000000.0);
@@ -57,10 +57,11 @@
5757
brief = P("brief")!=0;
5858
style_header("Repository Statistics");
5959
if( g.perm.Admin ){
6060
style_submenu_element("URLs", "URLs and Checkouts", "urllist");
6161
style_submenu_element("Schema", "Repository Schema", "repo_schema");
62
+ style_submenu_element("Web-Cache", "Web-Cache Stats", "cachestat");
6263
}
6364
@ <table class="label-value">
6465
@ <tr><th>Repository&nbsp;Size:</th><td>
6566
fsize = file_size(g.zRepositoryName);
6667
bigSizeName(sizeof(zBuf), zBuf, fsize);
6768
--- src/stat.c
+++ src/stat.c
@@ -25,11 +25,11 @@
25
26 /*
27 ** For a sufficiently large integer, provide an alternative
28 ** representation as MB or GB or TB.
29 */
30 static void bigSizeName(int nOut, char *zOut, sqlite3_int64 v){
31 if( v<100000 ){
32 sqlite3_snprintf(nOut, zOut, "%lld bytes", v);
33 }else if( v<1000000000 ){
34 sqlite3_snprintf(nOut, zOut, "%lld bytes (%.1fMB)",
35 v, (double)v/1000000.0);
@@ -57,10 +57,11 @@
57 brief = P("brief")!=0;
58 style_header("Repository Statistics");
59 if( g.perm.Admin ){
60 style_submenu_element("URLs", "URLs and Checkouts", "urllist");
61 style_submenu_element("Schema", "Repository Schema", "repo_schema");
 
62 }
63 @ <table class="label-value">
64 @ <tr><th>Repository&nbsp;Size:</th><td>
65 fsize = file_size(g.zRepositoryName);
66 bigSizeName(sizeof(zBuf), zBuf, fsize);
67
--- src/stat.c
+++ src/stat.c
@@ -25,11 +25,11 @@
25
26 /*
27 ** For a sufficiently large integer, provide an alternative
28 ** representation as MB or GB or TB.
29 */
30 void bigSizeName(int nOut, char *zOut, sqlite3_int64 v){
31 if( v<100000 ){
32 sqlite3_snprintf(nOut, zOut, "%lld bytes", v);
33 }else if( v<1000000000 ){
34 sqlite3_snprintf(nOut, zOut, "%lld bytes (%.1fMB)",
35 v, (double)v/1000000.0);
@@ -57,10 +57,11 @@
57 brief = P("brief")!=0;
58 style_header("Repository Statistics");
59 if( g.perm.Admin ){
60 style_submenu_element("URLs", "URLs and Checkouts", "urllist");
61 style_submenu_element("Schema", "Repository Schema", "repo_schema");
62 style_submenu_element("Web-Cache", "Web-Cache Stats", "cachestat");
63 }
64 @ <table class="label-value">
65 @ <tr><th>Repository&nbsp;Size:</th><td>
66 fsize = file_size(g.zRepositoryName);
67 bigSizeName(sizeof(zBuf), zBuf, fsize);
68
+8 -2
--- src/tar.c
+++ src/tar.c
@@ -583,11 +583,11 @@
583583
** Defaults to trunk.
584584
**
585585
*/
586586
void tarball_page(void){
587587
int rid;
588
- char *zName, *zRid;
588
+ char *zName, *zRid, *zKey;
589589
int nName, nRid;
590590
Blob tarball;
591591
592592
login_check_credentials();
593593
if( !g.perm.Zip ){ login_needed(); return; }
@@ -614,11 +614,17 @@
614614
if( rid==0 ){
615615
@ Not found
616616
return;
617617
}
618618
if( nRid==0 && nName>10 ) zName[10] = 0;
619
- tarball_of_checkin(rid, &tarball, zName);
619
+ zKey = db_text(0, "SELECT '/tarball/'||uuid||'/%q' FROM blob WHERE rid=%d",zName,rid);
620
+ blob_zero(&tarball);
621
+ if( cache_read(&tarball, zKey)==0 ){
622
+ tarball_of_checkin(rid, &tarball, zName);
623
+ cache_write(&tarball, zKey);
624
+ }
620625
free( zName );
621626
free( zRid );
627
+ free( zKey );
622628
cgi_set_content(&tarball);
623629
cgi_set_content_type("application/x-compressed");
624630
}
625631
--- src/tar.c
+++ src/tar.c
@@ -583,11 +583,11 @@
583 ** Defaults to trunk.
584 **
585 */
586 void tarball_page(void){
587 int rid;
588 char *zName, *zRid;
589 int nName, nRid;
590 Blob tarball;
591
592 login_check_credentials();
593 if( !g.perm.Zip ){ login_needed(); return; }
@@ -614,11 +614,17 @@
614 if( rid==0 ){
615 @ Not found
616 return;
617 }
618 if( nRid==0 && nName>10 ) zName[10] = 0;
619 tarball_of_checkin(rid, &tarball, zName);
 
 
 
 
 
620 free( zName );
621 free( zRid );
 
622 cgi_set_content(&tarball);
623 cgi_set_content_type("application/x-compressed");
624 }
625
--- src/tar.c
+++ src/tar.c
@@ -583,11 +583,11 @@
583 ** Defaults to trunk.
584 **
585 */
586 void tarball_page(void){
587 int rid;
588 char *zName, *zRid, *zKey;
589 int nName, nRid;
590 Blob tarball;
591
592 login_check_credentials();
593 if( !g.perm.Zip ){ login_needed(); return; }
@@ -614,11 +614,17 @@
614 if( rid==0 ){
615 @ Not found
616 return;
617 }
618 if( nRid==0 && nName>10 ) zName[10] = 0;
619 zKey = db_text(0, "SELECT '/tarball/'||uuid||'/%q' FROM blob WHERE rid=%d",zName,rid);
620 blob_zero(&tarball);
621 if( cache_read(&tarball, zKey)==0 ){
622 tarball_of_checkin(rid, &tarball, zName);
623 cache_write(&tarball, zKey);
624 }
625 free( zName );
626 free( zRid );
627 free( zKey );
628 cgi_set_content(&tarball);
629 cgi_set_content_type("application/x-compressed");
630 }
631
+31 -23
--- src/winfile.c
+++ src/winfile.c
@@ -32,15 +32,13 @@
3232
/*
3333
** Fill stat buf with information received from stat() or lstat().
3434
** lstat() is called on Unix if isWd is TRUE and allow-symlinks setting is on.
3535
**
3636
*/
37
-int win32_stat(const char *zFilename, struct fossilStat *buf, int isWd){
37
+int win32_stat(const wchar_t *zFilename, struct fossilStat *buf, int isWd){
3838
WIN32_FILE_ATTRIBUTE_DATA attr;
39
- wchar_t *zMbcs = fossil_utf8_to_filename(zFilename);
40
- int rc = GetFileAttributesExW(zMbcs, GetFileExInfoStandard, &attr);
41
- fossil_filename_free(zMbcs);
39
+ int rc = GetFileAttributesExW(zFilename, GetFileExInfoStandard, &attr);
4240
if( rc ){
4341
ULARGE_INTEGER ull;
4442
ull.LowPart = attr.ftLastWriteTime.dwLowDateTime;
4543
ull.HighPart = attr.ftLastWriteTime.dwHighDateTime;
4644
buf->st_mode = (attr.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) ?
@@ -53,26 +51,25 @@
5351
5452
/*
5553
** Wrapper around the access() system call. This code was copied from Tcl
5654
** 8.6 and then modified.
5755
*/
58
-int win32_access(const char *zFilename, int flags){
56
+int win32_access(const wchar_t *zFilename, int flags){
5957
int rc = 0;
6058
PSECURITY_DESCRIPTOR pSd = NULL;
61
- unsigned long size;
59
+ unsigned long size = 0;
6260
PSID pSid = NULL;
6361
BOOL sidDefaulted;
6462
BOOL impersonated = FALSE;
6563
SID_IDENTIFIER_AUTHORITY unmapped = {{0, 0, 0, 0, 0, 22}};
6664
GENERIC_MAPPING genMap;
6765
HANDLE hToken = NULL;
6866
DWORD desiredAccess = 0, grantedAccess = 0;
6967
BOOL accessYesNo = FALSE;
70
- PRIVILEGE_SET privSet;
71
- DWORD privSetSize = sizeof(PRIVILEGE_SET);
72
- wchar_t *zMbcs = fossil_utf8_to_filename(zFilename);
73
- DWORD attr = GetFileAttributesW(zMbcs);
68
+ PPRIVILEGE_SET pPrivSet = NULL;
69
+ DWORD privSetSize = 0;
70
+ DWORD attr = GetFileAttributesW(zFilename);
7471
7572
if( attr==INVALID_FILE_ATTRIBUTES ){
7673
/*
7774
* File might not exist.
7875
*/
@@ -113,12 +110,11 @@
113110
114111
/*
115112
* First find out how big the buffer needs to be.
116113
*/
117114
118
- size = 0;
119
- GetFileSecurityW(zMbcs,
115
+ GetFileSecurityW(zFilename,
120116
OWNER_SECURITY_INFORMATION | GROUP_SECURITY_INFORMATION |
121117
DACL_SECURITY_INFORMATION | LABEL_SECURITY_INFORMATION,
122118
0, 0, &size);
123119
124120
/*
@@ -146,11 +142,11 @@
146142
147143
/*
148144
* Call GetFileSecurity() for real.
149145
*/
150146
151
- if( !GetFileSecurityW(zMbcs,
147
+ if( !GetFileSecurityW(zFilename,
152148
OWNER_SECURITY_INFORMATION | GROUP_SECURITY_INFORMATION |
153149
DACL_SECURITY_INFORMATION | LABEL_SECURITY_INFORMATION,
154150
pSd, size, &size) ){
155151
/*
156152
* Error getting owner SD
@@ -216,16 +212,31 @@
216212
memset(&genMap, 0, sizeof(GENERIC_MAPPING));
217213
genMap.GenericRead = FILE_GENERIC_READ;
218214
genMap.GenericWrite = FILE_GENERIC_WRITE;
219215
genMap.GenericExecute = FILE_GENERIC_EXECUTE;
220216
genMap.GenericAll = FILE_ALL_ACCESS;
217
+
218
+ AccessCheck(pSd, hToken, desiredAccess, &genMap, 0,
219
+ &privSetSize, &grantedAccess, &accessYesNo);
220
+ /*
221
+ * Should have failed with ERROR_INSUFFICIENT_BUFFER
222
+ */
223
+
224
+ if( GetLastError()!=ERROR_INSUFFICIENT_BUFFER ){
225
+ rc = -1; goto done;
226
+ }
227
+ pPrivSet = (PPRIVILEGE_SET)HeapAlloc(GetProcessHeap(), 0, privSetSize);
228
+
229
+ if( pPrivSet==NULL ){
230
+ rc = -1; goto done;
231
+ }
221232
222233
/*
223234
* Perform access check using the token.
224235
*/
225236
226
- if( !AccessCheck(pSd, hToken, desiredAccess, &genMap, &privSet,
237
+ if( !AccessCheck(pSd, hToken, desiredAccess, &genMap, pPrivSet,
227238
&privSetSize, &grantedAccess, &accessYesNo) ){
228239
/*
229240
* Unable to perform access check.
230241
*/
231242
@@ -240,35 +251,32 @@
240251
}
241252
if( impersonated ){
242253
RevertToSelf();
243254
impersonated = FALSE;
244255
}
256
+ if( pPrivSet!=NULL ){
257
+ HeapFree(GetProcessHeap(), 0, pPrivSet);
258
+ }
245259
if( pSd!=NULL ){
246260
HeapFree(GetProcessHeap(), 0, pSd);
247261
}
248
- fossil_filename_free(zMbcs);
249262
return rc;
250263
}
251264
252265
/*
253266
** Wrapper around the chdir() system call.
254
-** If bChroot=1, do a chroot to this dir as well
255
-** (UNIX only)
256267
*/
257
-int win32_chdir(const char *zChDir, int bChroot){
258
- wchar_t *zPath = fossil_utf8_to_filename(zChDir);
259
- int rc = (int)!SetCurrentDirectoryW(zPath);
260
- fossil_filename_free(zPath);
268
+int win32_chdir(const wchar_t *zChDir, int bChroot){
269
+ int rc = (int)!SetCurrentDirectoryW(zChDir);
261270
return rc;
262271
}
263272
264273
/*
265274
** Get the current working directory.
266275
**
267276
** On windows, the name is converted from unicode to UTF8 and all '\\'
268
-** characters are converted to '/'. No conversions are needed on
269
-** unix.
277
+** characters are converted to '/'.
270278
*/
271279
void win32_getcwd(char *zBuf, int nBuf){
272280
int i;
273281
char *zUtf8;
274282
wchar_t *zWide = fossil_malloc( sizeof(wchar_t)*nBuf );
275283
--- src/winfile.c
+++ src/winfile.c
@@ -32,15 +32,13 @@
32 /*
33 ** Fill stat buf with information received from stat() or lstat().
34 ** lstat() is called on Unix if isWd is TRUE and allow-symlinks setting is on.
35 **
36 */
37 int win32_stat(const char *zFilename, struct fossilStat *buf, int isWd){
38 WIN32_FILE_ATTRIBUTE_DATA attr;
39 wchar_t *zMbcs = fossil_utf8_to_filename(zFilename);
40 int rc = GetFileAttributesExW(zMbcs, GetFileExInfoStandard, &attr);
41 fossil_filename_free(zMbcs);
42 if( rc ){
43 ULARGE_INTEGER ull;
44 ull.LowPart = attr.ftLastWriteTime.dwLowDateTime;
45 ull.HighPart = attr.ftLastWriteTime.dwHighDateTime;
46 buf->st_mode = (attr.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) ?
@@ -53,26 +51,25 @@
53
54 /*
55 ** Wrapper around the access() system call. This code was copied from Tcl
56 ** 8.6 and then modified.
57 */
58 int win32_access(const char *zFilename, int flags){
59 int rc = 0;
60 PSECURITY_DESCRIPTOR pSd = NULL;
61 unsigned long size;
62 PSID pSid = NULL;
63 BOOL sidDefaulted;
64 BOOL impersonated = FALSE;
65 SID_IDENTIFIER_AUTHORITY unmapped = {{0, 0, 0, 0, 0, 22}};
66 GENERIC_MAPPING genMap;
67 HANDLE hToken = NULL;
68 DWORD desiredAccess = 0, grantedAccess = 0;
69 BOOL accessYesNo = FALSE;
70 PRIVILEGE_SET privSet;
71 DWORD privSetSize = sizeof(PRIVILEGE_SET);
72 wchar_t *zMbcs = fossil_utf8_to_filename(zFilename);
73 DWORD attr = GetFileAttributesW(zMbcs);
74
75 if( attr==INVALID_FILE_ATTRIBUTES ){
76 /*
77 * File might not exist.
78 */
@@ -113,12 +110,11 @@
113
114 /*
115 * First find out how big the buffer needs to be.
116 */
117
118 size = 0;
119 GetFileSecurityW(zMbcs,
120 OWNER_SECURITY_INFORMATION | GROUP_SECURITY_INFORMATION |
121 DACL_SECURITY_INFORMATION | LABEL_SECURITY_INFORMATION,
122 0, 0, &size);
123
124 /*
@@ -146,11 +142,11 @@
146
147 /*
148 * Call GetFileSecurity() for real.
149 */
150
151 if( !GetFileSecurityW(zMbcs,
152 OWNER_SECURITY_INFORMATION | GROUP_SECURITY_INFORMATION |
153 DACL_SECURITY_INFORMATION | LABEL_SECURITY_INFORMATION,
154 pSd, size, &size) ){
155 /*
156 * Error getting owner SD
@@ -216,16 +212,31 @@
216 memset(&genMap, 0, sizeof(GENERIC_MAPPING));
217 genMap.GenericRead = FILE_GENERIC_READ;
218 genMap.GenericWrite = FILE_GENERIC_WRITE;
219 genMap.GenericExecute = FILE_GENERIC_EXECUTE;
220 genMap.GenericAll = FILE_ALL_ACCESS;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
221
222 /*
223 * Perform access check using the token.
224 */
225
226 if( !AccessCheck(pSd, hToken, desiredAccess, &genMap, &privSet,
227 &privSetSize, &grantedAccess, &accessYesNo) ){
228 /*
229 * Unable to perform access check.
230 */
231
@@ -240,35 +251,32 @@
240 }
241 if( impersonated ){
242 RevertToSelf();
243 impersonated = FALSE;
244 }
 
 
 
245 if( pSd!=NULL ){
246 HeapFree(GetProcessHeap(), 0, pSd);
247 }
248 fossil_filename_free(zMbcs);
249 return rc;
250 }
251
252 /*
253 ** Wrapper around the chdir() system call.
254 ** If bChroot=1, do a chroot to this dir as well
255 ** (UNIX only)
256 */
257 int win32_chdir(const char *zChDir, int bChroot){
258 wchar_t *zPath = fossil_utf8_to_filename(zChDir);
259 int rc = (int)!SetCurrentDirectoryW(zPath);
260 fossil_filename_free(zPath);
261 return rc;
262 }
263
264 /*
265 ** Get the current working directory.
266 **
267 ** On windows, the name is converted from unicode to UTF8 and all '\\'
268 ** characters are converted to '/'. No conversions are needed on
269 ** unix.
270 */
271 void win32_getcwd(char *zBuf, int nBuf){
272 int i;
273 char *zUtf8;
274 wchar_t *zWide = fossil_malloc( sizeof(wchar_t)*nBuf );
275
--- src/winfile.c
+++ src/winfile.c
@@ -32,15 +32,13 @@
32 /*
33 ** Fill stat buf with information received from stat() or lstat().
34 ** lstat() is called on Unix if isWd is TRUE and allow-symlinks setting is on.
35 **
36 */
37 int win32_stat(const wchar_t *zFilename, struct fossilStat *buf, int isWd){
38 WIN32_FILE_ATTRIBUTE_DATA attr;
39 int rc = GetFileAttributesExW(zFilename, GetFileExInfoStandard, &attr);
 
 
40 if( rc ){
41 ULARGE_INTEGER ull;
42 ull.LowPart = attr.ftLastWriteTime.dwLowDateTime;
43 ull.HighPart = attr.ftLastWriteTime.dwHighDateTime;
44 buf->st_mode = (attr.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) ?
@@ -53,26 +51,25 @@
51
52 /*
53 ** Wrapper around the access() system call. This code was copied from Tcl
54 ** 8.6 and then modified.
55 */
56 int win32_access(const wchar_t *zFilename, int flags){
57 int rc = 0;
58 PSECURITY_DESCRIPTOR pSd = NULL;
59 unsigned long size = 0;
60 PSID pSid = NULL;
61 BOOL sidDefaulted;
62 BOOL impersonated = FALSE;
63 SID_IDENTIFIER_AUTHORITY unmapped = {{0, 0, 0, 0, 0, 22}};
64 GENERIC_MAPPING genMap;
65 HANDLE hToken = NULL;
66 DWORD desiredAccess = 0, grantedAccess = 0;
67 BOOL accessYesNo = FALSE;
68 PPRIVILEGE_SET pPrivSet = NULL;
69 DWORD privSetSize = 0;
70 DWORD attr = GetFileAttributesW(zFilename);
 
71
72 if( attr==INVALID_FILE_ATTRIBUTES ){
73 /*
74 * File might not exist.
75 */
@@ -113,12 +110,11 @@
110
111 /*
112 * First find out how big the buffer needs to be.
113 */
114
115 GetFileSecurityW(zFilename,
 
116 OWNER_SECURITY_INFORMATION | GROUP_SECURITY_INFORMATION |
117 DACL_SECURITY_INFORMATION | LABEL_SECURITY_INFORMATION,
118 0, 0, &size);
119
120 /*
@@ -146,11 +142,11 @@
142
143 /*
144 * Call GetFileSecurity() for real.
145 */
146
147 if( !GetFileSecurityW(zFilename,
148 OWNER_SECURITY_INFORMATION | GROUP_SECURITY_INFORMATION |
149 DACL_SECURITY_INFORMATION | LABEL_SECURITY_INFORMATION,
150 pSd, size, &size) ){
151 /*
152 * Error getting owner SD
@@ -216,16 +212,31 @@
212 memset(&genMap, 0, sizeof(GENERIC_MAPPING));
213 genMap.GenericRead = FILE_GENERIC_READ;
214 genMap.GenericWrite = FILE_GENERIC_WRITE;
215 genMap.GenericExecute = FILE_GENERIC_EXECUTE;
216 genMap.GenericAll = FILE_ALL_ACCESS;
217
218 AccessCheck(pSd, hToken, desiredAccess, &genMap, 0,
219 &privSetSize, &grantedAccess, &accessYesNo);
220 /*
221 * Should have failed with ERROR_INSUFFICIENT_BUFFER
222 */
223
224 if( GetLastError()!=ERROR_INSUFFICIENT_BUFFER ){
225 rc = -1; goto done;
226 }
227 pPrivSet = (PPRIVILEGE_SET)HeapAlloc(GetProcessHeap(), 0, privSetSize);
228
229 if( pPrivSet==NULL ){
230 rc = -1; goto done;
231 }
232
233 /*
234 * Perform access check using the token.
235 */
236
237 if( !AccessCheck(pSd, hToken, desiredAccess, &genMap, pPrivSet,
238 &privSetSize, &grantedAccess, &accessYesNo) ){
239 /*
240 * Unable to perform access check.
241 */
242
@@ -240,35 +251,32 @@
251 }
252 if( impersonated ){
253 RevertToSelf();
254 impersonated = FALSE;
255 }
256 if( pPrivSet!=NULL ){
257 HeapFree(GetProcessHeap(), 0, pPrivSet);
258 }
259 if( pSd!=NULL ){
260 HeapFree(GetProcessHeap(), 0, pSd);
261 }
 
262 return rc;
263 }
264
265 /*
266 ** Wrapper around the chdir() system call.
 
 
267 */
268 int win32_chdir(const wchar_t *zChDir, int bChroot){
269 int rc = (int)!SetCurrentDirectoryW(zChDir);
 
 
270 return rc;
271 }
272
273 /*
274 ** Get the current working directory.
275 **
276 ** On windows, the name is converted from unicode to UTF8 and all '\\'
277 ** characters are converted to '/'.
 
278 */
279 void win32_getcwd(char *zBuf, int nBuf){
280 int i;
281 char *zUtf8;
282 wchar_t *zWide = fossil_malloc( sizeof(wchar_t)*nBuf );
283
+8 -1
--- src/zip.c
+++ src/zip.c
@@ -433,10 +433,11 @@
433433
void baseline_zip_page(void){
434434
int rid;
435435
char *zName, *zRid;
436436
int nName, nRid;
437437
Blob zip;
438
+ char *zKey;
438439
439440
login_check_credentials();
440441
if( !g.perm.Zip ){ login_needed(); return; }
441442
load_control();
442443
zName = mprintf("%s", PD("name",""));
@@ -453,11 +454,17 @@
453454
if( rid==0 ){
454455
@ Not found
455456
return;
456457
}
457458
if( nRid==0 && nName>10 ) zName[10] = 0;
458
- zip_of_baseline(rid, &zip, zName);
459
+ zKey = db_text(0, "SELECT '/zip/'||uuid||'/%q' FROM blob WHERE rid=%d",zName,rid);
460
+ blob_zero(&zip);
461
+ if( cache_read(&zip, zKey)==0 ){
462
+ zip_of_baseline(rid, &zip, zName);
463
+ cache_write(&zip, zKey);
464
+ }
459465
fossil_free( zName );
460466
fossil_free( zRid );
467
+ fossil_free( zKey );
461468
cgi_set_content(&zip);
462469
cgi_set_content_type("application/zip");
463470
}
464471
--- src/zip.c
+++ src/zip.c
@@ -433,10 +433,11 @@
433 void baseline_zip_page(void){
434 int rid;
435 char *zName, *zRid;
436 int nName, nRid;
437 Blob zip;
 
438
439 login_check_credentials();
440 if( !g.perm.Zip ){ login_needed(); return; }
441 load_control();
442 zName = mprintf("%s", PD("name",""));
@@ -453,11 +454,17 @@
453 if( rid==0 ){
454 @ Not found
455 return;
456 }
457 if( nRid==0 && nName>10 ) zName[10] = 0;
458 zip_of_baseline(rid, &zip, zName);
 
 
 
 
 
459 fossil_free( zName );
460 fossil_free( zRid );
 
461 cgi_set_content(&zip);
462 cgi_set_content_type("application/zip");
463 }
464
--- src/zip.c
+++ src/zip.c
@@ -433,10 +433,11 @@
433 void baseline_zip_page(void){
434 int rid;
435 char *zName, *zRid;
436 int nName, nRid;
437 Blob zip;
438 char *zKey;
439
440 login_check_credentials();
441 if( !g.perm.Zip ){ login_needed(); return; }
442 load_control();
443 zName = mprintf("%s", PD("name",""));
@@ -453,11 +454,17 @@
454 if( rid==0 ){
455 @ Not found
456 return;
457 }
458 if( nRid==0 && nName>10 ) zName[10] = 0;
459 zKey = db_text(0, "SELECT '/zip/'||uuid||'/%q' FROM blob WHERE rid=%d",zName,rid);
460 blob_zero(&zip);
461 if( cache_read(&zip, zKey)==0 ){
462 zip_of_baseline(rid, &zip, zName);
463 cache_write(&zip, zKey);
464 }
465 fossil_free( zName );
466 fossil_free( zRid );
467 fossil_free( zKey );
468 cgi_set_content(&zip);
469 cgi_set_content_type("application/zip");
470 }
471
--- win/Makefile.PellesCGMake
+++ win/Makefile.PellesCGMake
@@ -89,11 +89,11 @@
8989
9090
# define the sqlite shell files, which need special flags on compile
9191
SQLITESHELLSRC=shell.c
9292
ORIGSQLITESHELLSRC=$(foreach sf,$(SQLITESHELLSRC),$(SRCDIR)$(sf))
9393
SQLITESHELLOBJ=$(foreach sf,$(SQLITESHELLSRC),$(sf:.c=.obj))
94
-SQLITESHELLDEFINES=-Dmain=sqlite3_shell -DSQLITE_OMIT_LOAD_EXTENSION=1 -DUSE_SYSTEM_SQLITE=$(USE_SYSTEM_SQLITE) -DSQLITE_SHELL_DBNAME_PROC=fossil_open -Daccess=win32_access -Dgetenv=fossil_getenv -Dfopen=fossil_fopen
94
+SQLITESHELLDEFINES=-Dmain=sqlite3_shell -DSQLITE_OMIT_LOAD_EXTENSION=1 -DUSE_SYSTEM_SQLITE=$(USE_SYSTEM_SQLITE) -DSQLITE_SHELL_DBNAME_PROC=fossil_open -Daccess=file_access -Dgetenv=fossil_getenv -Dfopen=fossil_fopen
9595
9696
# define the th scripting files, which need special flags on compile
9797
THSRC=th.c th_lang.c
9898
ORIGTHSRC=$(foreach sf,$(THSRC),$(SRCDIR)$(sf))
9999
THOBJ=$(foreach sf,$(THSRC),$(sf:.c=.obj))
100100
--- win/Makefile.PellesCGMake
+++ win/Makefile.PellesCGMake
@@ -89,11 +89,11 @@
89
90 # define the sqlite shell files, which need special flags on compile
91 SQLITESHELLSRC=shell.c
92 ORIGSQLITESHELLSRC=$(foreach sf,$(SQLITESHELLSRC),$(SRCDIR)$(sf))
93 SQLITESHELLOBJ=$(foreach sf,$(SQLITESHELLSRC),$(sf:.c=.obj))
94 SQLITESHELLDEFINES=-Dmain=sqlite3_shell -DSQLITE_OMIT_LOAD_EXTENSION=1 -DUSE_SYSTEM_SQLITE=$(USE_SYSTEM_SQLITE) -DSQLITE_SHELL_DBNAME_PROC=fossil_open -Daccess=win32_access -Dgetenv=fossil_getenv -Dfopen=fossil_fopen
95
96 # define the th scripting files, which need special flags on compile
97 THSRC=th.c th_lang.c
98 ORIGTHSRC=$(foreach sf,$(THSRC),$(SRCDIR)$(sf))
99 THOBJ=$(foreach sf,$(THSRC),$(sf:.c=.obj))
100
--- win/Makefile.PellesCGMake
+++ win/Makefile.PellesCGMake
@@ -89,11 +89,11 @@
89
90 # define the sqlite shell files, which need special flags on compile
91 SQLITESHELLSRC=shell.c
92 ORIGSQLITESHELLSRC=$(foreach sf,$(SQLITESHELLSRC),$(SRCDIR)$(sf))
93 SQLITESHELLOBJ=$(foreach sf,$(SQLITESHELLSRC),$(sf:.c=.obj))
94 SQLITESHELLDEFINES=-Dmain=sqlite3_shell -DSQLITE_OMIT_LOAD_EXTENSION=1 -DUSE_SYSTEM_SQLITE=$(USE_SYSTEM_SQLITE) -DSQLITE_SHELL_DBNAME_PROC=fossil_open -Daccess=file_access -Dgetenv=fossil_getenv -Dfopen=fossil_fopen
95
96 # define the th scripting files, which need special flags on compile
97 THSRC=th.c th_lang.c
98 ORIGTHSRC=$(foreach sf,$(THSRC),$(SRCDIR)$(sf))
99 THOBJ=$(foreach sf,$(THSRC),$(sf:.c=.obj))
100
+11 -5
--- win/Makefile.dmc
+++ win/Makefile.dmc
@@ -26,15 +26,15 @@
2626
TCC = $(DMDIR)\bin\dmc $(CFLAGS) $(DMCDEF) $(SSL) $(INCL)
2727
LIBS = $(DMDIR)\extra\lib\ zlib wsock32 advapi32
2828
2929
SQLITE_OPTIONS = -DSQLITE_OMIT_LOAD_EXTENSION=1 -DSQLITE_ENABLE_LOCKING_STYLE=0 -DSQLITE_THREADSAFE=0 -DSQLITE_DEFAULT_FILE_FORMAT=4 -DSQLITE_OMIT_DEPRECATED -DSQLITE_ENABLE_EXPLAIN_COMMENTS
3030
31
-SHELL_OPTIONS = -Dmain=sqlite3_shell -DSQLITE_OMIT_LOAD_EXTENSION=1 -DUSE_SYSTEM_SQLITE=$(USE_SYSTEM_SQLITE) -DSQLITE_SHELL_DBNAME_PROC=fossil_open -Daccess=win32_access -Dgetenv=fossil_getenv -Dfopen=fossil_fopen
31
+SHELL_OPTIONS = -Dmain=sqlite3_shell -DSQLITE_OMIT_LOAD_EXTENSION=1 -DUSE_SYSTEM_SQLITE=$(USE_SYSTEM_SQLITE) -DSQLITE_SHELL_DBNAME_PROC=fossil_open -Daccess=file_access -Dgetenv=fossil_getenv -Dfopen=fossil_fopen
3232
33
-SRC = add_.c allrepo_.c attach_.c bag_.c bisect_.c blob_.c branch_.c browse_.c captcha_.c cgi_.c checkin_.c checkout_.c clearsign_.c clone_.c comformat_.c configure_.c content_.c db_.c delta_.c deltacmd_.c descendants_.c diff_.c diffcmd_.c doc_.c encode_.c event_.c export_.c file_.c finfo_.c glob_.c graph_.c gzip_.c http_.c http_socket_.c http_ssl_.c http_transport_.c import_.c info_.c json_.c json_artifact_.c json_branch_.c json_config_.c json_diff_.c json_dir_.c json_finfo_.c json_login_.c json_query_.c json_report_.c json_status_.c json_tag_.c json_timeline_.c json_user_.c json_wiki_.c leaf_.c loadctrl_.c login_.c lookslike_.c main_.c manifest_.c markdown_.c markdown_html_.c md5_.c merge_.c merge3_.c moderate_.c name_.c path_.c pivot_.c popen_.c pqueue_.c printf_.c rebuild_.c regexp_.c report_.c rss_.c schema_.c search_.c setup_.c sha1_.c shun_.c skins_.c sqlcmd_.c stash_.c stat_.c style_.c sync_.c tag_.c tar_.c th_main_.c timeline_.c tkt_.c tktsetup_.c undo_.c unicode_.c update_.c url_.c user_.c utf8_.c util_.c verify_.c vfile_.c wiki_.c wikiformat_.c winfile_.c winhttp_.c wysiwyg_.c xfer_.c xfersetup_.c zip_.c
33
+SRC = add_.c allrepo_.c attach_.c bag_.c bisect_.c blob_.c branch_.c browse_.c cache_.c captcha_.c cgi_.c checkin_.c checkout_.c clearsign_.c clone_.c comformat_.c configure_.c content_.c db_.c delta_.c deltacmd_.c descendants_.c diff_.c diffcmd_.c doc_.c encode_.c event_.c export_.c file_.c finfo_.c glob_.c graph_.c gzip_.c http_.c http_socket_.c http_ssl_.c http_transport_.c import_.c info_.c json_.c json_artifact_.c json_branch_.c json_config_.c json_diff_.c json_dir_.c json_finfo_.c json_login_.c json_query_.c json_report_.c json_status_.c json_tag_.c json_timeline_.c json_user_.c json_wiki_.c leaf_.c loadctrl_.c login_.c lookslike_.c main_.c manifest_.c markdown_.c markdown_html_.c md5_.c merge_.c merge3_.c moderate_.c name_.c path_.c pivot_.c popen_.c pqueue_.c printf_.c rebuild_.c regexp_.c report_.c rss_.c schema_.c search_.c setup_.c sha1_.c shun_.c skins_.c sqlcmd_.c stash_.c stat_.c style_.c sync_.c tag_.c tar_.c th_main_.c timeline_.c tkt_.c tktsetup_.c undo_.c unicode_.c update_.c url_.c user_.c utf8_.c util_.c verify_.c vfile_.c wiki_.c wikiformat_.c winfile_.c winhttp_.c wysiwyg_.c xfer_.c xfersetup_.c zip_.c
3434
35
-OBJ = $(OBJDIR)\add$O $(OBJDIR)\allrepo$O $(OBJDIR)\attach$O $(OBJDIR)\bag$O $(OBJDIR)\bisect$O $(OBJDIR)\blob$O $(OBJDIR)\branch$O $(OBJDIR)\browse$O $(OBJDIR)\captcha$O $(OBJDIR)\cgi$O $(OBJDIR)\checkin$O $(OBJDIR)\checkout$O $(OBJDIR)\clearsign$O $(OBJDIR)\clone$O $(OBJDIR)\comformat$O $(OBJDIR)\configure$O $(OBJDIR)\content$O $(OBJDIR)\db$O $(OBJDIR)\delta$O $(OBJDIR)\deltacmd$O $(OBJDIR)\descendants$O $(OBJDIR)\diff$O $(OBJDIR)\diffcmd$O $(OBJDIR)\doc$O $(OBJDIR)\encode$O $(OBJDIR)\event$O $(OBJDIR)\export$O $(OBJDIR)\file$O $(OBJDIR)\finfo$O $(OBJDIR)\glob$O $(OBJDIR)\graph$O $(OBJDIR)\gzip$O $(OBJDIR)\http$O $(OBJDIR)\http_socket$O $(OBJDIR)\http_ssl$O $(OBJDIR)\http_transport$O $(OBJDIR)\import$O $(OBJDIR)\info$O $(OBJDIR)\json$O $(OBJDIR)\json_artifact$O $(OBJDIR)\json_branch$O $(OBJDIR)\json_config$O $(OBJDIR)\json_diff$O $(OBJDIR)\json_dir$O $(OBJDIR)\json_finfo$O $(OBJDIR)\json_login$O $(OBJDIR)\json_query$O $(OBJDIR)\json_report$O $(OBJDIR)\json_status$O $(OBJDIR)\json_tag$O $(OBJDIR)\json_timeline$O $(OBJDIR)\json_user$O $(OBJDIR)\json_wiki$O $(OBJDIR)\leaf$O $(OBJDIR)\loadctrl$O $(OBJDIR)\login$O $(OBJDIR)\lookslike$O $(OBJDIR)\main$O $(OBJDIR)\manifest$O $(OBJDIR)\markdown$O $(OBJDIR)\markdown_html$O $(OBJDIR)\md5$O $(OBJDIR)\merge$O $(OBJDIR)\merge3$O $(OBJDIR)\moderate$O $(OBJDIR)\name$O $(OBJDIR)\path$O $(OBJDIR)\pivot$O $(OBJDIR)\popen$O $(OBJDIR)\pqueue$O $(OBJDIR)\printf$O $(OBJDIR)\rebuild$O $(OBJDIR)\regexp$O $(OBJDIR)\report$O $(OBJDIR)\rss$O $(OBJDIR)\schema$O $(OBJDIR)\search$O $(OBJDIR)\setup$O $(OBJDIR)\sha1$O $(OBJDIR)\shun$O $(OBJDIR)\skins$O $(OBJDIR)\sqlcmd$O $(OBJDIR)\stash$O $(OBJDIR)\stat$O $(OBJDIR)\style$O $(OBJDIR)\sync$O $(OBJDIR)\tag$O $(OBJDIR)\tar$O $(OBJDIR)\th_main$O $(OBJDIR)\timeline$O $(OBJDIR)\tkt$O $(OBJDIR)\tktsetup$O $(OBJDIR)\undo$O $(OBJDIR)\unicode$O $(OBJDIR)\update$O $(OBJDIR)\url$O $(OBJDIR)\user$O $(OBJDIR)\utf8$O $(OBJDIR)\util$O $(OBJDIR)\verify$O $(OBJDIR)\vfile$O $(OBJDIR)\wiki$O $(OBJDIR)\wikiformat$O $(OBJDIR)\winfile$O $(OBJDIR)\winhttp$O $(OBJDIR)\wysiwyg$O $(OBJDIR)\xfer$O $(OBJDIR)\xfersetup$O $(OBJDIR)\zip$O $(OBJDIR)\shell$O $(OBJDIR)\sqlite3$O $(OBJDIR)\th$O $(OBJDIR)\th_lang$O
35
+OBJ = $(OBJDIR)\add$O $(OBJDIR)\allrepo$O $(OBJDIR)\attach$O $(OBJDIR)\bag$O $(OBJDIR)\bisect$O $(OBJDIR)\blob$O $(OBJDIR)\branch$O $(OBJDIR)\browse$O $(OBJDIR)\cache$O $(OBJDIR)\captcha$O $(OBJDIR)\cgi$O $(OBJDIR)\checkin$O $(OBJDIR)\checkout$O $(OBJDIR)\clearsign$O $(OBJDIR)\clone$O $(OBJDIR)\comformat$O $(OBJDIR)\configure$O $(OBJDIR)\content$O $(OBJDIR)\db$O $(OBJDIR)\delta$O $(OBJDIR)\deltacmd$O $(OBJDIR)\descendants$O $(OBJDIR)\diff$O $(OBJDIR)\diffcmd$O $(OBJDIR)\doc$O $(OBJDIR)\encode$O $(OBJDIR)\event$O $(OBJDIR)\export$O $(OBJDIR)\file$O $(OBJDIR)\finfo$O $(OBJDIR)\glob$O $(OBJDIR)\graph$O $(OBJDIR)\gzip$O $(OBJDIR)\http$O $(OBJDIR)\http_socket$O $(OBJDIR)\http_ssl$O $(OBJDIR)\http_transport$O $(OBJDIR)\import$O $(OBJDIR)\info$O $(OBJDIR)\json$O $(OBJDIR)\json_artifact$O $(OBJDIR)\json_branch$O $(OBJDIR)\json_config$O $(OBJDIR)\json_diff$O $(OBJDIR)\json_dir$O $(OBJDIR)\json_finfo$O $(OBJDIR)\json_login$O $(OBJDIR)\json_query$O $(OBJDIR)\json_report$O $(OBJDIR)\json_status$O $(OBJDIR)\json_tag$O $(OBJDIR)\json_timeline$O $(OBJDIR)\json_user$O $(OBJDIR)\json_wiki$O $(OBJDIR)\leaf$O $(OBJDIR)\loadctrl$O $(OBJDIR)\login$O $(OBJDIR)\lookslike$O $(OBJDIR)\main$O $(OBJDIR)\manifest$O $(OBJDIR)\markdown$O $(OBJDIR)\markdown_html$O $(OBJDIR)\md5$O $(OBJDIR)\merge$O $(OBJDIR)\merge3$O $(OBJDIR)\moderate$O $(OBJDIR)\name$O $(OBJDIR)\path$O $(OBJDIR)\pivot$O $(OBJDIR)\popen$O $(OBJDIR)\pqueue$O $(OBJDIR)\printf$O $(OBJDIR)\rebuild$O $(OBJDIR)\regexp$O $(OBJDIR)\report$O $(OBJDIR)\rss$O $(OBJDIR)\schema$O $(OBJDIR)\search$O $(OBJDIR)\setup$O $(OBJDIR)\sha1$O $(OBJDIR)\shun$O $(OBJDIR)\skins$O $(OBJDIR)\sqlcmd$O $(OBJDIR)\stash$O $(OBJDIR)\stat$O $(OBJDIR)\style$O $(OBJDIR)\sync$O $(OBJDIR)\tag$O $(OBJDIR)\tar$O $(OBJDIR)\th_main$O $(OBJDIR)\timeline$O $(OBJDIR)\tkt$O $(OBJDIR)\tktsetup$O $(OBJDIR)\undo$O $(OBJDIR)\unicode$O $(OBJDIR)\update$O $(OBJDIR)\url$O $(OBJDIR)\user$O $(OBJDIR)\utf8$O $(OBJDIR)\util$O $(OBJDIR)\verify$O $(OBJDIR)\vfile$O $(OBJDIR)\wiki$O $(OBJDIR)\wikiformat$O $(OBJDIR)\winfile$O $(OBJDIR)\winhttp$O $(OBJDIR)\wysiwyg$O $(OBJDIR)\xfer$O $(OBJDIR)\xfersetup$O $(OBJDIR)\zip$O $(OBJDIR)\shell$O $(OBJDIR)\sqlite3$O $(OBJDIR)\th$O $(OBJDIR)\th_lang$O
3636
3737
3838
RC=$(DMDIR)\bin\rcc
3939
RCFLAGS=-32 -w1 -I$(SRCDIR) /D__DMC__
4040
@@ -48,11 +48,11 @@
4848
4949
$(OBJDIR)\fossil.res: $B\win\fossil.rc
5050
$(RC) $(RCFLAGS) -o$@ $**
5151
5252
$(OBJDIR)\link: $B\win\Makefile.dmc $(OBJDIR)\fossil.res
53
- +echo add allrepo attach bag bisect blob branch browse captcha cgi checkin checkout clearsign clone comformat configure content db delta deltacmd descendants diff diffcmd doc encode event export file finfo glob graph gzip http http_socket http_ssl http_transport import info json json_artifact json_branch json_config json_diff json_dir json_finfo json_login json_query json_report json_status json_tag json_timeline json_user json_wiki leaf loadctrl login lookslike main manifest markdown markdown_html md5 merge merge3 moderate name path pivot popen pqueue printf rebuild regexp report rss schema search setup sha1 shun skins sqlcmd stash stat style sync tag tar th_main timeline tkt tktsetup undo unicode update url user utf8 util verify vfile wiki wikiformat winfile winhttp wysiwyg xfer xfersetup zip shell sqlite3 th th_lang > $@
53
+ +echo add allrepo attach bag bisect blob branch browse cache captcha cgi checkin checkout clearsign clone comformat configure content db delta deltacmd descendants diff diffcmd doc encode event export file finfo glob graph gzip http http_socket http_ssl http_transport import info json json_artifact json_branch json_config json_diff json_dir json_finfo json_login json_query json_report json_status json_tag json_timeline json_user json_wiki leaf loadctrl login lookslike main manifest markdown markdown_html md5 merge merge3 moderate name path pivot popen pqueue printf rebuild regexp report rss schema search setup sha1 shun skins sqlcmd stash stat style sync tag tar th_main timeline tkt tktsetup undo unicode update url user utf8 util verify vfile wiki wikiformat winfile winhttp wysiwyg xfer xfersetup zip shell sqlite3 th th_lang > $@
5454
+echo fossil >> $@
5555
+echo fossil >> $@
5656
+echo $(LIBS) >> $@
5757
+echo. >> $@
5858
+echo fossil >> $@
@@ -160,10 +160,16 @@
160160
$(OBJDIR)\browse$O : browse_.c browse.h
161161
$(TCC) -o$@ -c browse_.c
162162
163163
browse_.c : $(SRCDIR)\browse.c
164164
+translate$E $** > $@
165
+
166
+$(OBJDIR)\cache$O : cache_.c cache.h
167
+ $(TCC) -o$@ -c cache_.c
168
+
169
+cache_.c : $(SRCDIR)\cache.c
170
+ +translate$E $** > $@
165171
166172
$(OBJDIR)\captcha$O : captcha_.c captcha.h
167173
$(TCC) -o$@ -c captcha_.c
168174
169175
captcha_.c : $(SRCDIR)\captcha.c
@@ -768,7 +774,7 @@
768774
769775
zip_.c : $(SRCDIR)\zip.c
770776
+translate$E $** > $@
771777
772778
headers: makeheaders$E page_index.h VERSION.h
773
- +makeheaders$E add_.c:add.h allrepo_.c:allrepo.h attach_.c:attach.h bag_.c:bag.h bisect_.c:bisect.h blob_.c:blob.h branch_.c:branch.h browse_.c:browse.h captcha_.c:captcha.h cgi_.c:cgi.h checkin_.c:checkin.h checkout_.c:checkout.h clearsign_.c:clearsign.h clone_.c:clone.h comformat_.c:comformat.h configure_.c:configure.h content_.c:content.h db_.c:db.h delta_.c:delta.h deltacmd_.c:deltacmd.h descendants_.c:descendants.h diff_.c:diff.h diffcmd_.c:diffcmd.h doc_.c:doc.h encode_.c:encode.h event_.c:event.h export_.c:export.h file_.c:file.h finfo_.c:finfo.h glob_.c:glob.h graph_.c:graph.h gzip_.c:gzip.h http_.c:http.h http_socket_.c:http_socket.h http_ssl_.c:http_ssl.h http_transport_.c:http_transport.h import_.c:import.h info_.c:info.h json_.c:json.h json_artifact_.c:json_artifact.h json_branch_.c:json_branch.h json_config_.c:json_config.h json_diff_.c:json_diff.h json_dir_.c:json_dir.h json_finfo_.c:json_finfo.h json_login_.c:json_login.h json_query_.c:json_query.h json_report_.c:json_report.h json_status_.c:json_status.h json_tag_.c:json_tag.h json_timeline_.c:json_timeline.h json_user_.c:json_user.h json_wiki_.c:json_wiki.h leaf_.c:leaf.h loadctrl_.c:loadctrl.h login_.c:login.h lookslike_.c:lookslike.h main_.c:main.h manifest_.c:manifest.h markdown_.c:markdown.h markdown_html_.c:markdown_html.h md5_.c:md5.h merge_.c:merge.h merge3_.c:merge3.h moderate_.c:moderate.h name_.c:name.h path_.c:path.h pivot_.c:pivot.h popen_.c:popen.h pqueue_.c:pqueue.h printf_.c:printf.h rebuild_.c:rebuild.h regexp_.c:regexp.h report_.c:report.h rss_.c:rss.h schema_.c:schema.h search_.c:search.h setup_.c:setup.h sha1_.c:sha1.h shun_.c:shun.h skins_.c:skins.h sqlcmd_.c:sqlcmd.h stash_.c:stash.h stat_.c:stat.h style_.c:style.h sync_.c:sync.h tag_.c:tag.h tar_.c:tar.h th_main_.c:th_main.h timeline_.c:timeline.h tkt_.c:tkt.h tktsetup_.c:tktsetup.h undo_.c:undo.h unicode_.c:unicode.h update_.c:update.h url_.c:url.h user_.c:user.h utf8_.c:utf8.h util_.c:util.h verify_.c:verify.h vfile_.c:vfile.h wiki_.c:wiki.h wikiformat_.c:wikiformat.h winfile_.c:winfile.h winhttp_.c:winhttp.h wysiwyg_.c:wysiwyg.h xfer_.c:xfer.h xfersetup_.c:xfersetup.h zip_.c:zip.h $(SRCDIR)\sqlite3.h $(SRCDIR)\th.h VERSION.h $(SRCDIR)\cson_amalgamation.h
779
+ +makeheaders$E add_.c:add.h allrepo_.c:allrepo.h attach_.c:attach.h bag_.c:bag.h bisect_.c:bisect.h blob_.c:blob.h branch_.c:branch.h browse_.c:browse.h cache_.c:cache.h captcha_.c:captcha.h cgi_.c:cgi.h checkin_.c:checkin.h checkout_.c:checkout.h clearsign_.c:clearsign.h clone_.c:clone.h comformat_.c:comformat.h configure_.c:configure.h content_.c:content.h db_.c:db.h delta_.c:delta.h deltacmd_.c:deltacmd.h descendants_.c:descendants.h diff_.c:diff.h diffcmd_.c:diffcmd.h doc_.c:doc.h encode_.c:encode.h event_.c:event.h export_.c:export.h file_.c:file.h finfo_.c:finfo.h glob_.c:glob.h graph_.c:graph.h gzip_.c:gzip.h http_.c:http.h http_socket_.c:http_socket.h http_ssl_.c:http_ssl.h http_transport_.c:http_transport.h import_.c:import.h info_.c:info.h json_.c:json.h json_artifact_.c:json_artifact.h json_branch_.c:json_branch.h json_config_.c:json_config.h json_diff_.c:json_diff.h json_dir_.c:json_dir.h json_finfo_.c:json_finfo.h json_login_.c:json_login.h json_query_.c:json_query.h json_report_.c:json_report.h json_status_.c:json_status.h json_tag_.c:json_tag.h json_timeline_.c:json_timeline.h json_user_.c:json_user.h json_wiki_.c:json_wiki.h leaf_.c:leaf.h loadctrl_.c:loadctrl.h login_.c:login.h lookslike_.c:lookslike.h main_.c:main.h manifest_.c:manifest.h markdown_.c:markdown.h markdown_html_.c:markdown_html.h md5_.c:md5.h merge_.c:merge.h merge3_.c:merge3.h moderate_.c:moderate.h name_.c:name.h path_.c:path.h pivot_.c:pivot.h popen_.c:popen.h pqueue_.c:pqueue.h printf_.c:printf.h rebuild_.c:rebuild.h regexp_.c:regexp.h report_.c:report.h rss_.c:rss.h schema_.c:schema.h search_.c:search.h setup_.c:setup.h sha1_.c:sha1.h shun_.c:shun.h skins_.c:skins.h sqlcmd_.c:sqlcmd.h stash_.c:stash.h stat_.c:stat.h style_.c:style.h sync_.c:sync.h tag_.c:tag.h tar_.c:tar.h th_main_.c:th_main.h timeline_.c:timeline.h tkt_.c:tkt.h tktsetup_.c:tktsetup.h undo_.c:undo.h unicode_.c:unicode.h update_.c:update.h url_.c:url.h user_.c:user.h utf8_.c:utf8.h util_.c:util.h verify_.c:verify.h vfile_.c:vfile.h wiki_.c:wiki.h wikiformat_.c:wikiformat.h winfile_.c:winfile.h winhttp_.c:winhttp.h wysiwyg_.c:wysiwyg.h xfer_.c:xfer.h xfersetup_.c:xfersetup.h zip_.c:zip.h $(SRCDIR)\sqlite3.h $(SRCDIR)\th.h VERSION.h $(SRCDIR)\cson_amalgamation.h
774780
@copy /Y nul: headers
775781
--- win/Makefile.dmc
+++ win/Makefile.dmc
@@ -26,15 +26,15 @@
26 TCC = $(DMDIR)\bin\dmc $(CFLAGS) $(DMCDEF) $(SSL) $(INCL)
27 LIBS = $(DMDIR)\extra\lib\ zlib wsock32 advapi32
28
29 SQLITE_OPTIONS = -DSQLITE_OMIT_LOAD_EXTENSION=1 -DSQLITE_ENABLE_LOCKING_STYLE=0 -DSQLITE_THREADSAFE=0 -DSQLITE_DEFAULT_FILE_FORMAT=4 -DSQLITE_OMIT_DEPRECATED -DSQLITE_ENABLE_EXPLAIN_COMMENTS
30
31 SHELL_OPTIONS = -Dmain=sqlite3_shell -DSQLITE_OMIT_LOAD_EXTENSION=1 -DUSE_SYSTEM_SQLITE=$(USE_SYSTEM_SQLITE) -DSQLITE_SHELL_DBNAME_PROC=fossil_open -Daccess=win32_access -Dgetenv=fossil_getenv -Dfopen=fossil_fopen
32
33 SRC = add_.c allrepo_.c attach_.c bag_.c bisect_.c blob_.c branch_.c browse_.c captcha_.c cgi_.c checkin_.c checkout_.c clearsign_.c clone_.c comformat_.c configure_.c content_.c db_.c delta_.c deltacmd_.c descendants_.c diff_.c diffcmd_.c doc_.c encode_.c event_.c export_.c file_.c finfo_.c glob_.c graph_.c gzip_.c http_.c http_socket_.c http_ssl_.c http_transport_.c import_.c info_.c json_.c json_artifact_.c json_branch_.c json_config_.c json_diff_.c json_dir_.c json_finfo_.c json_login_.c json_query_.c json_report_.c json_status_.c json_tag_.c json_timeline_.c json_user_.c json_wiki_.c leaf_.c loadctrl_.c login_.c lookslike_.c main_.c manifest_.c markdown_.c markdown_html_.c md5_.c merge_.c merge3_.c moderate_.c name_.c path_.c pivot_.c popen_.c pqueue_.c printf_.c rebuild_.c regexp_.c report_.c rss_.c schema_.c search_.c setup_.c sha1_.c shun_.c skins_.c sqlcmd_.c stash_.c stat_.c style_.c sync_.c tag_.c tar_.c th_main_.c timeline_.c tkt_.c tktsetup_.c undo_.c unicode_.c update_.c url_.c user_.c utf8_.c util_.c verify_.c vfile_.c wiki_.c wikiformat_.c winfile_.c winhttp_.c wysiwyg_.c xfer_.c xfersetup_.c zip_.c
34
35 OBJ = $(OBJDIR)\add$O $(OBJDIR)\allrepo$O $(OBJDIR)\attach$O $(OBJDIR)\bag$O $(OBJDIR)\bisect$O $(OBJDIR)\blob$O $(OBJDIR)\branch$O $(OBJDIR)\browse$O $(OBJDIR)\captcha$O $(OBJDIR)\cgi$O $(OBJDIR)\checkin$O $(OBJDIR)\checkout$O $(OBJDIR)\clearsign$O $(OBJDIR)\clone$O $(OBJDIR)\comformat$O $(OBJDIR)\configure$O $(OBJDIR)\content$O $(OBJDIR)\db$O $(OBJDIR)\delta$O $(OBJDIR)\deltacmd$O $(OBJDIR)\descendants$O $(OBJDIR)\diff$O $(OBJDIR)\diffcmd$O $(OBJDIR)\doc$O $(OBJDIR)\encode$O $(OBJDIR)\event$O $(OBJDIR)\export$O $(OBJDIR)\file$O $(OBJDIR)\finfo$O $(OBJDIR)\glob$O $(OBJDIR)\graph$O $(OBJDIR)\gzip$O $(OBJDIR)\http$O $(OBJDIR)\http_socket$O $(OBJDIR)\http_ssl$O $(OBJDIR)\http_transport$O $(OBJDIR)\import$O $(OBJDIR)\info$O $(OBJDIR)\json$O $(OBJDIR)\json_artifact$O $(OBJDIR)\json_branch$O $(OBJDIR)\json_config$O $(OBJDIR)\json_diff$O $(OBJDIR)\json_dir$O $(OBJDIR)\json_finfo$O $(OBJDIR)\json_login$O $(OBJDIR)\json_query$O $(OBJDIR)\json_report$O $(OBJDIR)\json_status$O $(OBJDIR)\json_tag$O $(OBJDIR)\json_timeline$O $(OBJDIR)\json_user$O $(OBJDIR)\json_wiki$O $(OBJDIR)\leaf$O $(OBJDIR)\loadctrl$O $(OBJDIR)\login$O $(OBJDIR)\lookslike$O $(OBJDIR)\main$O $(OBJDIR)\manifest$O $(OBJDIR)\markdown$O $(OBJDIR)\markdown_html$O $(OBJDIR)\md5$O $(OBJDIR)\merge$O $(OBJDIR)\merge3$O $(OBJDIR)\moderate$O $(OBJDIR)\name$O $(OBJDIR)\path$O $(OBJDIR)\pivot$O $(OBJDIR)\popen$O $(OBJDIR)\pqueue$O $(OBJDIR)\printf$O $(OBJDIR)\rebuild$O $(OBJDIR)\regexp$O $(OBJDIR)\report$O $(OBJDIR)\rss$O $(OBJDIR)\schema$O $(OBJDIR)\search$O $(OBJDIR)\setup$O $(OBJDIR)\sha1$O $(OBJDIR)\shun$O $(OBJDIR)\skins$O $(OBJDIR)\sqlcmd$O $(OBJDIR)\stash$O $(OBJDIR)\stat$O $(OBJDIR)\style$O $(OBJDIR)\sync$O $(OBJDIR)\tag$O $(OBJDIR)\tar$O $(OBJDIR)\th_main$O $(OBJDIR)\timeline$O $(OBJDIR)\tkt$O $(OBJDIR)\tktsetup$O $(OBJDIR)\undo$O $(OBJDIR)\unicode$O $(OBJDIR)\update$O $(OBJDIR)\url$O $(OBJDIR)\user$O $(OBJDIR)\utf8$O $(OBJDIR)\util$O $(OBJDIR)\verify$O $(OBJDIR)\vfile$O $(OBJDIR)\wiki$O $(OBJDIR)\wikiformat$O $(OBJDIR)\winfile$O $(OBJDIR)\winhttp$O $(OBJDIR)\wysiwyg$O $(OBJDIR)\xfer$O $(OBJDIR)\xfersetup$O $(OBJDIR)\zip$O $(OBJDIR)\shell$O $(OBJDIR)\sqlite3$O $(OBJDIR)\th$O $(OBJDIR)\th_lang$O
36
37
38 RC=$(DMDIR)\bin\rcc
39 RCFLAGS=-32 -w1 -I$(SRCDIR) /D__DMC__
40
@@ -48,11 +48,11 @@
48
49 $(OBJDIR)\fossil.res: $B\win\fossil.rc
50 $(RC) $(RCFLAGS) -o$@ $**
51
52 $(OBJDIR)\link: $B\win\Makefile.dmc $(OBJDIR)\fossil.res
53 +echo add allrepo attach bag bisect blob branch browse captcha cgi checkin checkout clearsign clone comformat configure content db delta deltacmd descendants diff diffcmd doc encode event export file finfo glob graph gzip http http_socket http_ssl http_transport import info json json_artifact json_branch json_config json_diff json_dir json_finfo json_login json_query json_report json_status json_tag json_timeline json_user json_wiki leaf loadctrl login lookslike main manifest markdown markdown_html md5 merge merge3 moderate name path pivot popen pqueue printf rebuild regexp report rss schema search setup sha1 shun skins sqlcmd stash stat style sync tag tar th_main timeline tkt tktsetup undo unicode update url user utf8 util verify vfile wiki wikiformat winfile winhttp wysiwyg xfer xfersetup zip shell sqlite3 th th_lang > $@
54 +echo fossil >> $@
55 +echo fossil >> $@
56 +echo $(LIBS) >> $@
57 +echo. >> $@
58 +echo fossil >> $@
@@ -160,10 +160,16 @@
160 $(OBJDIR)\browse$O : browse_.c browse.h
161 $(TCC) -o$@ -c browse_.c
162
163 browse_.c : $(SRCDIR)\browse.c
164 +translate$E $** > $@
 
 
 
 
 
 
165
166 $(OBJDIR)\captcha$O : captcha_.c captcha.h
167 $(TCC) -o$@ -c captcha_.c
168
169 captcha_.c : $(SRCDIR)\captcha.c
@@ -768,7 +774,7 @@
768
769 zip_.c : $(SRCDIR)\zip.c
770 +translate$E $** > $@
771
772 headers: makeheaders$E page_index.h VERSION.h
773 +makeheaders$E add_.c:add.h allrepo_.c:allrepo.h attach_.c:attach.h bag_.c:bag.h bisect_.c:bisect.h blob_.c:blob.h branch_.c:branch.h browse_.c:browse.h captcha_.c:captcha.h cgi_.c:cgi.h checkin_.c:checkin.h checkout_.c:checkout.h clearsign_.c:clearsign.h clone_.c:clone.h comformat_.c:comformat.h configure_.c:configure.h content_.c:content.h db_.c:db.h delta_.c:delta.h deltacmd_.c:deltacmd.h descendants_.c:descendants.h diff_.c:diff.h diffcmd_.c:diffcmd.h doc_.c:doc.h encode_.c:encode.h event_.c:event.h export_.c:export.h file_.c:file.h finfo_.c:finfo.h glob_.c:glob.h graph_.c:graph.h gzip_.c:gzip.h http_.c:http.h http_socket_.c:http_socket.h http_ssl_.c:http_ssl.h http_transport_.c:http_transport.h import_.c:import.h info_.c:info.h json_.c:json.h json_artifact_.c:json_artifact.h json_branch_.c:json_branch.h json_config_.c:json_config.h json_diff_.c:json_diff.h json_dir_.c:json_dir.h json_finfo_.c:json_finfo.h json_login_.c:json_login.h json_query_.c:json_query.h json_report_.c:json_report.h json_status_.c:json_status.h json_tag_.c:json_tag.h json_timeline_.c:json_timeline.h json_user_.c:json_user.h json_wiki_.c:json_wiki.h leaf_.c:leaf.h loadctrl_.c:loadctrl.h login_.c:login.h lookslike_.c:lookslike.h main_.c:main.h manifest_.c:manifest.h markdown_.c:markdown.h markdown_html_.c:markdown_html.h md5_.c:md5.h merge_.c:merge.h merge3_.c:merge3.h moderate_.c:moderate.h name_.c:name.h path_.c:path.h pivot_.c:pivot.h popen_.c:popen.h pqueue_.c:pqueue.h printf_.c:printf.h rebuild_.c:rebuild.h regexp_.c:regexp.h report_.c:report.h rss_.c:rss.h schema_.c:schema.h search_.c:search.h setup_.c:setup.h sha1_.c:sha1.h shun_.c:shun.h skins_.c:skins.h sqlcmd_.c:sqlcmd.h stash_.c:stash.h stat_.c:stat.h style_.c:style.h sync_.c:sync.h tag_.c:tag.h tar_.c:tar.h th_main_.c:th_main.h timeline_.c:timeline.h tkt_.c:tkt.h tktsetup_.c:tktsetup.h undo_.c:undo.h unicode_.c:unicode.h update_.c:update.h url_.c:url.h user_.c:user.h utf8_.c:utf8.h util_.c:util.h verify_.c:verify.h vfile_.c:vfile.h wiki_.c:wiki.h wikiformat_.c:wikiformat.h winfile_.c:winfile.h winhttp_.c:winhttp.h wysiwyg_.c:wysiwyg.h xfer_.c:xfer.h xfersetup_.c:xfersetup.h zip_.c:zip.h $(SRCDIR)\sqlite3.h $(SRCDIR)\th.h VERSION.h $(SRCDIR)\cson_amalgamation.h
774 @copy /Y nul: headers
775
--- win/Makefile.dmc
+++ win/Makefile.dmc
@@ -26,15 +26,15 @@
26 TCC = $(DMDIR)\bin\dmc $(CFLAGS) $(DMCDEF) $(SSL) $(INCL)
27 LIBS = $(DMDIR)\extra\lib\ zlib wsock32 advapi32
28
29 SQLITE_OPTIONS = -DSQLITE_OMIT_LOAD_EXTENSION=1 -DSQLITE_ENABLE_LOCKING_STYLE=0 -DSQLITE_THREADSAFE=0 -DSQLITE_DEFAULT_FILE_FORMAT=4 -DSQLITE_OMIT_DEPRECATED -DSQLITE_ENABLE_EXPLAIN_COMMENTS
30
31 SHELL_OPTIONS = -Dmain=sqlite3_shell -DSQLITE_OMIT_LOAD_EXTENSION=1 -DUSE_SYSTEM_SQLITE=$(USE_SYSTEM_SQLITE) -DSQLITE_SHELL_DBNAME_PROC=fossil_open -Daccess=file_access -Dgetenv=fossil_getenv -Dfopen=fossil_fopen
32
33 SRC = add_.c allrepo_.c attach_.c bag_.c bisect_.c blob_.c branch_.c browse_.c cache_.c captcha_.c cgi_.c checkin_.c checkout_.c clearsign_.c clone_.c comformat_.c configure_.c content_.c db_.c delta_.c deltacmd_.c descendants_.c diff_.c diffcmd_.c doc_.c encode_.c event_.c export_.c file_.c finfo_.c glob_.c graph_.c gzip_.c http_.c http_socket_.c http_ssl_.c http_transport_.c import_.c info_.c json_.c json_artifact_.c json_branch_.c json_config_.c json_diff_.c json_dir_.c json_finfo_.c json_login_.c json_query_.c json_report_.c json_status_.c json_tag_.c json_timeline_.c json_user_.c json_wiki_.c leaf_.c loadctrl_.c login_.c lookslike_.c main_.c manifest_.c markdown_.c markdown_html_.c md5_.c merge_.c merge3_.c moderate_.c name_.c path_.c pivot_.c popen_.c pqueue_.c printf_.c rebuild_.c regexp_.c report_.c rss_.c schema_.c search_.c setup_.c sha1_.c shun_.c skins_.c sqlcmd_.c stash_.c stat_.c style_.c sync_.c tag_.c tar_.c th_main_.c timeline_.c tkt_.c tktsetup_.c undo_.c unicode_.c update_.c url_.c user_.c utf8_.c util_.c verify_.c vfile_.c wiki_.c wikiformat_.c winfile_.c winhttp_.c wysiwyg_.c xfer_.c xfersetup_.c zip_.c
34
35 OBJ = $(OBJDIR)\add$O $(OBJDIR)\allrepo$O $(OBJDIR)\attach$O $(OBJDIR)\bag$O $(OBJDIR)\bisect$O $(OBJDIR)\blob$O $(OBJDIR)\branch$O $(OBJDIR)\browse$O $(OBJDIR)\cache$O $(OBJDIR)\captcha$O $(OBJDIR)\cgi$O $(OBJDIR)\checkin$O $(OBJDIR)\checkout$O $(OBJDIR)\clearsign$O $(OBJDIR)\clone$O $(OBJDIR)\comformat$O $(OBJDIR)\configure$O $(OBJDIR)\content$O $(OBJDIR)\db$O $(OBJDIR)\delta$O $(OBJDIR)\deltacmd$O $(OBJDIR)\descendants$O $(OBJDIR)\diff$O $(OBJDIR)\diffcmd$O $(OBJDIR)\doc$O $(OBJDIR)\encode$O $(OBJDIR)\event$O $(OBJDIR)\export$O $(OBJDIR)\file$O $(OBJDIR)\finfo$O $(OBJDIR)\glob$O $(OBJDIR)\graph$O $(OBJDIR)\gzip$O $(OBJDIR)\http$O $(OBJDIR)\http_socket$O $(OBJDIR)\http_ssl$O $(OBJDIR)\http_transport$O $(OBJDIR)\import$O $(OBJDIR)\info$O $(OBJDIR)\json$O $(OBJDIR)\json_artifact$O $(OBJDIR)\json_branch$O $(OBJDIR)\json_config$O $(OBJDIR)\json_diff$O $(OBJDIR)\json_dir$O $(OBJDIR)\json_finfo$O $(OBJDIR)\json_login$O $(OBJDIR)\json_query$O $(OBJDIR)\json_report$O $(OBJDIR)\json_status$O $(OBJDIR)\json_tag$O $(OBJDIR)\json_timeline$O $(OBJDIR)\json_user$O $(OBJDIR)\json_wiki$O $(OBJDIR)\leaf$O $(OBJDIR)\loadctrl$O $(OBJDIR)\login$O $(OBJDIR)\lookslike$O $(OBJDIR)\main$O $(OBJDIR)\manifest$O $(OBJDIR)\markdown$O $(OBJDIR)\markdown_html$O $(OBJDIR)\md5$O $(OBJDIR)\merge$O $(OBJDIR)\merge3$O $(OBJDIR)\moderate$O $(OBJDIR)\name$O $(OBJDIR)\path$O $(OBJDIR)\pivot$O $(OBJDIR)\popen$O $(OBJDIR)\pqueue$O $(OBJDIR)\printf$O $(OBJDIR)\rebuild$O $(OBJDIR)\regexp$O $(OBJDIR)\report$O $(OBJDIR)\rss$O $(OBJDIR)\schema$O $(OBJDIR)\search$O $(OBJDIR)\setup$O $(OBJDIR)\sha1$O $(OBJDIR)\shun$O $(OBJDIR)\skins$O $(OBJDIR)\sqlcmd$O $(OBJDIR)\stash$O $(OBJDIR)\stat$O $(OBJDIR)\style$O $(OBJDIR)\sync$O $(OBJDIR)\tag$O $(OBJDIR)\tar$O $(OBJDIR)\th_main$O $(OBJDIR)\timeline$O $(OBJDIR)\tkt$O $(OBJDIR)\tktsetup$O $(OBJDIR)\undo$O $(OBJDIR)\unicode$O $(OBJDIR)\update$O $(OBJDIR)\url$O $(OBJDIR)\user$O $(OBJDIR)\utf8$O $(OBJDIR)\util$O $(OBJDIR)\verify$O $(OBJDIR)\vfile$O $(OBJDIR)\wiki$O $(OBJDIR)\wikiformat$O $(OBJDIR)\winfile$O $(OBJDIR)\winhttp$O $(OBJDIR)\wysiwyg$O $(OBJDIR)\xfer$O $(OBJDIR)\xfersetup$O $(OBJDIR)\zip$O $(OBJDIR)\shell$O $(OBJDIR)\sqlite3$O $(OBJDIR)\th$O $(OBJDIR)\th_lang$O
36
37
38 RC=$(DMDIR)\bin\rcc
39 RCFLAGS=-32 -w1 -I$(SRCDIR) /D__DMC__
40
@@ -48,11 +48,11 @@
48
49 $(OBJDIR)\fossil.res: $B\win\fossil.rc
50 $(RC) $(RCFLAGS) -o$@ $**
51
52 $(OBJDIR)\link: $B\win\Makefile.dmc $(OBJDIR)\fossil.res
53 +echo add allrepo attach bag bisect blob branch browse cache captcha cgi checkin checkout clearsign clone comformat configure content db delta deltacmd descendants diff diffcmd doc encode event export file finfo glob graph gzip http http_socket http_ssl http_transport import info json json_artifact json_branch json_config json_diff json_dir json_finfo json_login json_query json_report json_status json_tag json_timeline json_user json_wiki leaf loadctrl login lookslike main manifest markdown markdown_html md5 merge merge3 moderate name path pivot popen pqueue printf rebuild regexp report rss schema search setup sha1 shun skins sqlcmd stash stat style sync tag tar th_main timeline tkt tktsetup undo unicode update url user utf8 util verify vfile wiki wikiformat winfile winhttp wysiwyg xfer xfersetup zip shell sqlite3 th th_lang > $@
54 +echo fossil >> $@
55 +echo fossil >> $@
56 +echo $(LIBS) >> $@
57 +echo. >> $@
58 +echo fossil >> $@
@@ -160,10 +160,16 @@
160 $(OBJDIR)\browse$O : browse_.c browse.h
161 $(TCC) -o$@ -c browse_.c
162
163 browse_.c : $(SRCDIR)\browse.c
164 +translate$E $** > $@
165
166 $(OBJDIR)\cache$O : cache_.c cache.h
167 $(TCC) -o$@ -c cache_.c
168
169 cache_.c : $(SRCDIR)\cache.c
170 +translate$E $** > $@
171
172 $(OBJDIR)\captcha$O : captcha_.c captcha.h
173 $(TCC) -o$@ -c captcha_.c
174
175 captcha_.c : $(SRCDIR)\captcha.c
@@ -768,7 +774,7 @@
774
775 zip_.c : $(SRCDIR)\zip.c
776 +translate$E $** > $@
777
778 headers: makeheaders$E page_index.h VERSION.h
779 +makeheaders$E add_.c:add.h allrepo_.c:allrepo.h attach_.c:attach.h bag_.c:bag.h bisect_.c:bisect.h blob_.c:blob.h branch_.c:branch.h browse_.c:browse.h cache_.c:cache.h captcha_.c:captcha.h cgi_.c:cgi.h checkin_.c:checkin.h checkout_.c:checkout.h clearsign_.c:clearsign.h clone_.c:clone.h comformat_.c:comformat.h configure_.c:configure.h content_.c:content.h db_.c:db.h delta_.c:delta.h deltacmd_.c:deltacmd.h descendants_.c:descendants.h diff_.c:diff.h diffcmd_.c:diffcmd.h doc_.c:doc.h encode_.c:encode.h event_.c:event.h export_.c:export.h file_.c:file.h finfo_.c:finfo.h glob_.c:glob.h graph_.c:graph.h gzip_.c:gzip.h http_.c:http.h http_socket_.c:http_socket.h http_ssl_.c:http_ssl.h http_transport_.c:http_transport.h import_.c:import.h info_.c:info.h json_.c:json.h json_artifact_.c:json_artifact.h json_branch_.c:json_branch.h json_config_.c:json_config.h json_diff_.c:json_diff.h json_dir_.c:json_dir.h json_finfo_.c:json_finfo.h json_login_.c:json_login.h json_query_.c:json_query.h json_report_.c:json_report.h json_status_.c:json_status.h json_tag_.c:json_tag.h json_timeline_.c:json_timeline.h json_user_.c:json_user.h json_wiki_.c:json_wiki.h leaf_.c:leaf.h loadctrl_.c:loadctrl.h login_.c:login.h lookslike_.c:lookslike.h main_.c:main.h manifest_.c:manifest.h markdown_.c:markdown.h markdown_html_.c:markdown_html.h md5_.c:md5.h merge_.c:merge.h merge3_.c:merge3.h moderate_.c:moderate.h name_.c:name.h path_.c:path.h pivot_.c:pivot.h popen_.c:popen.h pqueue_.c:pqueue.h printf_.c:printf.h rebuild_.c:rebuild.h regexp_.c:regexp.h report_.c:report.h rss_.c:rss.h schema_.c:schema.h search_.c:search.h setup_.c:setup.h sha1_.c:sha1.h shun_.c:shun.h skins_.c:skins.h sqlcmd_.c:sqlcmd.h stash_.c:stash.h stat_.c:stat.h style_.c:style.h sync_.c:sync.h tag_.c:tag.h tar_.c:tar.h th_main_.c:th_main.h timeline_.c:timeline.h tkt_.c:tkt.h tktsetup_.c:tktsetup.h undo_.c:undo.h unicode_.c:unicode.h update_.c:update.h url_.c:url.h user_.c:user.h utf8_.c:utf8.h util_.c:util.h verify_.c:verify.h vfile_.c:vfile.h wiki_.c:wiki.h wikiformat_.c:wikiformat.h winfile_.c:winfile.h winhttp_.c:winhttp.h wysiwyg_.c:wysiwyg.h xfer_.c:xfer.h xfersetup_.c:xfersetup.h zip_.c:zip.h $(SRCDIR)\sqlite3.h $(SRCDIR)\th.h VERSION.h $(SRCDIR)\cson_amalgamation.h
780 @copy /Y nul: headers
781
--- win/Makefile.mingw
+++ win/Makefile.mingw
@@ -59,10 +59,14 @@
5959
# FOSSIL_ENABLE_TCL_STUBS = 1
6060
6161
#### Load Tcl using the private stubs mechanism
6262
#
6363
# FOSSIL_ENABLE_TCL_PRIVATE_STUBS = 1
64
+
65
+#### Use 'system' sqlite
66
+#
67
+# USE_SYSTEM_SQLITE = 1
6468
6569
#### Use the Tcl source directory instead of the install directory?
6670
# This is useful when Tcl has been compiled statically with MinGW.
6771
#
6872
FOSSIL_TCL_SOURCE = 1
@@ -206,10 +210,14 @@
206210
207211
# MinGW: If available, use the Unicode capable runtime startup code.
208212
ifndef MINGW_IS_32BIT_ONLY
209213
LIB += -municode
210214
endif
215
+
216
+ifdef USE_SYSTEM_SQLITE
217
+LIB += -lsqlite3
218
+endif
211219
212220
# OpenSSL: Add the necessary libraries required, if enabled.
213221
ifdef FOSSIL_ENABLE_SSL
214222
LIB += -lssl -lcrypto -lgdi32
215223
endif
@@ -263,10 +271,11 @@
263271
$(SRCDIR)/bag.c \
264272
$(SRCDIR)/bisect.c \
265273
$(SRCDIR)/blob.c \
266274
$(SRCDIR)/branch.c \
267275
$(SRCDIR)/browse.c \
276
+ $(SRCDIR)/cache.c \
268277
$(SRCDIR)/captcha.c \
269278
$(SRCDIR)/cgi.c \
270279
$(SRCDIR)/checkin.c \
271280
$(SRCDIR)/checkout.c \
272281
$(SRCDIR)/clearsign.c \
@@ -374,10 +383,11 @@
374383
$(OBJDIR)/bag_.c \
375384
$(OBJDIR)/bisect_.c \
376385
$(OBJDIR)/blob_.c \
377386
$(OBJDIR)/branch_.c \
378387
$(OBJDIR)/browse_.c \
388
+ $(OBJDIR)/cache_.c \
379389
$(OBJDIR)/captcha_.c \
380390
$(OBJDIR)/cgi_.c \
381391
$(OBJDIR)/checkin_.c \
382392
$(OBJDIR)/checkout_.c \
383393
$(OBJDIR)/clearsign_.c \
@@ -485,10 +495,11 @@
485495
$(OBJDIR)/bag.o \
486496
$(OBJDIR)/bisect.o \
487497
$(OBJDIR)/blob.o \
488498
$(OBJDIR)/branch.o \
489499
$(OBJDIR)/browse.o \
500
+ $(OBJDIR)/cache.o \
490501
$(OBJDIR)/captcha.o \
491502
$(OBJDIR)/cgi.o \
492503
$(OBJDIR)/checkin.o \
493504
$(OBJDIR)/checkout.o \
494505
$(OBJDIR)/clearsign.o \
@@ -669,11 +680,19 @@
669680
$(TCLSH) $(SRCDIR)/../test/tester.tcl $(APPNAME)
670681
671682
$(OBJDIR)/VERSION.h: $(SRCDIR)/../manifest.uuid $(SRCDIR)/../manifest $(VERSION)
672683
$(VERSION) $(SRCDIR)/../manifest.uuid $(SRCDIR)/../manifest $(SRCDIR)/../VERSION >$(OBJDIR)/VERSION.h
673684
674
-EXTRAOBJ = $(OBJDIR)/sqlite3.o $(OBJDIR)/shell.o $(OBJDIR)/th.o $(OBJDIR)/th_lang.o $(OBJDIR)/th_tcl.o $(OBJDIR)/cson_amalgamation.o
685
+# The USE_SYSTEM_SQLITE variable may be undefined, set to 0, or set
686
+# to 1. If it is set to 1, then there is no need to build or link
687
+# the sqlite3.o object. Instead, the system sqlite will be linked
688
+# using -lsqlite3.
689
+SQLITE3_OBJ.1 =
690
+SQLITE3_OBJ.0 = $(OBJDIR)/sqlite3.o
691
+SQLITE3_OBJ. = $(SQLITE3_OBJ.0)
692
+
693
+EXTRAOBJ = $(SQLITE3_OBJ.$(USE_SYSTEM_SQLITE)) $(OBJDIR)/shell.o $(OBJDIR)/th.o $(OBJDIR)/th_lang.o $(OBJDIR)/th_tcl.o $(OBJDIR)/cson_amalgamation.o
675694
676695
zlib:
677696
$(MAKE) -C $(ZLIBDIR) PREFIX=$(PREFIX) -f win32/Makefile.gcc libz.a
678697
679698
clean-zlib:
@@ -724,10 +743,11 @@
724743
$(OBJDIR)/bag_.c:$(OBJDIR)/bag.h \
725744
$(OBJDIR)/bisect_.c:$(OBJDIR)/bisect.h \
726745
$(OBJDIR)/blob_.c:$(OBJDIR)/blob.h \
727746
$(OBJDIR)/branch_.c:$(OBJDIR)/branch.h \
728747
$(OBJDIR)/browse_.c:$(OBJDIR)/browse.h \
748
+ $(OBJDIR)/cache_.c:$(OBJDIR)/cache.h \
729749
$(OBJDIR)/captcha_.c:$(OBJDIR)/captcha.h \
730750
$(OBJDIR)/cgi_.c:$(OBJDIR)/cgi.h \
731751
$(OBJDIR)/checkin_.c:$(OBJDIR)/checkin.h \
732752
$(OBJDIR)/checkout_.c:$(OBJDIR)/checkout.h \
733753
$(OBJDIR)/clearsign_.c:$(OBJDIR)/clearsign.h \
@@ -897,10 +917,18 @@
897917
898918
$(OBJDIR)/browse.o: $(OBJDIR)/browse_.c $(OBJDIR)/browse.h $(SRCDIR)/config.h
899919
$(XTCC) -o $(OBJDIR)/browse.o -c $(OBJDIR)/browse_.c
900920
901921
$(OBJDIR)/browse.h: $(OBJDIR)/headers
922
+
923
+$(OBJDIR)/cache_.c: $(SRCDIR)/cache.c $(OBJDIR)/translate
924
+ $(TRANSLATE) $(SRCDIR)/cache.c >$(OBJDIR)/cache_.c
925
+
926
+$(OBJDIR)/cache.o: $(OBJDIR)/cache_.c $(OBJDIR)/cache.h $(SRCDIR)/config.h
927
+ $(XTCC) -o $(OBJDIR)/cache.o -c $(OBJDIR)/cache_.c
928
+
929
+$(OBJDIR)/cache.h: $(OBJDIR)/headers
902930
903931
$(OBJDIR)/captcha_.c: $(SRCDIR)/captcha.c $(OBJDIR)/translate
904932
$(TRANSLATE) $(SRCDIR)/captcha.c >$(OBJDIR)/captcha_.c
905933
906934
$(OBJDIR)/captcha.o: $(OBJDIR)/captcha_.c $(OBJDIR)/captcha.h $(SRCDIR)/config.h
@@ -1720,11 +1748,11 @@
17201748
17211749
SHELL_OPTIONS = -Dmain=sqlite3_shell \
17221750
-DSQLITE_OMIT_LOAD_EXTENSION=1 \
17231751
-DUSE_SYSTEM_SQLITE=$(USE_SYSTEM_SQLITE) \
17241752
-DSQLITE_SHELL_DBNAME_PROC=fossil_open \
1725
- -Daccess=win32_access \
1753
+ -Daccess=file_access \
17261754
-Dgetenv=fossil_getenv \
17271755
-Dfopen=fossil_fopen
17281756
17291757
$(OBJDIR)/sqlite3.o: $(SRCDIR)/sqlite3.c $(SRCDIR)/../win/Makefile.mingw
17301758
$(XTCC) $(SQLITE_OPTIONS) $(SQLITE_CFLAGS) -c $(SRCDIR)/sqlite3.c -o $(OBJDIR)/sqlite3.o
17311759
--- win/Makefile.mingw
+++ win/Makefile.mingw
@@ -59,10 +59,14 @@
59 # FOSSIL_ENABLE_TCL_STUBS = 1
60
61 #### Load Tcl using the private stubs mechanism
62 #
63 # FOSSIL_ENABLE_TCL_PRIVATE_STUBS = 1
 
 
 
 
64
65 #### Use the Tcl source directory instead of the install directory?
66 # This is useful when Tcl has been compiled statically with MinGW.
67 #
68 FOSSIL_TCL_SOURCE = 1
@@ -206,10 +210,14 @@
206
207 # MinGW: If available, use the Unicode capable runtime startup code.
208 ifndef MINGW_IS_32BIT_ONLY
209 LIB += -municode
210 endif
 
 
 
 
211
212 # OpenSSL: Add the necessary libraries required, if enabled.
213 ifdef FOSSIL_ENABLE_SSL
214 LIB += -lssl -lcrypto -lgdi32
215 endif
@@ -263,10 +271,11 @@
263 $(SRCDIR)/bag.c \
264 $(SRCDIR)/bisect.c \
265 $(SRCDIR)/blob.c \
266 $(SRCDIR)/branch.c \
267 $(SRCDIR)/browse.c \
 
268 $(SRCDIR)/captcha.c \
269 $(SRCDIR)/cgi.c \
270 $(SRCDIR)/checkin.c \
271 $(SRCDIR)/checkout.c \
272 $(SRCDIR)/clearsign.c \
@@ -374,10 +383,11 @@
374 $(OBJDIR)/bag_.c \
375 $(OBJDIR)/bisect_.c \
376 $(OBJDIR)/blob_.c \
377 $(OBJDIR)/branch_.c \
378 $(OBJDIR)/browse_.c \
 
379 $(OBJDIR)/captcha_.c \
380 $(OBJDIR)/cgi_.c \
381 $(OBJDIR)/checkin_.c \
382 $(OBJDIR)/checkout_.c \
383 $(OBJDIR)/clearsign_.c \
@@ -485,10 +495,11 @@
485 $(OBJDIR)/bag.o \
486 $(OBJDIR)/bisect.o \
487 $(OBJDIR)/blob.o \
488 $(OBJDIR)/branch.o \
489 $(OBJDIR)/browse.o \
 
490 $(OBJDIR)/captcha.o \
491 $(OBJDIR)/cgi.o \
492 $(OBJDIR)/checkin.o \
493 $(OBJDIR)/checkout.o \
494 $(OBJDIR)/clearsign.o \
@@ -669,11 +680,19 @@
669 $(TCLSH) $(SRCDIR)/../test/tester.tcl $(APPNAME)
670
671 $(OBJDIR)/VERSION.h: $(SRCDIR)/../manifest.uuid $(SRCDIR)/../manifest $(VERSION)
672 $(VERSION) $(SRCDIR)/../manifest.uuid $(SRCDIR)/../manifest $(SRCDIR)/../VERSION >$(OBJDIR)/VERSION.h
673
674 EXTRAOBJ = $(OBJDIR)/sqlite3.o $(OBJDIR)/shell.o $(OBJDIR)/th.o $(OBJDIR)/th_lang.o $(OBJDIR)/th_tcl.o $(OBJDIR)/cson_amalgamation.o
 
 
 
 
 
 
 
 
675
676 zlib:
677 $(MAKE) -C $(ZLIBDIR) PREFIX=$(PREFIX) -f win32/Makefile.gcc libz.a
678
679 clean-zlib:
@@ -724,10 +743,11 @@
724 $(OBJDIR)/bag_.c:$(OBJDIR)/bag.h \
725 $(OBJDIR)/bisect_.c:$(OBJDIR)/bisect.h \
726 $(OBJDIR)/blob_.c:$(OBJDIR)/blob.h \
727 $(OBJDIR)/branch_.c:$(OBJDIR)/branch.h \
728 $(OBJDIR)/browse_.c:$(OBJDIR)/browse.h \
 
729 $(OBJDIR)/captcha_.c:$(OBJDIR)/captcha.h \
730 $(OBJDIR)/cgi_.c:$(OBJDIR)/cgi.h \
731 $(OBJDIR)/checkin_.c:$(OBJDIR)/checkin.h \
732 $(OBJDIR)/checkout_.c:$(OBJDIR)/checkout.h \
733 $(OBJDIR)/clearsign_.c:$(OBJDIR)/clearsign.h \
@@ -897,10 +917,18 @@
897
898 $(OBJDIR)/browse.o: $(OBJDIR)/browse_.c $(OBJDIR)/browse.h $(SRCDIR)/config.h
899 $(XTCC) -o $(OBJDIR)/browse.o -c $(OBJDIR)/browse_.c
900
901 $(OBJDIR)/browse.h: $(OBJDIR)/headers
 
 
 
 
 
 
 
 
902
903 $(OBJDIR)/captcha_.c: $(SRCDIR)/captcha.c $(OBJDIR)/translate
904 $(TRANSLATE) $(SRCDIR)/captcha.c >$(OBJDIR)/captcha_.c
905
906 $(OBJDIR)/captcha.o: $(OBJDIR)/captcha_.c $(OBJDIR)/captcha.h $(SRCDIR)/config.h
@@ -1720,11 +1748,11 @@
1720
1721 SHELL_OPTIONS = -Dmain=sqlite3_shell \
1722 -DSQLITE_OMIT_LOAD_EXTENSION=1 \
1723 -DUSE_SYSTEM_SQLITE=$(USE_SYSTEM_SQLITE) \
1724 -DSQLITE_SHELL_DBNAME_PROC=fossil_open \
1725 -Daccess=win32_access \
1726 -Dgetenv=fossil_getenv \
1727 -Dfopen=fossil_fopen
1728
1729 $(OBJDIR)/sqlite3.o: $(SRCDIR)/sqlite3.c $(SRCDIR)/../win/Makefile.mingw
1730 $(XTCC) $(SQLITE_OPTIONS) $(SQLITE_CFLAGS) -c $(SRCDIR)/sqlite3.c -o $(OBJDIR)/sqlite3.o
1731
--- win/Makefile.mingw
+++ win/Makefile.mingw
@@ -59,10 +59,14 @@
59 # FOSSIL_ENABLE_TCL_STUBS = 1
60
61 #### Load Tcl using the private stubs mechanism
62 #
63 # FOSSIL_ENABLE_TCL_PRIVATE_STUBS = 1
64
65 #### Use 'system' sqlite
66 #
67 # USE_SYSTEM_SQLITE = 1
68
69 #### Use the Tcl source directory instead of the install directory?
70 # This is useful when Tcl has been compiled statically with MinGW.
71 #
72 FOSSIL_TCL_SOURCE = 1
@@ -206,10 +210,14 @@
210
211 # MinGW: If available, use the Unicode capable runtime startup code.
212 ifndef MINGW_IS_32BIT_ONLY
213 LIB += -municode
214 endif
215
216 ifdef USE_SYSTEM_SQLITE
217 LIB += -lsqlite3
218 endif
219
220 # OpenSSL: Add the necessary libraries required, if enabled.
221 ifdef FOSSIL_ENABLE_SSL
222 LIB += -lssl -lcrypto -lgdi32
223 endif
@@ -263,10 +271,11 @@
271 $(SRCDIR)/bag.c \
272 $(SRCDIR)/bisect.c \
273 $(SRCDIR)/blob.c \
274 $(SRCDIR)/branch.c \
275 $(SRCDIR)/browse.c \
276 $(SRCDIR)/cache.c \
277 $(SRCDIR)/captcha.c \
278 $(SRCDIR)/cgi.c \
279 $(SRCDIR)/checkin.c \
280 $(SRCDIR)/checkout.c \
281 $(SRCDIR)/clearsign.c \
@@ -374,10 +383,11 @@
383 $(OBJDIR)/bag_.c \
384 $(OBJDIR)/bisect_.c \
385 $(OBJDIR)/blob_.c \
386 $(OBJDIR)/branch_.c \
387 $(OBJDIR)/browse_.c \
388 $(OBJDIR)/cache_.c \
389 $(OBJDIR)/captcha_.c \
390 $(OBJDIR)/cgi_.c \
391 $(OBJDIR)/checkin_.c \
392 $(OBJDIR)/checkout_.c \
393 $(OBJDIR)/clearsign_.c \
@@ -485,10 +495,11 @@
495 $(OBJDIR)/bag.o \
496 $(OBJDIR)/bisect.o \
497 $(OBJDIR)/blob.o \
498 $(OBJDIR)/branch.o \
499 $(OBJDIR)/browse.o \
500 $(OBJDIR)/cache.o \
501 $(OBJDIR)/captcha.o \
502 $(OBJDIR)/cgi.o \
503 $(OBJDIR)/checkin.o \
504 $(OBJDIR)/checkout.o \
505 $(OBJDIR)/clearsign.o \
@@ -669,11 +680,19 @@
680 $(TCLSH) $(SRCDIR)/../test/tester.tcl $(APPNAME)
681
682 $(OBJDIR)/VERSION.h: $(SRCDIR)/../manifest.uuid $(SRCDIR)/../manifest $(VERSION)
683 $(VERSION) $(SRCDIR)/../manifest.uuid $(SRCDIR)/../manifest $(SRCDIR)/../VERSION >$(OBJDIR)/VERSION.h
684
685 # The USE_SYSTEM_SQLITE variable may be undefined, set to 0, or set
686 # to 1. If it is set to 1, then there is no need to build or link
687 # the sqlite3.o object. Instead, the system sqlite will be linked
688 # using -lsqlite3.
689 SQLITE3_OBJ.1 =
690 SQLITE3_OBJ.0 = $(OBJDIR)/sqlite3.o
691 SQLITE3_OBJ. = $(SQLITE3_OBJ.0)
692
693 EXTRAOBJ = $(SQLITE3_OBJ.$(USE_SYSTEM_SQLITE)) $(OBJDIR)/shell.o $(OBJDIR)/th.o $(OBJDIR)/th_lang.o $(OBJDIR)/th_tcl.o $(OBJDIR)/cson_amalgamation.o
694
695 zlib:
696 $(MAKE) -C $(ZLIBDIR) PREFIX=$(PREFIX) -f win32/Makefile.gcc libz.a
697
698 clean-zlib:
@@ -724,10 +743,11 @@
743 $(OBJDIR)/bag_.c:$(OBJDIR)/bag.h \
744 $(OBJDIR)/bisect_.c:$(OBJDIR)/bisect.h \
745 $(OBJDIR)/blob_.c:$(OBJDIR)/blob.h \
746 $(OBJDIR)/branch_.c:$(OBJDIR)/branch.h \
747 $(OBJDIR)/browse_.c:$(OBJDIR)/browse.h \
748 $(OBJDIR)/cache_.c:$(OBJDIR)/cache.h \
749 $(OBJDIR)/captcha_.c:$(OBJDIR)/captcha.h \
750 $(OBJDIR)/cgi_.c:$(OBJDIR)/cgi.h \
751 $(OBJDIR)/checkin_.c:$(OBJDIR)/checkin.h \
752 $(OBJDIR)/checkout_.c:$(OBJDIR)/checkout.h \
753 $(OBJDIR)/clearsign_.c:$(OBJDIR)/clearsign.h \
@@ -897,10 +917,18 @@
917
918 $(OBJDIR)/browse.o: $(OBJDIR)/browse_.c $(OBJDIR)/browse.h $(SRCDIR)/config.h
919 $(XTCC) -o $(OBJDIR)/browse.o -c $(OBJDIR)/browse_.c
920
921 $(OBJDIR)/browse.h: $(OBJDIR)/headers
922
923 $(OBJDIR)/cache_.c: $(SRCDIR)/cache.c $(OBJDIR)/translate
924 $(TRANSLATE) $(SRCDIR)/cache.c >$(OBJDIR)/cache_.c
925
926 $(OBJDIR)/cache.o: $(OBJDIR)/cache_.c $(OBJDIR)/cache.h $(SRCDIR)/config.h
927 $(XTCC) -o $(OBJDIR)/cache.o -c $(OBJDIR)/cache_.c
928
929 $(OBJDIR)/cache.h: $(OBJDIR)/headers
930
931 $(OBJDIR)/captcha_.c: $(SRCDIR)/captcha.c $(OBJDIR)/translate
932 $(TRANSLATE) $(SRCDIR)/captcha.c >$(OBJDIR)/captcha_.c
933
934 $(OBJDIR)/captcha.o: $(OBJDIR)/captcha_.c $(OBJDIR)/captcha.h $(SRCDIR)/config.h
@@ -1720,11 +1748,11 @@
1748
1749 SHELL_OPTIONS = -Dmain=sqlite3_shell \
1750 -DSQLITE_OMIT_LOAD_EXTENSION=1 \
1751 -DUSE_SYSTEM_SQLITE=$(USE_SYSTEM_SQLITE) \
1752 -DSQLITE_SHELL_DBNAME_PROC=fossil_open \
1753 -Daccess=file_access \
1754 -Dgetenv=fossil_getenv \
1755 -Dfopen=fossil_fopen
1756
1757 $(OBJDIR)/sqlite3.o: $(SRCDIR)/sqlite3.c $(SRCDIR)/../win/Makefile.mingw
1758 $(XTCC) $(SQLITE_OPTIONS) $(SQLITE_CFLAGS) -c $(SRCDIR)/sqlite3.c -o $(OBJDIR)/sqlite3.o
1759
--- win/Makefile.mingw.mistachkin
+++ win/Makefile.mingw.mistachkin
@@ -59,10 +59,14 @@
5959
FOSSIL_ENABLE_TCL_STUBS = 1
6060
6161
#### Load Tcl using the private stubs mechanism
6262
#
6363
FOSSIL_ENABLE_TCL_PRIVATE_STUBS = 1
64
+
65
+#### Use 'system' sqlite
66
+#
67
+# USE_SYSTEM_SQLITE = 1
6468
6569
#### Use the Tcl source directory instead of the install directory?
6670
# This is useful when Tcl has been compiled statically with MinGW.
6771
#
6872
FOSSIL_TCL_SOURCE = 1
@@ -206,10 +210,14 @@
206210
207211
# MinGW: If available, use the Unicode capable runtime startup code.
208212
ifndef MINGW_IS_32BIT_ONLY
209213
LIB += -municode
210214
endif
215
+
216
+ifdef USE_SYSTEM_SQLITE
217
+LIB += -lsqlite3
218
+endif
211219
212220
# OpenSSL: Add the necessary libraries required, if enabled.
213221
ifdef FOSSIL_ENABLE_SSL
214222
LIB += -lssl -lcrypto -lgdi32
215223
endif
@@ -263,10 +271,11 @@
263271
$(SRCDIR)/bag.c \
264272
$(SRCDIR)/bisect.c \
265273
$(SRCDIR)/blob.c \
266274
$(SRCDIR)/branch.c \
267275
$(SRCDIR)/browse.c \
276
+ $(SRCDIR)/cache.c \
268277
$(SRCDIR)/captcha.c \
269278
$(SRCDIR)/cgi.c \
270279
$(SRCDIR)/checkin.c \
271280
$(SRCDIR)/checkout.c \
272281
$(SRCDIR)/clearsign.c \
@@ -374,10 +383,11 @@
374383
$(OBJDIR)/bag_.c \
375384
$(OBJDIR)/bisect_.c \
376385
$(OBJDIR)/blob_.c \
377386
$(OBJDIR)/branch_.c \
378387
$(OBJDIR)/browse_.c \
388
+ $(OBJDIR)/cache_.c \
379389
$(OBJDIR)/captcha_.c \
380390
$(OBJDIR)/cgi_.c \
381391
$(OBJDIR)/checkin_.c \
382392
$(OBJDIR)/checkout_.c \
383393
$(OBJDIR)/clearsign_.c \
@@ -485,10 +495,11 @@
485495
$(OBJDIR)/bag.o \
486496
$(OBJDIR)/bisect.o \
487497
$(OBJDIR)/blob.o \
488498
$(OBJDIR)/branch.o \
489499
$(OBJDIR)/browse.o \
500
+ $(OBJDIR)/cache.o \
490501
$(OBJDIR)/captcha.o \
491502
$(OBJDIR)/cgi.o \
492503
$(OBJDIR)/checkin.o \
493504
$(OBJDIR)/checkout.o \
494505
$(OBJDIR)/clearsign.o \
@@ -669,11 +680,19 @@
669680
$(TCLSH) $(SRCDIR)/../test/tester.tcl $(APPNAME)
670681
671682
$(OBJDIR)/VERSION.h: $(SRCDIR)/../manifest.uuid $(SRCDIR)/../manifest $(VERSION)
672683
$(VERSION) $(SRCDIR)/../manifest.uuid $(SRCDIR)/../manifest $(SRCDIR)/../VERSION >$(OBJDIR)/VERSION.h
673684
674
-EXTRAOBJ = $(OBJDIR)/sqlite3.o $(OBJDIR)/shell.o $(OBJDIR)/th.o $(OBJDIR)/th_lang.o $(OBJDIR)/th_tcl.o $(OBJDIR)/cson_amalgamation.o
685
+# The USE_SYSTEM_SQLITE variable may be undefined, set to 0, or set
686
+# to 1. If it is set to 1, then there is no need to build or link
687
+# the sqlite3.o object. Instead, the system sqlite will be linked
688
+# using -lsqlite3.
689
+SQLITE3_OBJ.1 =
690
+SQLITE3_OBJ.0 = $(OBJDIR)/sqlite3.o
691
+SQLITE3_OBJ. = $(SQLITE3_OBJ.0)
692
+
693
+EXTRAOBJ = $(SQLITE3_OBJ.$(USE_SYSTEM_SQLITE)) $(OBJDIR)/shell.o $(OBJDIR)/th.o $(OBJDIR)/th_lang.o $(OBJDIR)/th_tcl.o $(OBJDIR)/cson_amalgamation.o
675694
676695
zlib:
677696
$(MAKE) -C $(ZLIBDIR) PREFIX=$(PREFIX) -f win32/Makefile.gcc libz.a
678697
679698
clean-zlib:
@@ -724,10 +743,11 @@
724743
$(OBJDIR)/bag_.c:$(OBJDIR)/bag.h \
725744
$(OBJDIR)/bisect_.c:$(OBJDIR)/bisect.h \
726745
$(OBJDIR)/blob_.c:$(OBJDIR)/blob.h \
727746
$(OBJDIR)/branch_.c:$(OBJDIR)/branch.h \
728747
$(OBJDIR)/browse_.c:$(OBJDIR)/browse.h \
748
+ $(OBJDIR)/cache_.c:$(OBJDIR)/cache.h \
729749
$(OBJDIR)/captcha_.c:$(OBJDIR)/captcha.h \
730750
$(OBJDIR)/cgi_.c:$(OBJDIR)/cgi.h \
731751
$(OBJDIR)/checkin_.c:$(OBJDIR)/checkin.h \
732752
$(OBJDIR)/checkout_.c:$(OBJDIR)/checkout.h \
733753
$(OBJDIR)/clearsign_.c:$(OBJDIR)/clearsign.h \
@@ -897,10 +917,18 @@
897917
898918
$(OBJDIR)/browse.o: $(OBJDIR)/browse_.c $(OBJDIR)/browse.h $(SRCDIR)/config.h
899919
$(XTCC) -o $(OBJDIR)/browse.o -c $(OBJDIR)/browse_.c
900920
901921
$(OBJDIR)/browse.h: $(OBJDIR)/headers
922
+
923
+$(OBJDIR)/cache_.c: $(SRCDIR)/cache.c $(OBJDIR)/translate
924
+ $(TRANSLATE) $(SRCDIR)/cache.c >$(OBJDIR)/cache_.c
925
+
926
+$(OBJDIR)/cache.o: $(OBJDIR)/cache_.c $(OBJDIR)/cache.h $(SRCDIR)/config.h
927
+ $(XTCC) -o $(OBJDIR)/cache.o -c $(OBJDIR)/cache_.c
928
+
929
+$(OBJDIR)/cache.h: $(OBJDIR)/headers
902930
903931
$(OBJDIR)/captcha_.c: $(SRCDIR)/captcha.c $(OBJDIR)/translate
904932
$(TRANSLATE) $(SRCDIR)/captcha.c >$(OBJDIR)/captcha_.c
905933
906934
$(OBJDIR)/captcha.o: $(OBJDIR)/captcha_.c $(OBJDIR)/captcha.h $(SRCDIR)/config.h
@@ -1720,11 +1748,11 @@
17201748
17211749
SHELL_OPTIONS = -Dmain=sqlite3_shell \
17221750
-DSQLITE_OMIT_LOAD_EXTENSION=1 \
17231751
-DUSE_SYSTEM_SQLITE=$(USE_SYSTEM_SQLITE) \
17241752
-DSQLITE_SHELL_DBNAME_PROC=fossil_open \
1725
- -Daccess=win32_access \
1753
+ -Daccess=file_access \
17261754
-Dgetenv=fossil_getenv \
17271755
-Dfopen=fossil_fopen
17281756
17291757
$(OBJDIR)/sqlite3.o: $(SRCDIR)/sqlite3.c $(SRCDIR)/../win/Makefile.mingw.mistachkin
17301758
$(XTCC) $(SQLITE_OPTIONS) $(SQLITE_CFLAGS) -c $(SRCDIR)/sqlite3.c -o $(OBJDIR)/sqlite3.o
17311759
--- win/Makefile.mingw.mistachkin
+++ win/Makefile.mingw.mistachkin
@@ -59,10 +59,14 @@
59 FOSSIL_ENABLE_TCL_STUBS = 1
60
61 #### Load Tcl using the private stubs mechanism
62 #
63 FOSSIL_ENABLE_TCL_PRIVATE_STUBS = 1
 
 
 
 
64
65 #### Use the Tcl source directory instead of the install directory?
66 # This is useful when Tcl has been compiled statically with MinGW.
67 #
68 FOSSIL_TCL_SOURCE = 1
@@ -206,10 +210,14 @@
206
207 # MinGW: If available, use the Unicode capable runtime startup code.
208 ifndef MINGW_IS_32BIT_ONLY
209 LIB += -municode
210 endif
 
 
 
 
211
212 # OpenSSL: Add the necessary libraries required, if enabled.
213 ifdef FOSSIL_ENABLE_SSL
214 LIB += -lssl -lcrypto -lgdi32
215 endif
@@ -263,10 +271,11 @@
263 $(SRCDIR)/bag.c \
264 $(SRCDIR)/bisect.c \
265 $(SRCDIR)/blob.c \
266 $(SRCDIR)/branch.c \
267 $(SRCDIR)/browse.c \
 
268 $(SRCDIR)/captcha.c \
269 $(SRCDIR)/cgi.c \
270 $(SRCDIR)/checkin.c \
271 $(SRCDIR)/checkout.c \
272 $(SRCDIR)/clearsign.c \
@@ -374,10 +383,11 @@
374 $(OBJDIR)/bag_.c \
375 $(OBJDIR)/bisect_.c \
376 $(OBJDIR)/blob_.c \
377 $(OBJDIR)/branch_.c \
378 $(OBJDIR)/browse_.c \
 
379 $(OBJDIR)/captcha_.c \
380 $(OBJDIR)/cgi_.c \
381 $(OBJDIR)/checkin_.c \
382 $(OBJDIR)/checkout_.c \
383 $(OBJDIR)/clearsign_.c \
@@ -485,10 +495,11 @@
485 $(OBJDIR)/bag.o \
486 $(OBJDIR)/bisect.o \
487 $(OBJDIR)/blob.o \
488 $(OBJDIR)/branch.o \
489 $(OBJDIR)/browse.o \
 
490 $(OBJDIR)/captcha.o \
491 $(OBJDIR)/cgi.o \
492 $(OBJDIR)/checkin.o \
493 $(OBJDIR)/checkout.o \
494 $(OBJDIR)/clearsign.o \
@@ -669,11 +680,19 @@
669 $(TCLSH) $(SRCDIR)/../test/tester.tcl $(APPNAME)
670
671 $(OBJDIR)/VERSION.h: $(SRCDIR)/../manifest.uuid $(SRCDIR)/../manifest $(VERSION)
672 $(VERSION) $(SRCDIR)/../manifest.uuid $(SRCDIR)/../manifest $(SRCDIR)/../VERSION >$(OBJDIR)/VERSION.h
673
674 EXTRAOBJ = $(OBJDIR)/sqlite3.o $(OBJDIR)/shell.o $(OBJDIR)/th.o $(OBJDIR)/th_lang.o $(OBJDIR)/th_tcl.o $(OBJDIR)/cson_amalgamation.o
 
 
 
 
 
 
 
 
675
676 zlib:
677 $(MAKE) -C $(ZLIBDIR) PREFIX=$(PREFIX) -f win32/Makefile.gcc libz.a
678
679 clean-zlib:
@@ -724,10 +743,11 @@
724 $(OBJDIR)/bag_.c:$(OBJDIR)/bag.h \
725 $(OBJDIR)/bisect_.c:$(OBJDIR)/bisect.h \
726 $(OBJDIR)/blob_.c:$(OBJDIR)/blob.h \
727 $(OBJDIR)/branch_.c:$(OBJDIR)/branch.h \
728 $(OBJDIR)/browse_.c:$(OBJDIR)/browse.h \
 
729 $(OBJDIR)/captcha_.c:$(OBJDIR)/captcha.h \
730 $(OBJDIR)/cgi_.c:$(OBJDIR)/cgi.h \
731 $(OBJDIR)/checkin_.c:$(OBJDIR)/checkin.h \
732 $(OBJDIR)/checkout_.c:$(OBJDIR)/checkout.h \
733 $(OBJDIR)/clearsign_.c:$(OBJDIR)/clearsign.h \
@@ -897,10 +917,18 @@
897
898 $(OBJDIR)/browse.o: $(OBJDIR)/browse_.c $(OBJDIR)/browse.h $(SRCDIR)/config.h
899 $(XTCC) -o $(OBJDIR)/browse.o -c $(OBJDIR)/browse_.c
900
901 $(OBJDIR)/browse.h: $(OBJDIR)/headers
 
 
 
 
 
 
 
 
902
903 $(OBJDIR)/captcha_.c: $(SRCDIR)/captcha.c $(OBJDIR)/translate
904 $(TRANSLATE) $(SRCDIR)/captcha.c >$(OBJDIR)/captcha_.c
905
906 $(OBJDIR)/captcha.o: $(OBJDIR)/captcha_.c $(OBJDIR)/captcha.h $(SRCDIR)/config.h
@@ -1720,11 +1748,11 @@
1720
1721 SHELL_OPTIONS = -Dmain=sqlite3_shell \
1722 -DSQLITE_OMIT_LOAD_EXTENSION=1 \
1723 -DUSE_SYSTEM_SQLITE=$(USE_SYSTEM_SQLITE) \
1724 -DSQLITE_SHELL_DBNAME_PROC=fossil_open \
1725 -Daccess=win32_access \
1726 -Dgetenv=fossil_getenv \
1727 -Dfopen=fossil_fopen
1728
1729 $(OBJDIR)/sqlite3.o: $(SRCDIR)/sqlite3.c $(SRCDIR)/../win/Makefile.mingw.mistachkin
1730 $(XTCC) $(SQLITE_OPTIONS) $(SQLITE_CFLAGS) -c $(SRCDIR)/sqlite3.c -o $(OBJDIR)/sqlite3.o
1731
--- win/Makefile.mingw.mistachkin
+++ win/Makefile.mingw.mistachkin
@@ -59,10 +59,14 @@
59 FOSSIL_ENABLE_TCL_STUBS = 1
60
61 #### Load Tcl using the private stubs mechanism
62 #
63 FOSSIL_ENABLE_TCL_PRIVATE_STUBS = 1
64
65 #### Use 'system' sqlite
66 #
67 # USE_SYSTEM_SQLITE = 1
68
69 #### Use the Tcl source directory instead of the install directory?
70 # This is useful when Tcl has been compiled statically with MinGW.
71 #
72 FOSSIL_TCL_SOURCE = 1
@@ -206,10 +210,14 @@
210
211 # MinGW: If available, use the Unicode capable runtime startup code.
212 ifndef MINGW_IS_32BIT_ONLY
213 LIB += -municode
214 endif
215
216 ifdef USE_SYSTEM_SQLITE
217 LIB += -lsqlite3
218 endif
219
220 # OpenSSL: Add the necessary libraries required, if enabled.
221 ifdef FOSSIL_ENABLE_SSL
222 LIB += -lssl -lcrypto -lgdi32
223 endif
@@ -263,10 +271,11 @@
271 $(SRCDIR)/bag.c \
272 $(SRCDIR)/bisect.c \
273 $(SRCDIR)/blob.c \
274 $(SRCDIR)/branch.c \
275 $(SRCDIR)/browse.c \
276 $(SRCDIR)/cache.c \
277 $(SRCDIR)/captcha.c \
278 $(SRCDIR)/cgi.c \
279 $(SRCDIR)/checkin.c \
280 $(SRCDIR)/checkout.c \
281 $(SRCDIR)/clearsign.c \
@@ -374,10 +383,11 @@
383 $(OBJDIR)/bag_.c \
384 $(OBJDIR)/bisect_.c \
385 $(OBJDIR)/blob_.c \
386 $(OBJDIR)/branch_.c \
387 $(OBJDIR)/browse_.c \
388 $(OBJDIR)/cache_.c \
389 $(OBJDIR)/captcha_.c \
390 $(OBJDIR)/cgi_.c \
391 $(OBJDIR)/checkin_.c \
392 $(OBJDIR)/checkout_.c \
393 $(OBJDIR)/clearsign_.c \
@@ -485,10 +495,11 @@
495 $(OBJDIR)/bag.o \
496 $(OBJDIR)/bisect.o \
497 $(OBJDIR)/blob.o \
498 $(OBJDIR)/branch.o \
499 $(OBJDIR)/browse.o \
500 $(OBJDIR)/cache.o \
501 $(OBJDIR)/captcha.o \
502 $(OBJDIR)/cgi.o \
503 $(OBJDIR)/checkin.o \
504 $(OBJDIR)/checkout.o \
505 $(OBJDIR)/clearsign.o \
@@ -669,11 +680,19 @@
680 $(TCLSH) $(SRCDIR)/../test/tester.tcl $(APPNAME)
681
682 $(OBJDIR)/VERSION.h: $(SRCDIR)/../manifest.uuid $(SRCDIR)/../manifest $(VERSION)
683 $(VERSION) $(SRCDIR)/../manifest.uuid $(SRCDIR)/../manifest $(SRCDIR)/../VERSION >$(OBJDIR)/VERSION.h
684
685 # The USE_SYSTEM_SQLITE variable may be undefined, set to 0, or set
686 # to 1. If it is set to 1, then there is no need to build or link
687 # the sqlite3.o object. Instead, the system sqlite will be linked
688 # using -lsqlite3.
689 SQLITE3_OBJ.1 =
690 SQLITE3_OBJ.0 = $(OBJDIR)/sqlite3.o
691 SQLITE3_OBJ. = $(SQLITE3_OBJ.0)
692
693 EXTRAOBJ = $(SQLITE3_OBJ.$(USE_SYSTEM_SQLITE)) $(OBJDIR)/shell.o $(OBJDIR)/th.o $(OBJDIR)/th_lang.o $(OBJDIR)/th_tcl.o $(OBJDIR)/cson_amalgamation.o
694
695 zlib:
696 $(MAKE) -C $(ZLIBDIR) PREFIX=$(PREFIX) -f win32/Makefile.gcc libz.a
697
698 clean-zlib:
@@ -724,10 +743,11 @@
743 $(OBJDIR)/bag_.c:$(OBJDIR)/bag.h \
744 $(OBJDIR)/bisect_.c:$(OBJDIR)/bisect.h \
745 $(OBJDIR)/blob_.c:$(OBJDIR)/blob.h \
746 $(OBJDIR)/branch_.c:$(OBJDIR)/branch.h \
747 $(OBJDIR)/browse_.c:$(OBJDIR)/browse.h \
748 $(OBJDIR)/cache_.c:$(OBJDIR)/cache.h \
749 $(OBJDIR)/captcha_.c:$(OBJDIR)/captcha.h \
750 $(OBJDIR)/cgi_.c:$(OBJDIR)/cgi.h \
751 $(OBJDIR)/checkin_.c:$(OBJDIR)/checkin.h \
752 $(OBJDIR)/checkout_.c:$(OBJDIR)/checkout.h \
753 $(OBJDIR)/clearsign_.c:$(OBJDIR)/clearsign.h \
@@ -897,10 +917,18 @@
917
918 $(OBJDIR)/browse.o: $(OBJDIR)/browse_.c $(OBJDIR)/browse.h $(SRCDIR)/config.h
919 $(XTCC) -o $(OBJDIR)/browse.o -c $(OBJDIR)/browse_.c
920
921 $(OBJDIR)/browse.h: $(OBJDIR)/headers
922
923 $(OBJDIR)/cache_.c: $(SRCDIR)/cache.c $(OBJDIR)/translate
924 $(TRANSLATE) $(SRCDIR)/cache.c >$(OBJDIR)/cache_.c
925
926 $(OBJDIR)/cache.o: $(OBJDIR)/cache_.c $(OBJDIR)/cache.h $(SRCDIR)/config.h
927 $(XTCC) -o $(OBJDIR)/cache.o -c $(OBJDIR)/cache_.c
928
929 $(OBJDIR)/cache.h: $(OBJDIR)/headers
930
931 $(OBJDIR)/captcha_.c: $(SRCDIR)/captcha.c $(OBJDIR)/translate
932 $(TRANSLATE) $(SRCDIR)/captcha.c >$(OBJDIR)/captcha_.c
933
934 $(OBJDIR)/captcha.o: $(OBJDIR)/captcha_.c $(OBJDIR)/captcha.h $(SRCDIR)/config.h
@@ -1720,11 +1748,11 @@
1748
1749 SHELL_OPTIONS = -Dmain=sqlite3_shell \
1750 -DSQLITE_OMIT_LOAD_EXTENSION=1 \
1751 -DUSE_SYSTEM_SQLITE=$(USE_SYSTEM_SQLITE) \
1752 -DSQLITE_SHELL_DBNAME_PROC=fossil_open \
1753 -Daccess=file_access \
1754 -Dgetenv=fossil_getenv \
1755 -Dfopen=fossil_fopen
1756
1757 $(OBJDIR)/sqlite3.o: $(SRCDIR)/sqlite3.c $(SRCDIR)/../win/Makefile.mingw.mistachkin
1758 $(XTCC) $(SQLITE_OPTIONS) $(SQLITE_CFLAGS) -c $(SRCDIR)/sqlite3.c -o $(OBJDIR)/sqlite3.o
1759
+11 -1
--- win/Makefile.msc
+++ win/Makefile.msc
@@ -102,11 +102,11 @@
102102
103103
SHELL_OPTIONS = /Dmain=sqlite3_shell \
104104
/DSQLITE_OMIT_LOAD_EXTENSION=1 \
105105
/DUSE_SYSTEM_SQLITE=$(USE_SYSTEM_SQLITE) \
106106
/DSQLITE_SHELL_DBNAME_PROC=fossil_open \
107
- /Daccess=win32_access \
107
+ /Daccess=file_access \
108108
/Dgetenv=fossil_getenv \
109109
/Dfopen=fossil_fopen
110110
111111
SRC = add_.c \
112112
allrepo_.c \
@@ -114,10 +114,11 @@
114114
bag_.c \
115115
bisect_.c \
116116
blob_.c \
117117
branch_.c \
118118
browse_.c \
119
+ cache_.c \
119120
captcha_.c \
120121
cgi_.c \
121122
checkin_.c \
122123
checkout_.c \
123124
clearsign_.c \
@@ -224,10 +225,11 @@
224225
$(OX)\bag$O \
225226
$(OX)\bisect$O \
226227
$(OX)\blob$O \
227228
$(OX)\branch$O \
228229
$(OX)\browse$O \
230
+ $(OX)\cache$O \
229231
$(OX)\captcha$O \
230232
$(OX)\cgi$O \
231233
$(OX)\checkin$O \
232234
$(OX)\checkout$O \
233235
$(OX)\clearsign$O \
@@ -356,10 +358,11 @@
356358
echo $(OX)\bag.obj >> $@
357359
echo $(OX)\bisect.obj >> $@
358360
echo $(OX)\blob.obj >> $@
359361
echo $(OX)\branch.obj >> $@
360362
echo $(OX)\browse.obj >> $@
363
+ echo $(OX)\cache.obj >> $@
361364
echo $(OX)\captcha.obj >> $@
362365
echo $(OX)\cgi.obj >> $@
363366
echo $(OX)\checkin.obj >> $@
364367
echo $(OX)\checkout.obj >> $@
365368
echo $(OX)\clearsign.obj >> $@
@@ -585,10 +588,16 @@
585588
$(OX)\browse$O : browse_.c browse.h
586589
$(TCC) /Fo$@ -c browse_.c
587590
588591
browse_.c : $(SRCDIR)\browse.c
589592
translate$E $** > $@
593
+
594
+$(OX)\cache$O : cache_.c cache.h
595
+ $(TCC) /Fo$@ -c cache_.c
596
+
597
+cache_.c : $(SRCDIR)\cache.c
598
+ translate$E $** > $@
590599
591600
$(OX)\captcha$O : captcha_.c captcha.h
592601
$(TCC) /Fo$@ -c captcha_.c
593602
594603
captcha_.c : $(SRCDIR)\captcha.c
@@ -1204,10 +1213,11 @@
12041213
bag_.c:bag.h \
12051214
bisect_.c:bisect.h \
12061215
blob_.c:blob.h \
12071216
branch_.c:branch.h \
12081217
browse_.c:browse.h \
1218
+ cache_.c:cache.h \
12091219
captcha_.c:captcha.h \
12101220
cgi_.c:cgi.h \
12111221
checkin_.c:checkin.h \
12121222
checkout_.c:checkout.h \
12131223
clearsign_.c:clearsign.h \
12141224
--- win/Makefile.msc
+++ win/Makefile.msc
@@ -102,11 +102,11 @@
102
103 SHELL_OPTIONS = /Dmain=sqlite3_shell \
104 /DSQLITE_OMIT_LOAD_EXTENSION=1 \
105 /DUSE_SYSTEM_SQLITE=$(USE_SYSTEM_SQLITE) \
106 /DSQLITE_SHELL_DBNAME_PROC=fossil_open \
107 /Daccess=win32_access \
108 /Dgetenv=fossil_getenv \
109 /Dfopen=fossil_fopen
110
111 SRC = add_.c \
112 allrepo_.c \
@@ -114,10 +114,11 @@
114 bag_.c \
115 bisect_.c \
116 blob_.c \
117 branch_.c \
118 browse_.c \
 
119 captcha_.c \
120 cgi_.c \
121 checkin_.c \
122 checkout_.c \
123 clearsign_.c \
@@ -224,10 +225,11 @@
224 $(OX)\bag$O \
225 $(OX)\bisect$O \
226 $(OX)\blob$O \
227 $(OX)\branch$O \
228 $(OX)\browse$O \
 
229 $(OX)\captcha$O \
230 $(OX)\cgi$O \
231 $(OX)\checkin$O \
232 $(OX)\checkout$O \
233 $(OX)\clearsign$O \
@@ -356,10 +358,11 @@
356 echo $(OX)\bag.obj >> $@
357 echo $(OX)\bisect.obj >> $@
358 echo $(OX)\blob.obj >> $@
359 echo $(OX)\branch.obj >> $@
360 echo $(OX)\browse.obj >> $@
 
361 echo $(OX)\captcha.obj >> $@
362 echo $(OX)\cgi.obj >> $@
363 echo $(OX)\checkin.obj >> $@
364 echo $(OX)\checkout.obj >> $@
365 echo $(OX)\clearsign.obj >> $@
@@ -585,10 +588,16 @@
585 $(OX)\browse$O : browse_.c browse.h
586 $(TCC) /Fo$@ -c browse_.c
587
588 browse_.c : $(SRCDIR)\browse.c
589 translate$E $** > $@
 
 
 
 
 
 
590
591 $(OX)\captcha$O : captcha_.c captcha.h
592 $(TCC) /Fo$@ -c captcha_.c
593
594 captcha_.c : $(SRCDIR)\captcha.c
@@ -1204,10 +1213,11 @@
1204 bag_.c:bag.h \
1205 bisect_.c:bisect.h \
1206 blob_.c:blob.h \
1207 branch_.c:branch.h \
1208 browse_.c:browse.h \
 
1209 captcha_.c:captcha.h \
1210 cgi_.c:cgi.h \
1211 checkin_.c:checkin.h \
1212 checkout_.c:checkout.h \
1213 clearsign_.c:clearsign.h \
1214
--- win/Makefile.msc
+++ win/Makefile.msc
@@ -102,11 +102,11 @@
102
103 SHELL_OPTIONS = /Dmain=sqlite3_shell \
104 /DSQLITE_OMIT_LOAD_EXTENSION=1 \
105 /DUSE_SYSTEM_SQLITE=$(USE_SYSTEM_SQLITE) \
106 /DSQLITE_SHELL_DBNAME_PROC=fossil_open \
107 /Daccess=file_access \
108 /Dgetenv=fossil_getenv \
109 /Dfopen=fossil_fopen
110
111 SRC = add_.c \
112 allrepo_.c \
@@ -114,10 +114,11 @@
114 bag_.c \
115 bisect_.c \
116 blob_.c \
117 branch_.c \
118 browse_.c \
119 cache_.c \
120 captcha_.c \
121 cgi_.c \
122 checkin_.c \
123 checkout_.c \
124 clearsign_.c \
@@ -224,10 +225,11 @@
225 $(OX)\bag$O \
226 $(OX)\bisect$O \
227 $(OX)\blob$O \
228 $(OX)\branch$O \
229 $(OX)\browse$O \
230 $(OX)\cache$O \
231 $(OX)\captcha$O \
232 $(OX)\cgi$O \
233 $(OX)\checkin$O \
234 $(OX)\checkout$O \
235 $(OX)\clearsign$O \
@@ -356,10 +358,11 @@
358 echo $(OX)\bag.obj >> $@
359 echo $(OX)\bisect.obj >> $@
360 echo $(OX)\blob.obj >> $@
361 echo $(OX)\branch.obj >> $@
362 echo $(OX)\browse.obj >> $@
363 echo $(OX)\cache.obj >> $@
364 echo $(OX)\captcha.obj >> $@
365 echo $(OX)\cgi.obj >> $@
366 echo $(OX)\checkin.obj >> $@
367 echo $(OX)\checkout.obj >> $@
368 echo $(OX)\clearsign.obj >> $@
@@ -585,10 +588,16 @@
588 $(OX)\browse$O : browse_.c browse.h
589 $(TCC) /Fo$@ -c browse_.c
590
591 browse_.c : $(SRCDIR)\browse.c
592 translate$E $** > $@
593
594 $(OX)\cache$O : cache_.c cache.h
595 $(TCC) /Fo$@ -c cache_.c
596
597 cache_.c : $(SRCDIR)\cache.c
598 translate$E $** > $@
599
600 $(OX)\captcha$O : captcha_.c captcha.h
601 $(TCC) /Fo$@ -c captcha_.c
602
603 captcha_.c : $(SRCDIR)\captcha.c
@@ -1204,10 +1213,11 @@
1213 bag_.c:bag.h \
1214 bisect_.c:bisect.h \
1215 blob_.c:blob.h \
1216 branch_.c:branch.h \
1217 browse_.c:browse.h \
1218 cache_.c:cache.h \
1219 captcha_.c:captcha.h \
1220 cgi_.c:cgi.h \
1221 checkin_.c:checkin.h \
1222 checkout_.c:checkout.h \
1223 clearsign_.c:clearsign.h \
1224
--- www/changes.wiki
+++ www/changes.wiki
@@ -4,11 +4,10 @@
44
* Add the ability to display content, diffs and annotations for UTF16
55
text files in the web interface.
66
* Add the "SaveAs..." and "Invert" buttons
77
to the graphical diff display that results
88
from using the --tk option with the [/help/diff | fossil diff] command.
9
- * Honor timezones in imports from git.
109
* The [/reports] page now requires Read ("o") permissions. The "byweek"
1110
report now properly propagates the selected year through the event type
1211
filter links.
1312
* The [/help/info | info command] now shows leaf status of the checkout.
1413
* Add support for tunneling https through a http proxy (Ticket [e854101c4f]).
@@ -35,20 +34,24 @@
3534
* Fix the [/help?cmd=stash|stash] so that it remembers added files and re-adds
3635
them when the stash is applied.
3736
* Fix the server so that it avoids writing to the database (and thus avoids
3837
database locking issues) on a
3938
[/help?cmd=pull|pull] or [/help?cmd=clone|clone].
40
- * Add support for [./server.wiki#loadmgmt|server load management].
39
+ * Add support for [./server.wiki#loadmgmt|server load management] using both
40
+ a cache of expensive pages (the [/help?cmd=cache|fossil cache] command)
41
+ and by rejecting expensive page requests when the server load average is too
42
+ high.
4143
* Add the [/help?cmd=praise|fossil praise] command as an alias for
4244
[/help?cmd=blame|fossil blame] for subversion compatibility.
4345
* Enhance the [/help?cmd=test-diff|fossil test-diff] command with -y or --tk
4446
options so that it shows both filenames above their respective columns in
4547
the side-by-side diff output.
4648
* Issue a warning if a [/help?cmd=add|fossil add] command tries to add a file
4749
that matches the ignore-glob.
4850
* Add option -W|--width to "[/help?cmd=stash|fossil stash ls]"
4951
and "[/help?cmd=leaves|fossil leaves]" commands.
52
+ * Enhance support for running as the root user. Now works on Haiku.
5053
5154
<h2>Changes For Version 1.28 (2014-01-27)</h2>
5255
* Enhance [/help?cmd=/reports | /reports] to support event type filtering.
5356
* When cloning a repository, the user name passed via the URL (if any)
5457
is now used as the default local admin user's name.
5558
--- www/changes.wiki
+++ www/changes.wiki
@@ -4,11 +4,10 @@
4 * Add the ability to display content, diffs and annotations for UTF16
5 text files in the web interface.
6 * Add the "SaveAs..." and "Invert" buttons
7 to the graphical diff display that results
8 from using the --tk option with the [/help/diff | fossil diff] command.
9 * Honor timezones in imports from git.
10 * The [/reports] page now requires Read ("o") permissions. The "byweek"
11 report now properly propagates the selected year through the event type
12 filter links.
13 * The [/help/info | info command] now shows leaf status of the checkout.
14 * Add support for tunneling https through a http proxy (Ticket [e854101c4f]).
@@ -35,20 +34,24 @@
35 * Fix the [/help?cmd=stash|stash] so that it remembers added files and re-adds
36 them when the stash is applied.
37 * Fix the server so that it avoids writing to the database (and thus avoids
38 database locking issues) on a
39 [/help?cmd=pull|pull] or [/help?cmd=clone|clone].
40 * Add support for [./server.wiki#loadmgmt|server load management].
 
 
 
41 * Add the [/help?cmd=praise|fossil praise] command as an alias for
42 [/help?cmd=blame|fossil blame] for subversion compatibility.
43 * Enhance the [/help?cmd=test-diff|fossil test-diff] command with -y or --tk
44 options so that it shows both filenames above their respective columns in
45 the side-by-side diff output.
46 * Issue a warning if a [/help?cmd=add|fossil add] command tries to add a file
47 that matches the ignore-glob.
48 * Add option -W|--width to "[/help?cmd=stash|fossil stash ls]"
49 and "[/help?cmd=leaves|fossil leaves]" commands.
 
50
51 <h2>Changes For Version 1.28 (2014-01-27)</h2>
52 * Enhance [/help?cmd=/reports | /reports] to support event type filtering.
53 * When cloning a repository, the user name passed via the URL (if any)
54 is now used as the default local admin user's name.
55
--- www/changes.wiki
+++ www/changes.wiki
@@ -4,11 +4,10 @@
4 * Add the ability to display content, diffs and annotations for UTF16
5 text files in the web interface.
6 * Add the "SaveAs..." and "Invert" buttons
7 to the graphical diff display that results
8 from using the --tk option with the [/help/diff | fossil diff] command.
 
9 * The [/reports] page now requires Read ("o") permissions. The "byweek"
10 report now properly propagates the selected year through the event type
11 filter links.
12 * The [/help/info | info command] now shows leaf status of the checkout.
13 * Add support for tunneling https through a http proxy (Ticket [e854101c4f]).
@@ -35,20 +34,24 @@
34 * Fix the [/help?cmd=stash|stash] so that it remembers added files and re-adds
35 them when the stash is applied.
36 * Fix the server so that it avoids writing to the database (and thus avoids
37 database locking issues) on a
38 [/help?cmd=pull|pull] or [/help?cmd=clone|clone].
39 * Add support for [./server.wiki#loadmgmt|server load management] using both
40 a cache of expensive pages (the [/help?cmd=cache|fossil cache] command)
41 and by rejecting expensive page requests when the server load average is too
42 high.
43 * Add the [/help?cmd=praise|fossil praise] command as an alias for
44 [/help?cmd=blame|fossil blame] for subversion compatibility.
45 * Enhance the [/help?cmd=test-diff|fossil test-diff] command with -y or --tk
46 options so that it shows both filenames above their respective columns in
47 the side-by-side diff output.
48 * Issue a warning if a [/help?cmd=add|fossil add] command tries to add a file
49 that matches the ignore-glob.
50 * Add option -W|--width to "[/help?cmd=stash|fossil stash ls]"
51 and "[/help?cmd=leaves|fossil leaves]" commands.
52 * Enhance support for running as the root user. Now works on Haiku.
53
54 <h2>Changes For Version 1.28 (2014-01-27)</h2>
55 * Enhance [/help?cmd=/reports | /reports] to support event type filtering.
56 * When cloning a repository, the user name passed via the URL (if any)
57 is now used as the default local admin user's name.
58
+24 -7
--- www/server.wiki
+++ www/server.wiki
@@ -246,11 +246,11 @@
246246
<a name="loadmgmt"></a>
247247
<h2>Managing Server Load</h2><blockquote>
248248
<p>
249249
A Fossil server is very efficient and normally presents a very light
250250
load on the server.
251
-The Fossil [./selfhost.wiki | self-host server] is a 1/24th slice VM at
251
+The Fossil [./selfhost.wiki | self-hosting server] is a 1/24th slice VM at
252252
[http://www.linode.com | Linode.com] hosting 65 other repositories in
253253
addition to Fossil (and including some very high-traffic sites such
254254
as [http://www.sqlite.org] and [http://system.data.sqlite.org]) and
255255
it has a typical load of 0.05 to 0.1. A single HTTP request to Fossil
256256
normally takes less than 10 milliseconds of CPU time to complete. So
@@ -264,16 +264,33 @@
264264
[/help?cmd=/annotate | /annotate] and others. On very large repositories,
265265
these commands can take 15 seconds or more of CPU time.
266266
If these kinds of requests arrive too quickly, the load average on the
267267
server can grow dramatically, making the server unresponsive.
268268
<p>
269
-To help avoid problems, Fossil has the ability to fail CPU-intensive
270
-web page requests with a
271
-[http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.5.3 | "503 Server Overload"]
272
-HTTP error if an expensive request is received while the host load
273
-average is too high. To activate this
274
-feature, visit the /Admin/Access setup page in the administrative web
269
+Fossil provides two capabilities to help avoid server overload problems
270
+due to excessive requests to expensive pages:
271
+<ol>
272
+<li><p>An optional cache is available that remembers the 10 most recently
273
+ requested /zip or /tarball pages and returns the precomputed answer
274
+ if the same page is requested again.
275
+<li><p>Page requests can be configured to fail with a
276
+ [http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.5.3 | "503 Server Overload"]
277
+ HTTP error if an expensive request is received while the host load
278
+ average is too high.
279
+</ol>
280
+Both of these load-control mechanisms are turned off by default, but they
281
+are recommended for high-traffic sites.
282
+<p>
283
+The webpage cache is activated using the [/help?cmd=cache|fossil cache init]
284
+command-line on the server. Add a -R option to specify the specific repository
285
+for which to enable caching. If running this command as root, be sure to
286
+"chown" the cache database (which is a separate file in the same directory
287
+and with the same name as the repository but with the suffix changed to ".cache")
288
+to give it write permission for the userid of the webserver.
289
+<p>
290
+To activate the server load control feature
291
+visit the /Admin/Access setup page in the administrative web
275292
interface and in the "<b>Server Load Average Limit</b>" box
276293
enter the load average threshold above which "503 Server
277294
Overload" replies will be issued for expensive requests. On the
278295
self-host Fossil server, that value is set to 1.5. But you could easily
279296
set it higher on a multi-core server.
280297
--- www/server.wiki
+++ www/server.wiki
@@ -246,11 +246,11 @@
246 <a name="loadmgmt"></a>
247 <h2>Managing Server Load</h2><blockquote>
248 <p>
249 A Fossil server is very efficient and normally presents a very light
250 load on the server.
251 The Fossil [./selfhost.wiki | self-host server] is a 1/24th slice VM at
252 [http://www.linode.com | Linode.com] hosting 65 other repositories in
253 addition to Fossil (and including some very high-traffic sites such
254 as [http://www.sqlite.org] and [http://system.data.sqlite.org]) and
255 it has a typical load of 0.05 to 0.1. A single HTTP request to Fossil
256 normally takes less than 10 milliseconds of CPU time to complete. So
@@ -264,16 +264,33 @@
264 [/help?cmd=/annotate | /annotate] and others. On very large repositories,
265 these commands can take 15 seconds or more of CPU time.
266 If these kinds of requests arrive too quickly, the load average on the
267 server can grow dramatically, making the server unresponsive.
268 <p>
269 To help avoid problems, Fossil has the ability to fail CPU-intensive
270 web page requests with a
271 [http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.5.3 | "503 Server Overload"]
272 HTTP error if an expensive request is received while the host load
273 average is too high. To activate this
274 feature, visit the /Admin/Access setup page in the administrative web
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
275 interface and in the "<b>Server Load Average Limit</b>" box
276 enter the load average threshold above which "503 Server
277 Overload" replies will be issued for expensive requests. On the
278 self-host Fossil server, that value is set to 1.5. But you could easily
279 set it higher on a multi-core server.
280
--- www/server.wiki
+++ www/server.wiki
@@ -246,11 +246,11 @@
246 <a name="loadmgmt"></a>
247 <h2>Managing Server Load</h2><blockquote>
248 <p>
249 A Fossil server is very efficient and normally presents a very light
250 load on the server.
251 The Fossil [./selfhost.wiki | self-hosting server] is a 1/24th slice VM at
252 [http://www.linode.com | Linode.com] hosting 65 other repositories in
253 addition to Fossil (and including some very high-traffic sites such
254 as [http://www.sqlite.org] and [http://system.data.sqlite.org]) and
255 it has a typical load of 0.05 to 0.1. A single HTTP request to Fossil
256 normally takes less than 10 milliseconds of CPU time to complete. So
@@ -264,16 +264,33 @@
264 [/help?cmd=/annotate | /annotate] and others. On very large repositories,
265 these commands can take 15 seconds or more of CPU time.
266 If these kinds of requests arrive too quickly, the load average on the
267 server can grow dramatically, making the server unresponsive.
268 <p>
269 Fossil provides two capabilities to help avoid server overload problems
270 due to excessive requests to expensive pages:
271 <ol>
272 <li><p>An optional cache is available that remembers the 10 most recently
273 requested /zip or /tarball pages and returns the precomputed answer
274 if the same page is requested again.
275 <li><p>Page requests can be configured to fail with a
276 [http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.5.3 | "503 Server Overload"]
277 HTTP error if an expensive request is received while the host load
278 average is too high.
279 </ol>
280 Both of these load-control mechanisms are turned off by default, but they
281 are recommended for high-traffic sites.
282 <p>
283 The webpage cache is activated using the [/help?cmd=cache|fossil cache init]
284 command-line on the server. Add a -R option to specify the specific repository
285 for which to enable caching. If running this command as root, be sure to
286 "chown" the cache database (which is a separate file in the same directory
287 and with the same name as the repository but with the suffix changed to ".cache")
288 to give it write permission for the userid of the webserver.
289 <p>
290 To activate the server load control feature
291 visit the /Admin/Access setup page in the administrative web
292 interface and in the "<b>Server Load Average Limit</b>" box
293 enter the load average threshold above which "503 Server
294 Overload" replies will be issued for expensive requests. On the
295 self-host Fossil server, that value is set to 1.5. But you could easily
296 set it higher on a multi-core server.
297

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button