Fossil SCM

More removals of unnecessary end-of-line spaces

jan.nijtmans 2014-01-28 08:20 trunk
Commit 45f35169f2e2897f9b178ed0610d77fa10c07531
+16 -16
--- src/cgi.c
+++ src/cgi.c
@@ -266,11 +266,11 @@
266266
zTok = strtok_r(0, ",\"",&zPos)){}
267267
fossil_free(zBuf);
268268
if(zTok) return 1;
269269
}
270270
}
271
-
271
+
272272
return 0;
273273
}
274274
#endif
275275
276276
/*
@@ -497,11 +497,11 @@
497497
** must be made of zValue.
498498
*/
499499
void cgi_setenv(const char *zName, const char *zValue){
500500
cgi_set_parameter_nocopy(zName, mprintf("%s",zValue), 0);
501501
}
502
-
502
+
503503
504504
/*
505505
** Add a list of query parameters or cookies to the parameter set.
506506
**
507507
** Each parameter is of the form NAME=VALUE. Both the NAME and the
@@ -615,11 +615,11 @@
615615
break;
616616
}
617617
}
618618
*pz = &z[i];
619619
get_line_from_string(pz, pLen);
620
- return z;
620
+ return z;
621621
}
622622
623623
/*
624624
** Tokenize a line of text into as many as nArg tokens. Make
625625
** azArg[] point to the start of each token.
@@ -722,11 +722,11 @@
722722
cgi_set_parameter_nocopy(mprintf("%s:mimetype",zName), z, 1);
723723
}
724724
}
725725
}
726726
}
727
- }
727
+ }
728728
}
729729
730730
731731
#ifdef FOSSIL_ENABLE_JSON
732732
/*
@@ -903,11 +903,11 @@
903903
z = (char*)P("HTTP_COOKIE");
904904
if( z ){
905905
z = mprintf("%s",z);
906906
add_param_list(z, ';');
907907
}
908
-
908
+
909909
z = (char*)P("QUERY_STRING");
910910
if( z ){
911911
z = mprintf("%s",z);
912912
add_param_list(z, '&');
913913
}
@@ -919,11 +919,11 @@
919919
920920
len = atoi(PD("CONTENT_LENGTH", "0"));
921921
g.zContentType = zType = P("CONTENT_TYPE");
922922
blob_zero(&g.cgiIn);
923923
if( len>0 && zType ){
924
- if( fossil_strcmp(zType,"application/x-www-form-urlencoded")==0
924
+ if( fossil_strcmp(zType,"application/x-www-form-urlencoded")==0
925925
|| strncmp(zType,"multipart/form-data",19)==0 ){
926926
z = fossil_malloc( len+1 );
927927
len = fread(z, 1, len, g.httpIn);
928928
z[len] = 0;
929929
cgi_trace(z);
@@ -949,11 +949,11 @@
949949
/* FIXMEs:
950950
951951
- See if fossil really needs g.cgiIn to be set for this purpose
952952
(i don't think it does). If it does then fill g.cgiIn and
953953
refactor to parse the JSON from there.
954
-
954
+
955955
- After parsing POST JSON, copy the "first layer" of keys/values
956956
to cgi_setenv(), honoring the upper-case distinction used
957957
in add_param_list(). However...
958958
959959
- If we do that then we might get a disconnect in precedence of
@@ -1225,11 +1225,11 @@
12251225
** loaded into g.zIpAddr.
12261226
*/
12271227
static const char *cgi_accept_forwarded_for(const char *z){
12281228
int i;
12291229
if( fossil_strcmp(g.zIpAddr, "127.0.0.1")!=0 ) return 0;
1230
-
1230
+
12311231
i = strlen(z)-1;
12321232
while( i>=0 && z[i]!=',' && !fossil_isspace(z[i]) ) i--;
12331233
return &z[++i];
12341234
}
12351235
@@ -1297,20 +1297,20 @@
12971297
for(i=0; zToken[i] && zToken[i]!='?'; i++){}
12981298
if( zToken[i] ) zToken[i++] = 0;
12991299
cgi_setenv("PATH_INFO", zToken);
13001300
cgi_setenv("QUERY_STRING", &zToken[i]);
13011301
if( zIpAddr==0 &&
1302
- getpeername(fileno(g.httpIn), (struct sockaddr*)&remoteName,
1302
+ getpeername(fileno(g.httpIn), (struct sockaddr*)&remoteName,
13031303
&size)>=0
13041304
){
13051305
zIpAddr = inet_ntoa(remoteName.sin_addr);
13061306
}
1307
- if( zIpAddr ){
1307
+ if( zIpAddr ){
13081308
cgi_setenv("REMOTE_ADDR", zIpAddr);
13091309
g.zIpAddr = mprintf("%s", zIpAddr);
13101310
}
1311
-
1311
+
13121312
/* Get all the optional fields that follow the first line.
13131313
*/
13141314
while( fgets(zLine,sizeof(zLine),g.httpIn) ){
13151315
char *zFieldName;
13161316
char *zVal;
@@ -1376,11 +1376,11 @@
13761376
const char *zType = 0;
13771377
int i, content_length = 0;
13781378
char zLine[2000]; /* A single line of input. */
13791379
13801380
if( zIpAddr ){
1381
- if( nCycles==0 ){
1381
+ if( nCycles==0 ){
13821382
cgi_setenv("REMOTE_ADDR", zIpAddr);
13831383
g.zIpAddr = mprintf("%s", zIpAddr);
13841384
}
13851385
}else{
13861386
fossil_panic("missing SSH IP address");
@@ -1442,11 +1442,11 @@
14421442
if( nCycles==0 ){
14431443
cgi_setenv("PATH_INFO", zToken);
14441444
}else{
14451445
cgi_replace_parameter("PATH_INFO", mprintf("%s",zToken));
14461446
}
1447
-
1447
+
14481448
/* Get all the optional fields that follow the first line.
14491449
*/
14501450
while( fgets(zLine,sizeof(zLine),g.httpIn) ){
14511451
char *zFieldName;
14521452
char *zVal;
@@ -1623,11 +1623,11 @@
16231623
cgi_init();
16241624
}
16251625
16261626
16271627
#if INTERFACE
1628
-/*
1628
+/*
16291629
** Bitmap values for the flags parameter to cgi_http_server().
16301630
*/
16311631
#define HTTP_SERVER_LOCALHOST 0x0001 /* Bind to 127.0.0.1 only */
16321632
#define HTTP_SERVER_SCGI 0x0002 /* SCGI instead of HTTP */
16331633
@@ -1771,11 +1771,11 @@
17711771
/* Bury dead children */
17721772
while( waitpid(0, 0, WNOHANG)>0 ){
17731773
nchildren--;
17741774
}
17751775
}
1776
- /* NOT REACHED */
1776
+ /* NOT REACHED */
17771777
fossil_exit(1);
17781778
#endif
17791779
/* NOT REACHED */
17801780
return 0;
17811781
}
@@ -1859,11 +1859,11 @@
18591859
p->tm_mon %= 12;
18601860
}
18611861
isLeapYr = p->tm_year%4==0 && (p->tm_year%100!=0 || (p->tm_year+300)%400==0);
18621862
p->tm_yday = priorDays[p->tm_mon] + p->tm_mday - 1;
18631863
if( isLeapYr && p->tm_mon>1 ) p->tm_yday++;
1864
- nDay = (p->tm_year-70)*365 + (p->tm_year-69)/4 -p->tm_year/100 +
1864
+ nDay = (p->tm_year-70)*365 + (p->tm_year-69)/4 -p->tm_year/100 +
18651865
(p->tm_year+300)/400 + p->tm_yday;
18661866
t = ((nDay*24 + p->tm_hour)*60 + p->tm_min)*60 + p->tm_sec;
18671867
return t;
18681868
}
18691869
18701870
--- src/cgi.c
+++ src/cgi.c
@@ -266,11 +266,11 @@
266 zTok = strtok_r(0, ",\"",&zPos)){}
267 fossil_free(zBuf);
268 if(zTok) return 1;
269 }
270 }
271
272 return 0;
273 }
274 #endif
275
276 /*
@@ -497,11 +497,11 @@
497 ** must be made of zValue.
498 */
499 void cgi_setenv(const char *zName, const char *zValue){
500 cgi_set_parameter_nocopy(zName, mprintf("%s",zValue), 0);
501 }
502
503
504 /*
505 ** Add a list of query parameters or cookies to the parameter set.
506 **
507 ** Each parameter is of the form NAME=VALUE. Both the NAME and the
@@ -615,11 +615,11 @@
615 break;
616 }
617 }
618 *pz = &z[i];
619 get_line_from_string(pz, pLen);
620 return z;
621 }
622
623 /*
624 ** Tokenize a line of text into as many as nArg tokens. Make
625 ** azArg[] point to the start of each token.
@@ -722,11 +722,11 @@
722 cgi_set_parameter_nocopy(mprintf("%s:mimetype",zName), z, 1);
723 }
724 }
725 }
726 }
727 }
728 }
729
730
731 #ifdef FOSSIL_ENABLE_JSON
732 /*
@@ -903,11 +903,11 @@
903 z = (char*)P("HTTP_COOKIE");
904 if( z ){
905 z = mprintf("%s",z);
906 add_param_list(z, ';');
907 }
908
909 z = (char*)P("QUERY_STRING");
910 if( z ){
911 z = mprintf("%s",z);
912 add_param_list(z, '&');
913 }
@@ -919,11 +919,11 @@
919
920 len = atoi(PD("CONTENT_LENGTH", "0"));
921 g.zContentType = zType = P("CONTENT_TYPE");
922 blob_zero(&g.cgiIn);
923 if( len>0 && zType ){
924 if( fossil_strcmp(zType,"application/x-www-form-urlencoded")==0
925 || strncmp(zType,"multipart/form-data",19)==0 ){
926 z = fossil_malloc( len+1 );
927 len = fread(z, 1, len, g.httpIn);
928 z[len] = 0;
929 cgi_trace(z);
@@ -949,11 +949,11 @@
949 /* FIXMEs:
950
951 - See if fossil really needs g.cgiIn to be set for this purpose
952 (i don't think it does). If it does then fill g.cgiIn and
953 refactor to parse the JSON from there.
954
955 - After parsing POST JSON, copy the "first layer" of keys/values
956 to cgi_setenv(), honoring the upper-case distinction used
957 in add_param_list(). However...
958
959 - If we do that then we might get a disconnect in precedence of
@@ -1225,11 +1225,11 @@
1225 ** loaded into g.zIpAddr.
1226 */
1227 static const char *cgi_accept_forwarded_for(const char *z){
1228 int i;
1229 if( fossil_strcmp(g.zIpAddr, "127.0.0.1")!=0 ) return 0;
1230
1231 i = strlen(z)-1;
1232 while( i>=0 && z[i]!=',' && !fossil_isspace(z[i]) ) i--;
1233 return &z[++i];
1234 }
1235
@@ -1297,20 +1297,20 @@
1297 for(i=0; zToken[i] && zToken[i]!='?'; i++){}
1298 if( zToken[i] ) zToken[i++] = 0;
1299 cgi_setenv("PATH_INFO", zToken);
1300 cgi_setenv("QUERY_STRING", &zToken[i]);
1301 if( zIpAddr==0 &&
1302 getpeername(fileno(g.httpIn), (struct sockaddr*)&remoteName,
1303 &size)>=0
1304 ){
1305 zIpAddr = inet_ntoa(remoteName.sin_addr);
1306 }
1307 if( zIpAddr ){
1308 cgi_setenv("REMOTE_ADDR", zIpAddr);
1309 g.zIpAddr = mprintf("%s", zIpAddr);
1310 }
1311
1312 /* Get all the optional fields that follow the first line.
1313 */
1314 while( fgets(zLine,sizeof(zLine),g.httpIn) ){
1315 char *zFieldName;
1316 char *zVal;
@@ -1376,11 +1376,11 @@
1376 const char *zType = 0;
1377 int i, content_length = 0;
1378 char zLine[2000]; /* A single line of input. */
1379
1380 if( zIpAddr ){
1381 if( nCycles==0 ){
1382 cgi_setenv("REMOTE_ADDR", zIpAddr);
1383 g.zIpAddr = mprintf("%s", zIpAddr);
1384 }
1385 }else{
1386 fossil_panic("missing SSH IP address");
@@ -1442,11 +1442,11 @@
1442 if( nCycles==0 ){
1443 cgi_setenv("PATH_INFO", zToken);
1444 }else{
1445 cgi_replace_parameter("PATH_INFO", mprintf("%s",zToken));
1446 }
1447
1448 /* Get all the optional fields that follow the first line.
1449 */
1450 while( fgets(zLine,sizeof(zLine),g.httpIn) ){
1451 char *zFieldName;
1452 char *zVal;
@@ -1623,11 +1623,11 @@
1623 cgi_init();
1624 }
1625
1626
1627 #if INTERFACE
1628 /*
1629 ** Bitmap values for the flags parameter to cgi_http_server().
1630 */
1631 #define HTTP_SERVER_LOCALHOST 0x0001 /* Bind to 127.0.0.1 only */
1632 #define HTTP_SERVER_SCGI 0x0002 /* SCGI instead of HTTP */
1633
@@ -1771,11 +1771,11 @@
1771 /* Bury dead children */
1772 while( waitpid(0, 0, WNOHANG)>0 ){
1773 nchildren--;
1774 }
1775 }
1776 /* NOT REACHED */
1777 fossil_exit(1);
1778 #endif
1779 /* NOT REACHED */
1780 return 0;
1781 }
@@ -1859,11 +1859,11 @@
1859 p->tm_mon %= 12;
1860 }
1861 isLeapYr = p->tm_year%4==0 && (p->tm_year%100!=0 || (p->tm_year+300)%400==0);
1862 p->tm_yday = priorDays[p->tm_mon] + p->tm_mday - 1;
1863 if( isLeapYr && p->tm_mon>1 ) p->tm_yday++;
1864 nDay = (p->tm_year-70)*365 + (p->tm_year-69)/4 -p->tm_year/100 +
1865 (p->tm_year+300)/400 + p->tm_yday;
1866 t = ((nDay*24 + p->tm_hour)*60 + p->tm_min)*60 + p->tm_sec;
1867 return t;
1868 }
1869
1870
--- src/cgi.c
+++ src/cgi.c
@@ -266,11 +266,11 @@
266 zTok = strtok_r(0, ",\"",&zPos)){}
267 fossil_free(zBuf);
268 if(zTok) return 1;
269 }
270 }
271
272 return 0;
273 }
274 #endif
275
276 /*
@@ -497,11 +497,11 @@
497 ** must be made of zValue.
498 */
499 void cgi_setenv(const char *zName, const char *zValue){
500 cgi_set_parameter_nocopy(zName, mprintf("%s",zValue), 0);
501 }
502
503
504 /*
505 ** Add a list of query parameters or cookies to the parameter set.
506 **
507 ** Each parameter is of the form NAME=VALUE. Both the NAME and the
@@ -615,11 +615,11 @@
615 break;
616 }
617 }
618 *pz = &z[i];
619 get_line_from_string(pz, pLen);
620 return z;
621 }
622
623 /*
624 ** Tokenize a line of text into as many as nArg tokens. Make
625 ** azArg[] point to the start of each token.
@@ -722,11 +722,11 @@
722 cgi_set_parameter_nocopy(mprintf("%s:mimetype",zName), z, 1);
723 }
724 }
725 }
726 }
727 }
728 }
729
730
731 #ifdef FOSSIL_ENABLE_JSON
732 /*
@@ -903,11 +903,11 @@
903 z = (char*)P("HTTP_COOKIE");
904 if( z ){
905 z = mprintf("%s",z);
906 add_param_list(z, ';');
907 }
908
909 z = (char*)P("QUERY_STRING");
910 if( z ){
911 z = mprintf("%s",z);
912 add_param_list(z, '&');
913 }
@@ -919,11 +919,11 @@
919
920 len = atoi(PD("CONTENT_LENGTH", "0"));
921 g.zContentType = zType = P("CONTENT_TYPE");
922 blob_zero(&g.cgiIn);
923 if( len>0 && zType ){
924 if( fossil_strcmp(zType,"application/x-www-form-urlencoded")==0
925 || strncmp(zType,"multipart/form-data",19)==0 ){
926 z = fossil_malloc( len+1 );
927 len = fread(z, 1, len, g.httpIn);
928 z[len] = 0;
929 cgi_trace(z);
@@ -949,11 +949,11 @@
949 /* FIXMEs:
950
951 - See if fossil really needs g.cgiIn to be set for this purpose
952 (i don't think it does). If it does then fill g.cgiIn and
953 refactor to parse the JSON from there.
954
955 - After parsing POST JSON, copy the "first layer" of keys/values
956 to cgi_setenv(), honoring the upper-case distinction used
957 in add_param_list(). However...
958
959 - If we do that then we might get a disconnect in precedence of
@@ -1225,11 +1225,11 @@
1225 ** loaded into g.zIpAddr.
1226 */
1227 static const char *cgi_accept_forwarded_for(const char *z){
1228 int i;
1229 if( fossil_strcmp(g.zIpAddr, "127.0.0.1")!=0 ) return 0;
1230
1231 i = strlen(z)-1;
1232 while( i>=0 && z[i]!=',' && !fossil_isspace(z[i]) ) i--;
1233 return &z[++i];
1234 }
1235
@@ -1297,20 +1297,20 @@
1297 for(i=0; zToken[i] && zToken[i]!='?'; i++){}
1298 if( zToken[i] ) zToken[i++] = 0;
1299 cgi_setenv("PATH_INFO", zToken);
1300 cgi_setenv("QUERY_STRING", &zToken[i]);
1301 if( zIpAddr==0 &&
1302 getpeername(fileno(g.httpIn), (struct sockaddr*)&remoteName,
1303 &size)>=0
1304 ){
1305 zIpAddr = inet_ntoa(remoteName.sin_addr);
1306 }
1307 if( zIpAddr ){
1308 cgi_setenv("REMOTE_ADDR", zIpAddr);
1309 g.zIpAddr = mprintf("%s", zIpAddr);
1310 }
1311
1312 /* Get all the optional fields that follow the first line.
1313 */
1314 while( fgets(zLine,sizeof(zLine),g.httpIn) ){
1315 char *zFieldName;
1316 char *zVal;
@@ -1376,11 +1376,11 @@
1376 const char *zType = 0;
1377 int i, content_length = 0;
1378 char zLine[2000]; /* A single line of input. */
1379
1380 if( zIpAddr ){
1381 if( nCycles==0 ){
1382 cgi_setenv("REMOTE_ADDR", zIpAddr);
1383 g.zIpAddr = mprintf("%s", zIpAddr);
1384 }
1385 }else{
1386 fossil_panic("missing SSH IP address");
@@ -1442,11 +1442,11 @@
1442 if( nCycles==0 ){
1443 cgi_setenv("PATH_INFO", zToken);
1444 }else{
1445 cgi_replace_parameter("PATH_INFO", mprintf("%s",zToken));
1446 }
1447
1448 /* Get all the optional fields that follow the first line.
1449 */
1450 while( fgets(zLine,sizeof(zLine),g.httpIn) ){
1451 char *zFieldName;
1452 char *zVal;
@@ -1623,11 +1623,11 @@
1623 cgi_init();
1624 }
1625
1626
1627 #if INTERFACE
1628 /*
1629 ** Bitmap values for the flags parameter to cgi_http_server().
1630 */
1631 #define HTTP_SERVER_LOCALHOST 0x0001 /* Bind to 127.0.0.1 only */
1632 #define HTTP_SERVER_SCGI 0x0002 /* SCGI instead of HTTP */
1633
@@ -1771,11 +1771,11 @@
1771 /* Bury dead children */
1772 while( waitpid(0, 0, WNOHANG)>0 ){
1773 nchildren--;
1774 }
1775 }
1776 /* NOT REACHED */
1777 fossil_exit(1);
1778 #endif
1779 /* NOT REACHED */
1780 return 0;
1781 }
@@ -1859,11 +1859,11 @@
1859 p->tm_mon %= 12;
1860 }
1861 isLeapYr = p->tm_year%4==0 && (p->tm_year%100!=0 || (p->tm_year+300)%400==0);
1862 p->tm_yday = priorDays[p->tm_mon] + p->tm_mday - 1;
1863 if( isLeapYr && p->tm_mon>1 ) p->tm_yday++;
1864 nDay = (p->tm_year-70)*365 + (p->tm_year-69)/4 -p->tm_year/100 +
1865 (p->tm_year+300)/400 + p->tm_yday;
1866 t = ((nDay*24 + p->tm_hour)*60 + p->tm_min)*60 + p->tm_sec;
1867 return t;
1868 }
1869
1870
+1 -1
--- src/comformat.c
+++ src/comformat.c
@@ -34,11 +34,11 @@
3434
int tlen = lineLength - indent;
3535
int si, sk, i, k;
3636
int doIndent = 0;
3737
char *zBuf;
3838
char zBuffer[400];
39
- int lineCnt = 0;
39
+ int lineCnt = 0;
4040
4141
if( tlen<=0 ){
4242
tlen = strlen(zText);
4343
}
4444
if( tlen >= (sizeof(zBuffer)) ){
4545
--- src/comformat.c
+++ src/comformat.c
@@ -34,11 +34,11 @@
34 int tlen = lineLength - indent;
35 int si, sk, i, k;
36 int doIndent = 0;
37 char *zBuf;
38 char zBuffer[400];
39 int lineCnt = 0;
40
41 if( tlen<=0 ){
42 tlen = strlen(zText);
43 }
44 if( tlen >= (sizeof(zBuffer)) ){
45
--- src/comformat.c
+++ src/comformat.c
@@ -34,11 +34,11 @@
34 int tlen = lineLength - indent;
35 int si, sk, i, k;
36 int doIndent = 0;
37 char *zBuf;
38 char zBuffer[400];
39 int lineCnt = 0;
40
41 if( tlen<=0 ){
42 tlen = strlen(zText);
43 }
44 if( tlen >= (sizeof(zBuffer)) ){
45
+32 -32
--- src/diffcmd.c
+++ src/diffcmd.c
@@ -599,11 +599,11 @@
599599
600600
/* A Tcl/Tk script used to render diff output.
601601
*/
602602
static const char zDiffScript[] =
603603
@ package require Tk
604
-@
604
+@
605605
@ array set CFG {
606606
@ TITLE {Fossil Diff}
607607
@ LN_COL_BG #dddddd
608608
@ LN_COL_FG #444444
609609
@ TXT_COL_BG #ffffff
@@ -622,30 +622,30 @@
622622
@ PADX 5
623623
@ WIDTH 80
624624
@ HEIGHT 45
625625
@ LB_HEIGHT 25
626626
@ }
627
-@
627
+@
628628
@ if {![namespace exists ttk]} {
629629
@ interp alias {} ::ttk::scrollbar {} ::scrollbar
630630
@ interp alias {} ::ttk::menubutton {} ::menubutton
631631
@ }
632
-@
632
+@
633633
@ proc dehtml {x} {
634634
@ set x [regsub -all {<[^>]*>} $x {}]
635635
@ return [string map {&amp; & &lt; < &gt; > &#39; ' &quot; \"} $x]
636636
@ }
637
-@
637
+@
638638
@ proc cols {} {
639639
@ return [list .lnA .txtA .mkr .lnB .txtB]
640640
@ }
641
-@
641
+@
642642
@ proc colType {c} {
643643
@ regexp {[a-z]+} $c type
644644
@ return $type
645645
@ }
646
-@
646
+@
647647
@ proc readDiffs {fossilcmd} {
648648
@ set in [open $fossilcmd r]
649649
@ fconfigure $in -encoding utf-8
650650
@ set nDiffs 0
651651
@ array set widths {txt 0 ln 0 mkr 0}
@@ -657,34 +657,34 @@
657657
@ continue
658658
@ }
659659
@ incr nDiffs
660660
@ set idx [expr {$nDiffs > 1 ? [.txtA index end] : "1.0"}]
661661
@ .wfiles.lb insert end $fn
662
-@
662
+@
663663
@ foreach c [cols] {
664664
@ while {[gets $in] ne "<pre>"} continue
665
-@
665
+@
666666
@ if {$nDiffs > 1} {
667667
@ $c insert end \n -
668668
@ }
669669
@ if {[colType $c] eq "txt"} {
670670
@ $c insert end $fn\n fn
671671
@ } else {
672672
@ $c insert end \n fn
673673
@ }
674674
@ $c insert end \n -
675
-@
675
+@
676676
@ set type [colType $c]
677677
@ set str {}
678678
@ while {[set line [gets $in]] ne "</pre>"} {
679679
@ set len [string length [dehtml $line]]
680680
@ if {$len > $widths($type)} {
681681
@ set widths($type) $len
682682
@ }
683683
@ append str $line\n
684684
@ }
685
-@
685
+@
686686
@ set re {<span class="diff([a-z]+)">([^<]*)</span>}
687687
@ # Use \r as separator since it can't appear in the diff output (it gets
688688
@ # converted to a space).
689689
@ set str [regsub -all $re $str "\r\\1\r\\2\r"]
690690
@ foreach {pre class mid} [split $str \r] {
@@ -695,11 +695,11 @@
695695
@ }
696696
@ }
697697
@ }
698698
@ }
699699
@ close $in
700
-@
700
+@
701701
@ foreach c [cols] {
702702
@ set type [colType $c]
703703
@ if {$type ne "txt"} {
704704
@ $c config -width $widths($type)
705705
@ }
@@ -707,19 +707,19 @@
707707
@ }
708708
@ if {$nDiffs <= [.wfiles.lb cget -height]} {
709709
@ .wfiles.lb config -height $nDiffs
710710
@ grid remove .wfiles.sb
711711
@ }
712
-@
712
+@
713713
@ return $nDiffs
714714
@ }
715
-@
715
+@
716716
@ proc viewDiff {idx} {
717717
@ .txtA yview $idx
718718
@ .txtA xview moveto 0
719719
@ }
720
-@
720
+@
721721
@ proc cycleDiffs {{reverse 0}} {
722722
@ if {$reverse} {
723723
@ set range [.txtA tag prevrange fn @0,0 1.0]
724724
@ if {$range eq ""} {
725725
@ viewDiff {fn.last -1c}
@@ -733,36 +733,36 @@
733733
@ } else {
734734
@ viewDiff [lindex $range 0]
735735
@ }
736736
@ }
737737
@ }
738
-@
738
+@
739739
@ proc xvis {col} {
740740
@ set view [$col xview]
741741
@ return [expr {[lindex $view 1]-[lindex $view 0]}]
742742
@ }
743
-@
743
+@
744744
@ proc scroll-x {args} {
745745
@ set c .txt[expr {[xvis .txtA] < [xvis .txtB] ? "A" : "B"}]
746746
@ eval $c xview $args
747747
@ }
748
-@
748
+@
749749
@ interp alias {} scroll-y {} .txtA yview
750
-@
750
+@
751751
@ proc noop {args} {}
752
-@
752
+@
753753
@ proc enableSync {axis} {
754754
@ update idletasks
755755
@ interp alias {} sync-$axis {}
756756
@ rename _sync-$axis sync-$axis
757757
@ }
758
-@
758
+@
759759
@ proc disableSync {axis} {
760760
@ rename sync-$axis _sync-$axis
761761
@ interp alias {} sync-$axis {} noop
762762
@ }
763
-@
763
+@
764764
@ proc sync-x {col first last} {
765765
@ disableSync x
766766
@ $col xview moveto [expr {$first*[xvis $col]/($last-$first)}]
767767
@ foreach side {A B} {
768768
@ set sb .sbx$side
@@ -788,11 +788,11 @@
788788
@ } else {
789789
@ grid remove .sby
790790
@ }
791791
@ enableSync y
792792
@ }
793
-@
793
+@
794794
@ wm withdraw .
795795
@ wm title . $CFG(TITLE)
796796
@ wm iconname . $CFG(TITLE)
797797
@ bind . <q> exit
798798
@ bind . <Tab> {cycleDiffs; break}
@@ -813,11 +813,11 @@
813813
@ End y {moveto 1}
814814
@ } {
815815
@ bind . <$key> "scroll-$axis $args; break"
816816
@ bind . <Shift-$key> continue
817817
@ }
818
-@
818
+@
819819
@ ::ttk::menubutton .files -text "Files"
820820
@ toplevel .wfiles
821821
@ wm withdraw .wfiles
822822
@ update idletasks
823823
@ wm transient .wfiles .
@@ -847,16 +847,16 @@
847847
@ }
848848
@ bind .wfiles.lb <Motion> {
849849
@ %W selection clear 0 end
850850
@ %W selection set @%x,%y
851851
@ }
852
-@
852
+@
853853
@ foreach {side syncCol} {A .txtB B .txtA} {
854854
@ set ln .ln$side
855855
@ text $ln
856856
@ $ln tag config - -justify right
857
-@
857
+@
858858
@ set txt .txt$side
859859
@ text $txt -width $CFG(WIDTH) -height $CFG(HEIGHT) -wrap none \
860860
@ -xscroll "sync-x $syncCol"
861861
@ catch {$txt config -tabstyle wordprocessor} ;# Required for Tk>=8.5
862862
@ foreach tag {add rm chng} {
@@ -865,11 +865,11 @@
865865
@ }
866866
@ $txt tag config fn -background $CFG(FN_BG) -foreground $CFG(FN_FG) \
867867
@ -justify center
868868
@ }
869869
@ text .mkr
870
-@
870
+@
871871
@ foreach c [cols] {
872872
@ set keyPrefix [string toupper [colType $c]]_COL_
873873
@ if {[tk windowingsystem] eq "win32"} {$c config -font {courier 9}}
874874
@ $c config -bg $CFG(${keyPrefix}BG) -fg $CFG(${keyPrefix}FG) -borderwidth 0 \
875875
@ -padx $CFG(PADX) -yscroll sync-y
@@ -877,22 +877,22 @@
877877
@ -foreground $CFG(HR_FG)
878878
@ $c tag config fn -spacing1 $CFG(FN_PAD) -spacing3 $CFG(FN_PAD)
879879
@ bindtags $c ". $c Text all"
880880
@ bind $c <1> {focus %W}
881881
@ }
882
-@
882
+@
883883
@ ::ttk::scrollbar .sby -command {.txtA yview} -orient vertical
884884
@ ::ttk::scrollbar .sbxA -command {.txtA xview} -orient horizontal
885885
@ ::ttk::scrollbar .sbxB -command {.txtB xview} -orient horizontal
886886
@ frame .spacer
887
-@
887
+@
888888
@ if {[readDiffs $fossilcmd] == 0} {
889889
@ tk_messageBox -type ok -title $CFG(TITLE) -message "No changes"
890890
@ exit
891891
@ }
892892
@ update idletasks
893
-@
893
+@
894894
@ grid rowconfigure . 1 -weight 1
895895
@ grid columnconfigure . 1 -weight 1
896896
@ grid columnconfigure . 4 -weight 1
897897
@ grid .files -row 0 -columnspan 6
898898
@ eval grid [cols] -row 1 -sticky nsew
@@ -906,11 +906,11 @@
906906
;
907907
908908
/*
909909
** Show diff output in a Tcl/Tk window, in response to the --tk option
910910
** to the diff command.
911
-**
911
+**
912912
** Steps:
913913
** (1) Write the Tcl/Tk script used for rendering into a temp file.
914914
** (2) Invoke "wish" on the temp file using fossil_system().
915915
** (3) Delete the temp file.
916916
*/
@@ -988,11 +988,11 @@
988988
** specified (as they exist on disk) and that same file as it was checked
989989
** out. Or if the FILE arguments are omitted, show the unsaved changed
990990
** currently in the working check-out.
991991
**
992992
** If the "--from VERSION" or "-r VERSION" option is used it specifies
993
-** the source check-in for the diff operation. If not specified, the
993
+** the source check-in for the diff operation. If not specified, the
994994
** source check-in is the base check-in for the current check-out.
995995
**
996996
** If the "--to VERSION" option appears, it specifies the check-in from
997997
** which the second version of the file or files is taken. If there is
998998
** no "--to" option then the (possibly edited) files in the current check-out
@@ -1015,11 +1015,11 @@
10151015
**
10161016
** Options:
10171017
** --binary PATTERN Treat files that match the glob PATTERN as binary
10181018
** --branch BRANCH Show diff of all changes on BRANCH
10191019
** --brief Show filenames only
1020
-** --context|-c N Use N lines of context
1020
+** --context|-c N Use N lines of context
10211021
** --diff-binary BOOL Include binary files when using external commands
10221022
** --from|-r VERSION select VERSION as source for the diff
10231023
** --internal|-i use internal diff logic
10241024
** --side-by-side|-y side-by-side diff
10251025
** --tk Launch a Tcl/Tk GUI for display
10261026
--- src/diffcmd.c
+++ src/diffcmd.c
@@ -599,11 +599,11 @@
599
600 /* A Tcl/Tk script used to render diff output.
601 */
602 static const char zDiffScript[] =
603 @ package require Tk
604 @
605 @ array set CFG {
606 @ TITLE {Fossil Diff}
607 @ LN_COL_BG #dddddd
608 @ LN_COL_FG #444444
609 @ TXT_COL_BG #ffffff
@@ -622,30 +622,30 @@
622 @ PADX 5
623 @ WIDTH 80
624 @ HEIGHT 45
625 @ LB_HEIGHT 25
626 @ }
627 @
628 @ if {![namespace exists ttk]} {
629 @ interp alias {} ::ttk::scrollbar {} ::scrollbar
630 @ interp alias {} ::ttk::menubutton {} ::menubutton
631 @ }
632 @
633 @ proc dehtml {x} {
634 @ set x [regsub -all {<[^>]*>} $x {}]
635 @ return [string map {&amp; & &lt; < &gt; > &#39; ' &quot; \"} $x]
636 @ }
637 @
638 @ proc cols {} {
639 @ return [list .lnA .txtA .mkr .lnB .txtB]
640 @ }
641 @
642 @ proc colType {c} {
643 @ regexp {[a-z]+} $c type
644 @ return $type
645 @ }
646 @
647 @ proc readDiffs {fossilcmd} {
648 @ set in [open $fossilcmd r]
649 @ fconfigure $in -encoding utf-8
650 @ set nDiffs 0
651 @ array set widths {txt 0 ln 0 mkr 0}
@@ -657,34 +657,34 @@
657 @ continue
658 @ }
659 @ incr nDiffs
660 @ set idx [expr {$nDiffs > 1 ? [.txtA index end] : "1.0"}]
661 @ .wfiles.lb insert end $fn
662 @
663 @ foreach c [cols] {
664 @ while {[gets $in] ne "<pre>"} continue
665 @
666 @ if {$nDiffs > 1} {
667 @ $c insert end \n -
668 @ }
669 @ if {[colType $c] eq "txt"} {
670 @ $c insert end $fn\n fn
671 @ } else {
672 @ $c insert end \n fn
673 @ }
674 @ $c insert end \n -
675 @
676 @ set type [colType $c]
677 @ set str {}
678 @ while {[set line [gets $in]] ne "</pre>"} {
679 @ set len [string length [dehtml $line]]
680 @ if {$len > $widths($type)} {
681 @ set widths($type) $len
682 @ }
683 @ append str $line\n
684 @ }
685 @
686 @ set re {<span class="diff([a-z]+)">([^<]*)</span>}
687 @ # Use \r as separator since it can't appear in the diff output (it gets
688 @ # converted to a space).
689 @ set str [regsub -all $re $str "\r\\1\r\\2\r"]
690 @ foreach {pre class mid} [split $str \r] {
@@ -695,11 +695,11 @@
695 @ }
696 @ }
697 @ }
698 @ }
699 @ close $in
700 @
701 @ foreach c [cols] {
702 @ set type [colType $c]
703 @ if {$type ne "txt"} {
704 @ $c config -width $widths($type)
705 @ }
@@ -707,19 +707,19 @@
707 @ }
708 @ if {$nDiffs <= [.wfiles.lb cget -height]} {
709 @ .wfiles.lb config -height $nDiffs
710 @ grid remove .wfiles.sb
711 @ }
712 @
713 @ return $nDiffs
714 @ }
715 @
716 @ proc viewDiff {idx} {
717 @ .txtA yview $idx
718 @ .txtA xview moveto 0
719 @ }
720 @
721 @ proc cycleDiffs {{reverse 0}} {
722 @ if {$reverse} {
723 @ set range [.txtA tag prevrange fn @0,0 1.0]
724 @ if {$range eq ""} {
725 @ viewDiff {fn.last -1c}
@@ -733,36 +733,36 @@
733 @ } else {
734 @ viewDiff [lindex $range 0]
735 @ }
736 @ }
737 @ }
738 @
739 @ proc xvis {col} {
740 @ set view [$col xview]
741 @ return [expr {[lindex $view 1]-[lindex $view 0]}]
742 @ }
743 @
744 @ proc scroll-x {args} {
745 @ set c .txt[expr {[xvis .txtA] < [xvis .txtB] ? "A" : "B"}]
746 @ eval $c xview $args
747 @ }
748 @
749 @ interp alias {} scroll-y {} .txtA yview
750 @
751 @ proc noop {args} {}
752 @
753 @ proc enableSync {axis} {
754 @ update idletasks
755 @ interp alias {} sync-$axis {}
756 @ rename _sync-$axis sync-$axis
757 @ }
758 @
759 @ proc disableSync {axis} {
760 @ rename sync-$axis _sync-$axis
761 @ interp alias {} sync-$axis {} noop
762 @ }
763 @
764 @ proc sync-x {col first last} {
765 @ disableSync x
766 @ $col xview moveto [expr {$first*[xvis $col]/($last-$first)}]
767 @ foreach side {A B} {
768 @ set sb .sbx$side
@@ -788,11 +788,11 @@
788 @ } else {
789 @ grid remove .sby
790 @ }
791 @ enableSync y
792 @ }
793 @
794 @ wm withdraw .
795 @ wm title . $CFG(TITLE)
796 @ wm iconname . $CFG(TITLE)
797 @ bind . <q> exit
798 @ bind . <Tab> {cycleDiffs; break}
@@ -813,11 +813,11 @@
813 @ End y {moveto 1}
814 @ } {
815 @ bind . <$key> "scroll-$axis $args; break"
816 @ bind . <Shift-$key> continue
817 @ }
818 @
819 @ ::ttk::menubutton .files -text "Files"
820 @ toplevel .wfiles
821 @ wm withdraw .wfiles
822 @ update idletasks
823 @ wm transient .wfiles .
@@ -847,16 +847,16 @@
847 @ }
848 @ bind .wfiles.lb <Motion> {
849 @ %W selection clear 0 end
850 @ %W selection set @%x,%y
851 @ }
852 @
853 @ foreach {side syncCol} {A .txtB B .txtA} {
854 @ set ln .ln$side
855 @ text $ln
856 @ $ln tag config - -justify right
857 @
858 @ set txt .txt$side
859 @ text $txt -width $CFG(WIDTH) -height $CFG(HEIGHT) -wrap none \
860 @ -xscroll "sync-x $syncCol"
861 @ catch {$txt config -tabstyle wordprocessor} ;# Required for Tk>=8.5
862 @ foreach tag {add rm chng} {
@@ -865,11 +865,11 @@
865 @ }
866 @ $txt tag config fn -background $CFG(FN_BG) -foreground $CFG(FN_FG) \
867 @ -justify center
868 @ }
869 @ text .mkr
870 @
871 @ foreach c [cols] {
872 @ set keyPrefix [string toupper [colType $c]]_COL_
873 @ if {[tk windowingsystem] eq "win32"} {$c config -font {courier 9}}
874 @ $c config -bg $CFG(${keyPrefix}BG) -fg $CFG(${keyPrefix}FG) -borderwidth 0 \
875 @ -padx $CFG(PADX) -yscroll sync-y
@@ -877,22 +877,22 @@
877 @ -foreground $CFG(HR_FG)
878 @ $c tag config fn -spacing1 $CFG(FN_PAD) -spacing3 $CFG(FN_PAD)
879 @ bindtags $c ". $c Text all"
880 @ bind $c <1> {focus %W}
881 @ }
882 @
883 @ ::ttk::scrollbar .sby -command {.txtA yview} -orient vertical
884 @ ::ttk::scrollbar .sbxA -command {.txtA xview} -orient horizontal
885 @ ::ttk::scrollbar .sbxB -command {.txtB xview} -orient horizontal
886 @ frame .spacer
887 @
888 @ if {[readDiffs $fossilcmd] == 0} {
889 @ tk_messageBox -type ok -title $CFG(TITLE) -message "No changes"
890 @ exit
891 @ }
892 @ update idletasks
893 @
894 @ grid rowconfigure . 1 -weight 1
895 @ grid columnconfigure . 1 -weight 1
896 @ grid columnconfigure . 4 -weight 1
897 @ grid .files -row 0 -columnspan 6
898 @ eval grid [cols] -row 1 -sticky nsew
@@ -906,11 +906,11 @@
906 ;
907
908 /*
909 ** Show diff output in a Tcl/Tk window, in response to the --tk option
910 ** to the diff command.
911 **
912 ** Steps:
913 ** (1) Write the Tcl/Tk script used for rendering into a temp file.
914 ** (2) Invoke "wish" on the temp file using fossil_system().
915 ** (3) Delete the temp file.
916 */
@@ -988,11 +988,11 @@
988 ** specified (as they exist on disk) and that same file as it was checked
989 ** out. Or if the FILE arguments are omitted, show the unsaved changed
990 ** currently in the working check-out.
991 **
992 ** If the "--from VERSION" or "-r VERSION" option is used it specifies
993 ** the source check-in for the diff operation. If not specified, the
994 ** source check-in is the base check-in for the current check-out.
995 **
996 ** If the "--to VERSION" option appears, it specifies the check-in from
997 ** which the second version of the file or files is taken. If there is
998 ** no "--to" option then the (possibly edited) files in the current check-out
@@ -1015,11 +1015,11 @@
1015 **
1016 ** Options:
1017 ** --binary PATTERN Treat files that match the glob PATTERN as binary
1018 ** --branch BRANCH Show diff of all changes on BRANCH
1019 ** --brief Show filenames only
1020 ** --context|-c N Use N lines of context
1021 ** --diff-binary BOOL Include binary files when using external commands
1022 ** --from|-r VERSION select VERSION as source for the diff
1023 ** --internal|-i use internal diff logic
1024 ** --side-by-side|-y side-by-side diff
1025 ** --tk Launch a Tcl/Tk GUI for display
1026
--- src/diffcmd.c
+++ src/diffcmd.c
@@ -599,11 +599,11 @@
599
600 /* A Tcl/Tk script used to render diff output.
601 */
602 static const char zDiffScript[] =
603 @ package require Tk
604 @
605 @ array set CFG {
606 @ TITLE {Fossil Diff}
607 @ LN_COL_BG #dddddd
608 @ LN_COL_FG #444444
609 @ TXT_COL_BG #ffffff
@@ -622,30 +622,30 @@
622 @ PADX 5
623 @ WIDTH 80
624 @ HEIGHT 45
625 @ LB_HEIGHT 25
626 @ }
627 @
628 @ if {![namespace exists ttk]} {
629 @ interp alias {} ::ttk::scrollbar {} ::scrollbar
630 @ interp alias {} ::ttk::menubutton {} ::menubutton
631 @ }
632 @
633 @ proc dehtml {x} {
634 @ set x [regsub -all {<[^>]*>} $x {}]
635 @ return [string map {&amp; & &lt; < &gt; > &#39; ' &quot; \"} $x]
636 @ }
637 @
638 @ proc cols {} {
639 @ return [list .lnA .txtA .mkr .lnB .txtB]
640 @ }
641 @
642 @ proc colType {c} {
643 @ regexp {[a-z]+} $c type
644 @ return $type
645 @ }
646 @
647 @ proc readDiffs {fossilcmd} {
648 @ set in [open $fossilcmd r]
649 @ fconfigure $in -encoding utf-8
650 @ set nDiffs 0
651 @ array set widths {txt 0 ln 0 mkr 0}
@@ -657,34 +657,34 @@
657 @ continue
658 @ }
659 @ incr nDiffs
660 @ set idx [expr {$nDiffs > 1 ? [.txtA index end] : "1.0"}]
661 @ .wfiles.lb insert end $fn
662 @
663 @ foreach c [cols] {
664 @ while {[gets $in] ne "<pre>"} continue
665 @
666 @ if {$nDiffs > 1} {
667 @ $c insert end \n -
668 @ }
669 @ if {[colType $c] eq "txt"} {
670 @ $c insert end $fn\n fn
671 @ } else {
672 @ $c insert end \n fn
673 @ }
674 @ $c insert end \n -
675 @
676 @ set type [colType $c]
677 @ set str {}
678 @ while {[set line [gets $in]] ne "</pre>"} {
679 @ set len [string length [dehtml $line]]
680 @ if {$len > $widths($type)} {
681 @ set widths($type) $len
682 @ }
683 @ append str $line\n
684 @ }
685 @
686 @ set re {<span class="diff([a-z]+)">([^<]*)</span>}
687 @ # Use \r as separator since it can't appear in the diff output (it gets
688 @ # converted to a space).
689 @ set str [regsub -all $re $str "\r\\1\r\\2\r"]
690 @ foreach {pre class mid} [split $str \r] {
@@ -695,11 +695,11 @@
695 @ }
696 @ }
697 @ }
698 @ }
699 @ close $in
700 @
701 @ foreach c [cols] {
702 @ set type [colType $c]
703 @ if {$type ne "txt"} {
704 @ $c config -width $widths($type)
705 @ }
@@ -707,19 +707,19 @@
707 @ }
708 @ if {$nDiffs <= [.wfiles.lb cget -height]} {
709 @ .wfiles.lb config -height $nDiffs
710 @ grid remove .wfiles.sb
711 @ }
712 @
713 @ return $nDiffs
714 @ }
715 @
716 @ proc viewDiff {idx} {
717 @ .txtA yview $idx
718 @ .txtA xview moveto 0
719 @ }
720 @
721 @ proc cycleDiffs {{reverse 0}} {
722 @ if {$reverse} {
723 @ set range [.txtA tag prevrange fn @0,0 1.0]
724 @ if {$range eq ""} {
725 @ viewDiff {fn.last -1c}
@@ -733,36 +733,36 @@
733 @ } else {
734 @ viewDiff [lindex $range 0]
735 @ }
736 @ }
737 @ }
738 @
739 @ proc xvis {col} {
740 @ set view [$col xview]
741 @ return [expr {[lindex $view 1]-[lindex $view 0]}]
742 @ }
743 @
744 @ proc scroll-x {args} {
745 @ set c .txt[expr {[xvis .txtA] < [xvis .txtB] ? "A" : "B"}]
746 @ eval $c xview $args
747 @ }
748 @
749 @ interp alias {} scroll-y {} .txtA yview
750 @
751 @ proc noop {args} {}
752 @
753 @ proc enableSync {axis} {
754 @ update idletasks
755 @ interp alias {} sync-$axis {}
756 @ rename _sync-$axis sync-$axis
757 @ }
758 @
759 @ proc disableSync {axis} {
760 @ rename sync-$axis _sync-$axis
761 @ interp alias {} sync-$axis {} noop
762 @ }
763 @
764 @ proc sync-x {col first last} {
765 @ disableSync x
766 @ $col xview moveto [expr {$first*[xvis $col]/($last-$first)}]
767 @ foreach side {A B} {
768 @ set sb .sbx$side
@@ -788,11 +788,11 @@
788 @ } else {
789 @ grid remove .sby
790 @ }
791 @ enableSync y
792 @ }
793 @
794 @ wm withdraw .
795 @ wm title . $CFG(TITLE)
796 @ wm iconname . $CFG(TITLE)
797 @ bind . <q> exit
798 @ bind . <Tab> {cycleDiffs; break}
@@ -813,11 +813,11 @@
813 @ End y {moveto 1}
814 @ } {
815 @ bind . <$key> "scroll-$axis $args; break"
816 @ bind . <Shift-$key> continue
817 @ }
818 @
819 @ ::ttk::menubutton .files -text "Files"
820 @ toplevel .wfiles
821 @ wm withdraw .wfiles
822 @ update idletasks
823 @ wm transient .wfiles .
@@ -847,16 +847,16 @@
847 @ }
848 @ bind .wfiles.lb <Motion> {
849 @ %W selection clear 0 end
850 @ %W selection set @%x,%y
851 @ }
852 @
853 @ foreach {side syncCol} {A .txtB B .txtA} {
854 @ set ln .ln$side
855 @ text $ln
856 @ $ln tag config - -justify right
857 @
858 @ set txt .txt$side
859 @ text $txt -width $CFG(WIDTH) -height $CFG(HEIGHT) -wrap none \
860 @ -xscroll "sync-x $syncCol"
861 @ catch {$txt config -tabstyle wordprocessor} ;# Required for Tk>=8.5
862 @ foreach tag {add rm chng} {
@@ -865,11 +865,11 @@
865 @ }
866 @ $txt tag config fn -background $CFG(FN_BG) -foreground $CFG(FN_FG) \
867 @ -justify center
868 @ }
869 @ text .mkr
870 @
871 @ foreach c [cols] {
872 @ set keyPrefix [string toupper [colType $c]]_COL_
873 @ if {[tk windowingsystem] eq "win32"} {$c config -font {courier 9}}
874 @ $c config -bg $CFG(${keyPrefix}BG) -fg $CFG(${keyPrefix}FG) -borderwidth 0 \
875 @ -padx $CFG(PADX) -yscroll sync-y
@@ -877,22 +877,22 @@
877 @ -foreground $CFG(HR_FG)
878 @ $c tag config fn -spacing1 $CFG(FN_PAD) -spacing3 $CFG(FN_PAD)
879 @ bindtags $c ". $c Text all"
880 @ bind $c <1> {focus %W}
881 @ }
882 @
883 @ ::ttk::scrollbar .sby -command {.txtA yview} -orient vertical
884 @ ::ttk::scrollbar .sbxA -command {.txtA xview} -orient horizontal
885 @ ::ttk::scrollbar .sbxB -command {.txtB xview} -orient horizontal
886 @ frame .spacer
887 @
888 @ if {[readDiffs $fossilcmd] == 0} {
889 @ tk_messageBox -type ok -title $CFG(TITLE) -message "No changes"
890 @ exit
891 @ }
892 @ update idletasks
893 @
894 @ grid rowconfigure . 1 -weight 1
895 @ grid columnconfigure . 1 -weight 1
896 @ grid columnconfigure . 4 -weight 1
897 @ grid .files -row 0 -columnspan 6
898 @ eval grid [cols] -row 1 -sticky nsew
@@ -906,11 +906,11 @@
906 ;
907
908 /*
909 ** Show diff output in a Tcl/Tk window, in response to the --tk option
910 ** to the diff command.
911 **
912 ** Steps:
913 ** (1) Write the Tcl/Tk script used for rendering into a temp file.
914 ** (2) Invoke "wish" on the temp file using fossil_system().
915 ** (3) Delete the temp file.
916 */
@@ -988,11 +988,11 @@
988 ** specified (as they exist on disk) and that same file as it was checked
989 ** out. Or if the FILE arguments are omitted, show the unsaved changed
990 ** currently in the working check-out.
991 **
992 ** If the "--from VERSION" or "-r VERSION" option is used it specifies
993 ** the source check-in for the diff operation. If not specified, the
994 ** source check-in is the base check-in for the current check-out.
995 **
996 ** If the "--to VERSION" option appears, it specifies the check-in from
997 ** which the second version of the file or files is taken. If there is
998 ** no "--to" option then the (possibly edited) files in the current check-out
@@ -1015,11 +1015,11 @@
1015 **
1016 ** Options:
1017 ** --binary PATTERN Treat files that match the glob PATTERN as binary
1018 ** --branch BRANCH Show diff of all changes on BRANCH
1019 ** --brief Show filenames only
1020 ** --context|-c N Use N lines of context
1021 ** --diff-binary BOOL Include binary files when using external commands
1022 ** --from|-r VERSION select VERSION as source for the diff
1023 ** --internal|-i use internal diff logic
1024 ** --side-by-side|-y side-by-side diff
1025 ** --tk Launch a Tcl/Tk GUI for display
1026
+1 -1
--- src/file.c
+++ src/file.c
@@ -996,11 +996,11 @@
996996
}else{
997997
xCmp = fossil_strnicmp;
998998
}
999999
10001000
/* Special case. zOrigName refers to g.zLocalRoot directory. */
1001
- if( (nFull==nLocalRoot-1 && xCmp(zLocalRoot, zFull, nFull)==0)
1001
+ if( (nFull==nLocalRoot-1 && xCmp(zLocalRoot, zFull, nFull)==0)
10021002
|| (nFull==1 && zFull[0]=='/' && nLocalRoot==1 && zLocalRoot[0]=='/') ){
10031003
blob_append(pOut, ".", 1);
10041004
blob_reset(&localRoot);
10051005
blob_reset(&full);
10061006
return 1;
10071007
--- src/file.c
+++ src/file.c
@@ -996,11 +996,11 @@
996 }else{
997 xCmp = fossil_strnicmp;
998 }
999
1000 /* Special case. zOrigName refers to g.zLocalRoot directory. */
1001 if( (nFull==nLocalRoot-1 && xCmp(zLocalRoot, zFull, nFull)==0)
1002 || (nFull==1 && zFull[0]=='/' && nLocalRoot==1 && zLocalRoot[0]=='/') ){
1003 blob_append(pOut, ".", 1);
1004 blob_reset(&localRoot);
1005 blob_reset(&full);
1006 return 1;
1007
--- src/file.c
+++ src/file.c
@@ -996,11 +996,11 @@
996 }else{
997 xCmp = fossil_strnicmp;
998 }
999
1000 /* Special case. zOrigName refers to g.zLocalRoot directory. */
1001 if( (nFull==nLocalRoot-1 && xCmp(zLocalRoot, zFull, nFull)==0)
1002 || (nFull==1 && zFull[0]=='/' && nLocalRoot==1 && zLocalRoot[0]=='/') ){
1003 blob_append(pOut, ".", 1);
1004 blob_reset(&localRoot);
1005 blob_reset(&full);
1006 return 1;
1007
+1 -1
--- src/finfo.c
+++ src/finfo.c
@@ -322,11 +322,11 @@
322322
);
323323
if( firstChngOnly ){
324324
#if 0
325325
blob_appendf(&sql, ", min(event.mtime)");
326326
#else
327
- blob_appendf(&sql,
327
+ blob_appendf(&sql,
328328
", min(CASE (SELECT value FROM tagxref"
329329
" WHERE tagtype>0 AND tagid=%d"
330330
" AND tagxref.rid=mlink.mid)"
331331
" WHEN 'trunk' THEN event.mtime-10000 ELSE event.mtime END)",
332332
TAG_BRANCH);
333333
--- src/finfo.c
+++ src/finfo.c
@@ -322,11 +322,11 @@
322 );
323 if( firstChngOnly ){
324 #if 0
325 blob_appendf(&sql, ", min(event.mtime)");
326 #else
327 blob_appendf(&sql,
328 ", min(CASE (SELECT value FROM tagxref"
329 " WHERE tagtype>0 AND tagid=%d"
330 " AND tagxref.rid=mlink.mid)"
331 " WHEN 'trunk' THEN event.mtime-10000 ELSE event.mtime END)",
332 TAG_BRANCH);
333
--- src/finfo.c
+++ src/finfo.c
@@ -322,11 +322,11 @@
322 );
323 if( firstChngOnly ){
324 #if 0
325 blob_appendf(&sql, ", min(event.mtime)");
326 #else
327 blob_appendf(&sql,
328 ", min(CASE (SELECT value FROM tagxref"
329 " WHERE tagtype>0 AND tagid=%d"
330 " AND tagxref.rid=mlink.mid)"
331 " WHEN 'trunk' THEN event.mtime-10000 ELSE event.mtime END)",
332 TAG_BRANCH);
333
+1 -1
--- src/gzip.c
+++ src/gzip.c
@@ -73,11 +73,11 @@
7373
*/
7474
#define GZIP_BUFSZ 100000
7575
void gzip_step(const char *pIn, int nIn){
7676
char *zOutBuf;
7777
int nOut;
78
-
78
+
7979
nOut = nIn + nIn/10 + 100;
8080
if( nOut<100000 ) nOut = 100000;
8181
zOutBuf = fossil_malloc(nOut);
8282
gzip.stream.avail_in = nIn;
8383
gzip.stream.next_in = (unsigned char*)pIn;
8484
--- src/gzip.c
+++ src/gzip.c
@@ -73,11 +73,11 @@
73 */
74 #define GZIP_BUFSZ 100000
75 void gzip_step(const char *pIn, int nIn){
76 char *zOutBuf;
77 int nOut;
78
79 nOut = nIn + nIn/10 + 100;
80 if( nOut<100000 ) nOut = 100000;
81 zOutBuf = fossil_malloc(nOut);
82 gzip.stream.avail_in = nIn;
83 gzip.stream.next_in = (unsigned char*)pIn;
84
--- src/gzip.c
+++ src/gzip.c
@@ -73,11 +73,11 @@
73 */
74 #define GZIP_BUFSZ 100000
75 void gzip_step(const char *pIn, int nIn){
76 char *zOutBuf;
77 int nOut;
78
79 nOut = nIn + nIn/10 + 100;
80 if( nOut<100000 ) nOut = 100000;
81 zOutBuf = fossil_malloc(nOut);
82 gzip.stream.avail_in = nIn;
83 gzip.stream.next_in = (unsigned char*)pIn;
84
+1 -1
--- src/info.c
+++ src/info.c
@@ -2394,11 +2394,11 @@
23942394
@ onkeyup="chgbn(this.value.trim(),'%h(zBranchName)')" /></td></tr>
23952395
if( !fHasHidden ){
23962396
@ <tr><th align="right" valign="top">Branch Hiding:</th>
23972397
@ <td valign="top">
23982398
@ <label><input type="checkbox" id="hidebr" name="hide"%s(zHideFlag) />
2399
- @ Hide branch
2399
+ @ Hide branch
24002400
@ <span style="font-weight:bold" id="hbranch">%h(zBranchName)</span>
24012401
@ from the timeline starting from this check-in</label>
24022402
@ </td></tr>
24032403
}
24042404
if( !fHasClosed ){
24052405
--- src/info.c
+++ src/info.c
@@ -2394,11 +2394,11 @@
2394 @ onkeyup="chgbn(this.value.trim(),'%h(zBranchName)')" /></td></tr>
2395 if( !fHasHidden ){
2396 @ <tr><th align="right" valign="top">Branch Hiding:</th>
2397 @ <td valign="top">
2398 @ <label><input type="checkbox" id="hidebr" name="hide"%s(zHideFlag) />
2399 @ Hide branch
2400 @ <span style="font-weight:bold" id="hbranch">%h(zBranchName)</span>
2401 @ from the timeline starting from this check-in</label>
2402 @ </td></tr>
2403 }
2404 if( !fHasClosed ){
2405
--- src/info.c
+++ src/info.c
@@ -2394,11 +2394,11 @@
2394 @ onkeyup="chgbn(this.value.trim(),'%h(zBranchName)')" /></td></tr>
2395 if( !fHasHidden ){
2396 @ <tr><th align="right" valign="top">Branch Hiding:</th>
2397 @ <td valign="top">
2398 @ <label><input type="checkbox" id="hidebr" name="hide"%s(zHideFlag) />
2399 @ Hide branch
2400 @ <span style="font-weight:bold" id="hbranch">%h(zBranchName)</span>
2401 @ from the timeline starting from this check-in</label>
2402 @ </td></tr>
2403 }
2404 if( !fHasClosed ){
2405
+22 -22
--- src/login.c
+++ src/login.c
@@ -41,11 +41,11 @@
4141
** logs and downloading diffs of very version of the archive that
4242
** has ever existed, and things like that.
4343
*/
4444
#include "config.h"
4545
#include "login.h"
46
-#if defined(_WIN32)
46
+#if defined(_WIN32)
4747
# include <windows.h> /* for Sleep */
4848
# if defined(__MINGW32__) || defined(_MSC_VER)
4949
# define sleep Sleep /* windows does not have sleep, but Sleep */
5050
# endif
5151
#endif
@@ -112,13 +112,13 @@
112112
}
113113
}
114114
115115
/*
116116
** The IP address of the client is stored as part of login cookies.
117
-** But some clients are behind firewalls that shift the IP address
118
-** with each HTTP request. To allow such (broken) clients to log in,
119
-** extract just a prefix of the IP address.
117
+** But some clients are behind firewalls that shift the IP address
118
+** with each HTTP request. To allow such (broken) clients to log in,
119
+** extract just a prefix of the IP address.
120120
*/
121121
static char *ipPrefix(const char *zIP){
122122
int i, j;
123123
static int ip_prefix_terms = -1;
124124
if( ip_prefix_terms<0 ){
@@ -344,11 +344,11 @@
344344
*/
345345
void login_clear_login_data(){
346346
if(!g.userUid){
347347
return;
348348
}else{
349
- char const * cookie = login_cookie_name();
349
+ char const * cookie = login_cookie_name();
350350
/* To logout, change the cookie value to an empty string */
351351
cgi_set_cookie(cookie, "",
352352
login_cookie_path(), -86400);
353353
db_multi_exec("UPDATE user SET cookie=NULL, ipaddr=NULL, "
354354
" cexpire=0 WHERE uid=%d"
@@ -491,21 +491,21 @@
491491
/* The user requests a password change */
492492
zSha1Pw = sha1_shared_secret(zPasswd, g.zLogin, 0);
493493
if( db_int(1, "SELECT 0 FROM user"
494494
" WHERE uid=%d"
495495
" AND (constant_time_cmp(pw,%Q)=0"
496
- " OR constant_time_cmp(pw,%Q)=0)",
496
+ " OR constant_time_cmp(pw,%Q)=0)",
497497
g.userUid, zSha1Pw, zPasswd) ){
498498
sleep(1);
499
- zErrMsg =
499
+ zErrMsg =
500500
@ <p><span class="loginError">
501501
@ You entered an incorrect old password while attempting to change
502502
@ your password. Your password is unchanged.
503503
@ </span></p>
504504
;
505505
}else if( fossil_strcmp(zNew1,zNew2)!=0 ){
506
- zErrMsg =
506
+ zErrMsg =
507507
@ <p><span class="loginError">
508508
@ The two copies of your new passwords do not match.
509509
@ Your password is unchanged.
510510
@ </span></p>
511511
;
@@ -544,11 +544,11 @@
544544
/* Attempting to log in as a user other than anonymous.
545545
*/
546546
uid = login_search_uid(zUsername, zPasswd);
547547
if( uid<=0 ){
548548
sleep(1);
549
- zErrMsg =
549
+ zErrMsg =
550550
@ <p><span class="loginError">
551551
@ You entered an unknown user or an incorrect password.
552552
@ </span></p>
553553
;
554554
record_login_attempt(zUsername, zIpAddr, 0);
@@ -620,11 +620,11 @@
620620
@ your user-id and password at the left and press the
621621
@ "Login" button. Your user name will be stored in a browser cookie.
622622
@ You must configure your web browser to accept cookies in order for
623623
@ the login to take.</p>
624624
if( db_get_boolean("self-register", 0) ){
625
- @ <p>If you do not have an account, you can
625
+ @ <p>If you do not have an account, you can
626626
@ <a href="%s(g.zTop)/register?g=%T(P("G"))">create one</a>.
627627
}
628628
if( zAnonPw ){
629629
unsigned int uSeed = captcha_seed();
630630
char const *zDecoded = captcha_decode(uSeed);
@@ -672,11 +672,11 @@
672672
style_footer();
673673
}
674674
675675
/*
676676
** Attempt to find login credentials for user zLogin on a peer repository
677
-** with project code zCode. Transfer those credentials to the local
677
+** with project code zCode. Transfer those credentials to the local
678678
** repository.
679679
**
680680
** Return true if a transfer was made and false if not.
681681
*/
682682
static int login_transfer_credentials(
@@ -690,11 +690,11 @@
690690
char *zSQL; /* SQL of the query against other repo */
691691
char *zOtherRepo; /* Filename of the other repository */
692692
int rc; /* Result code from SQLite library functions */
693693
int nXfer = 0; /* Number of credentials transferred */
694694
695
- zOtherRepo = db_text(0,
695
+ zOtherRepo = db_text(0,
696696
"SELECT value FROM config WHERE name='peer-repo-%q'",
697697
zCode
698698
);
699699
if( zOtherRepo==0 ) return 0; /* No such peer repository */
700700
@@ -752,11 +752,11 @@
752752
int uid;
753753
if( fossil_strcmp(zLogin, "anonymous")==0 ) return 0;
754754
if( fossil_strcmp(zLogin, "nobody")==0 ) return 0;
755755
if( fossil_strcmp(zLogin, "developer")==0 ) return 0;
756756
if( fossil_strcmp(zLogin, "reader")==0 ) return 0;
757
- uid = db_int(0,
757
+ uid = db_int(0,
758758
"SELECT uid FROM user"
759759
" WHERE login=%Q"
760760
" AND ipaddr=%Q"
761761
" AND cexpire>julianday('now')"
762762
" AND length(cap)>0"
@@ -792,11 +792,11 @@
792792
793793
sqlite3_create_function(g.db, "constant_time_cmp", 2, SQLITE_UTF8, 0,
794794
constant_time_cmp_function, 0, 0);
795795
796796
/* If the HTTP connection is coming over 127.0.0.1 and if
797
- ** local login is disabled and if we are using HTTP and not HTTPS,
797
+ ** local login is disabled and if we are using HTTP and not HTTPS,
798798
** then there is no need to check user credentials.
799799
**
800800
** This feature allows the "fossil ui" command to give the user
801801
** full access rights without having to log in.
802802
*/
@@ -847,15 +847,15 @@
847847
** SECRET is the "captcha-secret" value in the repository.
848848
*/
849849
double rTime = atof(zArg);
850850
Blob b;
851851
blob_zero(&b);
852
- blob_appendf(&b, "%s/%s/%s",
852
+ blob_appendf(&b, "%s/%s/%s",
853853
zArg, zRemoteAddr, db_get("captcha-secret",""));
854854
sha1sum_blob(&b, &b);
855855
if( fossil_strcmp(zHash, blob_str(&b))==0 ){
856
- uid = db_int(0,
856
+ uid = db_int(0,
857857
"SELECT uid FROM user WHERE login='anonymous'"
858858
" AND length(cap)>0"
859859
" AND length(pw)>0"
860860
" AND %.17g+0.25>julianday('now')",
861861
rTime
@@ -1002,11 +1002,11 @@
10021002
for(i=0; zCap[i]; i++){
10031003
switch( zCap[i] ){
10041004
case 's': g.perm.Setup = 1; /* Fall thru into Admin */
10051005
case 'a': g.perm.Admin = g.perm.RdTkt = g.perm.WrTkt = g.perm.Zip =
10061006
g.perm.RdWiki = g.perm.WrWiki = g.perm.NewWiki =
1007
- g.perm.ApndWiki = g.perm.Hyperlink = g.perm.Clone =
1007
+ g.perm.ApndWiki = g.perm.Hyperlink = g.perm.Clone =
10081008
g.perm.NewTkt = g.perm.Password = g.perm.RdAddr =
10091009
g.perm.TktFmt = g.perm.Attach = g.perm.ApndTkt =
10101010
g.perm.ModWiki = g.perm.ModTkt = 1;
10111011
/* Fall thru into Read/Write */
10121012
case 'i': g.perm.Read = g.perm.Write = 1; break;
@@ -1025,19 +1025,19 @@
10251025
case 'l': g.perm.ModWiki = 1; break;
10261026
10271027
case 'e': g.perm.RdAddr = 1; break;
10281028
case 'r': g.perm.RdTkt = 1; break;
10291029
case 'n': g.perm.NewTkt = 1; break;
1030
- case 'w': g.perm.WrTkt = g.perm.RdTkt = g.perm.NewTkt =
1030
+ case 'w': g.perm.WrTkt = g.perm.RdTkt = g.perm.NewTkt =
10311031
g.perm.ApndTkt = 1; break;
10321032
case 'c': g.perm.ApndTkt = 1; break;
10331033
case 'q': g.perm.ModTkt = 1; break;
10341034
case 't': g.perm.TktFmt = 1; break;
10351035
case 'b': g.perm.Attach = 1; break;
10361036
case 'x': g.perm.Private = 1; break;
10371037
1038
- /* The "u" privileges is a little different. It recursively
1038
+ /* The "u" privileges is a little different. It recursively
10391039
** inherits all privileges of the user named "reader" */
10401040
case 'u': {
10411041
if( (flags & LOGIN_IGNORE_UV)==0 ){
10421042
const char *zUser;
10431043
zUser = db_text("", "SELECT cap FROM user WHERE login='reader'");
@@ -1044,11 +1044,11 @@
10441044
login_set_capabilities(zUser, flags | LOGIN_IGNORE_UV);
10451045
}
10461046
break;
10471047
}
10481048
1049
- /* The "v" privileges is a little different. It recursively
1049
+ /* The "v" privileges is a little different. It recursively
10501050
** inherits all privileges of the user named "developer" */
10511051
case 'v': {
10521052
if( (flags & LOGIN_IGNORE_UV)==0 ){
10531053
const char *zDev;
10541054
zDev = db_text("", "SELECT cap FROM user WHERE login='developer'");
@@ -1359,11 +1359,11 @@
13591359
if( zPrefix==0 ) zPrefix = "";
13601360
if( zSuffix==0 ) zSuffix = "";
13611361
if( pzErrorMsg ) *pzErrorMsg = 0;
13621362
zSelfCode = abbreviated_project_code(db_get("project-code", "x"));
13631363
blob_zero(&err);
1364
- db_prepare(&q,
1364
+ db_prepare(&q,
13651365
"SELECT name, value FROM config"
13661366
" WHERE name GLOB 'peer-repo-*'"
13671367
" AND name <> 'peer-repo-%q'"
13681368
" ORDER BY +value",
13691369
zSelfCode
@@ -1441,11 +1441,11 @@
14411441
const char *zSelf; /* The ATTACH name of our repository */
14421442
14431443
*pzErrMsg = 0; /* Default to no errors */
14441444
zSelf = db_name("repository");
14451445
1446
- /* Get the full pathname of the other repository */
1446
+ /* Get the full pathname of the other repository */
14471447
file_canonical_name(zRepo, &fullName, 0);
14481448
zRepo = mprintf(blob_str(&fullName));
14491449
blob_reset(&fullName);
14501450
14511451
/* Get the full pathname for our repository. Also the project code
14521452
--- src/login.c
+++ src/login.c
@@ -41,11 +41,11 @@
41 ** logs and downloading diffs of very version of the archive that
42 ** has ever existed, and things like that.
43 */
44 #include "config.h"
45 #include "login.h"
46 #if defined(_WIN32)
47 # include <windows.h> /* for Sleep */
48 # if defined(__MINGW32__) || defined(_MSC_VER)
49 # define sleep Sleep /* windows does not have sleep, but Sleep */
50 # endif
51 #endif
@@ -112,13 +112,13 @@
112 }
113 }
114
115 /*
116 ** The IP address of the client is stored as part of login cookies.
117 ** But some clients are behind firewalls that shift the IP address
118 ** with each HTTP request. To allow such (broken) clients to log in,
119 ** extract just a prefix of the IP address.
120 */
121 static char *ipPrefix(const char *zIP){
122 int i, j;
123 static int ip_prefix_terms = -1;
124 if( ip_prefix_terms<0 ){
@@ -344,11 +344,11 @@
344 */
345 void login_clear_login_data(){
346 if(!g.userUid){
347 return;
348 }else{
349 char const * cookie = login_cookie_name();
350 /* To logout, change the cookie value to an empty string */
351 cgi_set_cookie(cookie, "",
352 login_cookie_path(), -86400);
353 db_multi_exec("UPDATE user SET cookie=NULL, ipaddr=NULL, "
354 " cexpire=0 WHERE uid=%d"
@@ -491,21 +491,21 @@
491 /* The user requests a password change */
492 zSha1Pw = sha1_shared_secret(zPasswd, g.zLogin, 0);
493 if( db_int(1, "SELECT 0 FROM user"
494 " WHERE uid=%d"
495 " AND (constant_time_cmp(pw,%Q)=0"
496 " OR constant_time_cmp(pw,%Q)=0)",
497 g.userUid, zSha1Pw, zPasswd) ){
498 sleep(1);
499 zErrMsg =
500 @ <p><span class="loginError">
501 @ You entered an incorrect old password while attempting to change
502 @ your password. Your password is unchanged.
503 @ </span></p>
504 ;
505 }else if( fossil_strcmp(zNew1,zNew2)!=0 ){
506 zErrMsg =
507 @ <p><span class="loginError">
508 @ The two copies of your new passwords do not match.
509 @ Your password is unchanged.
510 @ </span></p>
511 ;
@@ -544,11 +544,11 @@
544 /* Attempting to log in as a user other than anonymous.
545 */
546 uid = login_search_uid(zUsername, zPasswd);
547 if( uid<=0 ){
548 sleep(1);
549 zErrMsg =
550 @ <p><span class="loginError">
551 @ You entered an unknown user or an incorrect password.
552 @ </span></p>
553 ;
554 record_login_attempt(zUsername, zIpAddr, 0);
@@ -620,11 +620,11 @@
620 @ your user-id and password at the left and press the
621 @ "Login" button. Your user name will be stored in a browser cookie.
622 @ You must configure your web browser to accept cookies in order for
623 @ the login to take.</p>
624 if( db_get_boolean("self-register", 0) ){
625 @ <p>If you do not have an account, you can
626 @ <a href="%s(g.zTop)/register?g=%T(P("G"))">create one</a>.
627 }
628 if( zAnonPw ){
629 unsigned int uSeed = captcha_seed();
630 char const *zDecoded = captcha_decode(uSeed);
@@ -672,11 +672,11 @@
672 style_footer();
673 }
674
675 /*
676 ** Attempt to find login credentials for user zLogin on a peer repository
677 ** with project code zCode. Transfer those credentials to the local
678 ** repository.
679 **
680 ** Return true if a transfer was made and false if not.
681 */
682 static int login_transfer_credentials(
@@ -690,11 +690,11 @@
690 char *zSQL; /* SQL of the query against other repo */
691 char *zOtherRepo; /* Filename of the other repository */
692 int rc; /* Result code from SQLite library functions */
693 int nXfer = 0; /* Number of credentials transferred */
694
695 zOtherRepo = db_text(0,
696 "SELECT value FROM config WHERE name='peer-repo-%q'",
697 zCode
698 );
699 if( zOtherRepo==0 ) return 0; /* No such peer repository */
700
@@ -752,11 +752,11 @@
752 int uid;
753 if( fossil_strcmp(zLogin, "anonymous")==0 ) return 0;
754 if( fossil_strcmp(zLogin, "nobody")==0 ) return 0;
755 if( fossil_strcmp(zLogin, "developer")==0 ) return 0;
756 if( fossil_strcmp(zLogin, "reader")==0 ) return 0;
757 uid = db_int(0,
758 "SELECT uid FROM user"
759 " WHERE login=%Q"
760 " AND ipaddr=%Q"
761 " AND cexpire>julianday('now')"
762 " AND length(cap)>0"
@@ -792,11 +792,11 @@
792
793 sqlite3_create_function(g.db, "constant_time_cmp", 2, SQLITE_UTF8, 0,
794 constant_time_cmp_function, 0, 0);
795
796 /* If the HTTP connection is coming over 127.0.0.1 and if
797 ** local login is disabled and if we are using HTTP and not HTTPS,
798 ** then there is no need to check user credentials.
799 **
800 ** This feature allows the "fossil ui" command to give the user
801 ** full access rights without having to log in.
802 */
@@ -847,15 +847,15 @@
847 ** SECRET is the "captcha-secret" value in the repository.
848 */
849 double rTime = atof(zArg);
850 Blob b;
851 blob_zero(&b);
852 blob_appendf(&b, "%s/%s/%s",
853 zArg, zRemoteAddr, db_get("captcha-secret",""));
854 sha1sum_blob(&b, &b);
855 if( fossil_strcmp(zHash, blob_str(&b))==0 ){
856 uid = db_int(0,
857 "SELECT uid FROM user WHERE login='anonymous'"
858 " AND length(cap)>0"
859 " AND length(pw)>0"
860 " AND %.17g+0.25>julianday('now')",
861 rTime
@@ -1002,11 +1002,11 @@
1002 for(i=0; zCap[i]; i++){
1003 switch( zCap[i] ){
1004 case 's': g.perm.Setup = 1; /* Fall thru into Admin */
1005 case 'a': g.perm.Admin = g.perm.RdTkt = g.perm.WrTkt = g.perm.Zip =
1006 g.perm.RdWiki = g.perm.WrWiki = g.perm.NewWiki =
1007 g.perm.ApndWiki = g.perm.Hyperlink = g.perm.Clone =
1008 g.perm.NewTkt = g.perm.Password = g.perm.RdAddr =
1009 g.perm.TktFmt = g.perm.Attach = g.perm.ApndTkt =
1010 g.perm.ModWiki = g.perm.ModTkt = 1;
1011 /* Fall thru into Read/Write */
1012 case 'i': g.perm.Read = g.perm.Write = 1; break;
@@ -1025,19 +1025,19 @@
1025 case 'l': g.perm.ModWiki = 1; break;
1026
1027 case 'e': g.perm.RdAddr = 1; break;
1028 case 'r': g.perm.RdTkt = 1; break;
1029 case 'n': g.perm.NewTkt = 1; break;
1030 case 'w': g.perm.WrTkt = g.perm.RdTkt = g.perm.NewTkt =
1031 g.perm.ApndTkt = 1; break;
1032 case 'c': g.perm.ApndTkt = 1; break;
1033 case 'q': g.perm.ModTkt = 1; break;
1034 case 't': g.perm.TktFmt = 1; break;
1035 case 'b': g.perm.Attach = 1; break;
1036 case 'x': g.perm.Private = 1; break;
1037
1038 /* The "u" privileges is a little different. It recursively
1039 ** inherits all privileges of the user named "reader" */
1040 case 'u': {
1041 if( (flags & LOGIN_IGNORE_UV)==0 ){
1042 const char *zUser;
1043 zUser = db_text("", "SELECT cap FROM user WHERE login='reader'");
@@ -1044,11 +1044,11 @@
1044 login_set_capabilities(zUser, flags | LOGIN_IGNORE_UV);
1045 }
1046 break;
1047 }
1048
1049 /* The "v" privileges is a little different. It recursively
1050 ** inherits all privileges of the user named "developer" */
1051 case 'v': {
1052 if( (flags & LOGIN_IGNORE_UV)==0 ){
1053 const char *zDev;
1054 zDev = db_text("", "SELECT cap FROM user WHERE login='developer'");
@@ -1359,11 +1359,11 @@
1359 if( zPrefix==0 ) zPrefix = "";
1360 if( zSuffix==0 ) zSuffix = "";
1361 if( pzErrorMsg ) *pzErrorMsg = 0;
1362 zSelfCode = abbreviated_project_code(db_get("project-code", "x"));
1363 blob_zero(&err);
1364 db_prepare(&q,
1365 "SELECT name, value FROM config"
1366 " WHERE name GLOB 'peer-repo-*'"
1367 " AND name <> 'peer-repo-%q'"
1368 " ORDER BY +value",
1369 zSelfCode
@@ -1441,11 +1441,11 @@
1441 const char *zSelf; /* The ATTACH name of our repository */
1442
1443 *pzErrMsg = 0; /* Default to no errors */
1444 zSelf = db_name("repository");
1445
1446 /* Get the full pathname of the other repository */
1447 file_canonical_name(zRepo, &fullName, 0);
1448 zRepo = mprintf(blob_str(&fullName));
1449 blob_reset(&fullName);
1450
1451 /* Get the full pathname for our repository. Also the project code
1452
--- src/login.c
+++ src/login.c
@@ -41,11 +41,11 @@
41 ** logs and downloading diffs of very version of the archive that
42 ** has ever existed, and things like that.
43 */
44 #include "config.h"
45 #include "login.h"
46 #if defined(_WIN32)
47 # include <windows.h> /* for Sleep */
48 # if defined(__MINGW32__) || defined(_MSC_VER)
49 # define sleep Sleep /* windows does not have sleep, but Sleep */
50 # endif
51 #endif
@@ -112,13 +112,13 @@
112 }
113 }
114
115 /*
116 ** The IP address of the client is stored as part of login cookies.
117 ** But some clients are behind firewalls that shift the IP address
118 ** with each HTTP request. To allow such (broken) clients to log in,
119 ** extract just a prefix of the IP address.
120 */
121 static char *ipPrefix(const char *zIP){
122 int i, j;
123 static int ip_prefix_terms = -1;
124 if( ip_prefix_terms<0 ){
@@ -344,11 +344,11 @@
344 */
345 void login_clear_login_data(){
346 if(!g.userUid){
347 return;
348 }else{
349 char const * cookie = login_cookie_name();
350 /* To logout, change the cookie value to an empty string */
351 cgi_set_cookie(cookie, "",
352 login_cookie_path(), -86400);
353 db_multi_exec("UPDATE user SET cookie=NULL, ipaddr=NULL, "
354 " cexpire=0 WHERE uid=%d"
@@ -491,21 +491,21 @@
491 /* The user requests a password change */
492 zSha1Pw = sha1_shared_secret(zPasswd, g.zLogin, 0);
493 if( db_int(1, "SELECT 0 FROM user"
494 " WHERE uid=%d"
495 " AND (constant_time_cmp(pw,%Q)=0"
496 " OR constant_time_cmp(pw,%Q)=0)",
497 g.userUid, zSha1Pw, zPasswd) ){
498 sleep(1);
499 zErrMsg =
500 @ <p><span class="loginError">
501 @ You entered an incorrect old password while attempting to change
502 @ your password. Your password is unchanged.
503 @ </span></p>
504 ;
505 }else if( fossil_strcmp(zNew1,zNew2)!=0 ){
506 zErrMsg =
507 @ <p><span class="loginError">
508 @ The two copies of your new passwords do not match.
509 @ Your password is unchanged.
510 @ </span></p>
511 ;
@@ -544,11 +544,11 @@
544 /* Attempting to log in as a user other than anonymous.
545 */
546 uid = login_search_uid(zUsername, zPasswd);
547 if( uid<=0 ){
548 sleep(1);
549 zErrMsg =
550 @ <p><span class="loginError">
551 @ You entered an unknown user or an incorrect password.
552 @ </span></p>
553 ;
554 record_login_attempt(zUsername, zIpAddr, 0);
@@ -620,11 +620,11 @@
620 @ your user-id and password at the left and press the
621 @ "Login" button. Your user name will be stored in a browser cookie.
622 @ You must configure your web browser to accept cookies in order for
623 @ the login to take.</p>
624 if( db_get_boolean("self-register", 0) ){
625 @ <p>If you do not have an account, you can
626 @ <a href="%s(g.zTop)/register?g=%T(P("G"))">create one</a>.
627 }
628 if( zAnonPw ){
629 unsigned int uSeed = captcha_seed();
630 char const *zDecoded = captcha_decode(uSeed);
@@ -672,11 +672,11 @@
672 style_footer();
673 }
674
675 /*
676 ** Attempt to find login credentials for user zLogin on a peer repository
677 ** with project code zCode. Transfer those credentials to the local
678 ** repository.
679 **
680 ** Return true if a transfer was made and false if not.
681 */
682 static int login_transfer_credentials(
@@ -690,11 +690,11 @@
690 char *zSQL; /* SQL of the query against other repo */
691 char *zOtherRepo; /* Filename of the other repository */
692 int rc; /* Result code from SQLite library functions */
693 int nXfer = 0; /* Number of credentials transferred */
694
695 zOtherRepo = db_text(0,
696 "SELECT value FROM config WHERE name='peer-repo-%q'",
697 zCode
698 );
699 if( zOtherRepo==0 ) return 0; /* No such peer repository */
700
@@ -752,11 +752,11 @@
752 int uid;
753 if( fossil_strcmp(zLogin, "anonymous")==0 ) return 0;
754 if( fossil_strcmp(zLogin, "nobody")==0 ) return 0;
755 if( fossil_strcmp(zLogin, "developer")==0 ) return 0;
756 if( fossil_strcmp(zLogin, "reader")==0 ) return 0;
757 uid = db_int(0,
758 "SELECT uid FROM user"
759 " WHERE login=%Q"
760 " AND ipaddr=%Q"
761 " AND cexpire>julianday('now')"
762 " AND length(cap)>0"
@@ -792,11 +792,11 @@
792
793 sqlite3_create_function(g.db, "constant_time_cmp", 2, SQLITE_UTF8, 0,
794 constant_time_cmp_function, 0, 0);
795
796 /* If the HTTP connection is coming over 127.0.0.1 and if
797 ** local login is disabled and if we are using HTTP and not HTTPS,
798 ** then there is no need to check user credentials.
799 **
800 ** This feature allows the "fossil ui" command to give the user
801 ** full access rights without having to log in.
802 */
@@ -847,15 +847,15 @@
847 ** SECRET is the "captcha-secret" value in the repository.
848 */
849 double rTime = atof(zArg);
850 Blob b;
851 blob_zero(&b);
852 blob_appendf(&b, "%s/%s/%s",
853 zArg, zRemoteAddr, db_get("captcha-secret",""));
854 sha1sum_blob(&b, &b);
855 if( fossil_strcmp(zHash, blob_str(&b))==0 ){
856 uid = db_int(0,
857 "SELECT uid FROM user WHERE login='anonymous'"
858 " AND length(cap)>0"
859 " AND length(pw)>0"
860 " AND %.17g+0.25>julianday('now')",
861 rTime
@@ -1002,11 +1002,11 @@
1002 for(i=0; zCap[i]; i++){
1003 switch( zCap[i] ){
1004 case 's': g.perm.Setup = 1; /* Fall thru into Admin */
1005 case 'a': g.perm.Admin = g.perm.RdTkt = g.perm.WrTkt = g.perm.Zip =
1006 g.perm.RdWiki = g.perm.WrWiki = g.perm.NewWiki =
1007 g.perm.ApndWiki = g.perm.Hyperlink = g.perm.Clone =
1008 g.perm.NewTkt = g.perm.Password = g.perm.RdAddr =
1009 g.perm.TktFmt = g.perm.Attach = g.perm.ApndTkt =
1010 g.perm.ModWiki = g.perm.ModTkt = 1;
1011 /* Fall thru into Read/Write */
1012 case 'i': g.perm.Read = g.perm.Write = 1; break;
@@ -1025,19 +1025,19 @@
1025 case 'l': g.perm.ModWiki = 1; break;
1026
1027 case 'e': g.perm.RdAddr = 1; break;
1028 case 'r': g.perm.RdTkt = 1; break;
1029 case 'n': g.perm.NewTkt = 1; break;
1030 case 'w': g.perm.WrTkt = g.perm.RdTkt = g.perm.NewTkt =
1031 g.perm.ApndTkt = 1; break;
1032 case 'c': g.perm.ApndTkt = 1; break;
1033 case 'q': g.perm.ModTkt = 1; break;
1034 case 't': g.perm.TktFmt = 1; break;
1035 case 'b': g.perm.Attach = 1; break;
1036 case 'x': g.perm.Private = 1; break;
1037
1038 /* The "u" privileges is a little different. It recursively
1039 ** inherits all privileges of the user named "reader" */
1040 case 'u': {
1041 if( (flags & LOGIN_IGNORE_UV)==0 ){
1042 const char *zUser;
1043 zUser = db_text("", "SELECT cap FROM user WHERE login='reader'");
@@ -1044,11 +1044,11 @@
1044 login_set_capabilities(zUser, flags | LOGIN_IGNORE_UV);
1045 }
1046 break;
1047 }
1048
1049 /* The "v" privileges is a little different. It recursively
1050 ** inherits all privileges of the user named "developer" */
1051 case 'v': {
1052 if( (flags & LOGIN_IGNORE_UV)==0 ){
1053 const char *zDev;
1054 zDev = db_text("", "SELECT cap FROM user WHERE login='developer'");
@@ -1359,11 +1359,11 @@
1359 if( zPrefix==0 ) zPrefix = "";
1360 if( zSuffix==0 ) zSuffix = "";
1361 if( pzErrorMsg ) *pzErrorMsg = 0;
1362 zSelfCode = abbreviated_project_code(db_get("project-code", "x"));
1363 blob_zero(&err);
1364 db_prepare(&q,
1365 "SELECT name, value FROM config"
1366 " WHERE name GLOB 'peer-repo-*'"
1367 " AND name <> 'peer-repo-%q'"
1368 " ORDER BY +value",
1369 zSelfCode
@@ -1441,11 +1441,11 @@
1441 const char *zSelf; /* The ATTACH name of our repository */
1442
1443 *pzErrMsg = 0; /* Default to no errors */
1444 zSelf = db_name("repository");
1445
1446 /* Get the full pathname of the other repository */
1447 file_canonical_name(zRepo, &fullName, 0);
1448 zRepo = mprintf(blob_str(&fullName));
1449 blob_reset(&fullName);
1450
1451 /* Get the full pathname for our repository. Also the project code
1452
+1 -1
--- src/merge3.c
+++ src/merge3.c
@@ -364,11 +364,11 @@
364364
**
365365
** fossil 3-way-merge Xbase.c Xlocal.c Xup.c Xlocal.c
366366
** cp Xup.c Xbase.c
367367
** # Verify that everything still works
368368
** fossil commit
369
-**
369
+**
370370
*/
371371
void delta_3waymerge_cmd(void){
372372
Blob pivot, v1, v2, merged;
373373
if( g.argc!=6 ){
374374
usage("PIVOT V1 V2 MERGED");
375375
--- src/merge3.c
+++ src/merge3.c
@@ -364,11 +364,11 @@
364 **
365 ** fossil 3-way-merge Xbase.c Xlocal.c Xup.c Xlocal.c
366 ** cp Xup.c Xbase.c
367 ** # Verify that everything still works
368 ** fossil commit
369 **
370 */
371 void delta_3waymerge_cmd(void){
372 Blob pivot, v1, v2, merged;
373 if( g.argc!=6 ){
374 usage("PIVOT V1 V2 MERGED");
375
--- src/merge3.c
+++ src/merge3.c
@@ -364,11 +364,11 @@
364 **
365 ** fossil 3-way-merge Xbase.c Xlocal.c Xup.c Xlocal.c
366 ** cp Xup.c Xbase.c
367 ** # Verify that everything still works
368 ** fossil commit
369 **
370 */
371 void delta_3waymerge_cmd(void){
372 Blob pivot, v1, v2, merged;
373 if( g.argc!=6 ){
374 usage("PIVOT V1 V2 MERGED");
375
+14 -14
--- src/report.c
+++ src/report.c
@@ -12,11 +12,11 @@
1212
** Author contact information:
1313
** [email protected]
1414
** http://www.hwaci.com/drh/
1515
**
1616
*******************************************************************************
17
-**
17
+**
1818
** Code to generate the ticket listings
1919
*/
2020
#include "config.h"
2121
#include <time.h>
2222
#include "report.h"
@@ -43,11 +43,11 @@
4343
if( !g.perm.RdTkt && !g.perm.NewTkt ){ login_needed(); return; }
4444
style_header("Ticket Main Menu");
4545
if( g.thTrace ) Th_Trace("BEGIN_REPORTLIST<br />\n", -1);
4646
zScript = ticket_reportlist_code();
4747
if( g.thTrace ) Th_Trace("BEGIN_REPORTLIST_SCRIPT<br />\n", -1);
48
-
48
+
4949
blob_zero(&ril);
5050
ticket_init();
5151
5252
db_prepare(&q, "SELECT rn, title, owner FROM reportfmt ORDER BY title");
5353
while( db_step(&q)==SQLITE_ROW ){
@@ -70,14 +70,14 @@
7070
}
7171
if( g.perm.TktFmt ){
7272
blob_appendf(&ril, "[%zcopy</a>] ",
7373
href("%R/rptedit?rn=%d&copy=1", rn));
7474
}
75
- if( g.perm.Admin
75
+ if( g.perm.Admin
7676
|| (g.perm.WrTkt && zOwner && fossil_strcmp(g.zLogin,zOwner)==0)
7777
){
78
- blob_appendf(&ril, "[%zedit</a>]",
78
+ blob_appendf(&ril, "[%zedit</a>]",
7979
href("%R/rptedit?rn=%d", rn));
8080
}
8181
if( g.perm.TktFmt ){
8282
blob_appendf(&ril, "[%zsql</a>]",
8383
href("%R/rptsql?rn=%d", rn));
@@ -85,13 +85,13 @@
8585
blob_appendf(&ril, "</li>\n");
8686
}
8787
db_finalize(&q);
8888
8989
Th_Store("report_items", blob_str(&ril));
90
-
90
+
9191
Th_Render(zScript);
92
-
92
+
9393
blob_reset(&ril);
9494
if( g.thTrace ) Th_Trace("END_REPORTLIST<br />\n", -1);
9595
9696
style_footer();
9797
}
@@ -205,11 +205,11 @@
205205
}
206206
case SQLITE_RECURSIVE: {
207207
*(char**)pError = mprintf("recursive queries are not allowed");
208208
rc = SQLITE_DENY;
209209
break;
210
- }
210
+ }
211211
default: {
212212
*(char**)pError = mprintf("only SELECT statements are allowed");
213213
rc = SQLITE_DENY;
214214
break;
215215
}
@@ -262,11 +262,11 @@
262262
return mprintf("Semi-colon detected! "
263263
"Only a single SQL statement is allowed");
264264
}
265265
}
266266
}
267
-
267
+
268268
/* Compile the statement and check for illegal accesses or syntax errors. */
269269
report_restrict_sql(&zErr);
270270
rc = sqlite3_prepare(g.db, zSql, -1, &pStmt, &zTail);
271271
if( rc!=SQLITE_OK ){
272272
zErr = mprintf("Syntax error: %s", sqlite3_errmsg(g.db));
@@ -383,11 +383,11 @@
383383
}
384384
if( zTitle && zSQL ){
385385
if( zSQL[0]==0 ){
386386
zErr = "Please supply an SQL query statement";
387387
}else if( (zTitle = trim_string(zTitle))[0]==0 ){
388
- zErr = "Please supply a title";
388
+ zErr = "Please supply a title";
389389
}else{
390390
zErr = verify_sql_statement(zSQL);
391391
}
392392
if( zErr==0
393393
&& db_exists("SELECT 1 FROM reportfmt WHERE title=%Q and rn<>%d",
@@ -1065,13 +1065,13 @@
10651065
count = 0;
10661066
if( !tabs ){
10671067
struct GenerateHTML sState;
10681068
10691069
db_multi_exec("PRAGMA empty_result_callbacks=ON");
1070
- style_submenu_element("Raw", "Raw",
1070
+ style_submenu_element("Raw", "Raw",
10711071
"rptview?tablist=1&%h", PD("QUERY_STRING",""));
1072
- if( g.perm.Admin
1072
+ if( g.perm.Admin
10731073
|| (g.perm.TktFmt && g.zLogin && fossil_strcmp(g.zLogin,zOwner)==0) ){
10741074
style_submenu_element("Edit", "Edit", "rptedit?rn=%d", rn);
10751075
}
10761076
if( g.perm.TktFmt ){
10771077
style_submenu_element("SQL", "SQL", "rptsql?rn=%d",rn);
@@ -1079,11 +1079,11 @@
10791079
if( g.perm.NewTkt ){
10801080
style_submenu_element("New Ticket", "Create a new ticket",
10811081
"%s/tktnew", g.zTop);
10821082
}
10831083
style_header(zTitle);
1084
- output_color_key(zClrKey, 1,
1084
+ output_color_key(zClrKey, 1,
10851085
"border=\"0\" cellpadding=\"3\" cellspacing=\"0\" class=\"report\"");
10861086
@ <table border="1" cellpadding="2" cellspacing="0" class="report"
10871087
@ id="reportTable">
10881088
sState.rn = rn;
10891089
sState.nCount = 0;
@@ -1177,11 +1177,11 @@
11771177
if( j>i ){
11781178
fossil_print("%*s", j-i, "");
11791179
}
11801180
z += j;
11811181
}
1182
- break;
1182
+ break;
11831183
}
11841184
}
11851185
11861186
/*
11871187
** Output a row as a tab-separated line of text.
@@ -1212,11 +1212,11 @@
12121212
/*
12131213
** Generate a report. The rn query parameter is the report number.
12141214
** The output is written to stdout as flat file. The zFilter parameter
12151215
** is a full WHERE-condition.
12161216
*/
1217
-void rptshow(
1217
+void rptshow(
12181218
const char *zRep,
12191219
const char *zSepIn,
12201220
const char *zFilter,
12211221
tTktShowEncoding enc
12221222
){
12231223
--- src/report.c
+++ src/report.c
@@ -12,11 +12,11 @@
12 ** Author contact information:
13 ** [email protected]
14 ** http://www.hwaci.com/drh/
15 **
16 *******************************************************************************
17 **
18 ** Code to generate the ticket listings
19 */
20 #include "config.h"
21 #include <time.h>
22 #include "report.h"
@@ -43,11 +43,11 @@
43 if( !g.perm.RdTkt && !g.perm.NewTkt ){ login_needed(); return; }
44 style_header("Ticket Main Menu");
45 if( g.thTrace ) Th_Trace("BEGIN_REPORTLIST<br />\n", -1);
46 zScript = ticket_reportlist_code();
47 if( g.thTrace ) Th_Trace("BEGIN_REPORTLIST_SCRIPT<br />\n", -1);
48
49 blob_zero(&ril);
50 ticket_init();
51
52 db_prepare(&q, "SELECT rn, title, owner FROM reportfmt ORDER BY title");
53 while( db_step(&q)==SQLITE_ROW ){
@@ -70,14 +70,14 @@
70 }
71 if( g.perm.TktFmt ){
72 blob_appendf(&ril, "[%zcopy</a>] ",
73 href("%R/rptedit?rn=%d&copy=1", rn));
74 }
75 if( g.perm.Admin
76 || (g.perm.WrTkt && zOwner && fossil_strcmp(g.zLogin,zOwner)==0)
77 ){
78 blob_appendf(&ril, "[%zedit</a>]",
79 href("%R/rptedit?rn=%d", rn));
80 }
81 if( g.perm.TktFmt ){
82 blob_appendf(&ril, "[%zsql</a>]",
83 href("%R/rptsql?rn=%d", rn));
@@ -85,13 +85,13 @@
85 blob_appendf(&ril, "</li>\n");
86 }
87 db_finalize(&q);
88
89 Th_Store("report_items", blob_str(&ril));
90
91 Th_Render(zScript);
92
93 blob_reset(&ril);
94 if( g.thTrace ) Th_Trace("END_REPORTLIST<br />\n", -1);
95
96 style_footer();
97 }
@@ -205,11 +205,11 @@
205 }
206 case SQLITE_RECURSIVE: {
207 *(char**)pError = mprintf("recursive queries are not allowed");
208 rc = SQLITE_DENY;
209 break;
210 }
211 default: {
212 *(char**)pError = mprintf("only SELECT statements are allowed");
213 rc = SQLITE_DENY;
214 break;
215 }
@@ -262,11 +262,11 @@
262 return mprintf("Semi-colon detected! "
263 "Only a single SQL statement is allowed");
264 }
265 }
266 }
267
268 /* Compile the statement and check for illegal accesses or syntax errors. */
269 report_restrict_sql(&zErr);
270 rc = sqlite3_prepare(g.db, zSql, -1, &pStmt, &zTail);
271 if( rc!=SQLITE_OK ){
272 zErr = mprintf("Syntax error: %s", sqlite3_errmsg(g.db));
@@ -383,11 +383,11 @@
383 }
384 if( zTitle && zSQL ){
385 if( zSQL[0]==0 ){
386 zErr = "Please supply an SQL query statement";
387 }else if( (zTitle = trim_string(zTitle))[0]==0 ){
388 zErr = "Please supply a title";
389 }else{
390 zErr = verify_sql_statement(zSQL);
391 }
392 if( zErr==0
393 && db_exists("SELECT 1 FROM reportfmt WHERE title=%Q and rn<>%d",
@@ -1065,13 +1065,13 @@
1065 count = 0;
1066 if( !tabs ){
1067 struct GenerateHTML sState;
1068
1069 db_multi_exec("PRAGMA empty_result_callbacks=ON");
1070 style_submenu_element("Raw", "Raw",
1071 "rptview?tablist=1&%h", PD("QUERY_STRING",""));
1072 if( g.perm.Admin
1073 || (g.perm.TktFmt && g.zLogin && fossil_strcmp(g.zLogin,zOwner)==0) ){
1074 style_submenu_element("Edit", "Edit", "rptedit?rn=%d", rn);
1075 }
1076 if( g.perm.TktFmt ){
1077 style_submenu_element("SQL", "SQL", "rptsql?rn=%d",rn);
@@ -1079,11 +1079,11 @@
1079 if( g.perm.NewTkt ){
1080 style_submenu_element("New Ticket", "Create a new ticket",
1081 "%s/tktnew", g.zTop);
1082 }
1083 style_header(zTitle);
1084 output_color_key(zClrKey, 1,
1085 "border=\"0\" cellpadding=\"3\" cellspacing=\"0\" class=\"report\"");
1086 @ <table border="1" cellpadding="2" cellspacing="0" class="report"
1087 @ id="reportTable">
1088 sState.rn = rn;
1089 sState.nCount = 0;
@@ -1177,11 +1177,11 @@
1177 if( j>i ){
1178 fossil_print("%*s", j-i, "");
1179 }
1180 z += j;
1181 }
1182 break;
1183 }
1184 }
1185
1186 /*
1187 ** Output a row as a tab-separated line of text.
@@ -1212,11 +1212,11 @@
1212 /*
1213 ** Generate a report. The rn query parameter is the report number.
1214 ** The output is written to stdout as flat file. The zFilter parameter
1215 ** is a full WHERE-condition.
1216 */
1217 void rptshow(
1218 const char *zRep,
1219 const char *zSepIn,
1220 const char *zFilter,
1221 tTktShowEncoding enc
1222 ){
1223
--- src/report.c
+++ src/report.c
@@ -12,11 +12,11 @@
12 ** Author contact information:
13 ** [email protected]
14 ** http://www.hwaci.com/drh/
15 **
16 *******************************************************************************
17 **
18 ** Code to generate the ticket listings
19 */
20 #include "config.h"
21 #include <time.h>
22 #include "report.h"
@@ -43,11 +43,11 @@
43 if( !g.perm.RdTkt && !g.perm.NewTkt ){ login_needed(); return; }
44 style_header("Ticket Main Menu");
45 if( g.thTrace ) Th_Trace("BEGIN_REPORTLIST<br />\n", -1);
46 zScript = ticket_reportlist_code();
47 if( g.thTrace ) Th_Trace("BEGIN_REPORTLIST_SCRIPT<br />\n", -1);
48
49 blob_zero(&ril);
50 ticket_init();
51
52 db_prepare(&q, "SELECT rn, title, owner FROM reportfmt ORDER BY title");
53 while( db_step(&q)==SQLITE_ROW ){
@@ -70,14 +70,14 @@
70 }
71 if( g.perm.TktFmt ){
72 blob_appendf(&ril, "[%zcopy</a>] ",
73 href("%R/rptedit?rn=%d&copy=1", rn));
74 }
75 if( g.perm.Admin
76 || (g.perm.WrTkt && zOwner && fossil_strcmp(g.zLogin,zOwner)==0)
77 ){
78 blob_appendf(&ril, "[%zedit</a>]",
79 href("%R/rptedit?rn=%d", rn));
80 }
81 if( g.perm.TktFmt ){
82 blob_appendf(&ril, "[%zsql</a>]",
83 href("%R/rptsql?rn=%d", rn));
@@ -85,13 +85,13 @@
85 blob_appendf(&ril, "</li>\n");
86 }
87 db_finalize(&q);
88
89 Th_Store("report_items", blob_str(&ril));
90
91 Th_Render(zScript);
92
93 blob_reset(&ril);
94 if( g.thTrace ) Th_Trace("END_REPORTLIST<br />\n", -1);
95
96 style_footer();
97 }
@@ -205,11 +205,11 @@
205 }
206 case SQLITE_RECURSIVE: {
207 *(char**)pError = mprintf("recursive queries are not allowed");
208 rc = SQLITE_DENY;
209 break;
210 }
211 default: {
212 *(char**)pError = mprintf("only SELECT statements are allowed");
213 rc = SQLITE_DENY;
214 break;
215 }
@@ -262,11 +262,11 @@
262 return mprintf("Semi-colon detected! "
263 "Only a single SQL statement is allowed");
264 }
265 }
266 }
267
268 /* Compile the statement and check for illegal accesses or syntax errors. */
269 report_restrict_sql(&zErr);
270 rc = sqlite3_prepare(g.db, zSql, -1, &pStmt, &zTail);
271 if( rc!=SQLITE_OK ){
272 zErr = mprintf("Syntax error: %s", sqlite3_errmsg(g.db));
@@ -383,11 +383,11 @@
383 }
384 if( zTitle && zSQL ){
385 if( zSQL[0]==0 ){
386 zErr = "Please supply an SQL query statement";
387 }else if( (zTitle = trim_string(zTitle))[0]==0 ){
388 zErr = "Please supply a title";
389 }else{
390 zErr = verify_sql_statement(zSQL);
391 }
392 if( zErr==0
393 && db_exists("SELECT 1 FROM reportfmt WHERE title=%Q and rn<>%d",
@@ -1065,13 +1065,13 @@
1065 count = 0;
1066 if( !tabs ){
1067 struct GenerateHTML sState;
1068
1069 db_multi_exec("PRAGMA empty_result_callbacks=ON");
1070 style_submenu_element("Raw", "Raw",
1071 "rptview?tablist=1&%h", PD("QUERY_STRING",""));
1072 if( g.perm.Admin
1073 || (g.perm.TktFmt && g.zLogin && fossil_strcmp(g.zLogin,zOwner)==0) ){
1074 style_submenu_element("Edit", "Edit", "rptedit?rn=%d", rn);
1075 }
1076 if( g.perm.TktFmt ){
1077 style_submenu_element("SQL", "SQL", "rptsql?rn=%d",rn);
@@ -1079,11 +1079,11 @@
1079 if( g.perm.NewTkt ){
1080 style_submenu_element("New Ticket", "Create a new ticket",
1081 "%s/tktnew", g.zTop);
1082 }
1083 style_header(zTitle);
1084 output_color_key(zClrKey, 1,
1085 "border=\"0\" cellpadding=\"3\" cellspacing=\"0\" class=\"report\"");
1086 @ <table border="1" cellpadding="2" cellspacing="0" class="report"
1087 @ id="reportTable">
1088 sState.rn = rn;
1089 sState.nCount = 0;
@@ -1177,11 +1177,11 @@
1177 if( j>i ){
1178 fossil_print("%*s", j-i, "");
1179 }
1180 z += j;
1181 }
1182 break;
1183 }
1184 }
1185
1186 /*
1187 ** Output a row as a tab-separated line of text.
@@ -1212,11 +1212,11 @@
1212 /*
1213 ** Generate a report. The rn query parameter is the report number.
1214 ** The output is written to stdout as flat file. The zFilter parameter
1215 ** is a full WHERE-condition.
1216 */
1217 void rptshow(
1218 const char *zRep,
1219 const char *zSepIn,
1220 const char *zFilter,
1221 tTktShowEncoding enc
1222 ){
1223
+1 -1
--- src/search.c
+++ src/search.c
@@ -135,11 +135,11 @@
135135
136136
/* Every term must be seen or else the score is zero */
137137
for(j=0; j<p->nTerm; j++){
138138
if( !seen[j] ) return 0;
139139
}
140
-
140
+
141141
return score;
142142
}
143143
144144
/*
145145
** This is an SQLite function that scores its input using
146146
--- src/search.c
+++ src/search.c
@@ -135,11 +135,11 @@
135
136 /* Every term must be seen or else the score is zero */
137 for(j=0; j<p->nTerm; j++){
138 if( !seen[j] ) return 0;
139 }
140
141 return score;
142 }
143
144 /*
145 ** This is an SQLite function that scores its input using
146
--- src/search.c
+++ src/search.c
@@ -135,11 +135,11 @@
135
136 /* Every term must be seen or else the score is zero */
137 for(j=0; j<p->nTerm; j++){
138 if( !seen[j] ) return 0;
139 }
140
141 return score;
142 }
143
144 /*
145 ** This is an SQLite function that scores its input using
146
+1 -1
--- src/sqlcmd.c
+++ src/sqlcmd.c
@@ -42,11 +42,11 @@
4242
g.db = sqlite3_context_db_handle(context);
4343
g.repositoryOpen = 1;
4444
rid = name_to_rid(zName);
4545
if( rid==0 ) return;
4646
if( content_get(rid, &cx) ){
47
- sqlite3_result_blob(context, blob_buffer(&cx), blob_size(&cx),
47
+ sqlite3_result_blob(context, blob_buffer(&cx), blob_size(&cx),
4848
SQLITE_TRANSIENT);
4949
blob_reset(&cx);
5050
}
5151
}
5252
5353
--- src/sqlcmd.c
+++ src/sqlcmd.c
@@ -42,11 +42,11 @@
42 g.db = sqlite3_context_db_handle(context);
43 g.repositoryOpen = 1;
44 rid = name_to_rid(zName);
45 if( rid==0 ) return;
46 if( content_get(rid, &cx) ){
47 sqlite3_result_blob(context, blob_buffer(&cx), blob_size(&cx),
48 SQLITE_TRANSIENT);
49 blob_reset(&cx);
50 }
51 }
52
53
--- src/sqlcmd.c
+++ src/sqlcmd.c
@@ -42,11 +42,11 @@
42 g.db = sqlite3_context_db_handle(context);
43 g.repositoryOpen = 1;
44 rid = name_to_rid(zName);
45 if( rid==0 ) return;
46 if( content_get(rid, &cx) ){
47 sqlite3_result_blob(context, blob_buffer(&cx), blob_size(&cx),
48 SQLITE_TRANSIENT);
49 blob_reset(&cx);
50 }
51 }
52
53
+12 -12
--- src/vfile.c
+++ src/vfile.c
@@ -45,18 +45,18 @@
4545
** does not exist, then return 0.
4646
**
4747
** For this routine, the UUID must be exact. For a match against
4848
** user input with mixed case, use resolve_uuid().
4949
**
50
-** If the UUID is not found and phantomize is 1 or 2, then attempt to
50
+** If the UUID is not found and phantomize is 1 or 2, then attempt to
5151
** create a phantom record. A private phantom is created for 2 and
5252
** a public phantom is created for 1.
5353
*/
5454
int uuid_to_rid(const char *zUuid, int phantomize){
5555
int rid, sz;
5656
char z[UUID_SIZE+1];
57
-
57
+
5858
sz = strlen(zUuid);
5959
if( sz!=UUID_SIZE || !validate16(zUuid, sz) ){
6060
return 0;
6161
}
6262
memcpy(z, zUuid, UUID_SIZE+1);
@@ -140,11 +140,11 @@
140140
** the file has changed due to a merge. 3 means the file was added
141141
** by a merge.
142142
**
143143
** If VFILE.DELETED is true or if VFILE.RID is zero, then the file was either
144144
** removed from configuration management via "fossil rm" or added via
145
-** "fossil add", respectively, and in both cases we always know that
145
+** "fossil add", respectively, and in both cases we always know that
146146
** the file has changed without having the check the size, mtime,
147147
** or on-disk content.
148148
**
149149
** If the size of the file has changed, then we always know that the file
150150
** changed without having to look at the mtime or on-disk content.
@@ -315,11 +315,11 @@
315315
}
316316
if( verbose ) fossil_print("%s\n", &zName[nRepos]);
317317
if( file_wd_isdir(zName) == 1 ){
318318
/*TODO(dchest): remove directories? */
319319
fossil_fatal("%s is directory, cannot overwrite\n", zName);
320
- }
320
+ }
321321
if( file_wd_size(zName)>=0 && (isLink || file_wd_islink(zName)) ){
322322
file_delete(zName);
323323
}
324324
if( isLink ){
325325
symlink_create(blob_str(&content), zName);
@@ -392,11 +392,11 @@
392392
"merge",
393393
"original",
394394
"output",
395395
};
396396
int i, j, n;
397
-
397
+
398398
if( strglob("ci-comment-????????????.txt", zName) ) return 1;
399399
for(; zName[0]!=0; zName++){
400400
if( zName[0]=='/' && strglob("/ci-comment-????????????.txt", zName) ){
401401
return 1;
402402
}
@@ -407,11 +407,11 @@
407407
if( zName[n+1]==0 ) return 1;
408408
if( zName[n+1]=='-' ){
409409
for(j=n+2; zName[j] && fossil_isdigit(zName[j]); j++){}
410410
if( zName[j]==0 ) return 1;
411411
}
412
- }
412
+ }
413413
}
414414
return 0;
415415
}
416416
417417
#if INTERFACE
@@ -654,11 +654,11 @@
654654
FILE *in;
655655
Stmt q;
656656
char zBuf[4096];
657657
658658
db_must_be_within_tree();
659
- db_prepare(&q,
659
+ db_prepare(&q,
660660
"SELECT %Q || pathname, pathname, origname, is_selected(id), rid"
661661
" FROM vfile"
662662
" WHERE (NOT deleted OR NOT is_selected(id)) AND vid=%d"
663663
" ORDER BY if_selected(id, pathname, origname) /*scan*/",
664664
g.zLocalRoot, vid
@@ -673,11 +673,11 @@
673673
md5sum_step_text(zName, -1);
674674
if( file_wd_islink(zFullpath) ){
675675
/* Instead of file content, use link destination path */
676676
Blob pathBuf;
677677
678
- sqlite3_snprintf(sizeof(zBuf), zBuf, " %ld\n",
678
+ sqlite3_snprintf(sizeof(zBuf), zBuf, " %ld\n",
679679
blob_read_link(&pathBuf, zFullpath));
680680
md5sum_step_text(zBuf, -1);
681681
md5sum_step_text(blob_str(&pathBuf), -1);
682682
blob_reset(&pathBuf);
683683
}else{
@@ -743,13 +743,13 @@
743743
void vfile_compare_repository_to_disk(int vid){
744744
int rc;
745745
Stmt q;
746746
Blob disk, repo;
747747
char *zOut;
748
-
748
+
749749
db_must_be_within_tree();
750
- db_prepare(&q,
750
+ db_prepare(&q,
751751
"SELECT %Q || pathname, pathname, rid FROM vfile"
752752
" WHERE NOT deleted AND vid=%d AND is_selected(id)"
753753
" ORDER BY if_selected(id, pathname, origname) /*scan*/",
754754
g.zLocalRoot, vid
755755
);
@@ -809,11 +809,11 @@
809809
Blob file;
810810
Stmt q;
811811
char zBuf[100];
812812
813813
db_must_be_within_tree();
814
-
814
+
815815
db_prepare(&q, "SELECT pathname, origname, rid, is_selected(id)"
816816
" FROM vfile"
817817
" WHERE (NOT deleted OR NOT is_selected(id))"
818818
" AND rid>0 AND vid=%d"
819819
" ORDER BY if_selected(id,pathname,origname) /*scan*/",
@@ -847,11 +847,11 @@
847847
**
848848
** If pManOut is not NULL then fill it with the checksum found in the
849849
** "R" card near the end of the manifest.
850850
**
851851
** In a well-formed manifest, the two checksums computed here, pOut and
852
-** pManOut, should be identical.
852
+** pManOut, should be identical.
853853
*/
854854
void vfile_aggregate_checksum_manifest(int vid, Blob *pOut, Blob *pManOut){
855855
int fid;
856856
Blob file;
857857
Blob err;
858858
--- src/vfile.c
+++ src/vfile.c
@@ -45,18 +45,18 @@
45 ** does not exist, then return 0.
46 **
47 ** For this routine, the UUID must be exact. For a match against
48 ** user input with mixed case, use resolve_uuid().
49 **
50 ** If the UUID is not found and phantomize is 1 or 2, then attempt to
51 ** create a phantom record. A private phantom is created for 2 and
52 ** a public phantom is created for 1.
53 */
54 int uuid_to_rid(const char *zUuid, int phantomize){
55 int rid, sz;
56 char z[UUID_SIZE+1];
57
58 sz = strlen(zUuid);
59 if( sz!=UUID_SIZE || !validate16(zUuid, sz) ){
60 return 0;
61 }
62 memcpy(z, zUuid, UUID_SIZE+1);
@@ -140,11 +140,11 @@
140 ** the file has changed due to a merge. 3 means the file was added
141 ** by a merge.
142 **
143 ** If VFILE.DELETED is true or if VFILE.RID is zero, then the file was either
144 ** removed from configuration management via "fossil rm" or added via
145 ** "fossil add", respectively, and in both cases we always know that
146 ** the file has changed without having the check the size, mtime,
147 ** or on-disk content.
148 **
149 ** If the size of the file has changed, then we always know that the file
150 ** changed without having to look at the mtime or on-disk content.
@@ -315,11 +315,11 @@
315 }
316 if( verbose ) fossil_print("%s\n", &zName[nRepos]);
317 if( file_wd_isdir(zName) == 1 ){
318 /*TODO(dchest): remove directories? */
319 fossil_fatal("%s is directory, cannot overwrite\n", zName);
320 }
321 if( file_wd_size(zName)>=0 && (isLink || file_wd_islink(zName)) ){
322 file_delete(zName);
323 }
324 if( isLink ){
325 symlink_create(blob_str(&content), zName);
@@ -392,11 +392,11 @@
392 "merge",
393 "original",
394 "output",
395 };
396 int i, j, n;
397
398 if( strglob("ci-comment-????????????.txt", zName) ) return 1;
399 for(; zName[0]!=0; zName++){
400 if( zName[0]=='/' && strglob("/ci-comment-????????????.txt", zName) ){
401 return 1;
402 }
@@ -407,11 +407,11 @@
407 if( zName[n+1]==0 ) return 1;
408 if( zName[n+1]=='-' ){
409 for(j=n+2; zName[j] && fossil_isdigit(zName[j]); j++){}
410 if( zName[j]==0 ) return 1;
411 }
412 }
413 }
414 return 0;
415 }
416
417 #if INTERFACE
@@ -654,11 +654,11 @@
654 FILE *in;
655 Stmt q;
656 char zBuf[4096];
657
658 db_must_be_within_tree();
659 db_prepare(&q,
660 "SELECT %Q || pathname, pathname, origname, is_selected(id), rid"
661 " FROM vfile"
662 " WHERE (NOT deleted OR NOT is_selected(id)) AND vid=%d"
663 " ORDER BY if_selected(id, pathname, origname) /*scan*/",
664 g.zLocalRoot, vid
@@ -673,11 +673,11 @@
673 md5sum_step_text(zName, -1);
674 if( file_wd_islink(zFullpath) ){
675 /* Instead of file content, use link destination path */
676 Blob pathBuf;
677
678 sqlite3_snprintf(sizeof(zBuf), zBuf, " %ld\n",
679 blob_read_link(&pathBuf, zFullpath));
680 md5sum_step_text(zBuf, -1);
681 md5sum_step_text(blob_str(&pathBuf), -1);
682 blob_reset(&pathBuf);
683 }else{
@@ -743,13 +743,13 @@
743 void vfile_compare_repository_to_disk(int vid){
744 int rc;
745 Stmt q;
746 Blob disk, repo;
747 char *zOut;
748
749 db_must_be_within_tree();
750 db_prepare(&q,
751 "SELECT %Q || pathname, pathname, rid FROM vfile"
752 " WHERE NOT deleted AND vid=%d AND is_selected(id)"
753 " ORDER BY if_selected(id, pathname, origname) /*scan*/",
754 g.zLocalRoot, vid
755 );
@@ -809,11 +809,11 @@
809 Blob file;
810 Stmt q;
811 char zBuf[100];
812
813 db_must_be_within_tree();
814
815 db_prepare(&q, "SELECT pathname, origname, rid, is_selected(id)"
816 " FROM vfile"
817 " WHERE (NOT deleted OR NOT is_selected(id))"
818 " AND rid>0 AND vid=%d"
819 " ORDER BY if_selected(id,pathname,origname) /*scan*/",
@@ -847,11 +847,11 @@
847 **
848 ** If pManOut is not NULL then fill it with the checksum found in the
849 ** "R" card near the end of the manifest.
850 **
851 ** In a well-formed manifest, the two checksums computed here, pOut and
852 ** pManOut, should be identical.
853 */
854 void vfile_aggregate_checksum_manifest(int vid, Blob *pOut, Blob *pManOut){
855 int fid;
856 Blob file;
857 Blob err;
858
--- src/vfile.c
+++ src/vfile.c
@@ -45,18 +45,18 @@
45 ** does not exist, then return 0.
46 **
47 ** For this routine, the UUID must be exact. For a match against
48 ** user input with mixed case, use resolve_uuid().
49 **
50 ** If the UUID is not found and phantomize is 1 or 2, then attempt to
51 ** create a phantom record. A private phantom is created for 2 and
52 ** a public phantom is created for 1.
53 */
54 int uuid_to_rid(const char *zUuid, int phantomize){
55 int rid, sz;
56 char z[UUID_SIZE+1];
57
58 sz = strlen(zUuid);
59 if( sz!=UUID_SIZE || !validate16(zUuid, sz) ){
60 return 0;
61 }
62 memcpy(z, zUuid, UUID_SIZE+1);
@@ -140,11 +140,11 @@
140 ** the file has changed due to a merge. 3 means the file was added
141 ** by a merge.
142 **
143 ** If VFILE.DELETED is true or if VFILE.RID is zero, then the file was either
144 ** removed from configuration management via "fossil rm" or added via
145 ** "fossil add", respectively, and in both cases we always know that
146 ** the file has changed without having the check the size, mtime,
147 ** or on-disk content.
148 **
149 ** If the size of the file has changed, then we always know that the file
150 ** changed without having to look at the mtime or on-disk content.
@@ -315,11 +315,11 @@
315 }
316 if( verbose ) fossil_print("%s\n", &zName[nRepos]);
317 if( file_wd_isdir(zName) == 1 ){
318 /*TODO(dchest): remove directories? */
319 fossil_fatal("%s is directory, cannot overwrite\n", zName);
320 }
321 if( file_wd_size(zName)>=0 && (isLink || file_wd_islink(zName)) ){
322 file_delete(zName);
323 }
324 if( isLink ){
325 symlink_create(blob_str(&content), zName);
@@ -392,11 +392,11 @@
392 "merge",
393 "original",
394 "output",
395 };
396 int i, j, n;
397
398 if( strglob("ci-comment-????????????.txt", zName) ) return 1;
399 for(; zName[0]!=0; zName++){
400 if( zName[0]=='/' && strglob("/ci-comment-????????????.txt", zName) ){
401 return 1;
402 }
@@ -407,11 +407,11 @@
407 if( zName[n+1]==0 ) return 1;
408 if( zName[n+1]=='-' ){
409 for(j=n+2; zName[j] && fossil_isdigit(zName[j]); j++){}
410 if( zName[j]==0 ) return 1;
411 }
412 }
413 }
414 return 0;
415 }
416
417 #if INTERFACE
@@ -654,11 +654,11 @@
654 FILE *in;
655 Stmt q;
656 char zBuf[4096];
657
658 db_must_be_within_tree();
659 db_prepare(&q,
660 "SELECT %Q || pathname, pathname, origname, is_selected(id), rid"
661 " FROM vfile"
662 " WHERE (NOT deleted OR NOT is_selected(id)) AND vid=%d"
663 " ORDER BY if_selected(id, pathname, origname) /*scan*/",
664 g.zLocalRoot, vid
@@ -673,11 +673,11 @@
673 md5sum_step_text(zName, -1);
674 if( file_wd_islink(zFullpath) ){
675 /* Instead of file content, use link destination path */
676 Blob pathBuf;
677
678 sqlite3_snprintf(sizeof(zBuf), zBuf, " %ld\n",
679 blob_read_link(&pathBuf, zFullpath));
680 md5sum_step_text(zBuf, -1);
681 md5sum_step_text(blob_str(&pathBuf), -1);
682 blob_reset(&pathBuf);
683 }else{
@@ -743,13 +743,13 @@
743 void vfile_compare_repository_to_disk(int vid){
744 int rc;
745 Stmt q;
746 Blob disk, repo;
747 char *zOut;
748
749 db_must_be_within_tree();
750 db_prepare(&q,
751 "SELECT %Q || pathname, pathname, rid FROM vfile"
752 " WHERE NOT deleted AND vid=%d AND is_selected(id)"
753 " ORDER BY if_selected(id, pathname, origname) /*scan*/",
754 g.zLocalRoot, vid
755 );
@@ -809,11 +809,11 @@
809 Blob file;
810 Stmt q;
811 char zBuf[100];
812
813 db_must_be_within_tree();
814
815 db_prepare(&q, "SELECT pathname, origname, rid, is_selected(id)"
816 " FROM vfile"
817 " WHERE (NOT deleted OR NOT is_selected(id))"
818 " AND rid>0 AND vid=%d"
819 " ORDER BY if_selected(id,pathname,origname) /*scan*/",
@@ -847,11 +847,11 @@
847 **
848 ** If pManOut is not NULL then fill it with the checksum found in the
849 ** "R" card near the end of the manifest.
850 **
851 ** In a well-formed manifest, the two checksums computed here, pOut and
852 ** pManOut, should be identical.
853 */
854 void vfile_aggregate_checksum_manifest(int vid, Blob *pOut, Blob *pManOut){
855 int fid;
856 Blob file;
857 Blob err;
858
+39 -39
--- src/xfer.c
+++ src/xfer.c
@@ -94,11 +94,11 @@
9494
db_reset(&q);
9595
}
9696
}
9797
9898
/*
99
-** The aToken[0..nToken-1] blob array is a parse of a "file" line
99
+** The aToken[0..nToken-1] blob array is a parse of a "file" line
100100
** message. This routine finishes parsing that message and does
101101
** a record insert of the file.
102102
**
103103
** The file line is in one of the following two forms:
104104
**
@@ -119,14 +119,14 @@
119119
int n;
120120
int rid;
121121
int srcid = 0;
122122
Blob content, hash;
123123
int isPriv;
124
-
124
+
125125
isPriv = pXfer->nextIsPrivate;
126126
pXfer->nextIsPrivate = 0;
127
- if( pXfer->nToken<3
127
+ if( pXfer->nToken<3
128128
|| pXfer->nToken>4
129129
|| !blob_is_uuid(&pXfer->aToken[1])
130130
|| !blob_is_int(&pXfer->aToken[pXfer->nToken-1], &n)
131131
|| n<0
132132
|| (pXfer->nToken==4 && !blob_is_uuid(&pXfer->aToken[2]))
@@ -198,11 +198,11 @@
198198
assert( blob_is_reset(&content) );
199199
remote_has(rid);
200200
}
201201
202202
/*
203
-** The aToken[0..nToken-1] blob array is a parse of a "cfile" line
203
+** The aToken[0..nToken-1] blob array is a parse of a "cfile" line
204204
** message. This routine finishes parsing that message and does
205205
** a record insert of the file. The difference between "file" and
206206
** "cfile" is that with "cfile" the content is already compressed.
207207
**
208208
** The file line is in one of the following two forms:
@@ -227,14 +227,14 @@
227227
int szU; /* USIZE */
228228
int rid;
229229
int srcid = 0;
230230
Blob content;
231231
int isPriv;
232
-
232
+
233233
isPriv = pXfer->nextIsPrivate;
234234
pXfer->nextIsPrivate = 0;
235
- if( pXfer->nToken<4
235
+ if( pXfer->nToken<4
236236
|| pXfer->nToken>5
237237
|| !blob_is_uuid(&pXfer->aToken[1])
238238
|| !blob_is_int(&pXfer->aToken[pXfer->nToken-2], &szU)
239239
|| !blob_is_int(&pXfer->aToken[pXfer->nToken-1], &szC)
240240
|| szC<0 || szU<0
@@ -284,11 +284,11 @@
284284
){
285285
static const char *const azQuery[] = {
286286
"SELECT pid FROM plink x"
287287
" WHERE cid=%d"
288288
" AND NOT EXISTS(SELECT 1 FROM phantom WHERE rid=pid)",
289
-
289
+
290290
"SELECT pid, min(mtime) FROM mlink, event ON mlink.mid=event.objid"
291291
" WHERE fid=%d"
292292
" AND NOT EXISTS(SELECT 1 FROM phantom WHERE rid=pid)"
293293
};
294294
int i;
@@ -321,11 +321,11 @@
321321
}
322322
return size;
323323
}
324324
325325
/*
326
-** Try to send a file as a native delta.
326
+** Try to send a file as a native delta.
327327
** If successful, return the number of bytes in the delta.
328328
** If we cannot generate an appropriate delta, then send
329329
** nothing and return zero.
330330
**
331331
** Never send a delta against a private artifact.
@@ -403,11 +403,11 @@
403403
}
404404
if( uuid_is_shunned(blob_str(pUuid)) ){
405405
blob_reset(&uuid);
406406
return;
407407
}
408
- if( (pXfer->maxTime != -1 && time(NULL) >= pXfer->maxTime) ||
408
+ if( (pXfer->maxTime != -1 && time(NULL) >= pXfer->maxTime) ||
409409
pXfer->mxSend<=blob_size(pXfer->pOut) ){
410410
const char *zFormat = isPriv ? "igot %b 1\n" : "igot %b\n";
411411
blob_appendf(pXfer->pOut, zFormat, pUuid);
412412
pXfer->nIGotSent++;
413413
blob_reset(&uuid);
@@ -445,11 +445,11 @@
445445
#endif
446446
}
447447
448448
/*
449449
** Send the file identified by rid as a compressed artifact. Basically,
450
-** send the content exactly as it appears in the BLOB table using
450
+** send the content exactly as it appears in the BLOB table using
451451
** a "cfile" card.
452452
*/
453453
static void send_compressed_file(Xfer *pXfer, int rid){
454454
const char *zContent;
455455
const char *zUuid;
@@ -515,11 +515,11 @@
515515
** Except: do not request shunned artifacts. And do not request
516516
** private artifacts if we are not doing a private transfer.
517517
*/
518518
static void request_phantoms(Xfer *pXfer, int maxReq){
519519
Stmt q;
520
- db_prepare(&q,
520
+ db_prepare(&q,
521521
"SELECT uuid FROM phantom JOIN blob USING(rid)"
522522
" WHERE NOT EXISTS(SELECT 1 FROM shun WHERE uuid=blob.uuid) %s",
523523
(pXfer->syncPrivate ? "" :
524524
" AND NOT EXISTS(SELECT 1 FROM private WHERE rid=blob.rid)")
525525
);
@@ -551,12 +551,12 @@
551551
** Check the signature on an application/x-fossil payload received by
552552
** the HTTP server. The signature is a line of the following form:
553553
**
554554
** login LOGIN NONCE SIGNATURE
555555
**
556
-** The NONCE is the SHA1 hash of the remainder of the input.
557
-** SIGNATURE is the SHA1 checksum of the NONCE concatenated
556
+** The NONCE is the SHA1 hash of the remainder of the input.
557
+** SIGNATURE is the SHA1 checksum of the NONCE concatenated
558558
** with the users password.
559559
**
560560
** The parameters to this routine are ephemeral blobs holding the
561561
** LOGIN, NONCE and SIGNATURE.
562562
**
@@ -564,11 +564,11 @@
564564
** If everything checks out, the USER.CAP column for the USER table
565565
** is consulted to set privileges in the global g variable.
566566
**
567567
** If anything fails to check out, no changes are made to privileges.
568568
**
569
-** Signature generation on the client side is handled by the
569
+** Signature generation on the client side is handled by the
570570
** http_exchange() routine.
571571
**
572572
** Return non-zero for a login failure and zero for success.
573573
*/
574574
int check_login(Blob *pLogin, Blob *pNonce, Blob *pSig){
@@ -699,11 +699,11 @@
699699
blob_appendf(&deleteWhere, ",%d", rid);
700700
}
701701
}
702702
db_finalize(&q);
703703
db_multi_exec(
704
- "DELETE FROM unclustered WHERE rid NOT IN (0 %s)",
704
+ "DELETE FROM unclustered WHERE rid NOT IN (0 %s)",
705705
blob_str(&deleteWhere)
706706
);
707707
blob_reset(&deleteWhere);
708708
if( nRow>0 ){
709709
md5sum_blob(&cluster, &cksum);
@@ -738,21 +738,21 @@
738738
*/
739739
static int send_unclustered(Xfer *pXfer){
740740
Stmt q;
741741
int cnt = 0;
742742
if( pXfer->resync ){
743
- db_prepare(&q,
743
+ db_prepare(&q,
744744
"SELECT uuid, rid FROM blob"
745745
" WHERE NOT EXISTS(SELECT 1 FROM shun WHERE uuid=blob.uuid)"
746746
" AND NOT EXISTS(SELECT 1 FROM phantom WHERE rid=blob.rid)"
747747
" AND NOT EXISTS(SELECT 1 FROM private WHERE rid=blob.rid)"
748748
" AND blob.rid<=%d"
749749
" ORDER BY blob.rid DESC",
750750
pXfer->resync
751751
);
752752
}else{
753
- db_prepare(&q,
753
+ db_prepare(&q,
754754
"SELECT uuid FROM unclustered JOIN blob USING(rid)"
755755
" WHERE NOT EXISTS(SELECT 1 FROM shun WHERE uuid=blob.uuid)"
756756
" AND NOT EXISTS(SELECT 1 FROM phantom WHERE rid=blob.rid)"
757757
" AND NOT EXISTS(SELECT 1 FROM private WHERE rid=blob.rid)"
758758
);
@@ -772,11 +772,11 @@
772772
/*
773773
** Send an igot message for every artifact.
774774
*/
775775
static void send_all(Xfer *pXfer){
776776
Stmt q;
777
- db_prepare(&q,
777
+ db_prepare(&q,
778778
"SELECT uuid FROM blob "
779779
" WHERE NOT EXISTS(SELECT 1 FROM shun WHERE uuid=blob.uuid)"
780780
" AND NOT EXISTS(SELECT 1 FROM private WHERE rid=blob.rid)"
781781
" AND NOT EXISTS(SELECT 1 FROM phantom WHERE rid=blob.rid)"
782782
);
@@ -1033,12 +1033,12 @@
10331033
}else{
10341034
server_private_xfer_not_authorized();
10351035
}
10361036
}
10371037
}else
1038
-
1039
-
1038
+
1039
+
10401040
/* pull SERVERCODE PROJECTCODE
10411041
** push SERVERCODE PROJECTCODE
10421042
**
10431043
** The client wants either send or receive. The server should
10441044
** verify that the project code matches.
@@ -1142,14 +1142,14 @@
11421142
){
11431143
cgi_reset_content();
11441144
@ error login\sfailed
11451145
nErr++;
11461146
break;
1147
- }
1147
+ }
11481148
}
11491149
}else
1150
-
1150
+
11511151
/* reqconfig NAME
11521152
**
11531153
** Request a configuration value
11541154
*/
11551155
if( blob_eq(&xfer.aToken[0], "reqconfig")
@@ -1167,11 +1167,11 @@
11671167
/* Old style configuration transfer */
11681168
send_legacy_config_card(&xfer, zName);
11691169
}
11701170
}
11711171
}else
1172
-
1172
+
11731173
/* config NAME SIZE \n CONTENT
11741174
**
11751175
** Receive a configuration value from the client. This is only
11761176
** permitted for high-privilege users.
11771177
*/
@@ -1194,11 +1194,11 @@
11941194
configure_receive(zName, &content, CONFIGSET_ALL);
11951195
blob_reset(&content);
11961196
blob_seek(xfer.pIn, 1, BLOB_SEEK_CUR);
11971197
}else
11981198
1199
-
1199
+
12001200
12011201
/* cookie TEXT
12021202
**
12031203
** A cookie contains a arbitrary-length argument that is server-defined.
12041204
** The argument must be encoded so as not to contain any whitespace.
@@ -1413,11 +1413,11 @@
14131413
int nArtifactRcvd = 0; /* Total artifacts received */
14141414
const char *zOpType = 0;/* Push, Pull, Sync, Clone */
14151415
double rSkew = 0.0; /* Maximum time skew */
14161416
14171417
if( db_get_boolean("dont-push", 0) ) syncFlags &= ~SYNC_PUSH;
1418
- if( (syncFlags & (SYNC_PUSH|SYNC_PULL|SYNC_CLONE))==0
1418
+ if( (syncFlags & (SYNC_PUSH|SYNC_PULL|SYNC_CLONE))==0
14191419
&& configRcvMask==0 && configSendMask==0 ) return 0;
14201420
14211421
transport_stats(0, 0, 1);
14221422
socket_global_init();
14231423
memset(&xfer, 0, sizeof(xfer));
@@ -1487,11 +1487,11 @@
14871487
*/
14881488
zCookie = db_get("cookie", 0);
14891489
if( zCookie ){
14901490
blob_appendf(&send, "cookie %s\n", zCookie);
14911491
}
1492
-
1492
+
14931493
/* Generate gimme cards for phantoms and leaf cards
14941494
** for all leaves.
14951495
*/
14961496
if( (syncFlags & SYNC_PULL)!=0
14971497
|| ((syncFlags & SYNC_CLONE)!=0 && cloneSeqno==1)
@@ -1503,11 +1503,11 @@
15031503
nCardSent += send_unclustered(&xfer);
15041504
if( syncFlags & SYNC_PRIVATE ) send_private(&xfer);
15051505
}
15061506
15071507
/* Send configuration parameter requests. On a clone, delay sending
1508
- ** this until the second cycle since the login card might fail on
1508
+ ** this until the second cycle since the login card might fail on
15091509
** the first cycle.
15101510
*/
15111511
if( configRcvMask && ((syncFlags & SYNC_CLONE)==0 || nCycle>0) ){
15121512
const char *zName;
15131513
if( zOpType==0 ) zOpType = "Pull";
@@ -1663,20 +1663,20 @@
16631663
if( syncFlags & SYNC_PUSH ){
16641664
int rid = rid_from_uuid(&xfer.aToken[1], 0, 0);
16651665
if( rid ) send_file(&xfer, rid, &xfer.aToken[1], 0);
16661666
}
16671667
}else
1668
-
1668
+
16691669
/* igot UUID ?PRIVATEFLAG?
16701670
**
16711671
** Server announces that it has a particular file. If this is
16721672
** not a file that we have and we are pulling, then create a
16731673
** phantom to cause this file to be requested on the next cycle.
16741674
** Always remember that the server has this file so that we do
16751675
** not transmit it by accident.
16761676
**
1677
- ** If the PRIVATE argument exists and is 1, then the file is
1677
+ ** If the PRIVATE argument exists and is 1, then the file is
16781678
** private. Pretend it does not exists if we are not pulling
16791679
** private files.
16801680
*/
16811681
if( xfer.nToken>=2
16821682
&& blob_eq(&xfer.aToken[0], "igot")
@@ -1693,12 +1693,12 @@
16931693
rid = content_new(blob_str(&xfer.aToken[1]), isPriv);
16941694
if( rid ) newPhantom = 1;
16951695
}
16961696
remote_has(rid);
16971697
}else
1698
-
1699
-
1698
+
1699
+
17001700
/* push SERVERCODE PRODUCTCODE
17011701
**
17021702
** Should only happen in response to a clone. This message tells
17031703
** the client what product to use for the new database.
17041704
*/
@@ -1716,11 +1716,11 @@
17161716
db_set("project-code", zPCode, 0);
17171717
}
17181718
if( cloneSeqno>0 ) blob_appendf(&send, "clone 3 %d\n", cloneSeqno);
17191719
nCardSent++;
17201720
}else
1721
-
1721
+
17221722
/* config NAME SIZE \n CONTENT
17231723
**
17241724
** Receive a configuration value from the server.
17251725
**
17261726
** The received configuration setting is silently ignored if it was
@@ -1738,11 +1738,11 @@
17381738
nArtifactRcvd++;
17391739
blob_reset(&content);
17401740
blob_seek(xfer.pIn, 1, BLOB_SEEK_CUR);
17411741
}else
17421742
1743
-
1743
+
17441744
/* cookie TEXT
17451745
**
17461746
** The server might include a cookie in its reply. The client
17471747
** should remember this cookie and send it back to the server
17481748
** in its next query.
@@ -1780,11 +1780,11 @@
17801780
**
17811781
** Print a message. Similar to "error" but does not stop processing.
17821782
**
17831783
** If the "login failed" message is seen, clear the sync password prior
17841784
** to the next cycle.
1785
- */
1785
+ */
17861786
if( blob_eq(&xfer.aToken[0],"message") && xfer.nToken==2 ){
17871787
char *zMsg = blob_terminate(&xfer.aToken[1]);
17881788
defossilize(zMsg);
17891789
if( (syncFlags & SYNC_PUSH) && zMsg && strglob("pull only *", zMsg) ){
17901790
syncFlags &= ~SYNC_PUSH;
@@ -1797,11 +1797,11 @@
17971797
}else
17981798
17991799
/* pragma NAME VALUE...
18001800
**
18011801
** The server can send pragmas to try to convey meta-information to
1802
- ** the client. These are informational only. Unknown pragmas are
1802
+ ** the client. These are informational only. Unknown pragmas are
18031803
** silently ignored.
18041804
*/
18051805
if( blob_eq(&xfer.aToken[0], "pragma") && xfer.nToken>=2 ){
18061806
}else
18071807
@@ -1810,14 +1810,14 @@
18101810
** Report an error and abandon the sync session.
18111811
**
18121812
** Except, when cloning we will sometimes get an error on the
18131813
** first message exchange because the project-code is unknown
18141814
** and so the login card on the request was invalid. The project-code
1815
- ** is returned in the reply before the error card, so second and
1815
+ ** is returned in the reply before the error card, so second and
18161816
** subsequent messages should be OK. Nevertheless, we need to ignore
18171817
** the error card on the first message of a clone.
1818
- */
1818
+ */
18191819
if( blob_eq(&xfer.aToken[0],"error") && xfer.nToken==2 ){
18201820
if( (syncFlags & SYNC_CLONE)==0 || nCycle>0 ){
18211821
char *zMsg = blob_terminate(&xfer.aToken[1]);
18221822
defossilize(zMsg);
18231823
fossil_force_newline();
@@ -1894,11 +1894,11 @@
18941894
xfer.nFileRcvd = 0;
18951895
xfer.nDeltaRcvd = 0;
18961896
xfer.nDanglingFile = 0;
18971897
18981898
/* If we have one or more files queued to send, then go
1899
- ** another round
1899
+ ** another round
19001900
*/
19011901
if( xfer.nFileSent+xfer.nDeltaSent>0 ){
19021902
go = 1;
19031903
}
19041904
@@ -1908,11 +1908,11 @@
19081908
/* Stop the cycle if the server sends a "clone_seqno 0" card and
19091909
** we have gone at least two rounds. Always go at least two rounds
19101910
** on a clone in order to be sure to retrieve the configuration
19111911
** information which is only sent on the second round.
19121912
*/
1913
- if( cloneSeqno<=0 && nCycle>1 ) go = 0;
1913
+ if( cloneSeqno<=0 && nCycle>1 ) go = 0;
19141914
};
19151915
transport_stats(&nSent, &nRcvd, 1);
19161916
if( (rSkew*24.0*3600.0) > 10.0 ){
19171917
fossil_warning("*** time skew *** server is fast by %s",
19181918
db_timespan_name(rSkew));
19191919
--- src/xfer.c
+++ src/xfer.c
@@ -94,11 +94,11 @@
94 db_reset(&q);
95 }
96 }
97
98 /*
99 ** The aToken[0..nToken-1] blob array is a parse of a "file" line
100 ** message. This routine finishes parsing that message and does
101 ** a record insert of the file.
102 **
103 ** The file line is in one of the following two forms:
104 **
@@ -119,14 +119,14 @@
119 int n;
120 int rid;
121 int srcid = 0;
122 Blob content, hash;
123 int isPriv;
124
125 isPriv = pXfer->nextIsPrivate;
126 pXfer->nextIsPrivate = 0;
127 if( pXfer->nToken<3
128 || pXfer->nToken>4
129 || !blob_is_uuid(&pXfer->aToken[1])
130 || !blob_is_int(&pXfer->aToken[pXfer->nToken-1], &n)
131 || n<0
132 || (pXfer->nToken==4 && !blob_is_uuid(&pXfer->aToken[2]))
@@ -198,11 +198,11 @@
198 assert( blob_is_reset(&content) );
199 remote_has(rid);
200 }
201
202 /*
203 ** The aToken[0..nToken-1] blob array is a parse of a "cfile" line
204 ** message. This routine finishes parsing that message and does
205 ** a record insert of the file. The difference between "file" and
206 ** "cfile" is that with "cfile" the content is already compressed.
207 **
208 ** The file line is in one of the following two forms:
@@ -227,14 +227,14 @@
227 int szU; /* USIZE */
228 int rid;
229 int srcid = 0;
230 Blob content;
231 int isPriv;
232
233 isPriv = pXfer->nextIsPrivate;
234 pXfer->nextIsPrivate = 0;
235 if( pXfer->nToken<4
236 || pXfer->nToken>5
237 || !blob_is_uuid(&pXfer->aToken[1])
238 || !blob_is_int(&pXfer->aToken[pXfer->nToken-2], &szU)
239 || !blob_is_int(&pXfer->aToken[pXfer->nToken-1], &szC)
240 || szC<0 || szU<0
@@ -284,11 +284,11 @@
284 ){
285 static const char *const azQuery[] = {
286 "SELECT pid FROM plink x"
287 " WHERE cid=%d"
288 " AND NOT EXISTS(SELECT 1 FROM phantom WHERE rid=pid)",
289
290 "SELECT pid, min(mtime) FROM mlink, event ON mlink.mid=event.objid"
291 " WHERE fid=%d"
292 " AND NOT EXISTS(SELECT 1 FROM phantom WHERE rid=pid)"
293 };
294 int i;
@@ -321,11 +321,11 @@
321 }
322 return size;
323 }
324
325 /*
326 ** Try to send a file as a native delta.
327 ** If successful, return the number of bytes in the delta.
328 ** If we cannot generate an appropriate delta, then send
329 ** nothing and return zero.
330 **
331 ** Never send a delta against a private artifact.
@@ -403,11 +403,11 @@
403 }
404 if( uuid_is_shunned(blob_str(pUuid)) ){
405 blob_reset(&uuid);
406 return;
407 }
408 if( (pXfer->maxTime != -1 && time(NULL) >= pXfer->maxTime) ||
409 pXfer->mxSend<=blob_size(pXfer->pOut) ){
410 const char *zFormat = isPriv ? "igot %b 1\n" : "igot %b\n";
411 blob_appendf(pXfer->pOut, zFormat, pUuid);
412 pXfer->nIGotSent++;
413 blob_reset(&uuid);
@@ -445,11 +445,11 @@
445 #endif
446 }
447
448 /*
449 ** Send the file identified by rid as a compressed artifact. Basically,
450 ** send the content exactly as it appears in the BLOB table using
451 ** a "cfile" card.
452 */
453 static void send_compressed_file(Xfer *pXfer, int rid){
454 const char *zContent;
455 const char *zUuid;
@@ -515,11 +515,11 @@
515 ** Except: do not request shunned artifacts. And do not request
516 ** private artifacts if we are not doing a private transfer.
517 */
518 static void request_phantoms(Xfer *pXfer, int maxReq){
519 Stmt q;
520 db_prepare(&q,
521 "SELECT uuid FROM phantom JOIN blob USING(rid)"
522 " WHERE NOT EXISTS(SELECT 1 FROM shun WHERE uuid=blob.uuid) %s",
523 (pXfer->syncPrivate ? "" :
524 " AND NOT EXISTS(SELECT 1 FROM private WHERE rid=blob.rid)")
525 );
@@ -551,12 +551,12 @@
551 ** Check the signature on an application/x-fossil payload received by
552 ** the HTTP server. The signature is a line of the following form:
553 **
554 ** login LOGIN NONCE SIGNATURE
555 **
556 ** The NONCE is the SHA1 hash of the remainder of the input.
557 ** SIGNATURE is the SHA1 checksum of the NONCE concatenated
558 ** with the users password.
559 **
560 ** The parameters to this routine are ephemeral blobs holding the
561 ** LOGIN, NONCE and SIGNATURE.
562 **
@@ -564,11 +564,11 @@
564 ** If everything checks out, the USER.CAP column for the USER table
565 ** is consulted to set privileges in the global g variable.
566 **
567 ** If anything fails to check out, no changes are made to privileges.
568 **
569 ** Signature generation on the client side is handled by the
570 ** http_exchange() routine.
571 **
572 ** Return non-zero for a login failure and zero for success.
573 */
574 int check_login(Blob *pLogin, Blob *pNonce, Blob *pSig){
@@ -699,11 +699,11 @@
699 blob_appendf(&deleteWhere, ",%d", rid);
700 }
701 }
702 db_finalize(&q);
703 db_multi_exec(
704 "DELETE FROM unclustered WHERE rid NOT IN (0 %s)",
705 blob_str(&deleteWhere)
706 );
707 blob_reset(&deleteWhere);
708 if( nRow>0 ){
709 md5sum_blob(&cluster, &cksum);
@@ -738,21 +738,21 @@
738 */
739 static int send_unclustered(Xfer *pXfer){
740 Stmt q;
741 int cnt = 0;
742 if( pXfer->resync ){
743 db_prepare(&q,
744 "SELECT uuid, rid FROM blob"
745 " WHERE NOT EXISTS(SELECT 1 FROM shun WHERE uuid=blob.uuid)"
746 " AND NOT EXISTS(SELECT 1 FROM phantom WHERE rid=blob.rid)"
747 " AND NOT EXISTS(SELECT 1 FROM private WHERE rid=blob.rid)"
748 " AND blob.rid<=%d"
749 " ORDER BY blob.rid DESC",
750 pXfer->resync
751 );
752 }else{
753 db_prepare(&q,
754 "SELECT uuid FROM unclustered JOIN blob USING(rid)"
755 " WHERE NOT EXISTS(SELECT 1 FROM shun WHERE uuid=blob.uuid)"
756 " AND NOT EXISTS(SELECT 1 FROM phantom WHERE rid=blob.rid)"
757 " AND NOT EXISTS(SELECT 1 FROM private WHERE rid=blob.rid)"
758 );
@@ -772,11 +772,11 @@
772 /*
773 ** Send an igot message for every artifact.
774 */
775 static void send_all(Xfer *pXfer){
776 Stmt q;
777 db_prepare(&q,
778 "SELECT uuid FROM blob "
779 " WHERE NOT EXISTS(SELECT 1 FROM shun WHERE uuid=blob.uuid)"
780 " AND NOT EXISTS(SELECT 1 FROM private WHERE rid=blob.rid)"
781 " AND NOT EXISTS(SELECT 1 FROM phantom WHERE rid=blob.rid)"
782 );
@@ -1033,12 +1033,12 @@
1033 }else{
1034 server_private_xfer_not_authorized();
1035 }
1036 }
1037 }else
1038
1039
1040 /* pull SERVERCODE PROJECTCODE
1041 ** push SERVERCODE PROJECTCODE
1042 **
1043 ** The client wants either send or receive. The server should
1044 ** verify that the project code matches.
@@ -1142,14 +1142,14 @@
1142 ){
1143 cgi_reset_content();
1144 @ error login\sfailed
1145 nErr++;
1146 break;
1147 }
1148 }
1149 }else
1150
1151 /* reqconfig NAME
1152 **
1153 ** Request a configuration value
1154 */
1155 if( blob_eq(&xfer.aToken[0], "reqconfig")
@@ -1167,11 +1167,11 @@
1167 /* Old style configuration transfer */
1168 send_legacy_config_card(&xfer, zName);
1169 }
1170 }
1171 }else
1172
1173 /* config NAME SIZE \n CONTENT
1174 **
1175 ** Receive a configuration value from the client. This is only
1176 ** permitted for high-privilege users.
1177 */
@@ -1194,11 +1194,11 @@
1194 configure_receive(zName, &content, CONFIGSET_ALL);
1195 blob_reset(&content);
1196 blob_seek(xfer.pIn, 1, BLOB_SEEK_CUR);
1197 }else
1198
1199
1200
1201 /* cookie TEXT
1202 **
1203 ** A cookie contains a arbitrary-length argument that is server-defined.
1204 ** The argument must be encoded so as not to contain any whitespace.
@@ -1413,11 +1413,11 @@
1413 int nArtifactRcvd = 0; /* Total artifacts received */
1414 const char *zOpType = 0;/* Push, Pull, Sync, Clone */
1415 double rSkew = 0.0; /* Maximum time skew */
1416
1417 if( db_get_boolean("dont-push", 0) ) syncFlags &= ~SYNC_PUSH;
1418 if( (syncFlags & (SYNC_PUSH|SYNC_PULL|SYNC_CLONE))==0
1419 && configRcvMask==0 && configSendMask==0 ) return 0;
1420
1421 transport_stats(0, 0, 1);
1422 socket_global_init();
1423 memset(&xfer, 0, sizeof(xfer));
@@ -1487,11 +1487,11 @@
1487 */
1488 zCookie = db_get("cookie", 0);
1489 if( zCookie ){
1490 blob_appendf(&send, "cookie %s\n", zCookie);
1491 }
1492
1493 /* Generate gimme cards for phantoms and leaf cards
1494 ** for all leaves.
1495 */
1496 if( (syncFlags & SYNC_PULL)!=0
1497 || ((syncFlags & SYNC_CLONE)!=0 && cloneSeqno==1)
@@ -1503,11 +1503,11 @@
1503 nCardSent += send_unclustered(&xfer);
1504 if( syncFlags & SYNC_PRIVATE ) send_private(&xfer);
1505 }
1506
1507 /* Send configuration parameter requests. On a clone, delay sending
1508 ** this until the second cycle since the login card might fail on
1509 ** the first cycle.
1510 */
1511 if( configRcvMask && ((syncFlags & SYNC_CLONE)==0 || nCycle>0) ){
1512 const char *zName;
1513 if( zOpType==0 ) zOpType = "Pull";
@@ -1663,20 +1663,20 @@
1663 if( syncFlags & SYNC_PUSH ){
1664 int rid = rid_from_uuid(&xfer.aToken[1], 0, 0);
1665 if( rid ) send_file(&xfer, rid, &xfer.aToken[1], 0);
1666 }
1667 }else
1668
1669 /* igot UUID ?PRIVATEFLAG?
1670 **
1671 ** Server announces that it has a particular file. If this is
1672 ** not a file that we have and we are pulling, then create a
1673 ** phantom to cause this file to be requested on the next cycle.
1674 ** Always remember that the server has this file so that we do
1675 ** not transmit it by accident.
1676 **
1677 ** If the PRIVATE argument exists and is 1, then the file is
1678 ** private. Pretend it does not exists if we are not pulling
1679 ** private files.
1680 */
1681 if( xfer.nToken>=2
1682 && blob_eq(&xfer.aToken[0], "igot")
@@ -1693,12 +1693,12 @@
1693 rid = content_new(blob_str(&xfer.aToken[1]), isPriv);
1694 if( rid ) newPhantom = 1;
1695 }
1696 remote_has(rid);
1697 }else
1698
1699
1700 /* push SERVERCODE PRODUCTCODE
1701 **
1702 ** Should only happen in response to a clone. This message tells
1703 ** the client what product to use for the new database.
1704 */
@@ -1716,11 +1716,11 @@
1716 db_set("project-code", zPCode, 0);
1717 }
1718 if( cloneSeqno>0 ) blob_appendf(&send, "clone 3 %d\n", cloneSeqno);
1719 nCardSent++;
1720 }else
1721
1722 /* config NAME SIZE \n CONTENT
1723 **
1724 ** Receive a configuration value from the server.
1725 **
1726 ** The received configuration setting is silently ignored if it was
@@ -1738,11 +1738,11 @@
1738 nArtifactRcvd++;
1739 blob_reset(&content);
1740 blob_seek(xfer.pIn, 1, BLOB_SEEK_CUR);
1741 }else
1742
1743
1744 /* cookie TEXT
1745 **
1746 ** The server might include a cookie in its reply. The client
1747 ** should remember this cookie and send it back to the server
1748 ** in its next query.
@@ -1780,11 +1780,11 @@
1780 **
1781 ** Print a message. Similar to "error" but does not stop processing.
1782 **
1783 ** If the "login failed" message is seen, clear the sync password prior
1784 ** to the next cycle.
1785 */
1786 if( blob_eq(&xfer.aToken[0],"message") && xfer.nToken==2 ){
1787 char *zMsg = blob_terminate(&xfer.aToken[1]);
1788 defossilize(zMsg);
1789 if( (syncFlags & SYNC_PUSH) && zMsg && strglob("pull only *", zMsg) ){
1790 syncFlags &= ~SYNC_PUSH;
@@ -1797,11 +1797,11 @@
1797 }else
1798
1799 /* pragma NAME VALUE...
1800 **
1801 ** The server can send pragmas to try to convey meta-information to
1802 ** the client. These are informational only. Unknown pragmas are
1803 ** silently ignored.
1804 */
1805 if( blob_eq(&xfer.aToken[0], "pragma") && xfer.nToken>=2 ){
1806 }else
1807
@@ -1810,14 +1810,14 @@
1810 ** Report an error and abandon the sync session.
1811 **
1812 ** Except, when cloning we will sometimes get an error on the
1813 ** first message exchange because the project-code is unknown
1814 ** and so the login card on the request was invalid. The project-code
1815 ** is returned in the reply before the error card, so second and
1816 ** subsequent messages should be OK. Nevertheless, we need to ignore
1817 ** the error card on the first message of a clone.
1818 */
1819 if( blob_eq(&xfer.aToken[0],"error") && xfer.nToken==2 ){
1820 if( (syncFlags & SYNC_CLONE)==0 || nCycle>0 ){
1821 char *zMsg = blob_terminate(&xfer.aToken[1]);
1822 defossilize(zMsg);
1823 fossil_force_newline();
@@ -1894,11 +1894,11 @@
1894 xfer.nFileRcvd = 0;
1895 xfer.nDeltaRcvd = 0;
1896 xfer.nDanglingFile = 0;
1897
1898 /* If we have one or more files queued to send, then go
1899 ** another round
1900 */
1901 if( xfer.nFileSent+xfer.nDeltaSent>0 ){
1902 go = 1;
1903 }
1904
@@ -1908,11 +1908,11 @@
1908 /* Stop the cycle if the server sends a "clone_seqno 0" card and
1909 ** we have gone at least two rounds. Always go at least two rounds
1910 ** on a clone in order to be sure to retrieve the configuration
1911 ** information which is only sent on the second round.
1912 */
1913 if( cloneSeqno<=0 && nCycle>1 ) go = 0;
1914 };
1915 transport_stats(&nSent, &nRcvd, 1);
1916 if( (rSkew*24.0*3600.0) > 10.0 ){
1917 fossil_warning("*** time skew *** server is fast by %s",
1918 db_timespan_name(rSkew));
1919
--- src/xfer.c
+++ src/xfer.c
@@ -94,11 +94,11 @@
94 db_reset(&q);
95 }
96 }
97
98 /*
99 ** The aToken[0..nToken-1] blob array is a parse of a "file" line
100 ** message. This routine finishes parsing that message and does
101 ** a record insert of the file.
102 **
103 ** The file line is in one of the following two forms:
104 **
@@ -119,14 +119,14 @@
119 int n;
120 int rid;
121 int srcid = 0;
122 Blob content, hash;
123 int isPriv;
124
125 isPriv = pXfer->nextIsPrivate;
126 pXfer->nextIsPrivate = 0;
127 if( pXfer->nToken<3
128 || pXfer->nToken>4
129 || !blob_is_uuid(&pXfer->aToken[1])
130 || !blob_is_int(&pXfer->aToken[pXfer->nToken-1], &n)
131 || n<0
132 || (pXfer->nToken==4 && !blob_is_uuid(&pXfer->aToken[2]))
@@ -198,11 +198,11 @@
198 assert( blob_is_reset(&content) );
199 remote_has(rid);
200 }
201
202 /*
203 ** The aToken[0..nToken-1] blob array is a parse of a "cfile" line
204 ** message. This routine finishes parsing that message and does
205 ** a record insert of the file. The difference between "file" and
206 ** "cfile" is that with "cfile" the content is already compressed.
207 **
208 ** The file line is in one of the following two forms:
@@ -227,14 +227,14 @@
227 int szU; /* USIZE */
228 int rid;
229 int srcid = 0;
230 Blob content;
231 int isPriv;
232
233 isPriv = pXfer->nextIsPrivate;
234 pXfer->nextIsPrivate = 0;
235 if( pXfer->nToken<4
236 || pXfer->nToken>5
237 || !blob_is_uuid(&pXfer->aToken[1])
238 || !blob_is_int(&pXfer->aToken[pXfer->nToken-2], &szU)
239 || !blob_is_int(&pXfer->aToken[pXfer->nToken-1], &szC)
240 || szC<0 || szU<0
@@ -284,11 +284,11 @@
284 ){
285 static const char *const azQuery[] = {
286 "SELECT pid FROM plink x"
287 " WHERE cid=%d"
288 " AND NOT EXISTS(SELECT 1 FROM phantom WHERE rid=pid)",
289
290 "SELECT pid, min(mtime) FROM mlink, event ON mlink.mid=event.objid"
291 " WHERE fid=%d"
292 " AND NOT EXISTS(SELECT 1 FROM phantom WHERE rid=pid)"
293 };
294 int i;
@@ -321,11 +321,11 @@
321 }
322 return size;
323 }
324
325 /*
326 ** Try to send a file as a native delta.
327 ** If successful, return the number of bytes in the delta.
328 ** If we cannot generate an appropriate delta, then send
329 ** nothing and return zero.
330 **
331 ** Never send a delta against a private artifact.
@@ -403,11 +403,11 @@
403 }
404 if( uuid_is_shunned(blob_str(pUuid)) ){
405 blob_reset(&uuid);
406 return;
407 }
408 if( (pXfer->maxTime != -1 && time(NULL) >= pXfer->maxTime) ||
409 pXfer->mxSend<=blob_size(pXfer->pOut) ){
410 const char *zFormat = isPriv ? "igot %b 1\n" : "igot %b\n";
411 blob_appendf(pXfer->pOut, zFormat, pUuid);
412 pXfer->nIGotSent++;
413 blob_reset(&uuid);
@@ -445,11 +445,11 @@
445 #endif
446 }
447
448 /*
449 ** Send the file identified by rid as a compressed artifact. Basically,
450 ** send the content exactly as it appears in the BLOB table using
451 ** a "cfile" card.
452 */
453 static void send_compressed_file(Xfer *pXfer, int rid){
454 const char *zContent;
455 const char *zUuid;
@@ -515,11 +515,11 @@
515 ** Except: do not request shunned artifacts. And do not request
516 ** private artifacts if we are not doing a private transfer.
517 */
518 static void request_phantoms(Xfer *pXfer, int maxReq){
519 Stmt q;
520 db_prepare(&q,
521 "SELECT uuid FROM phantom JOIN blob USING(rid)"
522 " WHERE NOT EXISTS(SELECT 1 FROM shun WHERE uuid=blob.uuid) %s",
523 (pXfer->syncPrivate ? "" :
524 " AND NOT EXISTS(SELECT 1 FROM private WHERE rid=blob.rid)")
525 );
@@ -551,12 +551,12 @@
551 ** Check the signature on an application/x-fossil payload received by
552 ** the HTTP server. The signature is a line of the following form:
553 **
554 ** login LOGIN NONCE SIGNATURE
555 **
556 ** The NONCE is the SHA1 hash of the remainder of the input.
557 ** SIGNATURE is the SHA1 checksum of the NONCE concatenated
558 ** with the users password.
559 **
560 ** The parameters to this routine are ephemeral blobs holding the
561 ** LOGIN, NONCE and SIGNATURE.
562 **
@@ -564,11 +564,11 @@
564 ** If everything checks out, the USER.CAP column for the USER table
565 ** is consulted to set privileges in the global g variable.
566 **
567 ** If anything fails to check out, no changes are made to privileges.
568 **
569 ** Signature generation on the client side is handled by the
570 ** http_exchange() routine.
571 **
572 ** Return non-zero for a login failure and zero for success.
573 */
574 int check_login(Blob *pLogin, Blob *pNonce, Blob *pSig){
@@ -699,11 +699,11 @@
699 blob_appendf(&deleteWhere, ",%d", rid);
700 }
701 }
702 db_finalize(&q);
703 db_multi_exec(
704 "DELETE FROM unclustered WHERE rid NOT IN (0 %s)",
705 blob_str(&deleteWhere)
706 );
707 blob_reset(&deleteWhere);
708 if( nRow>0 ){
709 md5sum_blob(&cluster, &cksum);
@@ -738,21 +738,21 @@
738 */
739 static int send_unclustered(Xfer *pXfer){
740 Stmt q;
741 int cnt = 0;
742 if( pXfer->resync ){
743 db_prepare(&q,
744 "SELECT uuid, rid FROM blob"
745 " WHERE NOT EXISTS(SELECT 1 FROM shun WHERE uuid=blob.uuid)"
746 " AND NOT EXISTS(SELECT 1 FROM phantom WHERE rid=blob.rid)"
747 " AND NOT EXISTS(SELECT 1 FROM private WHERE rid=blob.rid)"
748 " AND blob.rid<=%d"
749 " ORDER BY blob.rid DESC",
750 pXfer->resync
751 );
752 }else{
753 db_prepare(&q,
754 "SELECT uuid FROM unclustered JOIN blob USING(rid)"
755 " WHERE NOT EXISTS(SELECT 1 FROM shun WHERE uuid=blob.uuid)"
756 " AND NOT EXISTS(SELECT 1 FROM phantom WHERE rid=blob.rid)"
757 " AND NOT EXISTS(SELECT 1 FROM private WHERE rid=blob.rid)"
758 );
@@ -772,11 +772,11 @@
772 /*
773 ** Send an igot message for every artifact.
774 */
775 static void send_all(Xfer *pXfer){
776 Stmt q;
777 db_prepare(&q,
778 "SELECT uuid FROM blob "
779 " WHERE NOT EXISTS(SELECT 1 FROM shun WHERE uuid=blob.uuid)"
780 " AND NOT EXISTS(SELECT 1 FROM private WHERE rid=blob.rid)"
781 " AND NOT EXISTS(SELECT 1 FROM phantom WHERE rid=blob.rid)"
782 );
@@ -1033,12 +1033,12 @@
1033 }else{
1034 server_private_xfer_not_authorized();
1035 }
1036 }
1037 }else
1038
1039
1040 /* pull SERVERCODE PROJECTCODE
1041 ** push SERVERCODE PROJECTCODE
1042 **
1043 ** The client wants either send or receive. The server should
1044 ** verify that the project code matches.
@@ -1142,14 +1142,14 @@
1142 ){
1143 cgi_reset_content();
1144 @ error login\sfailed
1145 nErr++;
1146 break;
1147 }
1148 }
1149 }else
1150
1151 /* reqconfig NAME
1152 **
1153 ** Request a configuration value
1154 */
1155 if( blob_eq(&xfer.aToken[0], "reqconfig")
@@ -1167,11 +1167,11 @@
1167 /* Old style configuration transfer */
1168 send_legacy_config_card(&xfer, zName);
1169 }
1170 }
1171 }else
1172
1173 /* config NAME SIZE \n CONTENT
1174 **
1175 ** Receive a configuration value from the client. This is only
1176 ** permitted for high-privilege users.
1177 */
@@ -1194,11 +1194,11 @@
1194 configure_receive(zName, &content, CONFIGSET_ALL);
1195 blob_reset(&content);
1196 blob_seek(xfer.pIn, 1, BLOB_SEEK_CUR);
1197 }else
1198
1199
1200
1201 /* cookie TEXT
1202 **
1203 ** A cookie contains a arbitrary-length argument that is server-defined.
1204 ** The argument must be encoded so as not to contain any whitespace.
@@ -1413,11 +1413,11 @@
1413 int nArtifactRcvd = 0; /* Total artifacts received */
1414 const char *zOpType = 0;/* Push, Pull, Sync, Clone */
1415 double rSkew = 0.0; /* Maximum time skew */
1416
1417 if( db_get_boolean("dont-push", 0) ) syncFlags &= ~SYNC_PUSH;
1418 if( (syncFlags & (SYNC_PUSH|SYNC_PULL|SYNC_CLONE))==0
1419 && configRcvMask==0 && configSendMask==0 ) return 0;
1420
1421 transport_stats(0, 0, 1);
1422 socket_global_init();
1423 memset(&xfer, 0, sizeof(xfer));
@@ -1487,11 +1487,11 @@
1487 */
1488 zCookie = db_get("cookie", 0);
1489 if( zCookie ){
1490 blob_appendf(&send, "cookie %s\n", zCookie);
1491 }
1492
1493 /* Generate gimme cards for phantoms and leaf cards
1494 ** for all leaves.
1495 */
1496 if( (syncFlags & SYNC_PULL)!=0
1497 || ((syncFlags & SYNC_CLONE)!=0 && cloneSeqno==1)
@@ -1503,11 +1503,11 @@
1503 nCardSent += send_unclustered(&xfer);
1504 if( syncFlags & SYNC_PRIVATE ) send_private(&xfer);
1505 }
1506
1507 /* Send configuration parameter requests. On a clone, delay sending
1508 ** this until the second cycle since the login card might fail on
1509 ** the first cycle.
1510 */
1511 if( configRcvMask && ((syncFlags & SYNC_CLONE)==0 || nCycle>0) ){
1512 const char *zName;
1513 if( zOpType==0 ) zOpType = "Pull";
@@ -1663,20 +1663,20 @@
1663 if( syncFlags & SYNC_PUSH ){
1664 int rid = rid_from_uuid(&xfer.aToken[1], 0, 0);
1665 if( rid ) send_file(&xfer, rid, &xfer.aToken[1], 0);
1666 }
1667 }else
1668
1669 /* igot UUID ?PRIVATEFLAG?
1670 **
1671 ** Server announces that it has a particular file. If this is
1672 ** not a file that we have and we are pulling, then create a
1673 ** phantom to cause this file to be requested on the next cycle.
1674 ** Always remember that the server has this file so that we do
1675 ** not transmit it by accident.
1676 **
1677 ** If the PRIVATE argument exists and is 1, then the file is
1678 ** private. Pretend it does not exists if we are not pulling
1679 ** private files.
1680 */
1681 if( xfer.nToken>=2
1682 && blob_eq(&xfer.aToken[0], "igot")
@@ -1693,12 +1693,12 @@
1693 rid = content_new(blob_str(&xfer.aToken[1]), isPriv);
1694 if( rid ) newPhantom = 1;
1695 }
1696 remote_has(rid);
1697 }else
1698
1699
1700 /* push SERVERCODE PRODUCTCODE
1701 **
1702 ** Should only happen in response to a clone. This message tells
1703 ** the client what product to use for the new database.
1704 */
@@ -1716,11 +1716,11 @@
1716 db_set("project-code", zPCode, 0);
1717 }
1718 if( cloneSeqno>0 ) blob_appendf(&send, "clone 3 %d\n", cloneSeqno);
1719 nCardSent++;
1720 }else
1721
1722 /* config NAME SIZE \n CONTENT
1723 **
1724 ** Receive a configuration value from the server.
1725 **
1726 ** The received configuration setting is silently ignored if it was
@@ -1738,11 +1738,11 @@
1738 nArtifactRcvd++;
1739 blob_reset(&content);
1740 blob_seek(xfer.pIn, 1, BLOB_SEEK_CUR);
1741 }else
1742
1743
1744 /* cookie TEXT
1745 **
1746 ** The server might include a cookie in its reply. The client
1747 ** should remember this cookie and send it back to the server
1748 ** in its next query.
@@ -1780,11 +1780,11 @@
1780 **
1781 ** Print a message. Similar to "error" but does not stop processing.
1782 **
1783 ** If the "login failed" message is seen, clear the sync password prior
1784 ** to the next cycle.
1785 */
1786 if( blob_eq(&xfer.aToken[0],"message") && xfer.nToken==2 ){
1787 char *zMsg = blob_terminate(&xfer.aToken[1]);
1788 defossilize(zMsg);
1789 if( (syncFlags & SYNC_PUSH) && zMsg && strglob("pull only *", zMsg) ){
1790 syncFlags &= ~SYNC_PUSH;
@@ -1797,11 +1797,11 @@
1797 }else
1798
1799 /* pragma NAME VALUE...
1800 **
1801 ** The server can send pragmas to try to convey meta-information to
1802 ** the client. These are informational only. Unknown pragmas are
1803 ** silently ignored.
1804 */
1805 if( blob_eq(&xfer.aToken[0], "pragma") && xfer.nToken>=2 ){
1806 }else
1807
@@ -1810,14 +1810,14 @@
1810 ** Report an error and abandon the sync session.
1811 **
1812 ** Except, when cloning we will sometimes get an error on the
1813 ** first message exchange because the project-code is unknown
1814 ** and so the login card on the request was invalid. The project-code
1815 ** is returned in the reply before the error card, so second and
1816 ** subsequent messages should be OK. Nevertheless, we need to ignore
1817 ** the error card on the first message of a clone.
1818 */
1819 if( blob_eq(&xfer.aToken[0],"error") && xfer.nToken==2 ){
1820 if( (syncFlags & SYNC_CLONE)==0 || nCycle>0 ){
1821 char *zMsg = blob_terminate(&xfer.aToken[1]);
1822 defossilize(zMsg);
1823 fossil_force_newline();
@@ -1894,11 +1894,11 @@
1894 xfer.nFileRcvd = 0;
1895 xfer.nDeltaRcvd = 0;
1896 xfer.nDanglingFile = 0;
1897
1898 /* If we have one or more files queued to send, then go
1899 ** another round
1900 */
1901 if( xfer.nFileSent+xfer.nDeltaSent>0 ){
1902 go = 1;
1903 }
1904
@@ -1908,11 +1908,11 @@
1908 /* Stop the cycle if the server sends a "clone_seqno 0" card and
1909 ** we have gone at least two rounds. Always go at least two rounds
1910 ** on a clone in order to be sure to retrieve the configuration
1911 ** information which is only sent on the second round.
1912 */
1913 if( cloneSeqno<=0 && nCycle>1 ) go = 0;
1914 };
1915 transport_stats(&nSent, &nRcvd, 1);
1916 if( (rSkew*24.0*3600.0) > 10.0 ){
1917 fossil_warning("*** time skew *** server is fast by %s",
1918 db_timespan_name(rSkew));
1919

Keyboard Shortcuts

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