Fossil SCM

Add new function fossil_strcmp() that works like strcmp() except that it handles NULL arguments correctly. Use fossil_strcmp() in place of strcmp() in many places in the code.

drh 2010-12-23 02:22 trunk
Commit 31c52c7b3e7e1b858d77b1707b18e9dd4f1da2dd
+1 -1
--- src/add.c
+++ src/add.c
@@ -98,11 +98,11 @@
9898
const char *zReserved;
9999
100100
file_tree_name(zName, &pathname, 1);
101101
zPath = blob_str(&pathname);
102102
for(i=0; (zReserved = fossil_reserved_name(i))!=0; i++){
103
- if( strcmp(zPath, zReserved)==0 ) break;
103
+ if( fossil_strcmp(zPath, zReserved)==0 ) break;
104104
}
105105
if( zReserved || (pOmit && blob_compare(&pathname, pOmit)==0) ){
106106
fossil_warning("cannot add %s", zPath);
107107
}else{
108108
if( !file_is_simple_pathname(zPath) ){
109109
--- src/add.c
+++ src/add.c
@@ -98,11 +98,11 @@
98 const char *zReserved;
99
100 file_tree_name(zName, &pathname, 1);
101 zPath = blob_str(&pathname);
102 for(i=0; (zReserved = fossil_reserved_name(i))!=0; i++){
103 if( strcmp(zPath, zReserved)==0 ) break;
104 }
105 if( zReserved || (pOmit && blob_compare(&pathname, pOmit)==0) ){
106 fossil_warning("cannot add %s", zPath);
107 }else{
108 if( !file_is_simple_pathname(zPath) ){
109
--- src/add.c
+++ src/add.c
@@ -98,11 +98,11 @@
98 const char *zReserved;
99
100 file_tree_name(zName, &pathname, 1);
101 zPath = blob_str(&pathname);
102 for(i=0; (zReserved = fossil_reserved_name(i))!=0; i++){
103 if( fossil_strcmp(zPath, zReserved)==0 ) break;
104 }
105 if( zReserved || (pOmit && blob_compare(&pathname, pOmit)==0) ){
106 fossil_warning("cannot add %s", zPath);
107 }else{
108 if( !file_is_simple_pathname(zPath) ){
109
+1 -1
--- src/attach.c
+++ src/attach.c
@@ -174,11 +174,11 @@
174174
style_footer();
175175
return;
176176
}
177177
g.okRead = 1;
178178
cgi_replace_parameter("name",zUUID);
179
- if( strcmp(g.zPath,"attachview")==0 ){
179
+ if( fossil_strcmp(g.zPath,"attachview")==0 ){
180180
artifact_page();
181181
}else{
182182
cgi_replace_parameter("m", mimetype_from_name(zFile));
183183
rawartifact_page();
184184
}
185185
--- src/attach.c
+++ src/attach.c
@@ -174,11 +174,11 @@
174 style_footer();
175 return;
176 }
177 g.okRead = 1;
178 cgi_replace_parameter("name",zUUID);
179 if( strcmp(g.zPath,"attachview")==0 ){
180 artifact_page();
181 }else{
182 cgi_replace_parameter("m", mimetype_from_name(zFile));
183 rawartifact_page();
184 }
185
--- src/attach.c
+++ src/attach.c
@@ -174,11 +174,11 @@
174 style_footer();
175 return;
176 }
177 g.okRead = 1;
178 cgi_replace_parameter("name",zUUID);
179 if( fossil_strcmp(g.zPath,"attachview")==0 ){
180 artifact_page();
181 }else{
182 cgi_replace_parameter("m", mimetype_from_name(zFile));
183 rawartifact_page();
184 }
185
+1 -1
--- src/branch.c
+++ src/branch.c
@@ -215,11 +215,11 @@
215215
" ORDER BY value /*sort*/",
216216
TAG_BRANCH
217217
);
218218
while( db_step(&q)==SQLITE_ROW ){
219219
const char *zBr = db_column_text(&q, 0);
220
- int isCur = zCurrent!=0 && strcmp(zCurrent,zBr)==0;
220
+ int isCur = zCurrent!=0 && fossil_strcmp(zCurrent,zBr)==0;
221221
printf("%s%s\n", (isCur ? "* " : " "), zBr);
222222
}
223223
db_finalize(&q);
224224
}else{
225225
fossil_panic("branch subcommand should be one of: "
226226
--- src/branch.c
+++ src/branch.c
@@ -215,11 +215,11 @@
215 " ORDER BY value /*sort*/",
216 TAG_BRANCH
217 );
218 while( db_step(&q)==SQLITE_ROW ){
219 const char *zBr = db_column_text(&q, 0);
220 int isCur = zCurrent!=0 && strcmp(zCurrent,zBr)==0;
221 printf("%s%s\n", (isCur ? "* " : " "), zBr);
222 }
223 db_finalize(&q);
224 }else{
225 fossil_panic("branch subcommand should be one of: "
226
--- src/branch.c
+++ src/branch.c
@@ -215,11 +215,11 @@
215 " ORDER BY value /*sort*/",
216 TAG_BRANCH
217 );
218 while( db_step(&q)==SQLITE_ROW ){
219 const char *zBr = db_column_text(&q, 0);
220 int isCur = zCurrent!=0 && fossil_strcmp(zCurrent,zBr)==0;
221 printf("%s%s\n", (isCur ? "* " : " "), zBr);
222 }
223 db_finalize(&q);
224 }else{
225 fossil_panic("branch subcommand should be one of: "
226
+4 -4
--- src/checkin.c
+++ src/checkin.c
@@ -649,23 +649,23 @@
649649
zPerm = " x";
650650
}else{
651651
zPerm = "";
652652
}
653653
if( !g.markPrivate ) content_make_public(frid);
654
- while( pFile && strcmp(pFile->zName,zName)<0 ){
654
+ while( pFile && fossil_strcmp(pFile->zName,zName)<0 ){
655655
blob_appendf(pOut, "F %F\n", pFile->zName);
656656
pFile = manifest_file_next(pBaseline, 0);
657657
nFBcard++;
658658
}
659659
cmp = 1;
660660
if( pFile==0
661
- || (cmp = strcmp(pFile->zName,zName))!=0
662
- || strcmp(pFile->zUuid, zUuid)!=0
661
+ || (cmp = fossil_strcmp(pFile->zName,zName))!=0
662
+ || fossil_strcmp(pFile->zUuid, zUuid)!=0
663663
){
664664
blob_resize(&filename, nBasename);
665665
if( zOrig && !isSelected ){ zName = zOrig; zOrig = 0; }
666
- if( zOrig==0 || strcmp(zOrig,zName)==0 ){
666
+ if( zOrig==0 || fossil_strcmp(zOrig,zName)==0 ){
667667
blob_appendf(pOut, "F %F %s%s\n", zName, zUuid, zPerm);
668668
}else{
669669
if( zPerm[0]==0 ){ zPerm = " w"; }
670670
blob_appendf(pOut, "F %F %s%s %F\n", zName, zUuid, zPerm, zOrig);
671671
}
672672
--- src/checkin.c
+++ src/checkin.c
@@ -649,23 +649,23 @@
649 zPerm = " x";
650 }else{
651 zPerm = "";
652 }
653 if( !g.markPrivate ) content_make_public(frid);
654 while( pFile && strcmp(pFile->zName,zName)<0 ){
655 blob_appendf(pOut, "F %F\n", pFile->zName);
656 pFile = manifest_file_next(pBaseline, 0);
657 nFBcard++;
658 }
659 cmp = 1;
660 if( pFile==0
661 || (cmp = strcmp(pFile->zName,zName))!=0
662 || strcmp(pFile->zUuid, zUuid)!=0
663 ){
664 blob_resize(&filename, nBasename);
665 if( zOrig && !isSelected ){ zName = zOrig; zOrig = 0; }
666 if( zOrig==0 || strcmp(zOrig,zName)==0 ){
667 blob_appendf(pOut, "F %F %s%s\n", zName, zUuid, zPerm);
668 }else{
669 if( zPerm[0]==0 ){ zPerm = " w"; }
670 blob_appendf(pOut, "F %F %s%s %F\n", zName, zUuid, zPerm, zOrig);
671 }
672
--- src/checkin.c
+++ src/checkin.c
@@ -649,23 +649,23 @@
649 zPerm = " x";
650 }else{
651 zPerm = "";
652 }
653 if( !g.markPrivate ) content_make_public(frid);
654 while( pFile && fossil_strcmp(pFile->zName,zName)<0 ){
655 blob_appendf(pOut, "F %F\n", pFile->zName);
656 pFile = manifest_file_next(pBaseline, 0);
657 nFBcard++;
658 }
659 cmp = 1;
660 if( pFile==0
661 || (cmp = fossil_strcmp(pFile->zName,zName))!=0
662 || fossil_strcmp(pFile->zUuid, zUuid)!=0
663 ){
664 blob_resize(&filename, nBasename);
665 if( zOrig && !isSelected ){ zName = zOrig; zOrig = 0; }
666 if( zOrig==0 || fossil_strcmp(zOrig,zName)==0 ){
667 blob_appendf(pOut, "F %F %s%s\n", zName, zUuid, zPerm);
668 }else{
669 if( zPerm[0]==0 ){ zPerm = " w"; }
670 blob_appendf(pOut, "F %F %s%s %F\n", zName, zUuid, zPerm, zOrig);
671 }
672
+9 -9
--- src/configure.c
+++ src/configure.c
@@ -120,11 +120,11 @@
120120
** safely exported. Return 0 if the parameter is not safe to export.
121121
*/
122122
int configure_is_exportable(const char *zName){
123123
int i;
124124
for(i=0; i<count(aConfig); i++){
125
- if( strcmp(zName, aConfig[i].zName)==0 ){
125
+ if( fossil_strcmp(zName, aConfig[i].zName)==0 ){
126126
int m = aConfig[i].groupMask;
127127
if( !g.okAdmin ){
128128
m &= ~CONFIGSET_USER;
129129
}
130130
if( !g.okRdAddr ){
@@ -142,19 +142,19 @@
142142
** and "@shun" and "@user". This routine writes SQL text into pOut that when
143143
** evaluated will populate the corresponding table with data.
144144
*/
145145
void configure_render_special_name(const char *zName, Blob *pOut){
146146
Stmt q;
147
- if( strcmp(zName, "@shun")==0 ){
147
+ if( fossil_strcmp(zName, "@shun")==0 ){
148148
db_prepare(&q, "SELECT uuid FROM shun");
149149
while( db_step(&q)==SQLITE_ROW ){
150150
blob_appendf(pOut, "INSERT OR IGNORE INTO shun VALUES('%s');\n",
151151
db_column_text(&q, 0)
152152
);
153153
}
154154
db_finalize(&q);
155
- }else if( strcmp(zName, "@reportfmt")==0 ){
155
+ }else if( fossil_strcmp(zName, "@reportfmt")==0 ){
156156
db_prepare(&q, "SELECT title, cols, sqlcode FROM reportfmt");
157157
while( db_step(&q)==SQLITE_ROW ){
158158
blob_appendf(pOut, "INSERT INTO _xfer_reportfmt(title,cols,sqlcode)"
159159
" VALUES(%Q,%Q,%Q);\n",
160160
db_column_text(&q, 0),
@@ -161,11 +161,11 @@
161161
db_column_text(&q, 1),
162162
db_column_text(&q, 2)
163163
);
164164
}
165165
db_finalize(&q);
166
- }else if( strcmp(zName, "@user")==0 ){
166
+ }else if( fossil_strcmp(zName, "@user")==0 ){
167167
db_prepare(&q,
168168
"SELECT login, CASE WHEN length(pw)==40 THEN pw END,"
169169
" cap, info, quote(photo) FROM user");
170170
while( db_step(&q)==SQLITE_ROW ){
171171
blob_appendf(pOut, "INSERT INTO _xfer_user(login,pw,cap,info,photo)"
@@ -176,11 +176,11 @@
176176
db_column_text(&q, 3),
177177
db_column_text(&q, 4)
178178
);
179179
}
180180
db_finalize(&q);
181
- }else if( strcmp(zName, "@concealed")==0 ){
181
+ }else if( fossil_strcmp(zName, "@concealed")==0 ){
182182
db_prepare(&q, "SELECT hash, content FROM concealed");
183183
while( db_step(&q)==SQLITE_ROW ){
184184
blob_appendf(pOut, "INSERT OR IGNORE INTO concealed(hash,content)"
185185
" VALUES(%Q,%Q);\n",
186186
db_column_text(&q, 0),
@@ -481,18 +481,18 @@
481481
for(i=0; i<count(aConfig); i++){
482482
const char *zName = aConfig[i].zName;
483483
if( (aConfig[i].groupMask & mask)==0 ) continue;
484484
if( zName[0]!='@' ){
485485
db_multi_exec("DELETE FROM config WHERE name=%Q", zName);
486
- }else if( strcmp(zName,"@user")==0 ){
486
+ }else if( fossil_strcmp(zName,"@user")==0 ){
487487
db_multi_exec("DELETE FROM user");
488488
db_create_default_users(0, 0);
489
- }else if( strcmp(zName,"@concealed")==0 ){
489
+ }else if( fossil_strcmp(zName,"@concealed")==0 ){
490490
db_multi_exec("DELETE FROM concealed");
491
- }else if( strcmp(zName,"@shun")==0 ){
491
+ }else if( fossil_strcmp(zName,"@shun")==0 ){
492492
db_multi_exec("DELETE FROM shun");
493
- }else if( strcmp(zName,"@reportfmt")==0 ){
493
+ }else if( fossil_strcmp(zName,"@reportfmt")==0 ){
494494
db_multi_exec("DELETE FROM reportfmt");
495495
}
496496
}
497497
db_end_transaction(0);
498498
printf("Configuration reset to factory defaults.\n");
499499
--- src/configure.c
+++ src/configure.c
@@ -120,11 +120,11 @@
120 ** safely exported. Return 0 if the parameter is not safe to export.
121 */
122 int configure_is_exportable(const char *zName){
123 int i;
124 for(i=0; i<count(aConfig); i++){
125 if( strcmp(zName, aConfig[i].zName)==0 ){
126 int m = aConfig[i].groupMask;
127 if( !g.okAdmin ){
128 m &= ~CONFIGSET_USER;
129 }
130 if( !g.okRdAddr ){
@@ -142,19 +142,19 @@
142 ** and "@shun" and "@user". This routine writes SQL text into pOut that when
143 ** evaluated will populate the corresponding table with data.
144 */
145 void configure_render_special_name(const char *zName, Blob *pOut){
146 Stmt q;
147 if( strcmp(zName, "@shun")==0 ){
148 db_prepare(&q, "SELECT uuid FROM shun");
149 while( db_step(&q)==SQLITE_ROW ){
150 blob_appendf(pOut, "INSERT OR IGNORE INTO shun VALUES('%s');\n",
151 db_column_text(&q, 0)
152 );
153 }
154 db_finalize(&q);
155 }else if( strcmp(zName, "@reportfmt")==0 ){
156 db_prepare(&q, "SELECT title, cols, sqlcode FROM reportfmt");
157 while( db_step(&q)==SQLITE_ROW ){
158 blob_appendf(pOut, "INSERT INTO _xfer_reportfmt(title,cols,sqlcode)"
159 " VALUES(%Q,%Q,%Q);\n",
160 db_column_text(&q, 0),
@@ -161,11 +161,11 @@
161 db_column_text(&q, 1),
162 db_column_text(&q, 2)
163 );
164 }
165 db_finalize(&q);
166 }else if( strcmp(zName, "@user")==0 ){
167 db_prepare(&q,
168 "SELECT login, CASE WHEN length(pw)==40 THEN pw END,"
169 " cap, info, quote(photo) FROM user");
170 while( db_step(&q)==SQLITE_ROW ){
171 blob_appendf(pOut, "INSERT INTO _xfer_user(login,pw,cap,info,photo)"
@@ -176,11 +176,11 @@
176 db_column_text(&q, 3),
177 db_column_text(&q, 4)
178 );
179 }
180 db_finalize(&q);
181 }else if( strcmp(zName, "@concealed")==0 ){
182 db_prepare(&q, "SELECT hash, content FROM concealed");
183 while( db_step(&q)==SQLITE_ROW ){
184 blob_appendf(pOut, "INSERT OR IGNORE INTO concealed(hash,content)"
185 " VALUES(%Q,%Q);\n",
186 db_column_text(&q, 0),
@@ -481,18 +481,18 @@
481 for(i=0; i<count(aConfig); i++){
482 const char *zName = aConfig[i].zName;
483 if( (aConfig[i].groupMask & mask)==0 ) continue;
484 if( zName[0]!='@' ){
485 db_multi_exec("DELETE FROM config WHERE name=%Q", zName);
486 }else if( strcmp(zName,"@user")==0 ){
487 db_multi_exec("DELETE FROM user");
488 db_create_default_users(0, 0);
489 }else if( strcmp(zName,"@concealed")==0 ){
490 db_multi_exec("DELETE FROM concealed");
491 }else if( strcmp(zName,"@shun")==0 ){
492 db_multi_exec("DELETE FROM shun");
493 }else if( strcmp(zName,"@reportfmt")==0 ){
494 db_multi_exec("DELETE FROM reportfmt");
495 }
496 }
497 db_end_transaction(0);
498 printf("Configuration reset to factory defaults.\n");
499
--- src/configure.c
+++ src/configure.c
@@ -120,11 +120,11 @@
120 ** safely exported. Return 0 if the parameter is not safe to export.
121 */
122 int configure_is_exportable(const char *zName){
123 int i;
124 for(i=0; i<count(aConfig); i++){
125 if( fossil_strcmp(zName, aConfig[i].zName)==0 ){
126 int m = aConfig[i].groupMask;
127 if( !g.okAdmin ){
128 m &= ~CONFIGSET_USER;
129 }
130 if( !g.okRdAddr ){
@@ -142,19 +142,19 @@
142 ** and "@shun" and "@user". This routine writes SQL text into pOut that when
143 ** evaluated will populate the corresponding table with data.
144 */
145 void configure_render_special_name(const char *zName, Blob *pOut){
146 Stmt q;
147 if( fossil_strcmp(zName, "@shun")==0 ){
148 db_prepare(&q, "SELECT uuid FROM shun");
149 while( db_step(&q)==SQLITE_ROW ){
150 blob_appendf(pOut, "INSERT OR IGNORE INTO shun VALUES('%s');\n",
151 db_column_text(&q, 0)
152 );
153 }
154 db_finalize(&q);
155 }else if( fossil_strcmp(zName, "@reportfmt")==0 ){
156 db_prepare(&q, "SELECT title, cols, sqlcode FROM reportfmt");
157 while( db_step(&q)==SQLITE_ROW ){
158 blob_appendf(pOut, "INSERT INTO _xfer_reportfmt(title,cols,sqlcode)"
159 " VALUES(%Q,%Q,%Q);\n",
160 db_column_text(&q, 0),
@@ -161,11 +161,11 @@
161 db_column_text(&q, 1),
162 db_column_text(&q, 2)
163 );
164 }
165 db_finalize(&q);
166 }else if( fossil_strcmp(zName, "@user")==0 ){
167 db_prepare(&q,
168 "SELECT login, CASE WHEN length(pw)==40 THEN pw END,"
169 " cap, info, quote(photo) FROM user");
170 while( db_step(&q)==SQLITE_ROW ){
171 blob_appendf(pOut, "INSERT INTO _xfer_user(login,pw,cap,info,photo)"
@@ -176,11 +176,11 @@
176 db_column_text(&q, 3),
177 db_column_text(&q, 4)
178 );
179 }
180 db_finalize(&q);
181 }else if( fossil_strcmp(zName, "@concealed")==0 ){
182 db_prepare(&q, "SELECT hash, content FROM concealed");
183 while( db_step(&q)==SQLITE_ROW ){
184 blob_appendf(pOut, "INSERT OR IGNORE INTO concealed(hash,content)"
185 " VALUES(%Q,%Q);\n",
186 db_column_text(&q, 0),
@@ -481,18 +481,18 @@
481 for(i=0; i<count(aConfig); i++){
482 const char *zName = aConfig[i].zName;
483 if( (aConfig[i].groupMask & mask)==0 ) continue;
484 if( zName[0]!='@' ){
485 db_multi_exec("DELETE FROM config WHERE name=%Q", zName);
486 }else if( fossil_strcmp(zName,"@user")==0 ){
487 db_multi_exec("DELETE FROM user");
488 db_create_default_users(0, 0);
489 }else if( fossil_strcmp(zName,"@concealed")==0 ){
490 db_multi_exec("DELETE FROM concealed");
491 }else if( fossil_strcmp(zName,"@shun")==0 ){
492 db_multi_exec("DELETE FROM shun");
493 }else if( fossil_strcmp(zName,"@reportfmt")==0 ){
494 db_multi_exec("DELETE FROM reportfmt");
495 }
496 }
497 db_end_transaction(0);
498 printf("Configuration reset to factory defaults.\n");
499
+3 -3
--- src/db.c
+++ src/db.c
@@ -1309,19 +1309,19 @@
13091309
*/
13101310
int is_truth(const char *zVal){
13111311
static const char *azOn[] = { "on", "yes", "true", "1" };
13121312
int i;
13131313
for(i=0; i<sizeof(azOn)/sizeof(azOn[0]); i++){
1314
- if( strcmp(zVal,azOn[i])==0 ) return 1;
1314
+ if( fossil_strcmp(zVal,azOn[i])==0 ) return 1;
13151315
}
13161316
return 0;
13171317
}
13181318
int is_false(const char *zVal){
13191319
static const char *azOff[] = { "off", "no", "false", "0" };
13201320
int i;
13211321
for(i=0; i<sizeof(azOff)/sizeof(azOff[0]); i++){
1322
- if( strcmp(zVal,azOff[i])==0 ) return 1;
1322
+ if( fossil_strcmp(zVal,azOff[i])==0 ) return 1;
13231323
}
13241324
return 0;
13251325
}
13261326
13271327
/*
@@ -1712,11 +1712,11 @@
17121712
if( strncmp(ctrlSettings[i].name, zName, n)==0 ) break;
17131713
}
17141714
if( !ctrlSettings[i].name ){
17151715
fossil_fatal("no such setting: %s", zName);
17161716
}
1717
- isManifest = strcmp(ctrlSettings[i].name, "manifest")==0;
1717
+ isManifest = fossil_strcmp(ctrlSettings[i].name, "manifest")==0;
17181718
if( isManifest && globalFlag ){
17191719
fossil_fatal("cannot set 'manifest' globally");
17201720
}
17211721
if( unsetFlag ){
17221722
db_unset(ctrlSettings[i].name, globalFlag);
17231723
--- src/db.c
+++ src/db.c
@@ -1309,19 +1309,19 @@
1309 */
1310 int is_truth(const char *zVal){
1311 static const char *azOn[] = { "on", "yes", "true", "1" };
1312 int i;
1313 for(i=0; i<sizeof(azOn)/sizeof(azOn[0]); i++){
1314 if( strcmp(zVal,azOn[i])==0 ) return 1;
1315 }
1316 return 0;
1317 }
1318 int is_false(const char *zVal){
1319 static const char *azOff[] = { "off", "no", "false", "0" };
1320 int i;
1321 for(i=0; i<sizeof(azOff)/sizeof(azOff[0]); i++){
1322 if( strcmp(zVal,azOff[i])==0 ) return 1;
1323 }
1324 return 0;
1325 }
1326
1327 /*
@@ -1712,11 +1712,11 @@
1712 if( strncmp(ctrlSettings[i].name, zName, n)==0 ) break;
1713 }
1714 if( !ctrlSettings[i].name ){
1715 fossil_fatal("no such setting: %s", zName);
1716 }
1717 isManifest = strcmp(ctrlSettings[i].name, "manifest")==0;
1718 if( isManifest && globalFlag ){
1719 fossil_fatal("cannot set 'manifest' globally");
1720 }
1721 if( unsetFlag ){
1722 db_unset(ctrlSettings[i].name, globalFlag);
1723
--- src/db.c
+++ src/db.c
@@ -1309,19 +1309,19 @@
1309 */
1310 int is_truth(const char *zVal){
1311 static const char *azOn[] = { "on", "yes", "true", "1" };
1312 int i;
1313 for(i=0; i<sizeof(azOn)/sizeof(azOn[0]); i++){
1314 if( fossil_strcmp(zVal,azOn[i])==0 ) return 1;
1315 }
1316 return 0;
1317 }
1318 int is_false(const char *zVal){
1319 static const char *azOff[] = { "off", "no", "false", "0" };
1320 int i;
1321 for(i=0; i<sizeof(azOff)/sizeof(azOff[0]); i++){
1322 if( fossil_strcmp(zVal,azOff[i])==0 ) return 1;
1323 }
1324 return 0;
1325 }
1326
1327 /*
@@ -1712,11 +1712,11 @@
1712 if( strncmp(ctrlSettings[i].name, zName, n)==0 ) break;
1713 }
1714 if( !ctrlSettings[i].name ){
1715 fossil_fatal("no such setting: %s", zName);
1716 }
1717 isManifest = fossil_strcmp(ctrlSettings[i].name, "manifest")==0;
1718 if( isManifest && globalFlag ){
1719 fossil_fatal("cannot set 'manifest' globally");
1720 }
1721 if( unsetFlag ){
1722 db_unset(ctrlSettings[i].name, globalFlag);
1723
+2 -2
--- src/diffcmd.c
+++ src/diffcmd.c
@@ -358,11 +358,11 @@
358358
if( pFromFile==0 ){
359359
cmp = +1;
360360
}else if( pToFile==0 ){
361361
cmp = -1;
362362
}else{
363
- cmp = strcmp(pFromFile->zName, pToFile->zName);
363
+ cmp = fossil_strcmp(pFromFile->zName, pToFile->zName);
364364
}
365365
if( cmp<0 ){
366366
printf("DELETED %s\n", pFromFile->zName);
367367
if( asNewFlag ){
368368
diff_manifest_entry(pFromFile, 0, zDiffCmd, ignoreEolWs);
@@ -372,11 +372,11 @@
372372
printf("ADDED %s\n", pToFile->zName);
373373
if( asNewFlag ){
374374
diff_manifest_entry(0, pToFile, zDiffCmd, ignoreEolWs);
375375
}
376376
pToFile = manifest_file_next(pTo,0);
377
- }else if( strcmp(pFromFile->zUuid, pToFile->zUuid)==0 ){
377
+ }else if( fossil_strcmp(pFromFile->zUuid, pToFile->zUuid)==0 ){
378378
/* No changes */
379379
pFromFile = manifest_file_next(pFrom,0);
380380
pToFile = manifest_file_next(pTo,0);
381381
}else{
382382
printf("CHANGED %s\n", pFromFile->zName);
383383
--- src/diffcmd.c
+++ src/diffcmd.c
@@ -358,11 +358,11 @@
358 if( pFromFile==0 ){
359 cmp = +1;
360 }else if( pToFile==0 ){
361 cmp = -1;
362 }else{
363 cmp = strcmp(pFromFile->zName, pToFile->zName);
364 }
365 if( cmp<0 ){
366 printf("DELETED %s\n", pFromFile->zName);
367 if( asNewFlag ){
368 diff_manifest_entry(pFromFile, 0, zDiffCmd, ignoreEolWs);
@@ -372,11 +372,11 @@
372 printf("ADDED %s\n", pToFile->zName);
373 if( asNewFlag ){
374 diff_manifest_entry(0, pToFile, zDiffCmd, ignoreEolWs);
375 }
376 pToFile = manifest_file_next(pTo,0);
377 }else if( strcmp(pFromFile->zUuid, pToFile->zUuid)==0 ){
378 /* No changes */
379 pFromFile = manifest_file_next(pFrom,0);
380 pToFile = manifest_file_next(pTo,0);
381 }else{
382 printf("CHANGED %s\n", pFromFile->zName);
383
--- src/diffcmd.c
+++ src/diffcmd.c
@@ -358,11 +358,11 @@
358 if( pFromFile==0 ){
359 cmp = +1;
360 }else if( pToFile==0 ){
361 cmp = -1;
362 }else{
363 cmp = fossil_strcmp(pFromFile->zName, pToFile->zName);
364 }
365 if( cmp<0 ){
366 printf("DELETED %s\n", pFromFile->zName);
367 if( asNewFlag ){
368 diff_manifest_entry(pFromFile, 0, zDiffCmd, ignoreEolWs);
@@ -372,11 +372,11 @@
372 printf("ADDED %s\n", pToFile->zName);
373 if( asNewFlag ){
374 diff_manifest_entry(0, pToFile, zDiffCmd, ignoreEolWs);
375 }
376 pToFile = manifest_file_next(pTo,0);
377 }else if( fossil_strcmp(pFromFile->zUuid, pToFile->zUuid)==0 ){
378 /* No changes */
379 pFromFile = manifest_file_next(pFrom,0);
380 pToFile = manifest_file_next(pTo,0);
381 }else{
382 printf("CHANGED %s\n", pFromFile->zName);
383
+6 -6
--- src/doc.c
+++ src/doc.c
@@ -297,11 +297,11 @@
297297
first = 0;
298298
last = sizeof(aMime)/sizeof(aMime[0]);
299299
while( first<=last ){
300300
int c;
301301
i = (first+last)/2;
302
- c = strcmp(zSuffix, aMime[i].zSuffix);
302
+ c = fossil_strcmp(zSuffix, aMime[i].zSuffix);
303303
if( c==0 ) return aMime[i].zMimetype;
304304
if( c<0 ){
305305
last = i-1;
306306
}else{
307307
first = i+1;
@@ -346,14 +346,14 @@
346346
zName += i;
347347
while( zName[0]=='/' ){ zName++; }
348348
if( !file_is_simple_pathname(zName) ){
349349
goto doc_not_found;
350350
}
351
- if( strcmp(zBaseline,"ckout")==0 && db_open_local()==0 ){
351
+ if( fossil_strcmp(zBaseline,"ckout")==0 && db_open_local()==0 ){
352352
sqlite3_snprintf(sizeof(zBaseline), zBaseline, "tip");
353353
}
354
- if( strcmp(zBaseline,"ckout")==0 ){
354
+ if( fossil_strcmp(zBaseline,"ckout")==0 ){
355355
/* Read from the local checkout */
356356
char *zFullpath;
357357
db_must_be_within_tree();
358358
zFullpath = mprintf("%s/%s", g.zLocalRoot, zName);
359359
if( !file_isfile(zFullpath) ){
@@ -362,11 +362,11 @@
362362
if( blob_read_from_file(&filebody, zFullpath)<0 ){
363363
goto doc_not_found;
364364
}
365365
}else{
366366
db_begin_transaction();
367
- if( strcmp(zBaseline,"tip")==0 ){
367
+ if( fossil_strcmp(zBaseline,"tip")==0 ){
368368
vid = db_int(0, "SELECT objid FROM event WHERE type='ci'"
369369
" ORDER BY mtime DESC LIMIT 1");
370370
}else{
371371
vid = name_to_rid(zBaseline);
372372
}
@@ -443,21 +443,21 @@
443443
Th_Store("doc_name", zName);
444444
Th_Store("doc_version", db_text(0, "SELECT '[' || substr(uuid,1,10) || ']'"
445445
" FROM blob WHERE rid=%d", vid));
446446
Th_Store("doc_date", db_text(0, "SELECT datetime(mtime) FROM event"
447447
" WHERE objid=%d AND type='ci'", vid));
448
- if( strcmp(zMime, "application/x-fossil-wiki")==0 ){
448
+ if( fossil_strcmp(zMime, "application/x-fossil-wiki")==0 ){
449449
Blob title, tail;
450450
if( wiki_find_title(&filebody, &title, &tail) ){
451451
style_header(blob_str(&title));
452452
wiki_convert(&tail, 0, 0);
453453
}else{
454454
style_header("Documentation");
455455
wiki_convert(&filebody, 0, 0);
456456
}
457457
style_footer();
458
- }else if( strcmp(zMime, "text/plain")==0 ){
458
+ }else if( fossil_strcmp(zMime, "text/plain")==0 ){
459459
style_header("Documentation");
460460
@ <blockquote><pre>
461461
@ %h(blob_str(&filebody))
462462
@ </pre></blockquote>
463463
style_footer();
464464
--- src/doc.c
+++ src/doc.c
@@ -297,11 +297,11 @@
297 first = 0;
298 last = sizeof(aMime)/sizeof(aMime[0]);
299 while( first<=last ){
300 int c;
301 i = (first+last)/2;
302 c = strcmp(zSuffix, aMime[i].zSuffix);
303 if( c==0 ) return aMime[i].zMimetype;
304 if( c<0 ){
305 last = i-1;
306 }else{
307 first = i+1;
@@ -346,14 +346,14 @@
346 zName += i;
347 while( zName[0]=='/' ){ zName++; }
348 if( !file_is_simple_pathname(zName) ){
349 goto doc_not_found;
350 }
351 if( strcmp(zBaseline,"ckout")==0 && db_open_local()==0 ){
352 sqlite3_snprintf(sizeof(zBaseline), zBaseline, "tip");
353 }
354 if( strcmp(zBaseline,"ckout")==0 ){
355 /* Read from the local checkout */
356 char *zFullpath;
357 db_must_be_within_tree();
358 zFullpath = mprintf("%s/%s", g.zLocalRoot, zName);
359 if( !file_isfile(zFullpath) ){
@@ -362,11 +362,11 @@
362 if( blob_read_from_file(&filebody, zFullpath)<0 ){
363 goto doc_not_found;
364 }
365 }else{
366 db_begin_transaction();
367 if( strcmp(zBaseline,"tip")==0 ){
368 vid = db_int(0, "SELECT objid FROM event WHERE type='ci'"
369 " ORDER BY mtime DESC LIMIT 1");
370 }else{
371 vid = name_to_rid(zBaseline);
372 }
@@ -443,21 +443,21 @@
443 Th_Store("doc_name", zName);
444 Th_Store("doc_version", db_text(0, "SELECT '[' || substr(uuid,1,10) || ']'"
445 " FROM blob WHERE rid=%d", vid));
446 Th_Store("doc_date", db_text(0, "SELECT datetime(mtime) FROM event"
447 " WHERE objid=%d AND type='ci'", vid));
448 if( strcmp(zMime, "application/x-fossil-wiki")==0 ){
449 Blob title, tail;
450 if( wiki_find_title(&filebody, &title, &tail) ){
451 style_header(blob_str(&title));
452 wiki_convert(&tail, 0, 0);
453 }else{
454 style_header("Documentation");
455 wiki_convert(&filebody, 0, 0);
456 }
457 style_footer();
458 }else if( strcmp(zMime, "text/plain")==0 ){
459 style_header("Documentation");
460 @ <blockquote><pre>
461 @ %h(blob_str(&filebody))
462 @ </pre></blockquote>
463 style_footer();
464
--- src/doc.c
+++ src/doc.c
@@ -297,11 +297,11 @@
297 first = 0;
298 last = sizeof(aMime)/sizeof(aMime[0]);
299 while( first<=last ){
300 int c;
301 i = (first+last)/2;
302 c = fossil_strcmp(zSuffix, aMime[i].zSuffix);
303 if( c==0 ) return aMime[i].zMimetype;
304 if( c<0 ){
305 last = i-1;
306 }else{
307 first = i+1;
@@ -346,14 +346,14 @@
346 zName += i;
347 while( zName[0]=='/' ){ zName++; }
348 if( !file_is_simple_pathname(zName) ){
349 goto doc_not_found;
350 }
351 if( fossil_strcmp(zBaseline,"ckout")==0 && db_open_local()==0 ){
352 sqlite3_snprintf(sizeof(zBaseline), zBaseline, "tip");
353 }
354 if( fossil_strcmp(zBaseline,"ckout")==0 ){
355 /* Read from the local checkout */
356 char *zFullpath;
357 db_must_be_within_tree();
358 zFullpath = mprintf("%s/%s", g.zLocalRoot, zName);
359 if( !file_isfile(zFullpath) ){
@@ -362,11 +362,11 @@
362 if( blob_read_from_file(&filebody, zFullpath)<0 ){
363 goto doc_not_found;
364 }
365 }else{
366 db_begin_transaction();
367 if( fossil_strcmp(zBaseline,"tip")==0 ){
368 vid = db_int(0, "SELECT objid FROM event WHERE type='ci'"
369 " ORDER BY mtime DESC LIMIT 1");
370 }else{
371 vid = name_to_rid(zBaseline);
372 }
@@ -443,21 +443,21 @@
443 Th_Store("doc_name", zName);
444 Th_Store("doc_version", db_text(0, "SELECT '[' || substr(uuid,1,10) || ']'"
445 " FROM blob WHERE rid=%d", vid));
446 Th_Store("doc_date", db_text(0, "SELECT datetime(mtime) FROM event"
447 " WHERE objid=%d AND type='ci'", vid));
448 if( fossil_strcmp(zMime, "application/x-fossil-wiki")==0 ){
449 Blob title, tail;
450 if( wiki_find_title(&filebody, &title, &tail) ){
451 style_header(blob_str(&title));
452 wiki_convert(&tail, 0, 0);
453 }else{
454 style_header("Documentation");
455 wiki_convert(&filebody, 0, 0);
456 }
457 style_footer();
458 }else if( fossil_strcmp(zMime, "text/plain")==0 ){
459 style_header("Documentation");
460 @ <blockquote><pre>
461 @ %h(blob_str(&filebody))
462 @ </pre></blockquote>
463 style_footer();
464
+2 -2
--- src/event.c
+++ src/event.c
@@ -169,11 +169,11 @@
169169
@ [<a href="%s(g.zTop)/timeline?c=%T(zETime)">%s(zETime)</a>]
170170
@ entered by user <b>%h(pEvent->zUser)</b> on
171171
@ [<a href="%s(g.zTop)/timeline?c=%T(zATime)">%s(zATime)</a>]:</p>
172172
@ <blockquote>
173173
for(i=0; i<pEvent->nTag; i++){
174
- if( strcmp(pEvent->aTag[i].zName,"+bgcolor")==0 ){
174
+ if( fossil_strcmp(pEvent->aTag[i].zName,"+bgcolor")==0 ){
175175
zClr = pEvent->aTag[i].zValue;
176176
}
177177
}
178178
if( zClr && zClr[0]==0 ) zClr = 0;
179179
if( zClr ){
@@ -248,11 +248,11 @@
248248
zClr = db_text("", "SELECT bgcolor FROM event WHERE objid=%d", rid);
249249
}else{
250250
zClr = "";
251251
}
252252
zClr = PD("clr",zClr);
253
- if( strcmp(zClr,"##")==0 ) zClr = PD("cclr","");
253
+ if( fossil_strcmp(zClr,"##")==0 ) zClr = PD("cclr","");
254254
255255
256256
/* If editing an existing event, extract the key fields to use as
257257
** a starting point for the edit.
258258
*/
259259
--- src/event.c
+++ src/event.c
@@ -169,11 +169,11 @@
169 @ [<a href="%s(g.zTop)/timeline?c=%T(zETime)">%s(zETime)</a>]
170 @ entered by user <b>%h(pEvent->zUser)</b> on
171 @ [<a href="%s(g.zTop)/timeline?c=%T(zATime)">%s(zATime)</a>]:</p>
172 @ <blockquote>
173 for(i=0; i<pEvent->nTag; i++){
174 if( strcmp(pEvent->aTag[i].zName,"+bgcolor")==0 ){
175 zClr = pEvent->aTag[i].zValue;
176 }
177 }
178 if( zClr && zClr[0]==0 ) zClr = 0;
179 if( zClr ){
@@ -248,11 +248,11 @@
248 zClr = db_text("", "SELECT bgcolor FROM event WHERE objid=%d", rid);
249 }else{
250 zClr = "";
251 }
252 zClr = PD("clr",zClr);
253 if( strcmp(zClr,"##")==0 ) zClr = PD("cclr","");
254
255
256 /* If editing an existing event, extract the key fields to use as
257 ** a starting point for the edit.
258 */
259
--- src/event.c
+++ src/event.c
@@ -169,11 +169,11 @@
169 @ [<a href="%s(g.zTop)/timeline?c=%T(zETime)">%s(zETime)</a>]
170 @ entered by user <b>%h(pEvent->zUser)</b> on
171 @ [<a href="%s(g.zTop)/timeline?c=%T(zATime)">%s(zATime)</a>]:</p>
172 @ <blockquote>
173 for(i=0; i<pEvent->nTag; i++){
174 if( fossil_strcmp(pEvent->aTag[i].zName,"+bgcolor")==0 ){
175 zClr = pEvent->aTag[i].zValue;
176 }
177 }
178 if( zClr && zClr[0]==0 ) zClr = 0;
179 if( zClr ){
@@ -248,11 +248,11 @@
248 zClr = db_text("", "SELECT bgcolor FROM event WHERE objid=%d", rid);
249 }else{
250 zClr = "";
251 }
252 zClr = PD("clr",zClr);
253 if( fossil_strcmp(zClr,"##")==0 ) zClr = PD("cclr","");
254
255
256 /* If editing an existing event, extract the key fields to use as
257 ** a starting point for the edit.
258 */
259
+1 -1
--- src/graph.c
+++ src/graph.c
@@ -147,11 +147,11 @@
147147
** Note: also used for background color names.
148148
*/
149149
static char *persistBranchName(GraphContext *p, const char *zBranch){
150150
int i;
151151
for(i=0; i<p->nBranch; i++){
152
- if( strcmp(zBranch, p->azBranch[i])==0 ) return p->azBranch[i];
152
+ if( fossil_strcmp(zBranch, p->azBranch[i])==0 ) return p->azBranch[i];
153153
}
154154
p->nBranch++;
155155
p->azBranch = fossil_realloc(p->azBranch, sizeof(char*)*p->nBranch);
156156
p->azBranch[p->nBranch-1] = mprintf("%s", zBranch);
157157
return p->azBranch[p->nBranch-1];
158158
--- src/graph.c
+++ src/graph.c
@@ -147,11 +147,11 @@
147 ** Note: also used for background color names.
148 */
149 static char *persistBranchName(GraphContext *p, const char *zBranch){
150 int i;
151 for(i=0; i<p->nBranch; i++){
152 if( strcmp(zBranch, p->azBranch[i])==0 ) return p->azBranch[i];
153 }
154 p->nBranch++;
155 p->azBranch = fossil_realloc(p->azBranch, sizeof(char*)*p->nBranch);
156 p->azBranch[p->nBranch-1] = mprintf("%s", zBranch);
157 return p->azBranch[p->nBranch-1];
158
--- src/graph.c
+++ src/graph.c
@@ -147,11 +147,11 @@
147 ** Note: also used for background color names.
148 */
149 static char *persistBranchName(GraphContext *p, const char *zBranch){
150 int i;
151 for(i=0; i<p->nBranch; i++){
152 if( fossil_strcmp(zBranch, p->azBranch[i])==0 ) return p->azBranch[i];
153 }
154 p->nBranch++;
155 p->azBranch = fossil_realloc(p->azBranch, sizeof(char*)*p->nBranch);
156 p->azBranch[p->nBranch-1] = mprintf("%s", zBranch);
157 return p->azBranch[p->nBranch-1];
158
+2 -2
--- src/import.c
+++ src/import.c
@@ -220,11 +220,11 @@
220220
zFromBranch = db_text(0, "SELECT brnm FROM xbranch WHERE tname=%Q",
221221
gg.zFromMark);
222222
}else{
223223
zFromBranch = 0;
224224
}
225
- if( zFromBranch==0 || strcmp(zFromBranch, gg.zBranch)!=0 ){
225
+ if( fossil_strcmp(zFromBranch, gg.zBranch)!=0 ){
226226
blob_appendf(&record, "T *branch * %F\n", gg.zBranch);
227227
blob_appendf(&record, "T *sym-%F *\n", gg.zBranch);
228228
if( zFromBranch ){
229229
blob_appendf(&record, "T -sym-%F *\n", zFromBranch);
230230
}
@@ -506,11 +506,11 @@
506506
pFile = import_find_file(zName, &i, gg.nFile);
507507
if( pFile==0 ){
508508
pFile = import_add_file();
509509
pFile->zName = import_strdup(zName);
510510
}
511
- pFile->isExe = (strcmp(zPerm, "100755")==0);
511
+ pFile->isExe = (fossil_strcmp(zPerm, "100755")==0);
512512
fossil_free(pFile->zUuid);
513513
pFile->zUuid = resolve_committish(zUuid);
514514
pFile->isFrom = 0;
515515
}else
516516
if( memcmp(zLine, "D ", 2)==0 ){
517517
--- src/import.c
+++ src/import.c
@@ -220,11 +220,11 @@
220 zFromBranch = db_text(0, "SELECT brnm FROM xbranch WHERE tname=%Q",
221 gg.zFromMark);
222 }else{
223 zFromBranch = 0;
224 }
225 if( zFromBranch==0 || strcmp(zFromBranch, gg.zBranch)!=0 ){
226 blob_appendf(&record, "T *branch * %F\n", gg.zBranch);
227 blob_appendf(&record, "T *sym-%F *\n", gg.zBranch);
228 if( zFromBranch ){
229 blob_appendf(&record, "T -sym-%F *\n", zFromBranch);
230 }
@@ -506,11 +506,11 @@
506 pFile = import_find_file(zName, &i, gg.nFile);
507 if( pFile==0 ){
508 pFile = import_add_file();
509 pFile->zName = import_strdup(zName);
510 }
511 pFile->isExe = (strcmp(zPerm, "100755")==0);
512 fossil_free(pFile->zUuid);
513 pFile->zUuid = resolve_committish(zUuid);
514 pFile->isFrom = 0;
515 }else
516 if( memcmp(zLine, "D ", 2)==0 ){
517
--- src/import.c
+++ src/import.c
@@ -220,11 +220,11 @@
220 zFromBranch = db_text(0, "SELECT brnm FROM xbranch WHERE tname=%Q",
221 gg.zFromMark);
222 }else{
223 zFromBranch = 0;
224 }
225 if( fossil_strcmp(zFromBranch, gg.zBranch)!=0 ){
226 blob_appendf(&record, "T *branch * %F\n", gg.zBranch);
227 blob_appendf(&record, "T *sym-%F *\n", gg.zBranch);
228 if( zFromBranch ){
229 blob_appendf(&record, "T -sym-%F *\n", zFromBranch);
230 }
@@ -506,11 +506,11 @@
506 pFile = import_find_file(zName, &i, gg.nFile);
507 if( pFile==0 ){
508 pFile = import_add_file();
509 pFile->zName = import_strdup(zName);
510 }
511 pFile->isExe = (fossil_strcmp(zPerm, "100755")==0);
512 fossil_free(pFile->zUuid);
513 pFile->zUuid = resolve_committish(zUuid);
514 pFile->isFrom = 0;
515 }else
516 if( memcmp(zLine, "D ", 2)==0 ){
517
+10 -10
--- src/info.c
+++ src/info.c
@@ -677,21 +677,21 @@
677677
if( pFileFrom==0 ){
678678
cmp = +1;
679679
}else if( pFileTo==0 ){
680680
cmp = -1;
681681
}else{
682
- cmp = strcmp(pFileFrom->zName, pFileTo->zName);
682
+ cmp = fossil_strcmp(pFileFrom->zName, pFileTo->zName);
683683
}
684684
if( cmp<0 ){
685685
append_file_change_line(pFileFrom->zName,
686686
pFileFrom->zUuid, 0, 0);
687687
pFileFrom = manifest_file_next(pFrom, 0);
688688
}else if( cmp>0 ){
689689
append_file_change_line(pFileTo->zName,
690690
0, pFileTo->zUuid, 0);
691691
pFileTo = manifest_file_next(pTo, 0);
692
- }else if( strcmp(pFileFrom->zUuid, pFileTo->zUuid)==0 ){
692
+ }else if( fossil_strcmp(pFileFrom->zUuid, pFileTo->zUuid)==0 ){
693693
/* No changes */
694694
pFileFrom = manifest_file_next(pFrom, 0);
695695
pFileTo = manifest_file_next(pTo, 0);
696696
}else{
697697
append_file_change_line(pFileFrom->zName,
@@ -1072,11 +1072,11 @@
10721072
cirid = name_to_rid_www("ci");
10731073
pManifest = manifest_get(cirid, CFTYPE_MANIFEST);
10741074
if( pManifest==0 ) return 0;
10751075
manifest_file_rewind(pManifest);
10761076
while( (pFile = manifest_file_next(pManifest,0))!=0 ){
1077
- if( strcmp(zFilename, pFile->zName)==0 ){
1077
+ if( fossil_strcmp(zFilename, pFile->zName)==0 ){
10781078
int rid = db_int(0, "SELECT rid FROM blob WHERE uuid=%Q", pFile->zUuid);
10791079
manifest_destroy(pManifest);
10801080
return rid;
10811081
}
10821082
}
@@ -1128,20 +1128,20 @@
11281128
object_description(rid, 0, &downloadName);
11291129
style_submenu_element("Download", "Download",
11301130
"%s/raw/%T?name=%s", g.zTop, blob_str(&downloadName), zUuid);
11311131
zMime = mimetype_from_name(blob_str(&downloadName));
11321132
if( zMime ){
1133
- if( strcmp(zMime, "text/html")==0 ){
1133
+ if( fossil_strcmp(zMime, "text/html")==0 ){
11341134
if( P("txt") ){
11351135
style_submenu_element("Html", "Html",
11361136
"%s/artifact?name=%s", g.zTop, zUuid);
11371137
}else{
11381138
renderAsHtml = 1;
11391139
style_submenu_element("Text", "Text",
11401140
"%s/artifact?name=%s&amp;txt=1", g.zTop, zUuid);
11411141
}
1142
- }else if( strcmp(zMime, "application/x-fossil-wiki")==0 ){
1142
+ }else if( fossil_strcmp(zMime, "application/x-fossil-wiki")==0 ){
11431143
if( P("txt") ){
11441144
style_submenu_element("Wiki", "Wiki",
11451145
"%s/artifact?name=%s", g.zTop, zUuid);
11461146
}else{
11471147
renderAsWiki = 1;
@@ -1339,11 +1339,11 @@
13391339
if( aColor[i].zColor[0] ){
13401340
@ <td style="background-color: %h(aColor[i].zColor);">
13411341
}else{
13421342
@ <td>
13431343
}
1344
- if( strcmp(zDefaultColor, aColor[i].zColor)==0 ){
1344
+ if( fossil_strcmp(zDefaultColor, aColor[i].zColor)==0 ){
13451345
@ <input type="radio" name="%s(zId)" value="%h(aColor[i].zColor)"
13461346
@ checked="checked" />
13471347
stdClrFound=1;
13481348
}else{
13491349
@ <input type="radio" name="%s(zId)" value="%h(aColor[i].zColor)" />
@@ -1422,11 +1422,11 @@
14221422
if( zDate==0 ) fossil_redirect_home();
14231423
zNewDate = PD("dt",zDate);
14241424
zColor = db_text("", "SELECT bgcolor"
14251425
" FROM event WHERE objid=%d", rid);
14261426
zNewColor = PD("clr",zColor);
1427
- if( strcmp(zNewColor,"##")==0 ){
1427
+ if( fossil_strcmp(zNewColor,"##")==0 ){
14281428
zNewColor = P("clrcust");
14291429
}
14301430
fPropagateColor = db_int(0, "SELECT tagtype FROM tagxref"
14311431
" WHERE rid=%d AND tagid=%d",
14321432
rid, TAG_BGCOLOR)==2;
@@ -1458,19 +1458,19 @@
14581458
zPrefix, zNewColor);
14591459
}
14601460
if( zNewColor[0]==0 && zColor[0]!=0 ){
14611461
db_multi_exec("REPLACE INTO newtags VALUES('bgcolor','-',NULL)");
14621462
}
1463
- if( strcmp(zComment,zNewComment)!=0 ){
1463
+ if( fossil_strcmp(zComment,zNewComment)!=0 ){
14641464
db_multi_exec("REPLACE INTO newtags VALUES('comment','+',%Q)",
14651465
zNewComment);
14661466
}
1467
- if( strcmp(zDate,zNewDate)!=0 ){
1467
+ if( fossil_strcmp(zDate,zNewDate)!=0 ){
14681468
db_multi_exec("REPLACE INTO newtags VALUES('date','+',%Q)",
14691469
zNewDate);
14701470
}
1471
- if( strcmp(zUser,zNewUser)!=0 ){
1471
+ if( fossil_strcmp(zUser,zNewUser)!=0 ){
14721472
db_multi_exec("REPLACE INTO newtags VALUES('user','+',%Q)", zNewUser);
14731473
}
14741474
db_prepare(&q,
14751475
"SELECT tag.tagid, tagname FROM tagxref, tag"
14761476
" WHERE tagxref.rid=%d AND tagtype>0 AND tagxref.tagid=tag.tagid",
14771477
--- src/info.c
+++ src/info.c
@@ -677,21 +677,21 @@
677 if( pFileFrom==0 ){
678 cmp = +1;
679 }else if( pFileTo==0 ){
680 cmp = -1;
681 }else{
682 cmp = strcmp(pFileFrom->zName, pFileTo->zName);
683 }
684 if( cmp<0 ){
685 append_file_change_line(pFileFrom->zName,
686 pFileFrom->zUuid, 0, 0);
687 pFileFrom = manifest_file_next(pFrom, 0);
688 }else if( cmp>0 ){
689 append_file_change_line(pFileTo->zName,
690 0, pFileTo->zUuid, 0);
691 pFileTo = manifest_file_next(pTo, 0);
692 }else if( strcmp(pFileFrom->zUuid, pFileTo->zUuid)==0 ){
693 /* No changes */
694 pFileFrom = manifest_file_next(pFrom, 0);
695 pFileTo = manifest_file_next(pTo, 0);
696 }else{
697 append_file_change_line(pFileFrom->zName,
@@ -1072,11 +1072,11 @@
1072 cirid = name_to_rid_www("ci");
1073 pManifest = manifest_get(cirid, CFTYPE_MANIFEST);
1074 if( pManifest==0 ) return 0;
1075 manifest_file_rewind(pManifest);
1076 while( (pFile = manifest_file_next(pManifest,0))!=0 ){
1077 if( strcmp(zFilename, pFile->zName)==0 ){
1078 int rid = db_int(0, "SELECT rid FROM blob WHERE uuid=%Q", pFile->zUuid);
1079 manifest_destroy(pManifest);
1080 return rid;
1081 }
1082 }
@@ -1128,20 +1128,20 @@
1128 object_description(rid, 0, &downloadName);
1129 style_submenu_element("Download", "Download",
1130 "%s/raw/%T?name=%s", g.zTop, blob_str(&downloadName), zUuid);
1131 zMime = mimetype_from_name(blob_str(&downloadName));
1132 if( zMime ){
1133 if( strcmp(zMime, "text/html")==0 ){
1134 if( P("txt") ){
1135 style_submenu_element("Html", "Html",
1136 "%s/artifact?name=%s", g.zTop, zUuid);
1137 }else{
1138 renderAsHtml = 1;
1139 style_submenu_element("Text", "Text",
1140 "%s/artifact?name=%s&amp;txt=1", g.zTop, zUuid);
1141 }
1142 }else if( strcmp(zMime, "application/x-fossil-wiki")==0 ){
1143 if( P("txt") ){
1144 style_submenu_element("Wiki", "Wiki",
1145 "%s/artifact?name=%s", g.zTop, zUuid);
1146 }else{
1147 renderAsWiki = 1;
@@ -1339,11 +1339,11 @@
1339 if( aColor[i].zColor[0] ){
1340 @ <td style="background-color: %h(aColor[i].zColor);">
1341 }else{
1342 @ <td>
1343 }
1344 if( strcmp(zDefaultColor, aColor[i].zColor)==0 ){
1345 @ <input type="radio" name="%s(zId)" value="%h(aColor[i].zColor)"
1346 @ checked="checked" />
1347 stdClrFound=1;
1348 }else{
1349 @ <input type="radio" name="%s(zId)" value="%h(aColor[i].zColor)" />
@@ -1422,11 +1422,11 @@
1422 if( zDate==0 ) fossil_redirect_home();
1423 zNewDate = PD("dt",zDate);
1424 zColor = db_text("", "SELECT bgcolor"
1425 " FROM event WHERE objid=%d", rid);
1426 zNewColor = PD("clr",zColor);
1427 if( strcmp(zNewColor,"##")==0 ){
1428 zNewColor = P("clrcust");
1429 }
1430 fPropagateColor = db_int(0, "SELECT tagtype FROM tagxref"
1431 " WHERE rid=%d AND tagid=%d",
1432 rid, TAG_BGCOLOR)==2;
@@ -1458,19 +1458,19 @@
1458 zPrefix, zNewColor);
1459 }
1460 if( zNewColor[0]==0 && zColor[0]!=0 ){
1461 db_multi_exec("REPLACE INTO newtags VALUES('bgcolor','-',NULL)");
1462 }
1463 if( strcmp(zComment,zNewComment)!=0 ){
1464 db_multi_exec("REPLACE INTO newtags VALUES('comment','+',%Q)",
1465 zNewComment);
1466 }
1467 if( strcmp(zDate,zNewDate)!=0 ){
1468 db_multi_exec("REPLACE INTO newtags VALUES('date','+',%Q)",
1469 zNewDate);
1470 }
1471 if( strcmp(zUser,zNewUser)!=0 ){
1472 db_multi_exec("REPLACE INTO newtags VALUES('user','+',%Q)", zNewUser);
1473 }
1474 db_prepare(&q,
1475 "SELECT tag.tagid, tagname FROM tagxref, tag"
1476 " WHERE tagxref.rid=%d AND tagtype>0 AND tagxref.tagid=tag.tagid",
1477
--- src/info.c
+++ src/info.c
@@ -677,21 +677,21 @@
677 if( pFileFrom==0 ){
678 cmp = +1;
679 }else if( pFileTo==0 ){
680 cmp = -1;
681 }else{
682 cmp = fossil_strcmp(pFileFrom->zName, pFileTo->zName);
683 }
684 if( cmp<0 ){
685 append_file_change_line(pFileFrom->zName,
686 pFileFrom->zUuid, 0, 0);
687 pFileFrom = manifest_file_next(pFrom, 0);
688 }else if( cmp>0 ){
689 append_file_change_line(pFileTo->zName,
690 0, pFileTo->zUuid, 0);
691 pFileTo = manifest_file_next(pTo, 0);
692 }else if( fossil_strcmp(pFileFrom->zUuid, pFileTo->zUuid)==0 ){
693 /* No changes */
694 pFileFrom = manifest_file_next(pFrom, 0);
695 pFileTo = manifest_file_next(pTo, 0);
696 }else{
697 append_file_change_line(pFileFrom->zName,
@@ -1072,11 +1072,11 @@
1072 cirid = name_to_rid_www("ci");
1073 pManifest = manifest_get(cirid, CFTYPE_MANIFEST);
1074 if( pManifest==0 ) return 0;
1075 manifest_file_rewind(pManifest);
1076 while( (pFile = manifest_file_next(pManifest,0))!=0 ){
1077 if( fossil_strcmp(zFilename, pFile->zName)==0 ){
1078 int rid = db_int(0, "SELECT rid FROM blob WHERE uuid=%Q", pFile->zUuid);
1079 manifest_destroy(pManifest);
1080 return rid;
1081 }
1082 }
@@ -1128,20 +1128,20 @@
1128 object_description(rid, 0, &downloadName);
1129 style_submenu_element("Download", "Download",
1130 "%s/raw/%T?name=%s", g.zTop, blob_str(&downloadName), zUuid);
1131 zMime = mimetype_from_name(blob_str(&downloadName));
1132 if( zMime ){
1133 if( fossil_strcmp(zMime, "text/html")==0 ){
1134 if( P("txt") ){
1135 style_submenu_element("Html", "Html",
1136 "%s/artifact?name=%s", g.zTop, zUuid);
1137 }else{
1138 renderAsHtml = 1;
1139 style_submenu_element("Text", "Text",
1140 "%s/artifact?name=%s&amp;txt=1", g.zTop, zUuid);
1141 }
1142 }else if( fossil_strcmp(zMime, "application/x-fossil-wiki")==0 ){
1143 if( P("txt") ){
1144 style_submenu_element("Wiki", "Wiki",
1145 "%s/artifact?name=%s", g.zTop, zUuid);
1146 }else{
1147 renderAsWiki = 1;
@@ -1339,11 +1339,11 @@
1339 if( aColor[i].zColor[0] ){
1340 @ <td style="background-color: %h(aColor[i].zColor);">
1341 }else{
1342 @ <td>
1343 }
1344 if( fossil_strcmp(zDefaultColor, aColor[i].zColor)==0 ){
1345 @ <input type="radio" name="%s(zId)" value="%h(aColor[i].zColor)"
1346 @ checked="checked" />
1347 stdClrFound=1;
1348 }else{
1349 @ <input type="radio" name="%s(zId)" value="%h(aColor[i].zColor)" />
@@ -1422,11 +1422,11 @@
1422 if( zDate==0 ) fossil_redirect_home();
1423 zNewDate = PD("dt",zDate);
1424 zColor = db_text("", "SELECT bgcolor"
1425 " FROM event WHERE objid=%d", rid);
1426 zNewColor = PD("clr",zColor);
1427 if( fossil_strcmp(zNewColor,"##")==0 ){
1428 zNewColor = P("clrcust");
1429 }
1430 fPropagateColor = db_int(0, "SELECT tagtype FROM tagxref"
1431 " WHERE rid=%d AND tagid=%d",
1432 rid, TAG_BGCOLOR)==2;
@@ -1458,19 +1458,19 @@
1458 zPrefix, zNewColor);
1459 }
1460 if( zNewColor[0]==0 && zColor[0]!=0 ){
1461 db_multi_exec("REPLACE INTO newtags VALUES('bgcolor','-',NULL)");
1462 }
1463 if( fossil_strcmp(zComment,zNewComment)!=0 ){
1464 db_multi_exec("REPLACE INTO newtags VALUES('comment','+',%Q)",
1465 zNewComment);
1466 }
1467 if( fossil_strcmp(zDate,zNewDate)!=0 ){
1468 db_multi_exec("REPLACE INTO newtags VALUES('date','+',%Q)",
1469 zNewDate);
1470 }
1471 if( fossil_strcmp(zUser,zNewUser)!=0 ){
1472 db_multi_exec("REPLACE INTO newtags VALUES('user','+',%Q)", zNewUser);
1473 }
1474 db_prepare(&q,
1475 "SELECT tag.tagid, tagname FROM tagxref, tag"
1476 " WHERE tagxref.rid=%d AND tagtype>0 AND tagxref.tagid=tag.tagid",
1477
+4 -5
--- src/login.c
+++ src/login.c
@@ -157,11 +157,11 @@
157157
@ <p><span class="loginError">
158158
@ You entered an incorrect old password while attempting to change
159159
@ your password. Your password is unchanged.
160160
@ </span></p>
161161
;
162
- }else if( strcmp(zNew1,zNew2)!=0 ){
162
+ }else if( fossil_strcmp(zNew1,zNew2)!=0 ){
163163
zErrMsg =
164164
@ <p><span class="loginError">
165165
@ The two copies of your new passwords do not match.
166166
@ Your password is unchanged.
167167
@ </span></p>
@@ -438,11 +438,11 @@
438438
439439
/* Set the global variables recording the userid and login. The
440440
** "nobody" user is a special case in that g.zLogin==0.
441441
*/
442442
g.userUid = uid;
443
- if( g.zLogin && strcmp(g.zLogin,"nobody")==0 ){
443
+ if( fossil_strcmp(g.zLogin,"nobody")==0 ){
444444
g.zLogin = 0;
445445
}
446446
447447
/* Set the capabilities */
448448
login_set_capabilities(zCap);
@@ -458,11 +458,11 @@
458458
if( g.zLogin && once ){
459459
const char *zCap;
460460
/* All logged-in users inherit privileges from "nobody" */
461461
zCap = db_text("", "SELECT cap FROM user WHERE login = 'nobody'");
462462
login_set_capabilities(zCap);
463
- if( strcmp(g.zLogin, "nobody")!=0 ){
463
+ if( fossil_strcmp(g.zLogin, "nobody")!=0 ){
464464
/* All logged-in users inherit privileges from "anonymous" */
465465
zCap = db_text("", "SELECT cap FROM user WHERE login = 'anonymous'");
466466
login_set_capabilities(zCap);
467467
}
468468
once = 0;
@@ -616,13 +616,12 @@
616616
** that ths Anti-CSRF token is present and is valid. If the Anti-CSRF token
617617
** is missing or is incorrect, that indicates a cross-site scripting attach
618618
** so emits an error message and abort.
619619
*/
620620
void login_verify_csrf_secret(void){
621
- const char *zCsrf; /* The CSRF secret */
622621
if( g.okCsrf ) return;
623
- if( (zCsrf = P("csrf"))!=0 && strcmp(zCsrf, g.zCsrfToken)==0 ){
622
+ if( fossil_strcmp(P("csrf"), g.zCsrfToken)==0 ){
624623
g.okCsrf = 1;
625624
return;
626625
}
627626
fossil_fatal("Cross-site request forgery attempt");
628627
}
629628
--- src/login.c
+++ src/login.c
@@ -157,11 +157,11 @@
157 @ <p><span class="loginError">
158 @ You entered an incorrect old password while attempting to change
159 @ your password. Your password is unchanged.
160 @ </span></p>
161 ;
162 }else if( strcmp(zNew1,zNew2)!=0 ){
163 zErrMsg =
164 @ <p><span class="loginError">
165 @ The two copies of your new passwords do not match.
166 @ Your password is unchanged.
167 @ </span></p>
@@ -438,11 +438,11 @@
438
439 /* Set the global variables recording the userid and login. The
440 ** "nobody" user is a special case in that g.zLogin==0.
441 */
442 g.userUid = uid;
443 if( g.zLogin && strcmp(g.zLogin,"nobody")==0 ){
444 g.zLogin = 0;
445 }
446
447 /* Set the capabilities */
448 login_set_capabilities(zCap);
@@ -458,11 +458,11 @@
458 if( g.zLogin && once ){
459 const char *zCap;
460 /* All logged-in users inherit privileges from "nobody" */
461 zCap = db_text("", "SELECT cap FROM user WHERE login = 'nobody'");
462 login_set_capabilities(zCap);
463 if( strcmp(g.zLogin, "nobody")!=0 ){
464 /* All logged-in users inherit privileges from "anonymous" */
465 zCap = db_text("", "SELECT cap FROM user WHERE login = 'anonymous'");
466 login_set_capabilities(zCap);
467 }
468 once = 0;
@@ -616,13 +616,12 @@
616 ** that ths Anti-CSRF token is present and is valid. If the Anti-CSRF token
617 ** is missing or is incorrect, that indicates a cross-site scripting attach
618 ** so emits an error message and abort.
619 */
620 void login_verify_csrf_secret(void){
621 const char *zCsrf; /* The CSRF secret */
622 if( g.okCsrf ) return;
623 if( (zCsrf = P("csrf"))!=0 && strcmp(zCsrf, g.zCsrfToken)==0 ){
624 g.okCsrf = 1;
625 return;
626 }
627 fossil_fatal("Cross-site request forgery attempt");
628 }
629
--- src/login.c
+++ src/login.c
@@ -157,11 +157,11 @@
157 @ <p><span class="loginError">
158 @ You entered an incorrect old password while attempting to change
159 @ your password. Your password is unchanged.
160 @ </span></p>
161 ;
162 }else if( fossil_strcmp(zNew1,zNew2)!=0 ){
163 zErrMsg =
164 @ <p><span class="loginError">
165 @ The two copies of your new passwords do not match.
166 @ Your password is unchanged.
167 @ </span></p>
@@ -438,11 +438,11 @@
438
439 /* Set the global variables recording the userid and login. The
440 ** "nobody" user is a special case in that g.zLogin==0.
441 */
442 g.userUid = uid;
443 if( fossil_strcmp(g.zLogin,"nobody")==0 ){
444 g.zLogin = 0;
445 }
446
447 /* Set the capabilities */
448 login_set_capabilities(zCap);
@@ -458,11 +458,11 @@
458 if( g.zLogin && once ){
459 const char *zCap;
460 /* All logged-in users inherit privileges from "nobody" */
461 zCap = db_text("", "SELECT cap FROM user WHERE login = 'nobody'");
462 login_set_capabilities(zCap);
463 if( fossil_strcmp(g.zLogin, "nobody")!=0 ){
464 /* All logged-in users inherit privileges from "anonymous" */
465 zCap = db_text("", "SELECT cap FROM user WHERE login = 'anonymous'");
466 login_set_capabilities(zCap);
467 }
468 once = 0;
@@ -616,13 +616,12 @@
616 ** that ths Anti-CSRF token is present and is valid. If the Anti-CSRF token
617 ** is missing or is incorrect, that indicates a cross-site scripting attach
618 ** so emits an error message and abort.
619 */
620 void login_verify_csrf_secret(void){
 
621 if( g.okCsrf ) return;
622 if( fossil_strcmp(P("csrf"), g.zCsrfToken)==0 ){
623 g.okCsrf = 1;
624 return;
625 }
626 fossil_fatal("Cross-site request forgery attempt");
627 }
628
+17 -2
--- src/main.c
+++ src/main.c
@@ -417,10 +417,25 @@
417417
*/
418418
rc = system(zOrigCmd);
419419
#endif
420420
return rc;
421421
}
422
+
423
+/*
424
+** Like strcmp() except that it accepts NULL pointers. NULL sorts before
425
+** all non-NULL string pointers.
426
+*/
427
+int fossil_strcmp(const char *zA, const char *zB){
428
+ if( zA==0 ){
429
+ if( zB==0 ) return 0;
430
+ return -1;
431
+ }else if( zB==0 ){
432
+ return +1;
433
+ }else{
434
+ return strcmp(zA,zB);
435
+ }
436
+}
422437
423438
/*
424439
** Turn off any NL to CRNL translation on the stream given as an
425440
** argument. This is a no-op on unix but is necessary on windows.
426441
*/
@@ -527,11 +542,11 @@
527542
}else if( z[nLong]==0 ){
528543
zReturn = g.argv[i+hasArg];
529544
remove_from_argv(i, 1+hasArg);
530545
break;
531546
}
532
- }else if( zShort!=0 && strcmp(z,zShort)==0 ){
547
+ }else if( fossil_strcmp(z,zShort)==0 ){
533548
zReturn = g.argv[i+hasArg];
534549
remove_from_argv(i, 1+hasArg);
535550
break;
536551
}
537552
}
@@ -927,11 +942,11 @@
927942
*/
928943
void cmd_cgi(void){
929944
const char *zFile;
930945
const char *zNotFound = 0;
931946
Blob config, line, key, value;
932
- if( g.argc==3 && strcmp(g.argv[1],"cgi")==0 ){
947
+ if( g.argc==3 && fossil_strcmp(g.argv[1],"cgi")==0 ){
933948
zFile = g.argv[2];
934949
}else{
935950
zFile = g.argv[1];
936951
}
937952
g.httpOut = stdout;
938953
--- src/main.c
+++ src/main.c
@@ -417,10 +417,25 @@
417 */
418 rc = system(zOrigCmd);
419 #endif
420 return rc;
421 }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
422
423 /*
424 ** Turn off any NL to CRNL translation on the stream given as an
425 ** argument. This is a no-op on unix but is necessary on windows.
426 */
@@ -527,11 +542,11 @@
527 }else if( z[nLong]==0 ){
528 zReturn = g.argv[i+hasArg];
529 remove_from_argv(i, 1+hasArg);
530 break;
531 }
532 }else if( zShort!=0 && strcmp(z,zShort)==0 ){
533 zReturn = g.argv[i+hasArg];
534 remove_from_argv(i, 1+hasArg);
535 break;
536 }
537 }
@@ -927,11 +942,11 @@
927 */
928 void cmd_cgi(void){
929 const char *zFile;
930 const char *zNotFound = 0;
931 Blob config, line, key, value;
932 if( g.argc==3 && strcmp(g.argv[1],"cgi")==0 ){
933 zFile = g.argv[2];
934 }else{
935 zFile = g.argv[1];
936 }
937 g.httpOut = stdout;
938
--- src/main.c
+++ src/main.c
@@ -417,10 +417,25 @@
417 */
418 rc = system(zOrigCmd);
419 #endif
420 return rc;
421 }
422
423 /*
424 ** Like strcmp() except that it accepts NULL pointers. NULL sorts before
425 ** all non-NULL string pointers.
426 */
427 int fossil_strcmp(const char *zA, const char *zB){
428 if( zA==0 ){
429 if( zB==0 ) return 0;
430 return -1;
431 }else if( zB==0 ){
432 return +1;
433 }else{
434 return strcmp(zA,zB);
435 }
436 }
437
438 /*
439 ** Turn off any NL to CRNL translation on the stream given as an
440 ** argument. This is a no-op on unix but is necessary on windows.
441 */
@@ -527,11 +542,11 @@
542 }else if( z[nLong]==0 ){
543 zReturn = g.argv[i+hasArg];
544 remove_from_argv(i, 1+hasArg);
545 break;
546 }
547 }else if( fossil_strcmp(z,zShort)==0 ){
548 zReturn = g.argv[i+hasArg];
549 remove_from_argv(i, 1+hasArg);
550 break;
551 }
552 }
@@ -927,11 +942,11 @@
942 */
943 void cmd_cgi(void){
944 const char *zFile;
945 const char *zNotFound = 0;
946 Blob config, line, key, value;
947 if( g.argc==3 && fossil_strcmp(g.argv[1],"cgi")==0 ){
948 zFile = g.argv[2];
949 }else{
950 zFile = g.argv[1];
951 }
952 g.httpOut = stdout;
953
+9 -23
--- src/manifest.c
+++ src/manifest.c
@@ -511,11 +511,11 @@
511511
i = p->nFile++;
512512
p->aFile[i].zName = zName;
513513
p->aFile[i].zUuid = zUuid;
514514
p->aFile[i].zPerm = zPerm;
515515
p->aFile[i].zPrior = zPriorName;
516
- if( i>0 && strcmp(p->aFile[i-1].zName, zName)>=0 ){
516
+ if( i>0 && fossil_strcmp(p->aFile[i-1].zName, zName)>=0 ){
517517
goto manifest_syntax_error;
518518
}
519519
break;
520520
}
521521
@@ -540,11 +540,11 @@
540540
p->nFieldAlloc*sizeof(p->aField[0]) );
541541
}
542542
i = p->nField++;
543543
p->aField[i].zName = zName;
544544
p->aField[i].zValue = zValue;
545
- if( i>0 && strcmp(p->aField[i-1].zName, zName)>=0 ){
545
+ if( i>0 && fossil_strcmp(p->aField[i-1].zName, zName)>=0 ){
546546
goto manifest_syntax_error;
547547
}
548548
break;
549549
}
550550
@@ -596,11 +596,11 @@
596596
p->azCChild = fossil_realloc(p->azCChild
597597
, p->nCChildAlloc*sizeof(p->azCChild[0]) );
598598
}
599599
i = p->nCChild++;
600600
p->azCChild[i] = zUuid;
601
- if( i>0 && strcmp(p->azCChild[i-1], zUuid)>=0 ){
601
+ if( i>0 && fossil_strcmp(p->azCChild[i-1], zUuid)>=0 ){
602602
goto manifest_syntax_error;
603603
}
604604
break;
605605
}
606606
@@ -684,11 +684,11 @@
684684
}
685685
i = p->nTag++;
686686
p->aTag[i].zName = zName;
687687
p->aTag[i].zUuid = zUuid;
688688
p->aTag[i].zValue = zValue;
689
- if( i>0 && strcmp(p->aTag[i-1].zName, zName)>=0 ){
689
+ if( i>0 && fossil_strcmp(p->aTag[i-1].zName, zName)>=0 ){
690690
goto manifest_syntax_error;
691691
}
692692
break;
693693
}
694694
@@ -1003,11 +1003,11 @@
10031003
}else if( p->iFile>=p->nFile ){
10041004
/* We have used all entries from the delta. Return the next
10051005
** entry from the baseline. */
10061006
if( pB->iFile<pB->nFile ) pOut = &pB->aFile[pB->iFile++];
10071007
break;
1008
- }else if( (cmp = strcmp(pB->aFile[pB->iFile].zName,
1008
+ }else if( (cmp = fossil_strcmp(pB->aFile[pB->iFile].zName,
10091009
p->aFile[p->iFile].zName)) < 0 ){
10101010
/* The next baseline entry comes before the next delta entry.
10111011
** So return the baseline entry. */
10121012
pOut = &pB->aFile[pB->iFile++];
10131013
break;
@@ -1117,11 +1117,11 @@
11171117
int c;
11181118
int i;
11191119
lwr = 0;
11201120
upr = p->nFile - 1;
11211121
if( p->iFile>=lwr && p->iFile<upr ){
1122
- c = strcmp(p->aFile[p->iFile+1].zName, zName);
1122
+ c = fossil_strcmp(p->aFile[p->iFile+1].zName, zName);
11231123
if( c==0 ){
11241124
return &p->aFile[++p->iFile];
11251125
}else if( c>0 ){
11261126
upr = p->iFile;
11271127
}else{
@@ -1128,11 +1128,11 @@
11281128
lwr = p->iFile+1;
11291129
}
11301130
}
11311131
while( lwr<=upr ){
11321132
i = (lwr+upr)/2;
1133
- c = strcmp(p->aFile[i].zName, zName);
1133
+ c = fossil_strcmp(p->aFile[i].zName, zName);
11341134
if( c<0 ){
11351135
lwr = i+1;
11361136
}else if( c>0 ){
11371137
upr = i-1;
11381138
}else{
@@ -1163,24 +1163,10 @@
11631163
pFile = manifest_file_seek_base(p->pBaseline, zName);
11641164
}
11651165
return pFile;
11661166
}
11671167
1168
-/*
1169
-** This strcmp() function handles NULL arguments. NULLs sort first.
1170
-*/
1171
-static int strcmp_null(const char *zOne, const char *zTwo){
1172
- if( zOne==0 ){
1173
- if( zTwo==0 ) return 0;
1174
- return -1;
1175
- }else if( zTwo==0 ){
1176
- return +1;
1177
- }else{
1178
- return strcmp(zOne, zTwo);
1179
- }
1180
-}
1181
-
11821168
/*
11831169
** Add mlink table entries associated with manifest cid. The
11841170
** parent manifest is pid.
11851171
**
11861172
** A single mlink entry is added for every file that changed content
@@ -1249,11 +1235,11 @@
12491235
pParentFile = manifest_file_seek(pParent, pChildFile->zName);
12501236
if( pParentFile==0 ){
12511237
if( pChildFile->zUuid ){
12521238
add_one_mlink(cid, 0, pChildFile->zUuid, pChildFile->zName, 0);
12531239
}
1254
- }else if( strcmp_null(pChildFile->zUuid, pParentFile->zUuid)!=0 ){
1240
+ }else if( fossil_strcmp(pChildFile->zUuid, pParentFile->zUuid)!=0 ){
12551241
add_one_mlink(cid, pParentFile->zUuid, pChildFile->zUuid,
12561242
pChildFile->zName, 0);
12571243
}
12581244
}
12591245
}
@@ -1362,11 +1348,11 @@
13621348
"SELECT %s FROM ticket WHERE tkt_uuid='%s'",
13631349
zTitleExpr, pManifest->zTicketUuid
13641350
);
13651351
if( !isNew ){
13661352
for(i=0; i<pManifest->nField; i++){
1367
- if( strcmp(pManifest->aField[i].zName, zStatusColumn)==0 ){
1353
+ if( fossil_strcmp(pManifest->aField[i].zName, zStatusColumn)==0 ){
13681354
zNewStatus = pManifest->aField[i].zValue;
13691355
}
13701356
}
13711357
if( zNewStatus ){
13721358
blob_appendf(&comment, "%h ticket [%.10s]: <i>%s</i>",
13731359
--- src/manifest.c
+++ src/manifest.c
@@ -511,11 +511,11 @@
511 i = p->nFile++;
512 p->aFile[i].zName = zName;
513 p->aFile[i].zUuid = zUuid;
514 p->aFile[i].zPerm = zPerm;
515 p->aFile[i].zPrior = zPriorName;
516 if( i>0 && strcmp(p->aFile[i-1].zName, zName)>=0 ){
517 goto manifest_syntax_error;
518 }
519 break;
520 }
521
@@ -540,11 +540,11 @@
540 p->nFieldAlloc*sizeof(p->aField[0]) );
541 }
542 i = p->nField++;
543 p->aField[i].zName = zName;
544 p->aField[i].zValue = zValue;
545 if( i>0 && strcmp(p->aField[i-1].zName, zName)>=0 ){
546 goto manifest_syntax_error;
547 }
548 break;
549 }
550
@@ -596,11 +596,11 @@
596 p->azCChild = fossil_realloc(p->azCChild
597 , p->nCChildAlloc*sizeof(p->azCChild[0]) );
598 }
599 i = p->nCChild++;
600 p->azCChild[i] = zUuid;
601 if( i>0 && strcmp(p->azCChild[i-1], zUuid)>=0 ){
602 goto manifest_syntax_error;
603 }
604 break;
605 }
606
@@ -684,11 +684,11 @@
684 }
685 i = p->nTag++;
686 p->aTag[i].zName = zName;
687 p->aTag[i].zUuid = zUuid;
688 p->aTag[i].zValue = zValue;
689 if( i>0 && strcmp(p->aTag[i-1].zName, zName)>=0 ){
690 goto manifest_syntax_error;
691 }
692 break;
693 }
694
@@ -1003,11 +1003,11 @@
1003 }else if( p->iFile>=p->nFile ){
1004 /* We have used all entries from the delta. Return the next
1005 ** entry from the baseline. */
1006 if( pB->iFile<pB->nFile ) pOut = &pB->aFile[pB->iFile++];
1007 break;
1008 }else if( (cmp = strcmp(pB->aFile[pB->iFile].zName,
1009 p->aFile[p->iFile].zName)) < 0 ){
1010 /* The next baseline entry comes before the next delta entry.
1011 ** So return the baseline entry. */
1012 pOut = &pB->aFile[pB->iFile++];
1013 break;
@@ -1117,11 +1117,11 @@
1117 int c;
1118 int i;
1119 lwr = 0;
1120 upr = p->nFile - 1;
1121 if( p->iFile>=lwr && p->iFile<upr ){
1122 c = strcmp(p->aFile[p->iFile+1].zName, zName);
1123 if( c==0 ){
1124 return &p->aFile[++p->iFile];
1125 }else if( c>0 ){
1126 upr = p->iFile;
1127 }else{
@@ -1128,11 +1128,11 @@
1128 lwr = p->iFile+1;
1129 }
1130 }
1131 while( lwr<=upr ){
1132 i = (lwr+upr)/2;
1133 c = strcmp(p->aFile[i].zName, zName);
1134 if( c<0 ){
1135 lwr = i+1;
1136 }else if( c>0 ){
1137 upr = i-1;
1138 }else{
@@ -1163,24 +1163,10 @@
1163 pFile = manifest_file_seek_base(p->pBaseline, zName);
1164 }
1165 return pFile;
1166 }
1167
1168 /*
1169 ** This strcmp() function handles NULL arguments. NULLs sort first.
1170 */
1171 static int strcmp_null(const char *zOne, const char *zTwo){
1172 if( zOne==0 ){
1173 if( zTwo==0 ) return 0;
1174 return -1;
1175 }else if( zTwo==0 ){
1176 return +1;
1177 }else{
1178 return strcmp(zOne, zTwo);
1179 }
1180 }
1181
1182 /*
1183 ** Add mlink table entries associated with manifest cid. The
1184 ** parent manifest is pid.
1185 **
1186 ** A single mlink entry is added for every file that changed content
@@ -1249,11 +1235,11 @@
1249 pParentFile = manifest_file_seek(pParent, pChildFile->zName);
1250 if( pParentFile==0 ){
1251 if( pChildFile->zUuid ){
1252 add_one_mlink(cid, 0, pChildFile->zUuid, pChildFile->zName, 0);
1253 }
1254 }else if( strcmp_null(pChildFile->zUuid, pParentFile->zUuid)!=0 ){
1255 add_one_mlink(cid, pParentFile->zUuid, pChildFile->zUuid,
1256 pChildFile->zName, 0);
1257 }
1258 }
1259 }
@@ -1362,11 +1348,11 @@
1362 "SELECT %s FROM ticket WHERE tkt_uuid='%s'",
1363 zTitleExpr, pManifest->zTicketUuid
1364 );
1365 if( !isNew ){
1366 for(i=0; i<pManifest->nField; i++){
1367 if( strcmp(pManifest->aField[i].zName, zStatusColumn)==0 ){
1368 zNewStatus = pManifest->aField[i].zValue;
1369 }
1370 }
1371 if( zNewStatus ){
1372 blob_appendf(&comment, "%h ticket [%.10s]: <i>%s</i>",
1373
--- src/manifest.c
+++ src/manifest.c
@@ -511,11 +511,11 @@
511 i = p->nFile++;
512 p->aFile[i].zName = zName;
513 p->aFile[i].zUuid = zUuid;
514 p->aFile[i].zPerm = zPerm;
515 p->aFile[i].zPrior = zPriorName;
516 if( i>0 && fossil_strcmp(p->aFile[i-1].zName, zName)>=0 ){
517 goto manifest_syntax_error;
518 }
519 break;
520 }
521
@@ -540,11 +540,11 @@
540 p->nFieldAlloc*sizeof(p->aField[0]) );
541 }
542 i = p->nField++;
543 p->aField[i].zName = zName;
544 p->aField[i].zValue = zValue;
545 if( i>0 && fossil_strcmp(p->aField[i-1].zName, zName)>=0 ){
546 goto manifest_syntax_error;
547 }
548 break;
549 }
550
@@ -596,11 +596,11 @@
596 p->azCChild = fossil_realloc(p->azCChild
597 , p->nCChildAlloc*sizeof(p->azCChild[0]) );
598 }
599 i = p->nCChild++;
600 p->azCChild[i] = zUuid;
601 if( i>0 && fossil_strcmp(p->azCChild[i-1], zUuid)>=0 ){
602 goto manifest_syntax_error;
603 }
604 break;
605 }
606
@@ -684,11 +684,11 @@
684 }
685 i = p->nTag++;
686 p->aTag[i].zName = zName;
687 p->aTag[i].zUuid = zUuid;
688 p->aTag[i].zValue = zValue;
689 if( i>0 && fossil_strcmp(p->aTag[i-1].zName, zName)>=0 ){
690 goto manifest_syntax_error;
691 }
692 break;
693 }
694
@@ -1003,11 +1003,11 @@
1003 }else if( p->iFile>=p->nFile ){
1004 /* We have used all entries from the delta. Return the next
1005 ** entry from the baseline. */
1006 if( pB->iFile<pB->nFile ) pOut = &pB->aFile[pB->iFile++];
1007 break;
1008 }else if( (cmp = fossil_strcmp(pB->aFile[pB->iFile].zName,
1009 p->aFile[p->iFile].zName)) < 0 ){
1010 /* The next baseline entry comes before the next delta entry.
1011 ** So return the baseline entry. */
1012 pOut = &pB->aFile[pB->iFile++];
1013 break;
@@ -1117,11 +1117,11 @@
1117 int c;
1118 int i;
1119 lwr = 0;
1120 upr = p->nFile - 1;
1121 if( p->iFile>=lwr && p->iFile<upr ){
1122 c = fossil_strcmp(p->aFile[p->iFile+1].zName, zName);
1123 if( c==0 ){
1124 return &p->aFile[++p->iFile];
1125 }else if( c>0 ){
1126 upr = p->iFile;
1127 }else{
@@ -1128,11 +1128,11 @@
1128 lwr = p->iFile+1;
1129 }
1130 }
1131 while( lwr<=upr ){
1132 i = (lwr+upr)/2;
1133 c = fossil_strcmp(p->aFile[i].zName, zName);
1134 if( c<0 ){
1135 lwr = i+1;
1136 }else if( c>0 ){
1137 upr = i-1;
1138 }else{
@@ -1163,24 +1163,10 @@
1163 pFile = manifest_file_seek_base(p->pBaseline, zName);
1164 }
1165 return pFile;
1166 }
1167
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1168 /*
1169 ** Add mlink table entries associated with manifest cid. The
1170 ** parent manifest is pid.
1171 **
1172 ** A single mlink entry is added for every file that changed content
@@ -1249,11 +1235,11 @@
1235 pParentFile = manifest_file_seek(pParent, pChildFile->zName);
1236 if( pParentFile==0 ){
1237 if( pChildFile->zUuid ){
1238 add_one_mlink(cid, 0, pChildFile->zUuid, pChildFile->zName, 0);
1239 }
1240 }else if( fossil_strcmp(pChildFile->zUuid, pParentFile->zUuid)!=0 ){
1241 add_one_mlink(cid, pParentFile->zUuid, pChildFile->zUuid,
1242 pChildFile->zName, 0);
1243 }
1244 }
1245 }
@@ -1362,11 +1348,11 @@
1348 "SELECT %s FROM ticket WHERE tkt_uuid='%s'",
1349 zTitleExpr, pManifest->zTicketUuid
1350 );
1351 if( !isNew ){
1352 for(i=0; i<pManifest->nField; i++){
1353 if( fossil_strcmp(pManifest->aField[i].zName, zStatusColumn)==0 ){
1354 zNewStatus = pManifest->aField[i].zValue;
1355 }
1356 }
1357 if( zNewStatus ){
1358 blob_appendf(&comment, "%h ticket [%.10s]: <i>%s</i>",
1359
+5 -4
--- src/name.c
+++ src/name.c
@@ -182,27 +182,28 @@
182182
zTagBase, zDate, (useUtc ? "" : ",'utc'")
183183
);
184184
break;
185185
}
186186
}
187
- if( zUuid==0 && strcmp(zTag, "tip")==0 ){
187
+ if( zUuid==0 && fossil_strcmp(zTag, "tip")==0 ){
188188
zUuid = db_text(0,
189189
"SELECT blob.uuid"
190190
" FROM event, blob"
191191
" WHERE event.type='ci'"
192192
" AND blob.rid=event.objid"
193193
" ORDER BY event.mtime DESC"
194194
);
195195
}
196196
if( zUuid==0 && g.localOpen && (vid=db_lget_int("checkout",0))!=0 ){
197
- if( strcmp(zTag, "current")==0 ){
197
+ if( fossil_strcmp(zTag, "current")==0 ){
198198
zUuid = db_text(0, "SELECT uuid FROM blob WHERE rid=%d", vid);
199
- }else if( strcmp(zTag, "prev")==0 || strcmp(zTag, "previous")==0 ){
199
+ }else if( fossil_strcmp(zTag, "prev")==0
200
+ || fossil_strcmp(zTag, "previous")==0 ){
200201
zUuid = db_text(0, "SELECT uuid FROM blob WHERE rid="
201202
"(SELECT pid FROM plink WHERE cid=%d AND isprim)",
202203
vid);
203
- }else if( strcmp(zTag, "next")==0 ){
204
+ }else if( fossil_strcmp(zTag, "next")==0 ){
204205
zUuid = db_text(0, "SELECT uuid FROM blob WHERE rid="
205206
"(SELECT cid FROM plink WHERE pid=%d AND isprim"
206207
" ORDER BY mtime DESC)",
207208
vid);
208209
}
209210
--- src/name.c
+++ src/name.c
@@ -182,27 +182,28 @@
182 zTagBase, zDate, (useUtc ? "" : ",'utc'")
183 );
184 break;
185 }
186 }
187 if( zUuid==0 && strcmp(zTag, "tip")==0 ){
188 zUuid = db_text(0,
189 "SELECT blob.uuid"
190 " FROM event, blob"
191 " WHERE event.type='ci'"
192 " AND blob.rid=event.objid"
193 " ORDER BY event.mtime DESC"
194 );
195 }
196 if( zUuid==0 && g.localOpen && (vid=db_lget_int("checkout",0))!=0 ){
197 if( strcmp(zTag, "current")==0 ){
198 zUuid = db_text(0, "SELECT uuid FROM blob WHERE rid=%d", vid);
199 }else if( strcmp(zTag, "prev")==0 || strcmp(zTag, "previous")==0 ){
 
200 zUuid = db_text(0, "SELECT uuid FROM blob WHERE rid="
201 "(SELECT pid FROM plink WHERE cid=%d AND isprim)",
202 vid);
203 }else if( strcmp(zTag, "next")==0 ){
204 zUuid = db_text(0, "SELECT uuid FROM blob WHERE rid="
205 "(SELECT cid FROM plink WHERE pid=%d AND isprim"
206 " ORDER BY mtime DESC)",
207 vid);
208 }
209
--- src/name.c
+++ src/name.c
@@ -182,27 +182,28 @@
182 zTagBase, zDate, (useUtc ? "" : ",'utc'")
183 );
184 break;
185 }
186 }
187 if( zUuid==0 && fossil_strcmp(zTag, "tip")==0 ){
188 zUuid = db_text(0,
189 "SELECT blob.uuid"
190 " FROM event, blob"
191 " WHERE event.type='ci'"
192 " AND blob.rid=event.objid"
193 " ORDER BY event.mtime DESC"
194 );
195 }
196 if( zUuid==0 && g.localOpen && (vid=db_lget_int("checkout",0))!=0 ){
197 if( fossil_strcmp(zTag, "current")==0 ){
198 zUuid = db_text(0, "SELECT uuid FROM blob WHERE rid=%d", vid);
199 }else if( fossil_strcmp(zTag, "prev")==0
200 || fossil_strcmp(zTag, "previous")==0 ){
201 zUuid = db_text(0, "SELECT uuid FROM blob WHERE rid="
202 "(SELECT pid FROM plink WHERE cid=%d AND isprim)",
203 vid);
204 }else if( fossil_strcmp(zTag, "next")==0 ){
205 zUuid = db_text(0, "SELECT uuid FROM blob WHERE rid="
206 "(SELECT cid FROM plink WHERE pid=%d AND isprim"
207 " ORDER BY mtime DESC)",
208 vid);
209 }
210
+4 -2
--- src/report.c
+++ src/report.c
@@ -64,11 +64,13 @@
6464
blob_appendf(&ril, "(by <i>%h</i></i>) ", zOwner);
6565
}
6666
if( g.okTktFmt ){
6767
blob_appendf(&ril, "[<a href=\"rptedit?rn=%d&amp;copy=1\" rel=\"nofollow\">copy</a>] ", rn);
6868
}
69
- if( g.okAdmin || (g.okWrTkt && zOwner && strcmp(g.zLogin,zOwner)==0) ){
69
+ if( g.okAdmin
70
+ || (g.okWrTkt && zOwner && fossil_strcmp(g.zLogin,zOwner)==0)
71
+ ){
7072
blob_appendf(&ril, "[<a href=\"rptedit?rn=%d\" rel=\"nofollow\">edit</a>] ", rn);
7173
}
7274
if( g.okTktFmt ){
7375
blob_appendf(&ril, "[<a href=\"rptsql?rn=%d\" rel=\"nofollow\">sql</a>] ", rn);
7476
}
@@ -423,11 +425,11 @@
423425
@ color key is displayed.) Each line contains the text for a single
424426
@ entry in the key. The first token of each line is the background
425427
@ color for that line.<br />
426428
@ <textarea name="k" rows="8" cols="50">%h(zClrKey)</textarea>
427429
@ </p>
428
- if( !g.okAdmin && strcmp(zOwner,g.zLogin)!=0 ){
430
+ if( !g.okAdmin && fossil_strcmp(zOwner,g.zLogin)!=0 ){
429431
@ <p>This report format is owned by %h(zOwner). You are not allowed
430432
@ to change it.</p>
431433
@ </form>
432434
report_format_hints();
433435
style_footer();
434436
--- src/report.c
+++ src/report.c
@@ -64,11 +64,13 @@
64 blob_appendf(&ril, "(by <i>%h</i></i>) ", zOwner);
65 }
66 if( g.okTktFmt ){
67 blob_appendf(&ril, "[<a href=\"rptedit?rn=%d&amp;copy=1\" rel=\"nofollow\">copy</a>] ", rn);
68 }
69 if( g.okAdmin || (g.okWrTkt && zOwner && strcmp(g.zLogin,zOwner)==0) ){
 
 
70 blob_appendf(&ril, "[<a href=\"rptedit?rn=%d\" rel=\"nofollow\">edit</a>] ", rn);
71 }
72 if( g.okTktFmt ){
73 blob_appendf(&ril, "[<a href=\"rptsql?rn=%d\" rel=\"nofollow\">sql</a>] ", rn);
74 }
@@ -423,11 +425,11 @@
423 @ color key is displayed.) Each line contains the text for a single
424 @ entry in the key. The first token of each line is the background
425 @ color for that line.<br />
426 @ <textarea name="k" rows="8" cols="50">%h(zClrKey)</textarea>
427 @ </p>
428 if( !g.okAdmin && strcmp(zOwner,g.zLogin)!=0 ){
429 @ <p>This report format is owned by %h(zOwner). You are not allowed
430 @ to change it.</p>
431 @ </form>
432 report_format_hints();
433 style_footer();
434
--- src/report.c
+++ src/report.c
@@ -64,11 +64,13 @@
64 blob_appendf(&ril, "(by <i>%h</i></i>) ", zOwner);
65 }
66 if( g.okTktFmt ){
67 blob_appendf(&ril, "[<a href=\"rptedit?rn=%d&amp;copy=1\" rel=\"nofollow\">copy</a>] ", rn);
68 }
69 if( g.okAdmin
70 || (g.okWrTkt && zOwner && fossil_strcmp(g.zLogin,zOwner)==0)
71 ){
72 blob_appendf(&ril, "[<a href=\"rptedit?rn=%d\" rel=\"nofollow\">edit</a>] ", rn);
73 }
74 if( g.okTktFmt ){
75 blob_appendf(&ril, "[<a href=\"rptsql?rn=%d\" rel=\"nofollow\">sql</a>] ", rn);
76 }
@@ -423,11 +425,11 @@
425 @ color key is displayed.) Each line contains the text for a single
426 @ entry in the key. The first token of each line is the background
427 @ color for that line.<br />
428 @ <textarea name="k" rows="8" cols="50">%h(zClrKey)</textarea>
429 @ </p>
430 if( !g.okAdmin && fossil_strcmp(zOwner,g.zLogin)!=0 ){
431 @ <p>This report format is owned by %h(zOwner). You are not allowed
432 @ to change it.</p>
433 @ </form>
434 report_format_hints();
435 style_footer();
436
+2 -2
--- src/stash.c
+++ src/stash.c
@@ -66,11 +66,11 @@
6666
"SELECT deleted, isexe, mrid, pathname, coalesce(origname,pathname)"
6767
" FROM vfile"
6868
" WHERE vid=%d AND (chnged OR deleted OR origname NOT NULL OR mrid==0)",
6969
vid
7070
);
71
- if( strcmp(zTreename,".")!=0 ){
71
+ if( fossil_strcmp(zTreename,".")!=0 ){
7272
blob_appendf(&sql,
7373
" AND (pathname GLOB '%q/*' OR origname GLOB '%q/*'"
7474
" OR pathname=%Q OR origname=%Q)",
7575
zTreename, zTreename, zTreename, zTreename
7676
);
@@ -213,11 +213,11 @@
213213
blob_reset(&a);
214214
blob_reset(&b);
215215
blob_reset(&disk);
216216
}
217217
blob_reset(&delta);
218
- if( strcmp(zOrig,zNew)!=0 ){
218
+ if( fossil_strcmp(zOrig,zNew)!=0 ){
219219
undo_save(zOrig);
220220
unlink(zOPath);
221221
}
222222
}
223223
db_finalize(&q);
224224
--- src/stash.c
+++ src/stash.c
@@ -66,11 +66,11 @@
66 "SELECT deleted, isexe, mrid, pathname, coalesce(origname,pathname)"
67 " FROM vfile"
68 " WHERE vid=%d AND (chnged OR deleted OR origname NOT NULL OR mrid==0)",
69 vid
70 );
71 if( strcmp(zTreename,".")!=0 ){
72 blob_appendf(&sql,
73 " AND (pathname GLOB '%q/*' OR origname GLOB '%q/*'"
74 " OR pathname=%Q OR origname=%Q)",
75 zTreename, zTreename, zTreename, zTreename
76 );
@@ -213,11 +213,11 @@
213 blob_reset(&a);
214 blob_reset(&b);
215 blob_reset(&disk);
216 }
217 blob_reset(&delta);
218 if( strcmp(zOrig,zNew)!=0 ){
219 undo_save(zOrig);
220 unlink(zOPath);
221 }
222 }
223 db_finalize(&q);
224
--- src/stash.c
+++ src/stash.c
@@ -66,11 +66,11 @@
66 "SELECT deleted, isexe, mrid, pathname, coalesce(origname,pathname)"
67 " FROM vfile"
68 " WHERE vid=%d AND (chnged OR deleted OR origname NOT NULL OR mrid==0)",
69 vid
70 );
71 if( fossil_strcmp(zTreename,".")!=0 ){
72 blob_appendf(&sql,
73 " AND (pathname GLOB '%q/*' OR origname GLOB '%q/*'"
74 " OR pathname=%Q OR origname=%Q)",
75 zTreename, zTreename, zTreename, zTreename
76 );
@@ -213,11 +213,11 @@
213 blob_reset(&a);
214 blob_reset(&b);
215 blob_reset(&disk);
216 }
217 blob_reset(&delta);
218 if( fossil_strcmp(zOrig,zNew)!=0 ){
219 undo_save(zOrig);
220 unlink(zOPath);
221 }
222 }
223 db_finalize(&q);
224
+1 -1
--- src/style.c
+++ src/style.c
@@ -70,11 +70,11 @@
7070
** Compare two submenu items for sorting purposes
7171
*/
7272
static int submenuCompare(const void *a, const void *b){
7373
const struct Submenu *A = (const struct Submenu*)a;
7474
const struct Submenu *B = (const struct Submenu*)b;
75
- return strcmp(A->zLabel, B->zLabel);
75
+ return fossil_strcmp(A->zLabel, B->zLabel);
7676
}
7777
7878
/*
7979
** Draw the header.
8080
*/
8181
--- src/style.c
+++ src/style.c
@@ -70,11 +70,11 @@
70 ** Compare two submenu items for sorting purposes
71 */
72 static int submenuCompare(const void *a, const void *b){
73 const struct Submenu *A = (const struct Submenu*)a;
74 const struct Submenu *B = (const struct Submenu*)b;
75 return strcmp(A->zLabel, B->zLabel);
76 }
77
78 /*
79 ** Draw the header.
80 */
81
--- src/style.c
+++ src/style.c
@@ -70,11 +70,11 @@
70 ** Compare two submenu items for sorting purposes
71 */
72 static int submenuCompare(const void *a, const void *b){
73 const struct Submenu *A = (const struct Submenu*)a;
74 const struct Submenu *B = (const struct Submenu*)b;
75 return fossil_strcmp(A->zLabel, B->zLabel);
76 }
77
78 /*
79 ** Draw the header.
80 */
81
+1 -1
--- src/sync.c
+++ src/sync.c
@@ -229,11 +229,11 @@
229229
db_find_and_open_repository(0, 0);
230230
if( g.argc!=2 && g.argc!=3 ){
231231
usage("remote-url ?URL|off?");
232232
}
233233
if( g.argc==3 ){
234
- if( strcmp(g.argv[2],"off")==0 ){
234
+ if( fossil_strcmp(g.argv[2],"off")==0 ){
235235
db_unset("last-sync-url", 0);
236236
db_unset("last-sync-pw", 0);
237237
}else{
238238
url_parse(g.argv[2]);
239239
if( g.urlUser && g.urlPasswd==0 ){
240240
--- src/sync.c
+++ src/sync.c
@@ -229,11 +229,11 @@
229 db_find_and_open_repository(0, 0);
230 if( g.argc!=2 && g.argc!=3 ){
231 usage("remote-url ?URL|off?");
232 }
233 if( g.argc==3 ){
234 if( strcmp(g.argv[2],"off")==0 ){
235 db_unset("last-sync-url", 0);
236 db_unset("last-sync-pw", 0);
237 }else{
238 url_parse(g.argv[2]);
239 if( g.urlUser && g.urlPasswd==0 ){
240
--- src/sync.c
+++ src/sync.c
@@ -229,11 +229,11 @@
229 db_find_and_open_repository(0, 0);
230 if( g.argc!=2 && g.argc!=3 ){
231 usage("remote-url ?URL|off?");
232 }
233 if( g.argc==3 ){
234 if( fossil_strcmp(g.argv[2],"off")==0 ){
235 db_unset("last-sync-url", 0);
236 db_unset("last-sync-pw", 0);
237 }else{
238 url_parse(g.argv[2]);
239 if( g.urlUser && g.urlPasswd==0 ){
240
+2 -2
--- src/timeline.c
+++ src/timeline.c
@@ -227,11 +227,11 @@
227227
@ <tr><td /><td /><td>
228228
@ <span class="timelineDisabled">... %d(suppressCnt) similar
229229
@ event%s(suppressCnt>1?"s":"") omitted.</span></td></tr>
230230
suppressCnt = 0;
231231
}
232
- if( strcmp(zType,"div")==0 ){
232
+ if( fossil_strcmp(zType,"div")==0 ){
233233
@ <tr><td colspan="3"><hr /></td></tr>
234234
continue;
235235
}
236236
if( memcmp(zDate, zPrevDate, 10) ){
237237
sqlite3_snprintf(sizeof(zPrevDate), zPrevDate, "%.10s", zDate);
@@ -1051,11 +1051,11 @@
10511051
zBrType = "*BRANCH* ";
10521052
}
10531053
sqlite3_snprintf(sizeof(zPrefix)-n, &zPrefix[n], zBrType);
10541054
n = strlen(zPrefix);
10551055
}
1056
- if( zCurrentUuid && strcmp(zCurrentUuid,zId)==0 ){
1056
+ if( fossil_strcmp(zCurrentUuid,zId)==0 ){
10571057
sqlite3_snprintf(sizeof(zPrefix)-n, &zPrefix[n], "*CURRENT* ");
10581058
n += strlen(zPrefix);
10591059
}
10601060
zFree = sqlite3_mprintf("[%.10s] %s%s", zUuid, zPrefix, zCom);
10611061
nLine += comment_print(zFree, 9, 79);
10621062
--- src/timeline.c
+++ src/timeline.c
@@ -227,11 +227,11 @@
227 @ <tr><td /><td /><td>
228 @ <span class="timelineDisabled">... %d(suppressCnt) similar
229 @ event%s(suppressCnt>1?"s":"") omitted.</span></td></tr>
230 suppressCnt = 0;
231 }
232 if( strcmp(zType,"div")==0 ){
233 @ <tr><td colspan="3"><hr /></td></tr>
234 continue;
235 }
236 if( memcmp(zDate, zPrevDate, 10) ){
237 sqlite3_snprintf(sizeof(zPrevDate), zPrevDate, "%.10s", zDate);
@@ -1051,11 +1051,11 @@
1051 zBrType = "*BRANCH* ";
1052 }
1053 sqlite3_snprintf(sizeof(zPrefix)-n, &zPrefix[n], zBrType);
1054 n = strlen(zPrefix);
1055 }
1056 if( zCurrentUuid && strcmp(zCurrentUuid,zId)==0 ){
1057 sqlite3_snprintf(sizeof(zPrefix)-n, &zPrefix[n], "*CURRENT* ");
1058 n += strlen(zPrefix);
1059 }
1060 zFree = sqlite3_mprintf("[%.10s] %s%s", zUuid, zPrefix, zCom);
1061 nLine += comment_print(zFree, 9, 79);
1062
--- src/timeline.c
+++ src/timeline.c
@@ -227,11 +227,11 @@
227 @ <tr><td /><td /><td>
228 @ <span class="timelineDisabled">... %d(suppressCnt) similar
229 @ event%s(suppressCnt>1?"s":"") omitted.</span></td></tr>
230 suppressCnt = 0;
231 }
232 if( fossil_strcmp(zType,"div")==0 ){
233 @ <tr><td colspan="3"><hr /></td></tr>
234 continue;
235 }
236 if( memcmp(zDate, zPrevDate, 10) ){
237 sqlite3_snprintf(sizeof(zPrevDate), zPrevDate, "%.10s", zDate);
@@ -1051,11 +1051,11 @@
1051 zBrType = "*BRANCH* ";
1052 }
1053 sqlite3_snprintf(sizeof(zPrefix)-n, &zPrefix[n], zBrType);
1054 n = strlen(zPrefix);
1055 }
1056 if( fossil_strcmp(zCurrentUuid,zId)==0 ){
1057 sqlite3_snprintf(sizeof(zPrefix)-n, &zPrefix[n], "*CURRENT* ");
1058 n += strlen(zPrefix);
1059 }
1060 zFree = sqlite3_mprintf("[%.10s] %s%s", zUuid, zPrefix, zCom);
1061 nLine += comment_print(zFree, 9, 79);
1062
+2 -2
--- src/update.c
+++ src/update.c
@@ -317,11 +317,11 @@
317317
char *zFullNewPath; /* Full pathname of dest */
318318
char nameChng; /* True if the name changed */
319319
320320
zFullPath = mprintf("%s%s", g.zLocalRoot, zName);
321321
zFullNewPath = mprintf("%s%s", g.zLocalRoot, zNewName);
322
- nameChng = strcmp(zName, zNewName);
322
+ nameChng = fossil_strcmp(zName, zNewName);
323323
if( idv>0 && ridv==0 && idt>0 && ridt>0 ){
324324
/* Conflict. This file has been added to the current checkout
325325
** but also exists in the target checkout. Use the current version.
326326
*/
327327
printf("CONFLICT %s\n", zName);
@@ -461,11 +461,11 @@
461461
pManifest = manifest_get(rid, CFTYPE_MANIFEST);
462462
463463
if( pManifest ){
464464
manifest_file_rewind(pManifest);
465465
while( (pFile = manifest_file_next(pManifest,0))!=0 ){
466
- if( strcmp(pFile->zName, file)==0 ){
466
+ if( fossil_strcmp(pFile->zName, file)==0 ){
467467
rid = uuid_to_rid(pFile->zUuid, 0);
468468
manifest_destroy(pManifest);
469469
return content_get(rid, content);
470470
}
471471
}
472472
--- src/update.c
+++ src/update.c
@@ -317,11 +317,11 @@
317 char *zFullNewPath; /* Full pathname of dest */
318 char nameChng; /* True if the name changed */
319
320 zFullPath = mprintf("%s%s", g.zLocalRoot, zName);
321 zFullNewPath = mprintf("%s%s", g.zLocalRoot, zNewName);
322 nameChng = strcmp(zName, zNewName);
323 if( idv>0 && ridv==0 && idt>0 && ridt>0 ){
324 /* Conflict. This file has been added to the current checkout
325 ** but also exists in the target checkout. Use the current version.
326 */
327 printf("CONFLICT %s\n", zName);
@@ -461,11 +461,11 @@
461 pManifest = manifest_get(rid, CFTYPE_MANIFEST);
462
463 if( pManifest ){
464 manifest_file_rewind(pManifest);
465 while( (pFile = manifest_file_next(pManifest,0))!=0 ){
466 if( strcmp(pFile->zName, file)==0 ){
467 rid = uuid_to_rid(pFile->zUuid, 0);
468 manifest_destroy(pManifest);
469 return content_get(rid, content);
470 }
471 }
472
--- src/update.c
+++ src/update.c
@@ -317,11 +317,11 @@
317 char *zFullNewPath; /* Full pathname of dest */
318 char nameChng; /* True if the name changed */
319
320 zFullPath = mprintf("%s%s", g.zLocalRoot, zName);
321 zFullNewPath = mprintf("%s%s", g.zLocalRoot, zNewName);
322 nameChng = fossil_strcmp(zName, zNewName);
323 if( idv>0 && ridv==0 && idt>0 && ridt>0 ){
324 /* Conflict. This file has been added to the current checkout
325 ** but also exists in the target checkout. Use the current version.
326 */
327 printf("CONFLICT %s\n", zName);
@@ -461,11 +461,11 @@
461 pManifest = manifest_get(rid, CFTYPE_MANIFEST);
462
463 if( pManifest ){
464 manifest_file_rewind(pManifest);
465 while( (pFile = manifest_file_next(pManifest,0))!=0 ){
466 if( fossil_strcmp(pFile->zName, file)==0 ){
467 rid = uuid_to_rid(pFile->zUuid, 0);
468 manifest_destroy(pManifest);
469 return content_get(rid, content);
470 }
471 }
472
+1 -1
--- src/url.c
+++ src/url.c
@@ -141,11 +141,11 @@
141141
}
142142
if( g.urlPath[i] ){
143143
g.urlPath[i] = 0;
144144
i++;
145145
}
146
- if( strcmp(zName,"fossil")==0 ){
146
+ if( fossil_strcmp(zName,"fossil")==0 ){
147147
g.urlFossil = zValue;
148148
dehttpize(g.urlFossil);
149149
zExe = mprintf("?fossil=%T", g.urlFossil);
150150
}
151151
}
152152
--- src/url.c
+++ src/url.c
@@ -141,11 +141,11 @@
141 }
142 if( g.urlPath[i] ){
143 g.urlPath[i] = 0;
144 i++;
145 }
146 if( strcmp(zName,"fossil")==0 ){
147 g.urlFossil = zValue;
148 dehttpize(g.urlFossil);
149 zExe = mprintf("?fossil=%T", g.urlFossil);
150 }
151 }
152
--- src/url.c
+++ src/url.c
@@ -141,11 +141,11 @@
141 }
142 if( g.urlPath[i] ){
143 g.urlPath[i] = 0;
144 i++;
145 }
146 if( fossil_strcmp(zName,"fossil")==0 ){
147 g.urlFossil = zValue;
148 dehttpize(g.urlFossil);
149 zExe = mprintf("?fossil=%T", g.urlFossil);
150 }
151 }
152

Keyboard Shortcuts

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