Fossil SCM

Do not use strcmp() for comparison since the sort order can vary by locale. Use fossil_strcmp() instead. Ticket [3f0216560679fd41].

drh 2011-05-27 12:03 trunk
Commit 32ad9a1584a16f09fff78563d789b2dbc6b4bae5
+1 -1
--- src/bisect.c
+++ src/bisect.c
@@ -72,11 +72,11 @@
7272
*/
7373
int bisect_option(const char *zName){
7474
unsigned int i;
7575
int r = -1;
7676
for(i=0; i<sizeof(aBisectOption)/sizeof(aBisectOption[0]); i++){
77
- if( strcmp(zName, aBisectOption[i].zName)==0 ){
77
+ if( fossil_strcmp(zName, aBisectOption[i].zName)==0 ){
7878
char *zLabel = mprintf("bisect-%s", zName);
7979
char *z = db_lget(zLabel, (char*)aBisectOption[i].zDefault);
8080
if( is_truth(z) ) r = 1;
8181
if( is_false(z) ) r = 0;
8282
if( r<0 ) r = is_truth(aBisectOption[i].zDefault);
8383
--- src/bisect.c
+++ src/bisect.c
@@ -72,11 +72,11 @@
72 */
73 int bisect_option(const char *zName){
74 unsigned int i;
75 int r = -1;
76 for(i=0; i<sizeof(aBisectOption)/sizeof(aBisectOption[0]); i++){
77 if( strcmp(zName, aBisectOption[i].zName)==0 ){
78 char *zLabel = mprintf("bisect-%s", zName);
79 char *z = db_lget(zLabel, (char*)aBisectOption[i].zDefault);
80 if( is_truth(z) ) r = 1;
81 if( is_false(z) ) r = 0;
82 if( r<0 ) r = is_truth(aBisectOption[i].zDefault);
83
--- src/bisect.c
+++ src/bisect.c
@@ -72,11 +72,11 @@
72 */
73 int bisect_option(const char *zName){
74 unsigned int i;
75 int r = -1;
76 for(i=0; i<sizeof(aBisectOption)/sizeof(aBisectOption[0]); i++){
77 if( fossil_strcmp(zName, aBisectOption[i].zName)==0 ){
78 char *zLabel = mprintf("bisect-%s", zName);
79 char *z = db_lget(zLabel, (char*)aBisectOption[i].zDefault);
80 if( is_truth(z) ) r = 1;
81 if( is_false(z) ) r = 0;
82 if( r<0 ) r = is_truth(aBisectOption[i].zDefault);
83
+20 -20
--- src/cgi.c
+++ src/cgi.c
@@ -314,11 +314,11 @@
314314
315315
/* Content intended for logged in users should only be cached in
316316
** the browser, not some shared location.
317317
*/
318318
fprintf(g.httpOut, "Content-Type: %s; charset=utf-8\r\n", zContentType);
319
- if( strcmp(zContentType,"application/x-fossil")==0 ){
319
+ if( fossil_strcmp(zContentType,"application/x-fossil")==0 ){
320320
cgi_combine_header_and_body();
321321
blob_compress(&cgiContent[0], &cgiContent[0]);
322322
}
323323
324324
if( iReplyStatus != 304 ) {
@@ -423,11 +423,11 @@
423423
** Replace a parameter with a new value.
424424
*/
425425
void cgi_replace_parameter(const char *zName, const char *zValue){
426426
int i;
427427
for(i=0; i<nUsedQP; i++){
428
- if( strcmp(aParamQP[i].zName,zName)==0 ){
428
+ if( fossil_strcmp(aParamQP[i].zName,zName)==0 ){
429429
aParamQP[i].zValue = zValue;
430430
return;
431431
}
432432
}
433433
cgi_set_parameter_nocopy(zName, zValue);
@@ -685,26 +685,26 @@
685685
686686
len = atoi(PD("CONTENT_LENGTH", "0"));
687687
g.zContentType = zType = P("CONTENT_TYPE");
688688
if( len>0 && zType ){
689689
blob_zero(&g.cgiIn);
690
- if( strcmp(zType,"application/x-www-form-urlencoded")==0
690
+ if( fossil_strcmp(zType,"application/x-www-form-urlencoded")==0
691691
|| strncmp(zType,"multipart/form-data",19)==0 ){
692692
z = fossil_malloc( len+1 );
693693
len = fread(z, 1, len, g.httpIn);
694694
z[len] = 0;
695695
if( zType[0]=='a' ){
696696
add_param_list(z, '&');
697697
}else{
698698
process_multipart_form_data(z, len);
699699
}
700
- }else if( strcmp(zType, "application/x-fossil")==0 ){
700
+ }else if( fossil_strcmp(zType, "application/x-fossil")==0 ){
701701
blob_read_from_channel(&g.cgiIn, g.httpIn, len);
702702
blob_uncompress(&g.cgiIn, &g.cgiIn);
703
- }else if( strcmp(zType, "application/x-fossil-debug")==0 ){
703
+ }else if( fossil_strcmp(zType, "application/x-fossil-debug")==0 ){
704704
blob_read_from_channel(&g.cgiIn, g.httpIn, len);
705
- }else if( strcmp(zType, "application/x-fossil-uncompressed")==0 ){
705
+ }else if( fossil_strcmp(zType, "application/x-fossil-uncompressed")==0 ){
706706
blob_read_from_channel(&g.cgiIn, g.httpIn, len);
707707
}
708708
}
709709
710710
z = (char*)P("HTTP_COOKIE");
@@ -720,11 +720,11 @@
720720
*/
721721
static int qparam_compare(const void *a, const void *b){
722722
struct QParam *pA = (struct QParam*)a;
723723
struct QParam *pB = (struct QParam*)b;
724724
int c;
725
- c = strcmp(pA->zName, pB->zName);
725
+ c = fossil_strcmp(pA->zName, pB->zName);
726726
if( c==0 ){
727727
c = pA->seq - pB->seq;
728728
}
729729
return c;
730730
}
@@ -749,11 +749,11 @@
749749
/* After sorting, remove duplicate parameters. The secondary sort
750750
** key is aParamQP[].seq and we keep the first entry. That means
751751
** with duplicate calls to cgi_set_parameter() the second and
752752
** subsequent calls are effectively no-ops. */
753753
for(i=j=1; i<nUsedQP; i++){
754
- if( strcmp(aParamQP[i].zName,aParamQP[i-1].zName)==0 ){
754
+ if( fossil_strcmp(aParamQP[i].zName,aParamQP[i-1].zName)==0 ){
755755
continue;
756756
}
757757
if( j<i ){
758758
memcpy(&aParamQP[j], &aParamQP[i], sizeof(aParamQP[j]));
759759
}
@@ -765,11 +765,11 @@
765765
/* Do a binary search for a matching query parameter */
766766
lo = 0;
767767
hi = nUsedQP-1;
768768
while( lo<=hi ){
769769
mid = (lo+hi)/2;
770
- c = strcmp(aParamQP[mid].zName, zName);
770
+ c = fossil_strcmp(aParamQP[mid].zName, zName);
771771
if( c==0 ){
772772
CGIDEBUG(("mem-match [%s] = [%s]\n", zName, aParamQP[mid].zValue));
773773
return aParamQP[mid].zValue;
774774
}else if( c>0 ){
775775
hi = mid-1;
@@ -976,12 +976,12 @@
976976
}
977977
zToken = extract_token(zLine, &z);
978978
if( zToken==0 ){
979979
malformed_request();
980980
}
981
- if( strcmp(zToken,"GET")!=0 && strcmp(zToken,"POST")!=0
982
- && strcmp(zToken,"HEAD")!=0 ){
981
+ if( fossil_strcmp(zToken,"GET")!=0 && fossil_strcmp(zToken,"POST")!=0
982
+ && fossil_strcmp(zToken,"HEAD")!=0 ){
983983
malformed_request();
984984
}
985985
cgi_setenv("GATEWAY_INTERFACE","CGI/1.0");
986986
cgi_setenv("REQUEST_METHOD",zToken);
987987
zToken = extract_token(z, &z);
@@ -1017,29 +1017,29 @@
10171017
while( i>0 && fossil_isspace(zVal[i-1]) ){ i--; }
10181018
zVal[i] = 0;
10191019
for(i=0; zFieldName[i]; i++){
10201020
zFieldName[i] = fossil_tolower(zFieldName[i]);
10211021
}
1022
- if( strcmp(zFieldName,"content-length:")==0 ){
1022
+ if( fossil_strcmp(zFieldName,"content-length:")==0 ){
10231023
cgi_setenv("CONTENT_LENGTH", zVal);
1024
- }else if( strcmp(zFieldName,"content-type:")==0 ){
1024
+ }else if( fossil_strcmp(zFieldName,"content-type:")==0 ){
10251025
cgi_setenv("CONTENT_TYPE", zVal);
1026
- }else if( strcmp(zFieldName,"cookie:")==0 ){
1026
+ }else if( fossil_strcmp(zFieldName,"cookie:")==0 ){
10271027
cgi_setenv("HTTP_COOKIE", zVal);
1028
- }else if( strcmp(zFieldName,"https:")==0 ){
1028
+ }else if( fossil_strcmp(zFieldName,"https:")==0 ){
10291029
cgi_setenv("HTTPS", zVal);
1030
- }else if( strcmp(zFieldName,"host:")==0 ){
1030
+ }else if( fossil_strcmp(zFieldName,"host:")==0 ){
10311031
cgi_setenv("HTTP_HOST", zVal);
1032
- }else if( strcmp(zFieldName,"if-none-match:")==0 ){
1032
+ }else if( fossil_strcmp(zFieldName,"if-none-match:")==0 ){
10331033
cgi_setenv("HTTP_IF_NONE_MATCH", zVal);
1034
- }else if( strcmp(zFieldName,"if-modified-since:")==0 ){
1034
+ }else if( fossil_strcmp(zFieldName,"if-modified-since:")==0 ){
10351035
cgi_setenv("HTTP_IF_MODIFIED_SINCE", zVal);
10361036
}
10371037
#if 0
1038
- else if( strcmp(zFieldName,"referer:")==0 ){
1038
+ else if( fossil_strcmp(zFieldName,"referer:")==0 ){
10391039
cgi_setenv("HTTP_REFERER", zVal);
1040
- }else if( strcmp(zFieldName,"user-agent:")==0 ){
1040
+ }else if( fossil_strcmp(zFieldName,"user-agent:")==0 ){
10411041
cgi_setenv("HTTP_USER_AGENT", zVal);
10421042
}
10431043
#endif
10441044
}
10451045
10461046
--- src/cgi.c
+++ src/cgi.c
@@ -314,11 +314,11 @@
314
315 /* Content intended for logged in users should only be cached in
316 ** the browser, not some shared location.
317 */
318 fprintf(g.httpOut, "Content-Type: %s; charset=utf-8\r\n", zContentType);
319 if( strcmp(zContentType,"application/x-fossil")==0 ){
320 cgi_combine_header_and_body();
321 blob_compress(&cgiContent[0], &cgiContent[0]);
322 }
323
324 if( iReplyStatus != 304 ) {
@@ -423,11 +423,11 @@
423 ** Replace a parameter with a new value.
424 */
425 void cgi_replace_parameter(const char *zName, const char *zValue){
426 int i;
427 for(i=0; i<nUsedQP; i++){
428 if( strcmp(aParamQP[i].zName,zName)==0 ){
429 aParamQP[i].zValue = zValue;
430 return;
431 }
432 }
433 cgi_set_parameter_nocopy(zName, zValue);
@@ -685,26 +685,26 @@
685
686 len = atoi(PD("CONTENT_LENGTH", "0"));
687 g.zContentType = zType = P("CONTENT_TYPE");
688 if( len>0 && zType ){
689 blob_zero(&g.cgiIn);
690 if( strcmp(zType,"application/x-www-form-urlencoded")==0
691 || strncmp(zType,"multipart/form-data",19)==0 ){
692 z = fossil_malloc( len+1 );
693 len = fread(z, 1, len, g.httpIn);
694 z[len] = 0;
695 if( zType[0]=='a' ){
696 add_param_list(z, '&');
697 }else{
698 process_multipart_form_data(z, len);
699 }
700 }else if( strcmp(zType, "application/x-fossil")==0 ){
701 blob_read_from_channel(&g.cgiIn, g.httpIn, len);
702 blob_uncompress(&g.cgiIn, &g.cgiIn);
703 }else if( strcmp(zType, "application/x-fossil-debug")==0 ){
704 blob_read_from_channel(&g.cgiIn, g.httpIn, len);
705 }else if( strcmp(zType, "application/x-fossil-uncompressed")==0 ){
706 blob_read_from_channel(&g.cgiIn, g.httpIn, len);
707 }
708 }
709
710 z = (char*)P("HTTP_COOKIE");
@@ -720,11 +720,11 @@
720 */
721 static int qparam_compare(const void *a, const void *b){
722 struct QParam *pA = (struct QParam*)a;
723 struct QParam *pB = (struct QParam*)b;
724 int c;
725 c = strcmp(pA->zName, pB->zName);
726 if( c==0 ){
727 c = pA->seq - pB->seq;
728 }
729 return c;
730 }
@@ -749,11 +749,11 @@
749 /* After sorting, remove duplicate parameters. The secondary sort
750 ** key is aParamQP[].seq and we keep the first entry. That means
751 ** with duplicate calls to cgi_set_parameter() the second and
752 ** subsequent calls are effectively no-ops. */
753 for(i=j=1; i<nUsedQP; i++){
754 if( strcmp(aParamQP[i].zName,aParamQP[i-1].zName)==0 ){
755 continue;
756 }
757 if( j<i ){
758 memcpy(&aParamQP[j], &aParamQP[i], sizeof(aParamQP[j]));
759 }
@@ -765,11 +765,11 @@
765 /* Do a binary search for a matching query parameter */
766 lo = 0;
767 hi = nUsedQP-1;
768 while( lo<=hi ){
769 mid = (lo+hi)/2;
770 c = strcmp(aParamQP[mid].zName, zName);
771 if( c==0 ){
772 CGIDEBUG(("mem-match [%s] = [%s]\n", zName, aParamQP[mid].zValue));
773 return aParamQP[mid].zValue;
774 }else if( c>0 ){
775 hi = mid-1;
@@ -976,12 +976,12 @@
976 }
977 zToken = extract_token(zLine, &z);
978 if( zToken==0 ){
979 malformed_request();
980 }
981 if( strcmp(zToken,"GET")!=0 && strcmp(zToken,"POST")!=0
982 && strcmp(zToken,"HEAD")!=0 ){
983 malformed_request();
984 }
985 cgi_setenv("GATEWAY_INTERFACE","CGI/1.0");
986 cgi_setenv("REQUEST_METHOD",zToken);
987 zToken = extract_token(z, &z);
@@ -1017,29 +1017,29 @@
1017 while( i>0 && fossil_isspace(zVal[i-1]) ){ i--; }
1018 zVal[i] = 0;
1019 for(i=0; zFieldName[i]; i++){
1020 zFieldName[i] = fossil_tolower(zFieldName[i]);
1021 }
1022 if( strcmp(zFieldName,"content-length:")==0 ){
1023 cgi_setenv("CONTENT_LENGTH", zVal);
1024 }else if( strcmp(zFieldName,"content-type:")==0 ){
1025 cgi_setenv("CONTENT_TYPE", zVal);
1026 }else if( strcmp(zFieldName,"cookie:")==0 ){
1027 cgi_setenv("HTTP_COOKIE", zVal);
1028 }else if( strcmp(zFieldName,"https:")==0 ){
1029 cgi_setenv("HTTPS", zVal);
1030 }else if( strcmp(zFieldName,"host:")==0 ){
1031 cgi_setenv("HTTP_HOST", zVal);
1032 }else if( strcmp(zFieldName,"if-none-match:")==0 ){
1033 cgi_setenv("HTTP_IF_NONE_MATCH", zVal);
1034 }else if( strcmp(zFieldName,"if-modified-since:")==0 ){
1035 cgi_setenv("HTTP_IF_MODIFIED_SINCE", zVal);
1036 }
1037 #if 0
1038 else if( strcmp(zFieldName,"referer:")==0 ){
1039 cgi_setenv("HTTP_REFERER", zVal);
1040 }else if( strcmp(zFieldName,"user-agent:")==0 ){
1041 cgi_setenv("HTTP_USER_AGENT", zVal);
1042 }
1043 #endif
1044 }
1045
1046
--- src/cgi.c
+++ src/cgi.c
@@ -314,11 +314,11 @@
314
315 /* Content intended for logged in users should only be cached in
316 ** the browser, not some shared location.
317 */
318 fprintf(g.httpOut, "Content-Type: %s; charset=utf-8\r\n", zContentType);
319 if( fossil_strcmp(zContentType,"application/x-fossil")==0 ){
320 cgi_combine_header_and_body();
321 blob_compress(&cgiContent[0], &cgiContent[0]);
322 }
323
324 if( iReplyStatus != 304 ) {
@@ -423,11 +423,11 @@
423 ** Replace a parameter with a new value.
424 */
425 void cgi_replace_parameter(const char *zName, const char *zValue){
426 int i;
427 for(i=0; i<nUsedQP; i++){
428 if( fossil_strcmp(aParamQP[i].zName,zName)==0 ){
429 aParamQP[i].zValue = zValue;
430 return;
431 }
432 }
433 cgi_set_parameter_nocopy(zName, zValue);
@@ -685,26 +685,26 @@
685
686 len = atoi(PD("CONTENT_LENGTH", "0"));
687 g.zContentType = zType = P("CONTENT_TYPE");
688 if( len>0 && zType ){
689 blob_zero(&g.cgiIn);
690 if( fossil_strcmp(zType,"application/x-www-form-urlencoded")==0
691 || strncmp(zType,"multipart/form-data",19)==0 ){
692 z = fossil_malloc( len+1 );
693 len = fread(z, 1, len, g.httpIn);
694 z[len] = 0;
695 if( zType[0]=='a' ){
696 add_param_list(z, '&');
697 }else{
698 process_multipart_form_data(z, len);
699 }
700 }else if( fossil_strcmp(zType, "application/x-fossil")==0 ){
701 blob_read_from_channel(&g.cgiIn, g.httpIn, len);
702 blob_uncompress(&g.cgiIn, &g.cgiIn);
703 }else if( fossil_strcmp(zType, "application/x-fossil-debug")==0 ){
704 blob_read_from_channel(&g.cgiIn, g.httpIn, len);
705 }else if( fossil_strcmp(zType, "application/x-fossil-uncompressed")==0 ){
706 blob_read_from_channel(&g.cgiIn, g.httpIn, len);
707 }
708 }
709
710 z = (char*)P("HTTP_COOKIE");
@@ -720,11 +720,11 @@
720 */
721 static int qparam_compare(const void *a, const void *b){
722 struct QParam *pA = (struct QParam*)a;
723 struct QParam *pB = (struct QParam*)b;
724 int c;
725 c = fossil_strcmp(pA->zName, pB->zName);
726 if( c==0 ){
727 c = pA->seq - pB->seq;
728 }
729 return c;
730 }
@@ -749,11 +749,11 @@
749 /* After sorting, remove duplicate parameters. The secondary sort
750 ** key is aParamQP[].seq and we keep the first entry. That means
751 ** with duplicate calls to cgi_set_parameter() the second and
752 ** subsequent calls are effectively no-ops. */
753 for(i=j=1; i<nUsedQP; i++){
754 if( fossil_strcmp(aParamQP[i].zName,aParamQP[i-1].zName)==0 ){
755 continue;
756 }
757 if( j<i ){
758 memcpy(&aParamQP[j], &aParamQP[i], sizeof(aParamQP[j]));
759 }
@@ -765,11 +765,11 @@
765 /* Do a binary search for a matching query parameter */
766 lo = 0;
767 hi = nUsedQP-1;
768 while( lo<=hi ){
769 mid = (lo+hi)/2;
770 c = fossil_strcmp(aParamQP[mid].zName, zName);
771 if( c==0 ){
772 CGIDEBUG(("mem-match [%s] = [%s]\n", zName, aParamQP[mid].zValue));
773 return aParamQP[mid].zValue;
774 }else if( c>0 ){
775 hi = mid-1;
@@ -976,12 +976,12 @@
976 }
977 zToken = extract_token(zLine, &z);
978 if( zToken==0 ){
979 malformed_request();
980 }
981 if( fossil_strcmp(zToken,"GET")!=0 && fossil_strcmp(zToken,"POST")!=0
982 && fossil_strcmp(zToken,"HEAD")!=0 ){
983 malformed_request();
984 }
985 cgi_setenv("GATEWAY_INTERFACE","CGI/1.0");
986 cgi_setenv("REQUEST_METHOD",zToken);
987 zToken = extract_token(z, &z);
@@ -1017,29 +1017,29 @@
1017 while( i>0 && fossil_isspace(zVal[i-1]) ){ i--; }
1018 zVal[i] = 0;
1019 for(i=0; zFieldName[i]; i++){
1020 zFieldName[i] = fossil_tolower(zFieldName[i]);
1021 }
1022 if( fossil_strcmp(zFieldName,"content-length:")==0 ){
1023 cgi_setenv("CONTENT_LENGTH", zVal);
1024 }else if( fossil_strcmp(zFieldName,"content-type:")==0 ){
1025 cgi_setenv("CONTENT_TYPE", zVal);
1026 }else if( fossil_strcmp(zFieldName,"cookie:")==0 ){
1027 cgi_setenv("HTTP_COOKIE", zVal);
1028 }else if( fossil_strcmp(zFieldName,"https:")==0 ){
1029 cgi_setenv("HTTPS", zVal);
1030 }else if( fossil_strcmp(zFieldName,"host:")==0 ){
1031 cgi_setenv("HTTP_HOST", zVal);
1032 }else if( fossil_strcmp(zFieldName,"if-none-match:")==0 ){
1033 cgi_setenv("HTTP_IF_NONE_MATCH", zVal);
1034 }else if( fossil_strcmp(zFieldName,"if-modified-since:")==0 ){
1035 cgi_setenv("HTTP_IF_MODIFIED_SINCE", zVal);
1036 }
1037 #if 0
1038 else if( fossil_strcmp(zFieldName,"referer:")==0 ){
1039 cgi_setenv("HTTP_REFERER", zVal);
1040 }else if( fossil_strcmp(zFieldName,"user-agent:")==0 ){
1041 cgi_setenv("HTTP_USER_AGENT", zVal);
1042 }
1043 #endif
1044 }
1045
1046
+1 -1
--- src/configure.c
+++ src/configure.c
@@ -506,11 +506,11 @@
506506
}
507507
blob_reset(&sql);
508508
}else{
509509
/* Otherwise, the old format */
510510
if( (configure_is_exportable(zName) & groupMask)==0 ) return;
511
- if( strcmp(zName, "logo-image")==0 ){
511
+ if( fossil_strcmp(zName, "logo-image")==0 ){
512512
Stmt ins;
513513
db_prepare(&ins,
514514
"REPLACE INTO config(name, value, mtime) VALUES(:name, :value, now())"
515515
);
516516
db_bind_text(&ins, ":name", zName);
517517
--- src/configure.c
+++ src/configure.c
@@ -506,11 +506,11 @@
506 }
507 blob_reset(&sql);
508 }else{
509 /* Otherwise, the old format */
510 if( (configure_is_exportable(zName) & groupMask)==0 ) return;
511 if( strcmp(zName, "logo-image")==0 ){
512 Stmt ins;
513 db_prepare(&ins,
514 "REPLACE INTO config(name, value, mtime) VALUES(:name, :value, now())"
515 );
516 db_bind_text(&ins, ":name", zName);
517
--- src/configure.c
+++ src/configure.c
@@ -506,11 +506,11 @@
506 }
507 blob_reset(&sql);
508 }else{
509 /* Otherwise, the old format */
510 if( (configure_is_exportable(zName) & groupMask)==0 ) return;
511 if( fossil_strcmp(zName, "logo-image")==0 ){
512 Stmt ins;
513 db_prepare(&ins,
514 "REPLACE INTO config(name, value, mtime) VALUES(:name, :value, now())"
515 );
516 db_bind_text(&ins, ":name", zName);
517
+1 -1
--- src/content.c
+++ src/content.c
@@ -850,11 +850,11 @@
850850
if( blob_size(&content)!=size ){
851851
fossil_warning("size mismatch on blob rid=%d: %d vs %d",
852852
rid, blob_size(&content), size);
853853
}
854854
sha1sum_blob(&content, &cksum);
855
- if( strcmp(blob_str(&cksum), zUuid)!=0 ){
855
+ if( fossil_strcmp(blob_str(&cksum), zUuid)!=0 ){
856856
fossil_fatal("checksum mismatch on blob rid=%d: %s vs %s",
857857
rid, blob_str(&cksum), zUuid);
858858
}
859859
blob_reset(&cksum);
860860
blob_reset(&content);
861861
--- src/content.c
+++ src/content.c
@@ -850,11 +850,11 @@
850 if( blob_size(&content)!=size ){
851 fossil_warning("size mismatch on blob rid=%d: %d vs %d",
852 rid, blob_size(&content), size);
853 }
854 sha1sum_blob(&content, &cksum);
855 if( strcmp(blob_str(&cksum), zUuid)!=0 ){
856 fossil_fatal("checksum mismatch on blob rid=%d: %s vs %s",
857 rid, blob_str(&cksum), zUuid);
858 }
859 blob_reset(&cksum);
860 blob_reset(&content);
861
--- src/content.c
+++ src/content.c
@@ -850,11 +850,11 @@
850 if( blob_size(&content)!=size ){
851 fossil_warning("size mismatch on blob rid=%d: %d vs %d",
852 rid, blob_size(&content), size);
853 }
854 sha1sum_blob(&content, &cksum);
855 if( fossil_strcmp(blob_str(&cksum), zUuid)!=0 ){
856 fossil_fatal("checksum mismatch on blob rid=%d: %s vs %s",
857 rid, blob_str(&cksum), zUuid);
858 }
859 blob_reset(&cksum);
860 blob_reset(&content);
861
+4 -4
--- src/db.c
+++ src/db.c
@@ -907,14 +907,14 @@
907907
908908
/*
909909
** Return the name of the database "localdb", "configdb", or "repository".
910910
*/
911911
const char *db_name(const char *zDb){
912
- assert( strcmp(zDb,"localdb")==0
913
- || strcmp(zDb,"configdb")==0
914
- || strcmp(zDb,"repository")==0 );
915
- if( strcmp(zDb, g.zMainDbType)==0 ) zDb = "main";
912
+ assert( fossil_strcmp(zDb,"localdb")==0
913
+ || fossil_strcmp(zDb,"configdb")==0
914
+ || fossil_strcmp(zDb,"repository")==0 );
915
+ if( fossil_strcmp(zDb, g.zMainDbType)==0 ) zDb = "main";
916916
return zDb;
917917
}
918918
919919
/*
920920
** Return TRUE if the schema is out-of-date
921921
--- src/db.c
+++ src/db.c
@@ -907,14 +907,14 @@
907
908 /*
909 ** Return the name of the database "localdb", "configdb", or "repository".
910 */
911 const char *db_name(const char *zDb){
912 assert( strcmp(zDb,"localdb")==0
913 || strcmp(zDb,"configdb")==0
914 || strcmp(zDb,"repository")==0 );
915 if( strcmp(zDb, g.zMainDbType)==0 ) zDb = "main";
916 return zDb;
917 }
918
919 /*
920 ** Return TRUE if the schema is out-of-date
921
--- src/db.c
+++ src/db.c
@@ -907,14 +907,14 @@
907
908 /*
909 ** Return the name of the database "localdb", "configdb", or "repository".
910 */
911 const char *db_name(const char *zDb){
912 assert( fossil_strcmp(zDb,"localdb")==0
913 || fossil_strcmp(zDb,"configdb")==0
914 || fossil_strcmp(zDb,"repository")==0 );
915 if( fossil_strcmp(zDb, g.zMainDbType)==0 ) zDb = "main";
916 return zDb;
917 }
918
919 /*
920 ** Return TRUE if the schema is out-of-date
921
+2 -2
--- src/http.c
+++ src/http.c
@@ -39,11 +39,11 @@
3939
const char *zPw; /* The user password */
4040
Blob pw; /* The nonce with user password appended */
4141
Blob sig; /* The signature field */
4242
4343
blob_zero(pLogin);
44
- if( g.urlUser==0 || strcmp(g.urlUser, "anonymous")==0 ){
44
+ if( g.urlUser==0 || fossil_strcmp(g.urlUser, "anonymous")==0 ){
4545
return; /* If no login card for users "nobody" and "anonymous" */
4646
}
4747
if( g.urlIsSsh ){
4848
return; /* If no login card for SSH: */
4949
}
@@ -233,11 +233,11 @@
233233
}else if( rc==302 && fossil_strnicmp(zLine, "location:", 9)==0 ){
234234
int i, j;
235235
for(i=9; zLine[i] && zLine[i]==' '; i++){}
236236
if( zLine[i]==0 ) fossil_fatal("malformed redirect: %s", zLine);
237237
j = strlen(zLine) - 1;
238
- while( j>4 && strcmp(&zLine[j-4],"/xfer")==0 ){
238
+ while( j>4 && fossil_strcmp(&zLine[j-4],"/xfer")==0 ){
239239
j -= 4;
240240
zLine[j] = 0;
241241
}
242242
fossil_print("redirect to %s\n", &zLine[i]);
243243
url_parse(&zLine[i]);
244244
--- src/http.c
+++ src/http.c
@@ -39,11 +39,11 @@
39 const char *zPw; /* The user password */
40 Blob pw; /* The nonce with user password appended */
41 Blob sig; /* The signature field */
42
43 blob_zero(pLogin);
44 if( g.urlUser==0 || strcmp(g.urlUser, "anonymous")==0 ){
45 return; /* If no login card for users "nobody" and "anonymous" */
46 }
47 if( g.urlIsSsh ){
48 return; /* If no login card for SSH: */
49 }
@@ -233,11 +233,11 @@
233 }else if( rc==302 && fossil_strnicmp(zLine, "location:", 9)==0 ){
234 int i, j;
235 for(i=9; zLine[i] && zLine[i]==' '; i++){}
236 if( zLine[i]==0 ) fossil_fatal("malformed redirect: %s", zLine);
237 j = strlen(zLine) - 1;
238 while( j>4 && strcmp(&zLine[j-4],"/xfer")==0 ){
239 j -= 4;
240 zLine[j] = 0;
241 }
242 fossil_print("redirect to %s\n", &zLine[i]);
243 url_parse(&zLine[i]);
244
--- src/http.c
+++ src/http.c
@@ -39,11 +39,11 @@
39 const char *zPw; /* The user password */
40 Blob pw; /* The nonce with user password appended */
41 Blob sig; /* The signature field */
42
43 blob_zero(pLogin);
44 if( g.urlUser==0 || fossil_strcmp(g.urlUser, "anonymous")==0 ){
45 return; /* If no login card for users "nobody" and "anonymous" */
46 }
47 if( g.urlIsSsh ){
48 return; /* If no login card for SSH: */
49 }
@@ -233,11 +233,11 @@
233 }else if( rc==302 && fossil_strnicmp(zLine, "location:", 9)==0 ){
234 int i, j;
235 for(i=9; zLine[i] && zLine[i]==' '; i++){}
236 if( zLine[i]==0 ) fossil_fatal("malformed redirect: %s", zLine);
237 j = strlen(zLine) - 1;
238 while( j>4 && fossil_strcmp(&zLine[j-4],"/xfer")==0 ){
239 j -= 4;
240 zLine[j] = 0;
241 }
242 fossil_print("redirect to %s\n", &zLine[i]);
243 url_parse(&zLine[i]);
244
+1 -1
--- src/import.c
+++ src/import.c
@@ -205,11 +205,11 @@
205205
** Compare two ImportFile objects for sorting
206206
*/
207207
static int mfile_cmp(const void *pLeft, const void *pRight){
208208
const ImportFile *pA = (const ImportFile*)pLeft;
209209
const ImportFile *pB = (const ImportFile*)pRight;
210
- return strcmp(pA->zName, pB->zName);
210
+ return fossil_strcmp(pA->zName, pB->zName);
211211
}
212212
213213
/* Forward reference */
214214
static void import_prior_files(void);
215215
216216
--- src/import.c
+++ src/import.c
@@ -205,11 +205,11 @@
205 ** Compare two ImportFile objects for sorting
206 */
207 static int mfile_cmp(const void *pLeft, const void *pRight){
208 const ImportFile *pA = (const ImportFile*)pLeft;
209 const ImportFile *pB = (const ImportFile*)pRight;
210 return strcmp(pA->zName, pB->zName);
211 }
212
213 /* Forward reference */
214 static void import_prior_files(void);
215
216
--- src/import.c
+++ src/import.c
@@ -205,11 +205,11 @@
205 ** Compare two ImportFile objects for sorting
206 */
207 static int mfile_cmp(const void *pLeft, const void *pRight){
208 const ImportFile *pA = (const ImportFile*)pLeft;
209 const ImportFile *pB = (const ImportFile*)pRight;
210 return fossil_strcmp(pA->zName, pB->zName);
211 }
212
213 /* Forward reference */
214 static void import_prior_files(void);
215
216
+2 -2
--- src/info.c
+++ src/info.c
@@ -220,11 +220,11 @@
220220
hyperlink_to_uuid(zOrigUuid);
221221
}else{
222222
@ propagates to descendants
223223
}
224224
#if 0
225
- if( zValue && strcmp(zTagname,"branch")==0 ){
225
+ if( zValue && fossil_strcmp(zTagname,"branch")==0 ){
226226
@ &nbsp;&nbsp;
227227
@ <a href="%s(g.zTop)/timeline?r=%T(zValue)">branch timeline</a>
228228
}
229229
#endif
230230
}
@@ -1619,11 +1619,11 @@
16191619
blob_zero(&ctrl);
16201620
zNow = date_in_standard_format("now");
16211621
blob_appendf(&ctrl, "D %s\n", zNow);
16221622
db_multi_exec("CREATE TEMP TABLE newtags(tag UNIQUE, prefix, value)");
16231623
if( zNewColor[0]
1624
- && (fPropagateColor!=fNewPropagateColor || strcmp(zColor,zNewColor)!=0)
1624
+ && (fPropagateColor!=fNewPropagateColor || fossil_strcmp(zColor,zNewColor)!=0)
16251625
){
16261626
char *zPrefix = "+";
16271627
if( fNewPropagateColor ){
16281628
zPrefix = "*";
16291629
}
16301630
--- src/info.c
+++ src/info.c
@@ -220,11 +220,11 @@
220 hyperlink_to_uuid(zOrigUuid);
221 }else{
222 @ propagates to descendants
223 }
224 #if 0
225 if( zValue && strcmp(zTagname,"branch")==0 ){
226 @ &nbsp;&nbsp;
227 @ <a href="%s(g.zTop)/timeline?r=%T(zValue)">branch timeline</a>
228 }
229 #endif
230 }
@@ -1619,11 +1619,11 @@
1619 blob_zero(&ctrl);
1620 zNow = date_in_standard_format("now");
1621 blob_appendf(&ctrl, "D %s\n", zNow);
1622 db_multi_exec("CREATE TEMP TABLE newtags(tag UNIQUE, prefix, value)");
1623 if( zNewColor[0]
1624 && (fPropagateColor!=fNewPropagateColor || strcmp(zColor,zNewColor)!=0)
1625 ){
1626 char *zPrefix = "+";
1627 if( fNewPropagateColor ){
1628 zPrefix = "*";
1629 }
1630
--- src/info.c
+++ src/info.c
@@ -220,11 +220,11 @@
220 hyperlink_to_uuid(zOrigUuid);
221 }else{
222 @ propagates to descendants
223 }
224 #if 0
225 if( zValue && fossil_strcmp(zTagname,"branch")==0 ){
226 @ &nbsp;&nbsp;
227 @ <a href="%s(g.zTop)/timeline?r=%T(zValue)">branch timeline</a>
228 }
229 #endif
230 }
@@ -1619,11 +1619,11 @@
1619 blob_zero(&ctrl);
1620 zNow = date_in_standard_format("now");
1621 blob_appendf(&ctrl, "D %s\n", zNow);
1622 db_multi_exec("CREATE TEMP TABLE newtags(tag UNIQUE, prefix, value)");
1623 if( zNewColor[0]
1624 && (fPropagateColor!=fNewPropagateColor || fossil_strcmp(zColor,zNewColor)!=0)
1625 ){
1626 char *zPrefix = "+";
1627 if( fNewPropagateColor ){
1628 zPrefix = "*";
1629 }
1630
+5 -5
--- src/login.c
+++ src/login.c
@@ -152,11 +152,11 @@
152152
const char *zPw; /* The correct password shown in the captcha */
153153
int uid; /* The user ID of anonymous */
154154
155155
if( zUsername==0 ) return 0;
156156
if( zPassword==0 ) return 0;
157
- if( strcmp(zUsername,"anonymous")!=0 ) return 0;
157
+ if( fossil_strcmp(zUsername,"anonymous")!=0 ) return 0;
158158
zCS = P("cs"); /* The "cs" parameter is the "captcha seed" */
159159
if( zCS==0 ) return 0;
160160
zPw = captcha_decode((unsigned int)atoi(zCS));
161161
if( fossil_stricmp(zPw, zPassword)!=0 ) return 0;
162162
uid = db_int(0, "SELECT uid FROM user WHERE login='anonymous'"
@@ -561,11 +561,11 @@
561561
**
562562
** This feature allows the "fossil ui" command to give the user
563563
** full access rights without having to log in.
564564
*/
565565
zRemoteAddr = ipPrefix(zIpAddr = PD("REMOTE_ADDR","nil"));
566
- if( strcmp(zIpAddr, "127.0.0.1")==0
566
+ if( fossil_strcmp(zIpAddr, "127.0.0.1")==0
567567
&& g.useLocalauth
568568
&& db_get_int("localauth",0)==0
569569
&& P("HTTPS")==0
570570
){
571571
uid = db_int(0, "SELECT uid FROM user WHERE cap LIKE '%%s%%'");
@@ -594,11 +594,11 @@
594594
}
595595
}
596596
}
597597
if( zUser==0 ){
598598
/* Invalid cookie */
599
- }else if( strcmp(zUser, "anonymous")==0 ){
599
+ }else if( fossil_strcmp(zUser, "anonymous")==0 ){
600600
/* Cookies of the form "HASH/TIME/anonymous". The TIME must not be
601601
** too old and the sha1 hash of TIME/IPADDR/SECRET must match HASH.
602602
** SECRET is the "captcha-secret" value in the repository.
603603
*/
604604
double rTime = atof(zArg);
@@ -963,11 +963,11 @@
963963
@ </span></p>
964964
}else if( strlen(zPasswd) < 6){
965965
@ <p><span class="loginError">
966966
@ Password too weak.
967967
@ </span></p>
968
- }else if( strcmp(zPasswd,zConfirm)!=0 ){
968
+ }else if( fossil_strcmp(zPasswd,zConfirm)!=0 ){
969969
@ <p><span class="loginError">
970970
@ The two copies of your new passwords do not match.
971971
@ </span></p>
972972
}else if( fossil_stricmp(zPw, zCap)!=0 ){
973973
@ <p><span class="loginError">
@@ -1192,11 +1192,11 @@
11921192
if( zSelfLabel==0 ){
11931193
zSelfLabel = zSelfProjCode;
11941194
}
11951195
11961196
/* Make sure we are not trying to join ourselves */
1197
- if( strcmp(zRepo, zSelfRepo)==0 ){
1197
+ if( fossil_strcmp(zRepo, zSelfRepo)==0 ){
11981198
*pzErrMsg = mprintf("The \"other\" repository is the same as this one.");
11991199
return;
12001200
}
12011201
12021202
/* Make sure the other repository is a valid Fossil database */
12031203
--- src/login.c
+++ src/login.c
@@ -152,11 +152,11 @@
152 const char *zPw; /* The correct password shown in the captcha */
153 int uid; /* The user ID of anonymous */
154
155 if( zUsername==0 ) return 0;
156 if( zPassword==0 ) return 0;
157 if( strcmp(zUsername,"anonymous")!=0 ) return 0;
158 zCS = P("cs"); /* The "cs" parameter is the "captcha seed" */
159 if( zCS==0 ) return 0;
160 zPw = captcha_decode((unsigned int)atoi(zCS));
161 if( fossil_stricmp(zPw, zPassword)!=0 ) return 0;
162 uid = db_int(0, "SELECT uid FROM user WHERE login='anonymous'"
@@ -561,11 +561,11 @@
561 **
562 ** This feature allows the "fossil ui" command to give the user
563 ** full access rights without having to log in.
564 */
565 zRemoteAddr = ipPrefix(zIpAddr = PD("REMOTE_ADDR","nil"));
566 if( strcmp(zIpAddr, "127.0.0.1")==0
567 && g.useLocalauth
568 && db_get_int("localauth",0)==0
569 && P("HTTPS")==0
570 ){
571 uid = db_int(0, "SELECT uid FROM user WHERE cap LIKE '%%s%%'");
@@ -594,11 +594,11 @@
594 }
595 }
596 }
597 if( zUser==0 ){
598 /* Invalid cookie */
599 }else if( strcmp(zUser, "anonymous")==0 ){
600 /* Cookies of the form "HASH/TIME/anonymous". The TIME must not be
601 ** too old and the sha1 hash of TIME/IPADDR/SECRET must match HASH.
602 ** SECRET is the "captcha-secret" value in the repository.
603 */
604 double rTime = atof(zArg);
@@ -963,11 +963,11 @@
963 @ </span></p>
964 }else if( strlen(zPasswd) < 6){
965 @ <p><span class="loginError">
966 @ Password too weak.
967 @ </span></p>
968 }else if( strcmp(zPasswd,zConfirm)!=0 ){
969 @ <p><span class="loginError">
970 @ The two copies of your new passwords do not match.
971 @ </span></p>
972 }else if( fossil_stricmp(zPw, zCap)!=0 ){
973 @ <p><span class="loginError">
@@ -1192,11 +1192,11 @@
1192 if( zSelfLabel==0 ){
1193 zSelfLabel = zSelfProjCode;
1194 }
1195
1196 /* Make sure we are not trying to join ourselves */
1197 if( strcmp(zRepo, zSelfRepo)==0 ){
1198 *pzErrMsg = mprintf("The \"other\" repository is the same as this one.");
1199 return;
1200 }
1201
1202 /* Make sure the other repository is a valid Fossil database */
1203
--- src/login.c
+++ src/login.c
@@ -152,11 +152,11 @@
152 const char *zPw; /* The correct password shown in the captcha */
153 int uid; /* The user ID of anonymous */
154
155 if( zUsername==0 ) return 0;
156 if( zPassword==0 ) return 0;
157 if( fossil_strcmp(zUsername,"anonymous")!=0 ) return 0;
158 zCS = P("cs"); /* The "cs" parameter is the "captcha seed" */
159 if( zCS==0 ) return 0;
160 zPw = captcha_decode((unsigned int)atoi(zCS));
161 if( fossil_stricmp(zPw, zPassword)!=0 ) return 0;
162 uid = db_int(0, "SELECT uid FROM user WHERE login='anonymous'"
@@ -561,11 +561,11 @@
561 **
562 ** This feature allows the "fossil ui" command to give the user
563 ** full access rights without having to log in.
564 */
565 zRemoteAddr = ipPrefix(zIpAddr = PD("REMOTE_ADDR","nil"));
566 if( fossil_strcmp(zIpAddr, "127.0.0.1")==0
567 && g.useLocalauth
568 && db_get_int("localauth",0)==0
569 && P("HTTPS")==0
570 ){
571 uid = db_int(0, "SELECT uid FROM user WHERE cap LIKE '%%s%%'");
@@ -594,11 +594,11 @@
594 }
595 }
596 }
597 if( zUser==0 ){
598 /* Invalid cookie */
599 }else if( fossil_strcmp(zUser, "anonymous")==0 ){
600 /* Cookies of the form "HASH/TIME/anonymous". The TIME must not be
601 ** too old and the sha1 hash of TIME/IPADDR/SECRET must match HASH.
602 ** SECRET is the "captcha-secret" value in the repository.
603 */
604 double rTime = atof(zArg);
@@ -963,11 +963,11 @@
963 @ </span></p>
964 }else if( strlen(zPasswd) < 6){
965 @ <p><span class="loginError">
966 @ Password too weak.
967 @ </span></p>
968 }else if( fossil_strcmp(zPasswd,zConfirm)!=0 ){
969 @ <p><span class="loginError">
970 @ The two copies of your new passwords do not match.
971 @ </span></p>
972 }else if( fossil_stricmp(zPw, zCap)!=0 ){
973 @ <p><span class="loginError">
@@ -1192,11 +1192,11 @@
1192 if( zSelfLabel==0 ){
1193 zSelfLabel = zSelfProjCode;
1194 }
1195
1196 /* Make sure we are not trying to join ourselves */
1197 if( fossil_strcmp(zRepo, zSelfRepo)==0 ){
1198 *pzErrMsg = mprintf("The \"other\" repository is the same as this one.");
1199 return;
1200 }
1201
1202 /* Make sure the other repository is a valid Fossil database */
1203
+3 -18
--- src/main.c
+++ src/main.c
@@ -196,11 +196,11 @@
196196
lwr = 0;
197197
upr = nMap-1;
198198
while( lwr<=upr ){
199199
int mid, c;
200200
mid = (upr+lwr)/2;
201
- c = strcmp(zName, aMap[mid].zName);
201
+ c = fossil_strcmp(zName, aMap[mid].zName);
202202
if( c==0 ){
203203
*pIndex = mid;
204204
return 0;
205205
}else if( c<0 ){
206206
upr = mid - 1;
@@ -446,25 +446,10 @@
446446
rc = system(zOrigCmd);
447447
#endif
448448
return rc;
449449
}
450450
451
-/*
452
-** Like strcmp() except that it accepts NULL pointers. NULL sorts before
453
-** all non-NULL string pointers.
454
-*/
455
-int fossil_strcmp(const char *zA, const char *zB){
456
- if( zA==0 ){
457
- if( zB==0 ) return 0;
458
- return -1;
459
- }else if( zB==0 ){
460
- return +1;
461
- }else{
462
- return strcmp(zA,zB);
463
- }
464
-}
465
-
466451
/*
467452
** Turn off any NL to CRNL translation on the stream given as an
468453
** argument. This is a no-op on unix but is necessary on windows.
469454
*/
470455
void fossil_binary_mode(FILE *p){
@@ -928,11 +913,11 @@
928913
}
929914
if( zRepo[0]=='/' && zRepo[1]=='/' ){ zRepo++; j--; }
930915
931916
szFile = file_size(zRepo);
932917
if( zPathInfo[i]=='/' && szFile<0 ){
933
- assert( strcmp(&zRepo[j], ".fossil")==0 );
918
+ assert( fossil_strcmp(&zRepo[j], ".fossil")==0 );
934919
zRepo[j] = 0;
935920
if( file_isdir(zRepo)==1 ){
936921
fossil_free(zToFree);
937922
i++;
938923
continue;
@@ -1187,11 +1172,11 @@
11871172
zName = P("SCRIPT_NAME");
11881173
if( zName && zName[0]=='/' ) zName++;
11891174
}
11901175
if( zName && validate16(zName, strlen(zName)) ){
11911176
for(i=0; i<nRedirect; i++){
1192
- if( strcmp(azRedirect[i*2],"*")==0 ){
1177
+ if( fossil_strcmp(azRedirect[i*2],"*")==0 ){
11931178
zNotFound = azRedirect[i*2+1];
11941179
continue;
11951180
}
11961181
db_open_repository(azRedirect[i*2]);
11971182
if( db_exists("SELECT 1 FROM blob WHERE uuid GLOB '%s*'", zName) ){
11981183
--- src/main.c
+++ src/main.c
@@ -196,11 +196,11 @@
196 lwr = 0;
197 upr = nMap-1;
198 while( lwr<=upr ){
199 int mid, c;
200 mid = (upr+lwr)/2;
201 c = strcmp(zName, aMap[mid].zName);
202 if( c==0 ){
203 *pIndex = mid;
204 return 0;
205 }else if( c<0 ){
206 upr = mid - 1;
@@ -446,25 +446,10 @@
446 rc = system(zOrigCmd);
447 #endif
448 return rc;
449 }
450
451 /*
452 ** Like strcmp() except that it accepts NULL pointers. NULL sorts before
453 ** all non-NULL string pointers.
454 */
455 int fossil_strcmp(const char *zA, const char *zB){
456 if( zA==0 ){
457 if( zB==0 ) return 0;
458 return -1;
459 }else if( zB==0 ){
460 return +1;
461 }else{
462 return strcmp(zA,zB);
463 }
464 }
465
466 /*
467 ** Turn off any NL to CRNL translation on the stream given as an
468 ** argument. This is a no-op on unix but is necessary on windows.
469 */
470 void fossil_binary_mode(FILE *p){
@@ -928,11 +913,11 @@
928 }
929 if( zRepo[0]=='/' && zRepo[1]=='/' ){ zRepo++; j--; }
930
931 szFile = file_size(zRepo);
932 if( zPathInfo[i]=='/' && szFile<0 ){
933 assert( strcmp(&zRepo[j], ".fossil")==0 );
934 zRepo[j] = 0;
935 if( file_isdir(zRepo)==1 ){
936 fossil_free(zToFree);
937 i++;
938 continue;
@@ -1187,11 +1172,11 @@
1187 zName = P("SCRIPT_NAME");
1188 if( zName && zName[0]=='/' ) zName++;
1189 }
1190 if( zName && validate16(zName, strlen(zName)) ){
1191 for(i=0; i<nRedirect; i++){
1192 if( strcmp(azRedirect[i*2],"*")==0 ){
1193 zNotFound = azRedirect[i*2+1];
1194 continue;
1195 }
1196 db_open_repository(azRedirect[i*2]);
1197 if( db_exists("SELECT 1 FROM blob WHERE uuid GLOB '%s*'", zName) ){
1198
--- src/main.c
+++ src/main.c
@@ -196,11 +196,11 @@
196 lwr = 0;
197 upr = nMap-1;
198 while( lwr<=upr ){
199 int mid, c;
200 mid = (upr+lwr)/2;
201 c = fossil_strcmp(zName, aMap[mid].zName);
202 if( c==0 ){
203 *pIndex = mid;
204 return 0;
205 }else if( c<0 ){
206 upr = mid - 1;
@@ -446,25 +446,10 @@
446 rc = system(zOrigCmd);
447 #endif
448 return rc;
449 }
450
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
451 /*
452 ** Turn off any NL to CRNL translation on the stream given as an
453 ** argument. This is a no-op on unix but is necessary on windows.
454 */
455 void fossil_binary_mode(FILE *p){
@@ -928,11 +913,11 @@
913 }
914 if( zRepo[0]=='/' && zRepo[1]=='/' ){ zRepo++; j--; }
915
916 szFile = file_size(zRepo);
917 if( zPathInfo[i]=='/' && szFile<0 ){
918 assert( fossil_strcmp(&zRepo[j], ".fossil")==0 );
919 zRepo[j] = 0;
920 if( file_isdir(zRepo)==1 ){
921 fossil_free(zToFree);
922 i++;
923 continue;
@@ -1187,11 +1172,11 @@
1172 zName = P("SCRIPT_NAME");
1173 if( zName && zName[0]=='/' ) zName++;
1174 }
1175 if( zName && validate16(zName, strlen(zName)) ){
1176 for(i=0; i<nRedirect; i++){
1177 if( fossil_strcmp(azRedirect[i*2],"*")==0 ){
1178 zNotFound = azRedirect[i*2+1];
1179 continue;
1180 }
1181 db_open_repository(azRedirect[i*2]);
1182 if( db_exists("SELECT 1 FROM blob WHERE uuid GLOB '%s*'", zName) ){
1183
+21
--- src/printf.c
+++ src/printf.c
@@ -841,10 +841,31 @@
841841
vxprintf(&b, zFormat, ap);
842842
fossil_puts(blob_str(&b), 0);
843843
blob_reset(&b);
844844
}
845845
}
846
+
847
+/*
848
+** Like strcmp() except that it accepts NULL pointers. NULL sorts before
849
+** all non-NULL string pointers. Also, this strcmp() is a binary comparison
850
+** that does not consider locale.
851
+*/
852
+int fossil_strcmp(const char *zA, const char *zB){
853
+ if( zA==0 ){
854
+ if( zB==0 ) return 0;
855
+ return -1;
856
+ }else if( zB==0 ){
857
+ return +1;
858
+ }else{
859
+ int a, b;
860
+ do{
861
+ a = *zA++;
862
+ b = *zB++;
863
+ }while( a==b && a!=0 );
864
+ return a - b;
865
+ }
866
+}
846867
847868
/*
848869
** Case insensitive string comparison.
849870
*/
850871
int fossil_strnicmp(const char *zA, const char *zB, int nByte){
851872
--- src/printf.c
+++ src/printf.c
@@ -841,10 +841,31 @@
841 vxprintf(&b, zFormat, ap);
842 fossil_puts(blob_str(&b), 0);
843 blob_reset(&b);
844 }
845 }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
846
847 /*
848 ** Case insensitive string comparison.
849 */
850 int fossil_strnicmp(const char *zA, const char *zB, int nByte){
851
--- src/printf.c
+++ src/printf.c
@@ -841,10 +841,31 @@
841 vxprintf(&b, zFormat, ap);
842 fossil_puts(blob_str(&b), 0);
843 blob_reset(&b);
844 }
845 }
846
847 /*
848 ** Like strcmp() except that it accepts NULL pointers. NULL sorts before
849 ** all non-NULL string pointers. Also, this strcmp() is a binary comparison
850 ** that does not consider locale.
851 */
852 int fossil_strcmp(const char *zA, const char *zB){
853 if( zA==0 ){
854 if( zB==0 ) return 0;
855 return -1;
856 }else if( zB==0 ){
857 return +1;
858 }else{
859 int a, b;
860 do{
861 a = *zA++;
862 b = *zB++;
863 }while( a==b && a!=0 );
864 return a - b;
865 }
866 }
867
868 /*
869 ** Case insensitive string comparison.
870 */
871 int fossil_strnicmp(const char *zA, const char *zB, int nByte){
872
+2 -2
--- src/report.c
+++ src/report.c
@@ -644,11 +644,11 @@
644644
pState->nCol = 0;
645645
pState->isMultirow = 0;
646646
pState->iNewRow = -1;
647647
pState->iBg = -1;
648648
for(i=0; i<nArg; i++){
649
- if( azName[i][0]=='b' && strcmp(azName[i],"bgcolor")==0 ){
649
+ if( azName[i][0]=='b' && fossil_strcmp(azName[i],"bgcolor")==0 ){
650650
pState->iBg = i;
651651
continue;
652652
}
653653
if( g.okWrite && azName[i][0]=='#' ){
654654
pState->nCol++;
@@ -947,11 +947,11 @@
947947
948948
db_multi_exec("PRAGMA empty_result_callbacks=ON");
949949
style_submenu_element("Raw", "Raw",
950950
"rptview?tablist=1&amp;%h", PD("QUERY_STRING",""));
951951
if( g.okAdmin
952
- || (g.okTktFmt && g.zLogin && zOwner && strcmp(g.zLogin,zOwner)==0) ){
952
+ || (g.okTktFmt && g.zLogin && fossil_strcmp(g.zLogin,zOwner)==0) ){
953953
style_submenu_element("Edit", "Edit", "rptedit?rn=%d", rn);
954954
}
955955
if( g.okTktFmt ){
956956
style_submenu_element("SQL", "SQL", "rptsql?rn=%d",rn);
957957
}
958958
--- src/report.c
+++ src/report.c
@@ -644,11 +644,11 @@
644 pState->nCol = 0;
645 pState->isMultirow = 0;
646 pState->iNewRow = -1;
647 pState->iBg = -1;
648 for(i=0; i<nArg; i++){
649 if( azName[i][0]=='b' && strcmp(azName[i],"bgcolor")==0 ){
650 pState->iBg = i;
651 continue;
652 }
653 if( g.okWrite && azName[i][0]=='#' ){
654 pState->nCol++;
@@ -947,11 +947,11 @@
947
948 db_multi_exec("PRAGMA empty_result_callbacks=ON");
949 style_submenu_element("Raw", "Raw",
950 "rptview?tablist=1&amp;%h", PD("QUERY_STRING",""));
951 if( g.okAdmin
952 || (g.okTktFmt && g.zLogin && zOwner && strcmp(g.zLogin,zOwner)==0) ){
953 style_submenu_element("Edit", "Edit", "rptedit?rn=%d", rn);
954 }
955 if( g.okTktFmt ){
956 style_submenu_element("SQL", "SQL", "rptsql?rn=%d",rn);
957 }
958
--- src/report.c
+++ src/report.c
@@ -644,11 +644,11 @@
644 pState->nCol = 0;
645 pState->isMultirow = 0;
646 pState->iNewRow = -1;
647 pState->iBg = -1;
648 for(i=0; i<nArg; i++){
649 if( azName[i][0]=='b' && fossil_strcmp(azName[i],"bgcolor")==0 ){
650 pState->iBg = i;
651 continue;
652 }
653 if( g.okWrite && azName[i][0]=='#' ){
654 pState->nCol++;
@@ -947,11 +947,11 @@
947
948 db_multi_exec("PRAGMA empty_result_callbacks=ON");
949 style_submenu_element("Raw", "Raw",
950 "rptview?tablist=1&amp;%h", PD("QUERY_STRING",""));
951 if( g.okAdmin
952 || (g.okTktFmt && g.zLogin && fossil_strcmp(g.zLogin,zOwner)==0) ){
953 style_submenu_element("Edit", "Edit", "rptedit?rn=%d", rn);
954 }
955 if( g.okTktFmt ){
956 style_submenu_element("SQL", "SQL", "rptsql?rn=%d",rn);
957 }
958
+7 -7
--- src/setup.c
+++ src/setup.c
@@ -436,38 +436,38 @@
436436
if( strchr(zCap, 'z') ) oaz = " checked=\"checked\"";
437437
}
438438
439439
/* figure out inherited permissions */
440440
memset(inherit, 0, sizeof(inherit));
441
- if( strcmp(zLogin, "developer") ){
441
+ if( fossil_strcmp(zLogin, "developer") ){
442442
char *z1, *z2;
443443
z1 = z2 = db_text(0,"SELECT cap FROM user WHERE login='developer'");
444444
while( z1 && *z1 ){
445445
inherit[0x7f & *(z1++)] =
446446
"<span class=\"ueditInheritDeveloper\">&bull;</span>";
447447
}
448448
free(z2);
449449
}
450
- if( strcmp(zLogin, "reader") ){
450
+ if( fossil_strcmp(zLogin, "reader") ){
451451
char *z1, *z2;
452452
z1 = z2 = db_text(0,"SELECT cap FROM user WHERE login='reader'");
453453
while( z1 && *z1 ){
454454
inherit[0x7f & *(z1++)] =
455455
"<span class=\"ueditInheritReader\">&bull;</span>";
456456
}
457457
free(z2);
458458
}
459
- if( strcmp(zLogin, "anonymous") ){
459
+ if( fossil_strcmp(zLogin, "anonymous") ){
460460
char *z1, *z2;
461461
z1 = z2 = db_text(0,"SELECT cap FROM user WHERE login='anonymous'");
462462
while( z1 && *z1 ){
463463
inherit[0x7f & *(z1++)] =
464464
"<span class=\"ueditInheritAnonymous\">&bull;</span>";
465465
}
466466
free(z2);
467467
}
468
- if( strcmp(zLogin, "nobody") ){
468
+ if( fossil_strcmp(zLogin, "nobody") ){
469469
char *z1, *z2;
470470
z1 = z2 = db_text(0,"SELECT cap FROM user WHERE login='nobody'");
471471
while( z1 && *z1 ){
472472
inherit[0x7f & *(z1++)] =
473473
"<span class=\"ueditInheritNobody\">&bull;</span>";
@@ -741,11 +741,11 @@
741741
int iVal = db_get_boolean(zVar, dfltVal);
742742
if( zQ==0 && P("submit") ){
743743
zQ = "off";
744744
}
745745
if( zQ ){
746
- int iQ = strcmp(zQ,"on")==0 || atoi(zQ);
746
+ int iQ = fossil_strcmp(zQ,"on")==0 || atoi(zQ);
747747
if( iQ!=iVal ){
748748
login_verify_csrf_secret();
749749
db_set(zVar, iQ ? "1" : "0", 0);
750750
iVal = iQ;
751751
}
@@ -768,11 +768,11 @@
768768
const char *zQParm, /* The query parameter */
769769
char *zDflt /* Default value if VAR table entry does not exist */
770770
){
771771
const char *zVal = db_get(zVar, zDflt);
772772
const char *zQ = P(zQParm);
773
- if( zQ && strcmp(zQ,zVal)!=0 ){
773
+ if( zQ && fossil_strcmp(zQ,zVal)!=0 ){
774774
login_verify_csrf_secret();
775775
db_set(zVar, zQ, 0);
776776
zVal = zQ;
777777
}
778778
@ <input type="text" name="%s(zQParm)" value="%h(zVal)" size="%d(width)" />
@@ -790,11 +790,11 @@
790790
const char *zQP, /* The query parameter */
791791
const char *zDflt /* Default value if VAR table entry does not exist */
792792
){
793793
const char *z = db_get(zVar, (char*)zDflt);
794794
const char *zQ = P(zQP);
795
- if( zQ && strcmp(zQ,z)!=0 ){
795
+ if( zQ && fossil_strcmp(zQ,z)!=0 ){
796796
login_verify_csrf_secret();
797797
db_set(zVar, zQ, 0);
798798
z = zQ;
799799
}
800800
if( rows>0 && cols>0 ){
801801
--- src/setup.c
+++ src/setup.c
@@ -436,38 +436,38 @@
436 if( strchr(zCap, 'z') ) oaz = " checked=\"checked\"";
437 }
438
439 /* figure out inherited permissions */
440 memset(inherit, 0, sizeof(inherit));
441 if( strcmp(zLogin, "developer") ){
442 char *z1, *z2;
443 z1 = z2 = db_text(0,"SELECT cap FROM user WHERE login='developer'");
444 while( z1 && *z1 ){
445 inherit[0x7f & *(z1++)] =
446 "<span class=\"ueditInheritDeveloper\">&bull;</span>";
447 }
448 free(z2);
449 }
450 if( strcmp(zLogin, "reader") ){
451 char *z1, *z2;
452 z1 = z2 = db_text(0,"SELECT cap FROM user WHERE login='reader'");
453 while( z1 && *z1 ){
454 inherit[0x7f & *(z1++)] =
455 "<span class=\"ueditInheritReader\">&bull;</span>";
456 }
457 free(z2);
458 }
459 if( strcmp(zLogin, "anonymous") ){
460 char *z1, *z2;
461 z1 = z2 = db_text(0,"SELECT cap FROM user WHERE login='anonymous'");
462 while( z1 && *z1 ){
463 inherit[0x7f & *(z1++)] =
464 "<span class=\"ueditInheritAnonymous\">&bull;</span>";
465 }
466 free(z2);
467 }
468 if( strcmp(zLogin, "nobody") ){
469 char *z1, *z2;
470 z1 = z2 = db_text(0,"SELECT cap FROM user WHERE login='nobody'");
471 while( z1 && *z1 ){
472 inherit[0x7f & *(z1++)] =
473 "<span class=\"ueditInheritNobody\">&bull;</span>";
@@ -741,11 +741,11 @@
741 int iVal = db_get_boolean(zVar, dfltVal);
742 if( zQ==0 && P("submit") ){
743 zQ = "off";
744 }
745 if( zQ ){
746 int iQ = strcmp(zQ,"on")==0 || atoi(zQ);
747 if( iQ!=iVal ){
748 login_verify_csrf_secret();
749 db_set(zVar, iQ ? "1" : "0", 0);
750 iVal = iQ;
751 }
@@ -768,11 +768,11 @@
768 const char *zQParm, /* The query parameter */
769 char *zDflt /* Default value if VAR table entry does not exist */
770 ){
771 const char *zVal = db_get(zVar, zDflt);
772 const char *zQ = P(zQParm);
773 if( zQ && strcmp(zQ,zVal)!=0 ){
774 login_verify_csrf_secret();
775 db_set(zVar, zQ, 0);
776 zVal = zQ;
777 }
778 @ <input type="text" name="%s(zQParm)" value="%h(zVal)" size="%d(width)" />
@@ -790,11 +790,11 @@
790 const char *zQP, /* The query parameter */
791 const char *zDflt /* Default value if VAR table entry does not exist */
792 ){
793 const char *z = db_get(zVar, (char*)zDflt);
794 const char *zQ = P(zQP);
795 if( zQ && strcmp(zQ,z)!=0 ){
796 login_verify_csrf_secret();
797 db_set(zVar, zQ, 0);
798 z = zQ;
799 }
800 if( rows>0 && cols>0 ){
801
--- src/setup.c
+++ src/setup.c
@@ -436,38 +436,38 @@
436 if( strchr(zCap, 'z') ) oaz = " checked=\"checked\"";
437 }
438
439 /* figure out inherited permissions */
440 memset(inherit, 0, sizeof(inherit));
441 if( fossil_strcmp(zLogin, "developer") ){
442 char *z1, *z2;
443 z1 = z2 = db_text(0,"SELECT cap FROM user WHERE login='developer'");
444 while( z1 && *z1 ){
445 inherit[0x7f & *(z1++)] =
446 "<span class=\"ueditInheritDeveloper\">&bull;</span>";
447 }
448 free(z2);
449 }
450 if( fossil_strcmp(zLogin, "reader") ){
451 char *z1, *z2;
452 z1 = z2 = db_text(0,"SELECT cap FROM user WHERE login='reader'");
453 while( z1 && *z1 ){
454 inherit[0x7f & *(z1++)] =
455 "<span class=\"ueditInheritReader\">&bull;</span>";
456 }
457 free(z2);
458 }
459 if( fossil_strcmp(zLogin, "anonymous") ){
460 char *z1, *z2;
461 z1 = z2 = db_text(0,"SELECT cap FROM user WHERE login='anonymous'");
462 while( z1 && *z1 ){
463 inherit[0x7f & *(z1++)] =
464 "<span class=\"ueditInheritAnonymous\">&bull;</span>";
465 }
466 free(z2);
467 }
468 if( fossil_strcmp(zLogin, "nobody") ){
469 char *z1, *z2;
470 z1 = z2 = db_text(0,"SELECT cap FROM user WHERE login='nobody'");
471 while( z1 && *z1 ){
472 inherit[0x7f & *(z1++)] =
473 "<span class=\"ueditInheritNobody\">&bull;</span>";
@@ -741,11 +741,11 @@
741 int iVal = db_get_boolean(zVar, dfltVal);
742 if( zQ==0 && P("submit") ){
743 zQ = "off";
744 }
745 if( zQ ){
746 int iQ = fossil_strcmp(zQ,"on")==0 || atoi(zQ);
747 if( iQ!=iVal ){
748 login_verify_csrf_secret();
749 db_set(zVar, iQ ? "1" : "0", 0);
750 iVal = iQ;
751 }
@@ -768,11 +768,11 @@
768 const char *zQParm, /* The query parameter */
769 char *zDflt /* Default value if VAR table entry does not exist */
770 ){
771 const char *zVal = db_get(zVar, zDflt);
772 const char *zQ = P(zQParm);
773 if( zQ && fossil_strcmp(zQ,zVal)!=0 ){
774 login_verify_csrf_secret();
775 db_set(zVar, zQ, 0);
776 zVal = zQ;
777 }
778 @ <input type="text" name="%s(zQParm)" value="%h(zVal)" size="%d(width)" />
@@ -790,11 +790,11 @@
790 const char *zQP, /* The query parameter */
791 const char *zDflt /* Default value if VAR table entry does not exist */
792 ){
793 const char *z = db_get(zVar, (char*)zDflt);
794 const char *zQ = P(zQP);
795 if( zQ && fossil_strcmp(zQ,z)!=0 ){
796 login_verify_csrf_secret();
797 db_set(zVar, zQ, 0);
798 z = zQ;
799 }
800 if( rows>0 && cols>0 ){
801
+5 -5
--- src/skins.c
+++ src/skins.c
@@ -1053,11 +1053,11 @@
10531053
setDefaultSkin();
10541054
zCurrent = getSkin(0);
10551055
10561056
if( P("save")!=0 && (zName = skinVarName(P("save"),0))!=0 ){
10571057
if( db_exists("SELECT 1 FROM config WHERE name=%Q", zName)
1058
- || strcmp(zName, "Default")==0 ){
1058
+ || fossil_strcmp(zName, "Default")==0 ){
10591059
zErr = mprintf("Skin name \"%h\" already exists. "
10601060
"Choose a different name.", P("sn"));
10611061
}else{
10621062
db_multi_exec("INSERT INTO config(name,value,mtime) VALUES(%Q,%Q,now())",
10631063
zName, zCurrent
@@ -1067,11 +1067,11 @@
10671067
10681068
/* The user pressed the "Use This Skin" button. */
10691069
if( P("load") && (z = P("sn"))!=0 && z[0] ){
10701070
int seen = 0;
10711071
for(i=0; i<sizeof(aBuiltinSkin)/sizeof(aBuiltinSkin[0]); i++){
1072
- if( strcmp(aBuiltinSkin[i].zValue, zCurrent)==0 ){
1072
+ if( fossil_strcmp(aBuiltinSkin[i].zValue, zCurrent)==0 ){
10731073
seen = 1;
10741074
break;
10751075
}
10761076
}
10771077
if( !seen ){
@@ -1085,11 +1085,11 @@
10851085
" %Q,now())", zCurrent
10861086
);
10871087
}
10881088
seen = 0;
10891089
for(i=0; i<sizeof(aBuiltinSkin)/sizeof(aBuiltinSkin[0]); i++){
1090
- if( strcmp(aBuiltinSkin[i].zName, z)==0 ){
1090
+ if( fossil_strcmp(aBuiltinSkin[i].zName, z)==0 ){
10911091
seen = 1;
10921092
zCurrent = aBuiltinSkin[i].zValue;
10931093
db_multi_exec("%s", zCurrent);
10941094
break;
10951095
}
@@ -1111,11 +1111,11 @@
11111111
@
11121112
@ <h2>Available Skins:</h2>
11131113
@ <ol>
11141114
for(i=0; i<sizeof(aBuiltinSkin)/sizeof(aBuiltinSkin[0]); i++){
11151115
z = aBuiltinSkin[i].zName;
1116
- if( strcmp(aBuiltinSkin[i].zValue, zCurrent)==0 ){
1116
+ if( fossil_strcmp(aBuiltinSkin[i].zValue, zCurrent)==0 ){
11171117
@ <li><p>%h(z).&nbsp;&nbsp; <b>Currently In Use</b></p>
11181118
}else{
11191119
@ <li><form action="%s(g.zTop)/setup_skin" method="post"><div>
11201120
@ %h(z).&nbsp;&nbsp;
11211121
@ <input type="hidden" name="sn" value="%h(z)" />
@@ -1129,11 +1129,11 @@
11291129
" ORDER BY name"
11301130
);
11311131
while( db_step(&q)==SQLITE_ROW ){
11321132
const char *zN = db_column_text(&q, 0);
11331133
const char *zV = db_column_text(&q, 1);
1134
- if( strcmp(zV, zCurrent)==0 ){
1134
+ if( fossil_strcmp(zV, zCurrent)==0 ){
11351135
@ <li><p>%h(zN).&nbsp;&nbsp; <b>Currently In Use</b></p>
11361136
}else{
11371137
@ <li><form action="%s(g.zTop)/setup_skin" method="post">
11381138
@ %h(zN).&nbsp;&nbsp;
11391139
@ <input type="hidden" name="sn" value="%h(zN)">
11401140
--- src/skins.c
+++ src/skins.c
@@ -1053,11 +1053,11 @@
1053 setDefaultSkin();
1054 zCurrent = getSkin(0);
1055
1056 if( P("save")!=0 && (zName = skinVarName(P("save"),0))!=0 ){
1057 if( db_exists("SELECT 1 FROM config WHERE name=%Q", zName)
1058 || strcmp(zName, "Default")==0 ){
1059 zErr = mprintf("Skin name \"%h\" already exists. "
1060 "Choose a different name.", P("sn"));
1061 }else{
1062 db_multi_exec("INSERT INTO config(name,value,mtime) VALUES(%Q,%Q,now())",
1063 zName, zCurrent
@@ -1067,11 +1067,11 @@
1067
1068 /* The user pressed the "Use This Skin" button. */
1069 if( P("load") && (z = P("sn"))!=0 && z[0] ){
1070 int seen = 0;
1071 for(i=0; i<sizeof(aBuiltinSkin)/sizeof(aBuiltinSkin[0]); i++){
1072 if( strcmp(aBuiltinSkin[i].zValue, zCurrent)==0 ){
1073 seen = 1;
1074 break;
1075 }
1076 }
1077 if( !seen ){
@@ -1085,11 +1085,11 @@
1085 " %Q,now())", zCurrent
1086 );
1087 }
1088 seen = 0;
1089 for(i=0; i<sizeof(aBuiltinSkin)/sizeof(aBuiltinSkin[0]); i++){
1090 if( strcmp(aBuiltinSkin[i].zName, z)==0 ){
1091 seen = 1;
1092 zCurrent = aBuiltinSkin[i].zValue;
1093 db_multi_exec("%s", zCurrent);
1094 break;
1095 }
@@ -1111,11 +1111,11 @@
1111 @
1112 @ <h2>Available Skins:</h2>
1113 @ <ol>
1114 for(i=0; i<sizeof(aBuiltinSkin)/sizeof(aBuiltinSkin[0]); i++){
1115 z = aBuiltinSkin[i].zName;
1116 if( strcmp(aBuiltinSkin[i].zValue, zCurrent)==0 ){
1117 @ <li><p>%h(z).&nbsp;&nbsp; <b>Currently In Use</b></p>
1118 }else{
1119 @ <li><form action="%s(g.zTop)/setup_skin" method="post"><div>
1120 @ %h(z).&nbsp;&nbsp;
1121 @ <input type="hidden" name="sn" value="%h(z)" />
@@ -1129,11 +1129,11 @@
1129 " ORDER BY name"
1130 );
1131 while( db_step(&q)==SQLITE_ROW ){
1132 const char *zN = db_column_text(&q, 0);
1133 const char *zV = db_column_text(&q, 1);
1134 if( strcmp(zV, zCurrent)==0 ){
1135 @ <li><p>%h(zN).&nbsp;&nbsp; <b>Currently In Use</b></p>
1136 }else{
1137 @ <li><form action="%s(g.zTop)/setup_skin" method="post">
1138 @ %h(zN).&nbsp;&nbsp;
1139 @ <input type="hidden" name="sn" value="%h(zN)">
1140
--- src/skins.c
+++ src/skins.c
@@ -1053,11 +1053,11 @@
1053 setDefaultSkin();
1054 zCurrent = getSkin(0);
1055
1056 if( P("save")!=0 && (zName = skinVarName(P("save"),0))!=0 ){
1057 if( db_exists("SELECT 1 FROM config WHERE name=%Q", zName)
1058 || fossil_strcmp(zName, "Default")==0 ){
1059 zErr = mprintf("Skin name \"%h\" already exists. "
1060 "Choose a different name.", P("sn"));
1061 }else{
1062 db_multi_exec("INSERT INTO config(name,value,mtime) VALUES(%Q,%Q,now())",
1063 zName, zCurrent
@@ -1067,11 +1067,11 @@
1067
1068 /* The user pressed the "Use This Skin" button. */
1069 if( P("load") && (z = P("sn"))!=0 && z[0] ){
1070 int seen = 0;
1071 for(i=0; i<sizeof(aBuiltinSkin)/sizeof(aBuiltinSkin[0]); i++){
1072 if( fossil_strcmp(aBuiltinSkin[i].zValue, zCurrent)==0 ){
1073 seen = 1;
1074 break;
1075 }
1076 }
1077 if( !seen ){
@@ -1085,11 +1085,11 @@
1085 " %Q,now())", zCurrent
1086 );
1087 }
1088 seen = 0;
1089 for(i=0; i<sizeof(aBuiltinSkin)/sizeof(aBuiltinSkin[0]); i++){
1090 if( fossil_strcmp(aBuiltinSkin[i].zName, z)==0 ){
1091 seen = 1;
1092 zCurrent = aBuiltinSkin[i].zValue;
1093 db_multi_exec("%s", zCurrent);
1094 break;
1095 }
@@ -1111,11 +1111,11 @@
1111 @
1112 @ <h2>Available Skins:</h2>
1113 @ <ol>
1114 for(i=0; i<sizeof(aBuiltinSkin)/sizeof(aBuiltinSkin[0]); i++){
1115 z = aBuiltinSkin[i].zName;
1116 if( fossil_strcmp(aBuiltinSkin[i].zValue, zCurrent)==0 ){
1117 @ <li><p>%h(z).&nbsp;&nbsp; <b>Currently In Use</b></p>
1118 }else{
1119 @ <li><form action="%s(g.zTop)/setup_skin" method="post"><div>
1120 @ %h(z).&nbsp;&nbsp;
1121 @ <input type="hidden" name="sn" value="%h(z)" />
@@ -1129,11 +1129,11 @@
1129 " ORDER BY name"
1130 );
1131 while( db_step(&q)==SQLITE_ROW ){
1132 const char *zN = db_column_text(&q, 0);
1133 const char *zV = db_column_text(&q, 1);
1134 if( fossil_strcmp(zV, zCurrent)==0 ){
1135 @ <li><p>%h(zN).&nbsp;&nbsp; <b>Currently In Use</b></p>
1136 }else{
1137 @ <li><form action="%s(g.zTop)/setup_skin" method="post">
1138 @ %h(zN).&nbsp;&nbsp;
1139 @ <input type="hidden" name="sn" value="%h(zN)">
1140
+1 -1
--- src/tar.c
+++ src/tar.c
@@ -309,11 +309,11 @@
309309
if( !g.okZip ){ login_needed(); return; }
310310
zName = mprintf("%s", PD("name",""));
311311
nName = strlen(zName);
312312
zRid = mprintf("%s", PD("uuid",""));
313313
nRid = strlen(zRid);
314
- if( nName>7 && strcmp(&zName[nName-7], ".tar.gz")==0 ){
314
+ if( nName>7 && fossil_strcmp(&zName[nName-7], ".tar.gz")==0 ){
315315
/* Special case: Remove the ".tar.gz" suffix. */
316316
nName -= 7;
317317
zName[nName] = 0;
318318
}else{
319319
/* If the file suffix is not ".tar.gz" then just remove the
320320
--- src/tar.c
+++ src/tar.c
@@ -309,11 +309,11 @@
309 if( !g.okZip ){ login_needed(); return; }
310 zName = mprintf("%s", PD("name",""));
311 nName = strlen(zName);
312 zRid = mprintf("%s", PD("uuid",""));
313 nRid = strlen(zRid);
314 if( nName>7 && strcmp(&zName[nName-7], ".tar.gz")==0 ){
315 /* Special case: Remove the ".tar.gz" suffix. */
316 nName -= 7;
317 zName[nName] = 0;
318 }else{
319 /* If the file suffix is not ".tar.gz" then just remove the
320
--- src/tar.c
+++ src/tar.c
@@ -309,11 +309,11 @@
309 if( !g.okZip ){ login_needed(); return; }
310 zName = mprintf("%s", PD("name",""));
311 nName = strlen(zName);
312 zRid = mprintf("%s", PD("uuid",""));
313 nRid = strlen(zRid);
314 if( nName>7 && fossil_strcmp(&zName[nName-7], ".tar.gz")==0 ){
315 /* Special case: Remove the ".tar.gz" suffix. */
316 nName -= 7;
317 zName[nName] = 0;
318 }else{
319 /* If the file suffix is not ".tar.gz" then just remove the
320
+1 -1
--- src/timeline.c
+++ src/timeline.c
@@ -1350,11 +1350,11 @@
13501350
zOrigin = "now";
13511351
}
13521352
k = strlen(zOrigin);
13531353
blob_zero(&uuid);
13541354
blob_append(&uuid, zOrigin, -1);
1355
- if( strcmp(zOrigin, "now")==0 ){
1355
+ if( fossil_strcmp(zOrigin, "now")==0 ){
13561356
if( mode==3 || mode==4 ){
13571357
fossil_fatal("cannot compute descendants or ancestors of a date");
13581358
}
13591359
zDate = mprintf("(SELECT datetime('now'))");
13601360
}else if( strncmp(zOrigin, "current", k)==0 ){
13611361
--- src/timeline.c
+++ src/timeline.c
@@ -1350,11 +1350,11 @@
1350 zOrigin = "now";
1351 }
1352 k = strlen(zOrigin);
1353 blob_zero(&uuid);
1354 blob_append(&uuid, zOrigin, -1);
1355 if( strcmp(zOrigin, "now")==0 ){
1356 if( mode==3 || mode==4 ){
1357 fossil_fatal("cannot compute descendants or ancestors of a date");
1358 }
1359 zDate = mprintf("(SELECT datetime('now'))");
1360 }else if( strncmp(zOrigin, "current", k)==0 ){
1361
--- src/timeline.c
+++ src/timeline.c
@@ -1350,11 +1350,11 @@
1350 zOrigin = "now";
1351 }
1352 k = strlen(zOrigin);
1353 blob_zero(&uuid);
1354 blob_append(&uuid, zOrigin, -1);
1355 if( fossil_strcmp(zOrigin, "now")==0 ){
1356 if( mode==3 || mode==4 ){
1357 fossil_fatal("cannot compute descendants or ancestors of a date");
1358 }
1359 zDate = mprintf("(SELECT datetime('now'))");
1360 }else if( strncmp(zOrigin, "current", k)==0 ){
1361
+3 -3
--- src/tkt.c
+++ src/tkt.c
@@ -34,11 +34,11 @@
3434
3535
/*
3636
** Compare two entries in azField for sorting purposes
3737
*/
3838
static int nameCmpr(const void *a, const void *b){
39
- return strcmp(*(char**)a, *(char**)b);
39
+ return fossil_strcmp(*(char**)a, *(char**)b);
4040
}
4141
4242
/*
4343
** Obtain a list of all fields of the TICKET table. Put them
4444
** in sorted order in azField[].
@@ -75,11 +75,11 @@
7575
** Return -1 if zField is not in azField[].
7676
*/
7777
static int fieldId(const char *zField){
7878
int i;
7979
for(i=0; i<nField; i++){
80
- if( strcmp(azField[i], zField)==0 ) return i;
80
+ if( fossil_strcmp(azField[i], zField)==0 ) return i;
8181
}
8282
return -1;
8383
}
8484
8585
/*
@@ -115,11 +115,11 @@
115115
zVal = "";
116116
}else if( strncmp(zName, "private_", 8)==0 ){
117117
zVal = zRevealed = db_reveal(zVal);
118118
}
119119
for(j=0; j<nField; j++){
120
- if( strcmp(azField[j],zName)==0 ){
120
+ if( fossil_strcmp(azField[j],zName)==0 ){
121121
azValue[j] = mprintf("%s", zVal);
122122
break;
123123
}
124124
}
125125
if( Th_Fetch(zName, &size)==0 ){
126126
--- src/tkt.c
+++ src/tkt.c
@@ -34,11 +34,11 @@
34
35 /*
36 ** Compare two entries in azField for sorting purposes
37 */
38 static int nameCmpr(const void *a, const void *b){
39 return strcmp(*(char**)a, *(char**)b);
40 }
41
42 /*
43 ** Obtain a list of all fields of the TICKET table. Put them
44 ** in sorted order in azField[].
@@ -75,11 +75,11 @@
75 ** Return -1 if zField is not in azField[].
76 */
77 static int fieldId(const char *zField){
78 int i;
79 for(i=0; i<nField; i++){
80 if( strcmp(azField[i], zField)==0 ) return i;
81 }
82 return -1;
83 }
84
85 /*
@@ -115,11 +115,11 @@
115 zVal = "";
116 }else if( strncmp(zName, "private_", 8)==0 ){
117 zVal = zRevealed = db_reveal(zVal);
118 }
119 for(j=0; j<nField; j++){
120 if( strcmp(azField[j],zName)==0 ){
121 azValue[j] = mprintf("%s", zVal);
122 break;
123 }
124 }
125 if( Th_Fetch(zName, &size)==0 ){
126
--- src/tkt.c
+++ src/tkt.c
@@ -34,11 +34,11 @@
34
35 /*
36 ** Compare two entries in azField for sorting purposes
37 */
38 static int nameCmpr(const void *a, const void *b){
39 return fossil_strcmp(*(char**)a, *(char**)b);
40 }
41
42 /*
43 ** Obtain a list of all fields of the TICKET table. Put them
44 ** in sorted order in azField[].
@@ -75,11 +75,11 @@
75 ** Return -1 if zField is not in azField[].
76 */
77 static int fieldId(const char *zField){
78 int i;
79 for(i=0; i<nField; i++){
80 if( fossil_strcmp(azField[i], zField)==0 ) return i;
81 }
82 return -1;
83 }
84
85 /*
@@ -115,11 +115,11 @@
115 zVal = "";
116 }else if( strncmp(zName, "private_", 8)==0 ){
117 zVal = zRevealed = db_reveal(zVal);
118 }
119 for(j=0; j<nField; j++){
120 if( fossil_strcmp(azField[j],zName)==0 ){
121 azValue[j] = mprintf("%s", zVal);
122 break;
123 }
124 }
125 if( Th_Fetch(zName, &size)==0 ){
126
+2 -2
--- src/update.c
+++ src/update.c
@@ -119,14 +119,14 @@
119119
if( !nochangeFlag && !internalUpdate ) autosync(AUTOSYNC_PULL);
120120
121121
if( internalUpdate ){
122122
tid = internalUpdate;
123123
}else if( g.argc>=3 ){
124
- if( strcmp(g.argv[2], "current")==0 ){
124
+ if( fossil_strcmp(g.argv[2], "current")==0 ){
125125
/* If VERSION is "current", then use the same algorithm to find the
126126
** target as if VERSION were omitted. */
127
- }else if( strcmp(g.argv[2], "latest")==0 ){
127
+ }else if( fossil_strcmp(g.argv[2], "latest")==0 ){
128128
/* If VERSION is "latest", then use the same algorithm to find the
129129
** target as if VERSION were omitted and the --latest flag is present.
130130
*/
131131
latestFlag = 1;
132132
}else{
133133
--- src/update.c
+++ src/update.c
@@ -119,14 +119,14 @@
119 if( !nochangeFlag && !internalUpdate ) autosync(AUTOSYNC_PULL);
120
121 if( internalUpdate ){
122 tid = internalUpdate;
123 }else if( g.argc>=3 ){
124 if( strcmp(g.argv[2], "current")==0 ){
125 /* If VERSION is "current", then use the same algorithm to find the
126 ** target as if VERSION were omitted. */
127 }else if( strcmp(g.argv[2], "latest")==0 ){
128 /* If VERSION is "latest", then use the same algorithm to find the
129 ** target as if VERSION were omitted and the --latest flag is present.
130 */
131 latestFlag = 1;
132 }else{
133
--- src/update.c
+++ src/update.c
@@ -119,14 +119,14 @@
119 if( !nochangeFlag && !internalUpdate ) autosync(AUTOSYNC_PULL);
120
121 if( internalUpdate ){
122 tid = internalUpdate;
123 }else if( g.argc>=3 ){
124 if( fossil_strcmp(g.argv[2], "current")==0 ){
125 /* If VERSION is "current", then use the same algorithm to find the
126 ** target as if VERSION were omitted. */
127 }else if( fossil_strcmp(g.argv[2], "latest")==0 ){
128 /* If VERSION is "latest", then use the same algorithm to find the
129 ** target as if VERSION were omitted and the --latest flag is present.
130 */
131 latestFlag = 1;
132 }else{
133
+2 -2
--- src/url.c
+++ src/url.c
@@ -340,16 +340,16 @@
340340
341341
blob_reset(&p->url);
342342
blob_appendf(&p->url, "%s/%s", g.zTop, p->zBase);
343343
for(i=0; i<p->nParam; i++){
344344
const char *z = p->azValue[i];
345
- if( zName1 && strcmp(zName1,p->azName[i])==0 ){
345
+ if( zName1 && fossil_strcmp(zName1,p->azName[i])==0 ){
346346
zName1 = 0;
347347
z = zValue1;
348348
if( z==0 ) continue;
349349
}
350
- if( zName2 && strcmp(zName2,p->azName[i])==0 ){
350
+ if( zName2 && fossil_strcmp(zName2,p->azName[i])==0 ){
351351
zName2 = 0;
352352
z = zValue2;
353353
if( z==0 ) continue;
354354
}
355355
blob_appendf(&p->url, "%s%s", zSep, p->azName[i]);
356356
--- src/url.c
+++ src/url.c
@@ -340,16 +340,16 @@
340
341 blob_reset(&p->url);
342 blob_appendf(&p->url, "%s/%s", g.zTop, p->zBase);
343 for(i=0; i<p->nParam; i++){
344 const char *z = p->azValue[i];
345 if( zName1 && strcmp(zName1,p->azName[i])==0 ){
346 zName1 = 0;
347 z = zValue1;
348 if( z==0 ) continue;
349 }
350 if( zName2 && strcmp(zName2,p->azName[i])==0 ){
351 zName2 = 0;
352 z = zValue2;
353 if( z==0 ) continue;
354 }
355 blob_appendf(&p->url, "%s%s", zSep, p->azName[i]);
356
--- src/url.c
+++ src/url.c
@@ -340,16 +340,16 @@
340
341 blob_reset(&p->url);
342 blob_appendf(&p->url, "%s/%s", g.zTop, p->zBase);
343 for(i=0; i<p->nParam; i++){
344 const char *z = p->azValue[i];
345 if( zName1 && fossil_strcmp(zName1,p->azName[i])==0 ){
346 zName1 = 0;
347 z = zValue1;
348 if( z==0 ) continue;
349 }
350 if( zName2 && fossil_strcmp(zName2,p->azName[i])==0 ){
351 zName2 = 0;
352 z = zValue2;
353 if( z==0 ) continue;
354 }
355 blob_appendf(&p->url, "%s%s", zSep, p->azName[i]);
356
+2 -2
--- src/wiki.c
+++ src/wiki.c
@@ -85,11 +85,11 @@
8585
login_check_credentials();
8686
if( zIndexPage ){
8787
const char *zPathInfo = P("PATH_INFO");
8888
while( zIndexPage[0]=='/' ) zIndexPage++;
8989
while( zPathInfo[0]=='/' ) zPathInfo++;
90
- if( strcmp(zIndexPage, zPathInfo)==0 ) zIndexPage = 0;
90
+ if( fossil_strcmp(zIndexPage, zPathInfo)==0 ) zIndexPage = 0;
9191
}
9292
if( zIndexPage ){
9393
cgi_redirectf("%s/%s", g.zTop, zIndexPage);
9494
}
9595
if( !g.okRdWiki ){
@@ -415,11 +415,11 @@
415415
zId = db_text(0, "SELECT lower(hex(randomblob(8)))");
416416
blob_appendf(p, "\n\n<hr><div id=\"%s\"><i>On %s UTC %h",
417417
zId, zDate, g.zLogin);
418418
free(zDate);
419419
zUser = PD("u",g.zLogin);
420
- if( zUser[0] && strcmp(zUser,g.zLogin) ){
420
+ if( zUser[0] && fossil_strcmp(zUser,g.zLogin) ){
421421
blob_appendf(p, " (claiming to be %h)", zUser);
422422
}
423423
zRemark = PD("r","");
424424
blob_appendf(p, " added:</i><br />\n%s</div id=\"%s\">", zRemark, zId);
425425
}
426426
--- src/wiki.c
+++ src/wiki.c
@@ -85,11 +85,11 @@
85 login_check_credentials();
86 if( zIndexPage ){
87 const char *zPathInfo = P("PATH_INFO");
88 while( zIndexPage[0]=='/' ) zIndexPage++;
89 while( zPathInfo[0]=='/' ) zPathInfo++;
90 if( strcmp(zIndexPage, zPathInfo)==0 ) zIndexPage = 0;
91 }
92 if( zIndexPage ){
93 cgi_redirectf("%s/%s", g.zTop, zIndexPage);
94 }
95 if( !g.okRdWiki ){
@@ -415,11 +415,11 @@
415 zId = db_text(0, "SELECT lower(hex(randomblob(8)))");
416 blob_appendf(p, "\n\n<hr><div id=\"%s\"><i>On %s UTC %h",
417 zId, zDate, g.zLogin);
418 free(zDate);
419 zUser = PD("u",g.zLogin);
420 if( zUser[0] && strcmp(zUser,g.zLogin) ){
421 blob_appendf(p, " (claiming to be %h)", zUser);
422 }
423 zRemark = PD("r","");
424 blob_appendf(p, " added:</i><br />\n%s</div id=\"%s\">", zRemark, zId);
425 }
426
--- src/wiki.c
+++ src/wiki.c
@@ -85,11 +85,11 @@
85 login_check_credentials();
86 if( zIndexPage ){
87 const char *zPathInfo = P("PATH_INFO");
88 while( zIndexPage[0]=='/' ) zIndexPage++;
89 while( zPathInfo[0]=='/' ) zPathInfo++;
90 if( fossil_strcmp(zIndexPage, zPathInfo)==0 ) zIndexPage = 0;
91 }
92 if( zIndexPage ){
93 cgi_redirectf("%s/%s", g.zTop, zIndexPage);
94 }
95 if( !g.okRdWiki ){
@@ -415,11 +415,11 @@
415 zId = db_text(0, "SELECT lower(hex(randomblob(8)))");
416 blob_appendf(p, "\n\n<hr><div id=\"%s\"><i>On %s UTC %h",
417 zId, zDate, g.zLogin);
418 free(zDate);
419 zUser = PD("u",g.zLogin);
420 if( zUser[0] && fossil_strcmp(zUser,g.zLogin) ){
421 blob_appendf(p, " (claiming to be %h)", zUser);
422 }
423 zRemark = PD("r","");
424 blob_appendf(p, " added:</i><br />\n%s</div id=\"%s\">", zRemark, zId);
425 }
426
--- src/wikiformat.c
+++ src/wikiformat.c
@@ -131,11 +131,11 @@
131131
int i, c, first, last;
132132
first = 1;
133133
last = sizeof(aAttribute)/sizeof(aAttribute[0]) - 1;
134134
while( first<=last ){
135135
i = (first+last)/2;
136
- c = strcmp(aAttribute[i].zName, z);
136
+ c = fossil_strcmp(aAttribute[i].zName, z);
137137
if( c==0 ){
138138
return i;
139139
}else if( c<0 ){
140140
first = i+1;
141141
}else{
@@ -330,11 +330,11 @@
330330
int i, c, first, last;
331331
first = 1;
332332
last = sizeof(aMarkup)/sizeof(aMarkup[0]) - 1;
333333
while( first<=last ){
334334
i = (first+last)/2;
335
- c = strcmp(aMarkup[i].zName, z);
335
+ c = fossil_strcmp(aMarkup[i].zName, z);
336336
if( c==0 ){
337337
assert( aMarkup[i].iCode==i );
338338
return i;
339339
}else if( c<0 ){
340340
first = i+1;
@@ -880,11 +880,11 @@
880880
int i;
881881
assert( zId!=0 );
882882
for(i=p->nStack-1; i>=0; i--){
883883
if( p->aStack[i].iCode!=iTag ) continue;
884884
if( p->aStack[i].zId==0 ) continue;
885
- if( strcmp(zId, p->aStack[i].zId)!=0 ) continue;
885
+ if( fossil_strcmp(zId, p->aStack[i].zId)!=0 ) continue;
886886
break;
887887
}
888888
return i;
889889
}
890890
@@ -1118,11 +1118,11 @@
11181118
if( pMarkup->iCode!=MARKUP_VERBATIM ) return 0;
11191119
if( !pMarkup->endTag ) return 0;
11201120
if( p->zVerbatimId==0 ) return 1;
11211121
if( pMarkup->nAttr!=1 ) return 0;
11221122
z = pMarkup->aAttr[0].zValue;
1123
- return strcmp(z, p->zVerbatimId)==0;
1123
+ return fossil_strcmp(z, p->zVerbatimId)==0;
11241124
}
11251125
11261126
/*
11271127
** Return the MUTYPE for the top of the stack.
11281128
*/
@@ -1144,11 +1144,11 @@
11441144
int inlineOnly = (p->state & INLINE_MARKUP_ONLY)!=0;
11451145
int wikiUseHtml = (p->state & WIKI_USE_HTML)!=0;
11461146
11471147
/* Make sure the attribute constants and names still align
11481148
** following changes in the attribute list. */
1149
- assert( strcmp(aAttribute[ATTR_WIDTH].zName, "width")==0 );
1149
+ assert( fossil_strcmp(aAttribute[ATTR_WIDTH].zName, "width")==0 );
11501150
11511151
while( z[0] ){
11521152
if( wikiUseHtml ){
11531153
n = nextRawToken(z, p, &tokenType);
11541154
}else{
11551155
--- src/wikiformat.c
+++ src/wikiformat.c
@@ -131,11 +131,11 @@
131 int i, c, first, last;
132 first = 1;
133 last = sizeof(aAttribute)/sizeof(aAttribute[0]) - 1;
134 while( first<=last ){
135 i = (first+last)/2;
136 c = strcmp(aAttribute[i].zName, z);
137 if( c==0 ){
138 return i;
139 }else if( c<0 ){
140 first = i+1;
141 }else{
@@ -330,11 +330,11 @@
330 int i, c, first, last;
331 first = 1;
332 last = sizeof(aMarkup)/sizeof(aMarkup[0]) - 1;
333 while( first<=last ){
334 i = (first+last)/2;
335 c = strcmp(aMarkup[i].zName, z);
336 if( c==0 ){
337 assert( aMarkup[i].iCode==i );
338 return i;
339 }else if( c<0 ){
340 first = i+1;
@@ -880,11 +880,11 @@
880 int i;
881 assert( zId!=0 );
882 for(i=p->nStack-1; i>=0; i--){
883 if( p->aStack[i].iCode!=iTag ) continue;
884 if( p->aStack[i].zId==0 ) continue;
885 if( strcmp(zId, p->aStack[i].zId)!=0 ) continue;
886 break;
887 }
888 return i;
889 }
890
@@ -1118,11 +1118,11 @@
1118 if( pMarkup->iCode!=MARKUP_VERBATIM ) return 0;
1119 if( !pMarkup->endTag ) return 0;
1120 if( p->zVerbatimId==0 ) return 1;
1121 if( pMarkup->nAttr!=1 ) return 0;
1122 z = pMarkup->aAttr[0].zValue;
1123 return strcmp(z, p->zVerbatimId)==0;
1124 }
1125
1126 /*
1127 ** Return the MUTYPE for the top of the stack.
1128 */
@@ -1144,11 +1144,11 @@
1144 int inlineOnly = (p->state & INLINE_MARKUP_ONLY)!=0;
1145 int wikiUseHtml = (p->state & WIKI_USE_HTML)!=0;
1146
1147 /* Make sure the attribute constants and names still align
1148 ** following changes in the attribute list. */
1149 assert( strcmp(aAttribute[ATTR_WIDTH].zName, "width")==0 );
1150
1151 while( z[0] ){
1152 if( wikiUseHtml ){
1153 n = nextRawToken(z, p, &tokenType);
1154 }else{
1155
--- src/wikiformat.c
+++ src/wikiformat.c
@@ -131,11 +131,11 @@
131 int i, c, first, last;
132 first = 1;
133 last = sizeof(aAttribute)/sizeof(aAttribute[0]) - 1;
134 while( first<=last ){
135 i = (first+last)/2;
136 c = fossil_strcmp(aAttribute[i].zName, z);
137 if( c==0 ){
138 return i;
139 }else if( c<0 ){
140 first = i+1;
141 }else{
@@ -330,11 +330,11 @@
330 int i, c, first, last;
331 first = 1;
332 last = sizeof(aMarkup)/sizeof(aMarkup[0]) - 1;
333 while( first<=last ){
334 i = (first+last)/2;
335 c = fossil_strcmp(aMarkup[i].zName, z);
336 if( c==0 ){
337 assert( aMarkup[i].iCode==i );
338 return i;
339 }else if( c<0 ){
340 first = i+1;
@@ -880,11 +880,11 @@
880 int i;
881 assert( zId!=0 );
882 for(i=p->nStack-1; i>=0; i--){
883 if( p->aStack[i].iCode!=iTag ) continue;
884 if( p->aStack[i].zId==0 ) continue;
885 if( fossil_strcmp(zId, p->aStack[i].zId)!=0 ) continue;
886 break;
887 }
888 return i;
889 }
890
@@ -1118,11 +1118,11 @@
1118 if( pMarkup->iCode!=MARKUP_VERBATIM ) return 0;
1119 if( !pMarkup->endTag ) return 0;
1120 if( p->zVerbatimId==0 ) return 1;
1121 if( pMarkup->nAttr!=1 ) return 0;
1122 z = pMarkup->aAttr[0].zValue;
1123 return fossil_strcmp(z, p->zVerbatimId)==0;
1124 }
1125
1126 /*
1127 ** Return the MUTYPE for the top of the stack.
1128 */
@@ -1144,11 +1144,11 @@
1144 int inlineOnly = (p->state & INLINE_MARKUP_ONLY)!=0;
1145 int wikiUseHtml = (p->state & WIKI_USE_HTML)!=0;
1146
1147 /* Make sure the attribute constants and names still align
1148 ** following changes in the attribute list. */
1149 assert( fossil_strcmp(aAttribute[ATTR_WIDTH].zName, "width")==0 );
1150
1151 while( z[0] ){
1152 if( wikiUseHtml ){
1153 n = nextRawToken(z, p, &tokenType);
1154 }else{
1155
+3 -3
--- src/xfer.c
+++ src/xfer.c
@@ -549,11 +549,11 @@
549549
Stmt q;
550550
int rc = -1;
551551
char *zLogin = blob_terminate(pLogin);
552552
defossilize(zLogin);
553553
554
- if( strcmp(zLogin, "nobody")==0 || strcmp(zLogin,"anonymous")==0 ){
554
+ if( fossil_strcmp(zLogin, "nobody")==0 || fossil_strcmp(zLogin,"anonymous")==0 ){
555555
return 0; /* Anybody is allowed to sync as "nobody" or "anonymous" */
556556
}
557557
if( fossil_strcmp(P("REMOTE_USER"), zLogin)==0 ){
558558
return 0; /* Accept Basic Authorization */
559559
}
@@ -807,11 +807,11 @@
807807
int nGimme = 0;
808808
int size;
809809
int recvConfig = 0;
810810
char *zNow;
811811
812
- if( strcmp(PD("REQUEST_METHOD","POST"),"POST") ){
812
+ if( fossil_strcmp(PD("REQUEST_METHOD","POST"),"POST") ){
813813
fossil_redirect_home();
814814
}
815815
g.zLogin = "anonymous";
816816
login_set_anon_nobody_capabilities();
817817
login_check_credentials();
@@ -1632,11 +1632,11 @@
16321632
*/
16331633
if( blob_eq(&xfer.aToken[0],"error") && xfer.nToken==2 ){
16341634
if( !cloneFlag || nCycle>0 ){
16351635
char *zMsg = blob_terminate(&xfer.aToken[1]);
16361636
defossilize(zMsg);
1637
- if( strcmp(zMsg, "login failed")==0 ){
1637
+ if( fossil_strcmp(zMsg, "login failed")==0 ){
16381638
if( nCycle<2 ){
16391639
if( !g.dontKeepUrl ) db_unset("last-sync-pw", 0);
16401640
go = 1;
16411641
}
16421642
}else{
16431643
--- src/xfer.c
+++ src/xfer.c
@@ -549,11 +549,11 @@
549 Stmt q;
550 int rc = -1;
551 char *zLogin = blob_terminate(pLogin);
552 defossilize(zLogin);
553
554 if( strcmp(zLogin, "nobody")==0 || strcmp(zLogin,"anonymous")==0 ){
555 return 0; /* Anybody is allowed to sync as "nobody" or "anonymous" */
556 }
557 if( fossil_strcmp(P("REMOTE_USER"), zLogin)==0 ){
558 return 0; /* Accept Basic Authorization */
559 }
@@ -807,11 +807,11 @@
807 int nGimme = 0;
808 int size;
809 int recvConfig = 0;
810 char *zNow;
811
812 if( strcmp(PD("REQUEST_METHOD","POST"),"POST") ){
813 fossil_redirect_home();
814 }
815 g.zLogin = "anonymous";
816 login_set_anon_nobody_capabilities();
817 login_check_credentials();
@@ -1632,11 +1632,11 @@
1632 */
1633 if( blob_eq(&xfer.aToken[0],"error") && xfer.nToken==2 ){
1634 if( !cloneFlag || nCycle>0 ){
1635 char *zMsg = blob_terminate(&xfer.aToken[1]);
1636 defossilize(zMsg);
1637 if( strcmp(zMsg, "login failed")==0 ){
1638 if( nCycle<2 ){
1639 if( !g.dontKeepUrl ) db_unset("last-sync-pw", 0);
1640 go = 1;
1641 }
1642 }else{
1643
--- src/xfer.c
+++ src/xfer.c
@@ -549,11 +549,11 @@
549 Stmt q;
550 int rc = -1;
551 char *zLogin = blob_terminate(pLogin);
552 defossilize(zLogin);
553
554 if( fossil_strcmp(zLogin, "nobody")==0 || fossil_strcmp(zLogin,"anonymous")==0 ){
555 return 0; /* Anybody is allowed to sync as "nobody" or "anonymous" */
556 }
557 if( fossil_strcmp(P("REMOTE_USER"), zLogin)==0 ){
558 return 0; /* Accept Basic Authorization */
559 }
@@ -807,11 +807,11 @@
807 int nGimme = 0;
808 int size;
809 int recvConfig = 0;
810 char *zNow;
811
812 if( fossil_strcmp(PD("REQUEST_METHOD","POST"),"POST") ){
813 fossil_redirect_home();
814 }
815 g.zLogin = "anonymous";
816 login_set_anon_nobody_capabilities();
817 login_check_credentials();
@@ -1632,11 +1632,11 @@
1632 */
1633 if( blob_eq(&xfer.aToken[0],"error") && xfer.nToken==2 ){
1634 if( !cloneFlag || nCycle>0 ){
1635 char *zMsg = blob_terminate(&xfer.aToken[1]);
1636 defossilize(zMsg);
1637 if( fossil_strcmp(zMsg, "login failed")==0 ){
1638 if( nCycle<2 ){
1639 if( !g.dontKeepUrl ) db_unset("last-sync-pw", 0);
1640 go = 1;
1641 }
1642 }else{
1643
+1 -1
--- src/zip.c
+++ src/zip.c
@@ -98,11 +98,11 @@
9898
for(i=0; zName[i]; i++){
9999
if( zName[i]=='/' ){
100100
c = zName[i+1];
101101
zName[i+1] = 0;
102102
for(j=0; j<nDir; j++){
103
- if( strcmp(zName, azDir[j])==0 ) break;
103
+ if( fossil_strcmp(zName, azDir[j])==0 ) break;
104104
}
105105
if( j>=nDir ){
106106
nDir++;
107107
azDir = fossil_realloc(azDir, sizeof(azDir[0])*nDir);
108108
azDir[j] = mprintf("%s", zName);
109109
--- src/zip.c
+++ src/zip.c
@@ -98,11 +98,11 @@
98 for(i=0; zName[i]; i++){
99 if( zName[i]=='/' ){
100 c = zName[i+1];
101 zName[i+1] = 0;
102 for(j=0; j<nDir; j++){
103 if( strcmp(zName, azDir[j])==0 ) break;
104 }
105 if( j>=nDir ){
106 nDir++;
107 azDir = fossil_realloc(azDir, sizeof(azDir[0])*nDir);
108 azDir[j] = mprintf("%s", zName);
109
--- src/zip.c
+++ src/zip.c
@@ -98,11 +98,11 @@
98 for(i=0; zName[i]; i++){
99 if( zName[i]=='/' ){
100 c = zName[i+1];
101 zName[i+1] = 0;
102 for(j=0; j<nDir; j++){
103 if( fossil_strcmp(zName, azDir[j])==0 ) break;
104 }
105 if( j>=nDir ){
106 nDir++;
107 azDir = fossil_realloc(azDir, sizeof(azDir[0])*nDir);
108 azDir[j] = mprintf("%s", zName);
109

Keyboard Shortcuts

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