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.
Commit
31c52c7b3e7e1b858d77b1707b18e9dd4f1da2dd
Parent
5f23fbad37cdc2c…
23 files changed
+1
-1
+1
-1
+1
-1
+4
-4
+9
-9
+3
-3
+2
-2
+6
-6
+2
-2
+1
-1
+2
-2
+10
-10
+4
-5
+17
-2
+9
-23
+5
-4
+4
-2
+2
-2
+1
-1
+1
-1
+2
-2
+2
-2
+1
-1
~
src/add.c
~
src/attach.c
~
src/branch.c
~
src/checkin.c
~
src/configure.c
~
src/db.c
~
src/diffcmd.c
~
src/doc.c
~
src/event.c
~
src/graph.c
~
src/import.c
~
src/info.c
~
src/login.c
~
src/main.c
~
src/manifest.c
~
src/name.c
~
src/report.c
~
src/stash.c
~
src/style.c
~
src/sync.c
~
src/timeline.c
~
src/update.c
~
src/url.c
+1
-1
| --- src/add.c | ||
| +++ src/add.c | ||
| @@ -98,11 +98,11 @@ | ||
| 98 | 98 | const char *zReserved; |
| 99 | 99 | |
| 100 | 100 | file_tree_name(zName, &pathname, 1); |
| 101 | 101 | zPath = blob_str(&pathname); |
| 102 | 102 | 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; | |
| 104 | 104 | } |
| 105 | 105 | if( zReserved || (pOmit && blob_compare(&pathname, pOmit)==0) ){ |
| 106 | 106 | fossil_warning("cannot add %s", zPath); |
| 107 | 107 | }else{ |
| 108 | 108 | if( !file_is_simple_pathname(zPath) ){ |
| 109 | 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( 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 @@ | ||
| 174 | 174 | style_footer(); |
| 175 | 175 | return; |
| 176 | 176 | } |
| 177 | 177 | g.okRead = 1; |
| 178 | 178 | cgi_replace_parameter("name",zUUID); |
| 179 | - if( strcmp(g.zPath,"attachview")==0 ){ | |
| 179 | + if( fossil_strcmp(g.zPath,"attachview")==0 ){ | |
| 180 | 180 | artifact_page(); |
| 181 | 181 | }else{ |
| 182 | 182 | cgi_replace_parameter("m", mimetype_from_name(zFile)); |
| 183 | 183 | rawartifact_page(); |
| 184 | 184 | } |
| 185 | 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( 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 @@ | ||
| 215 | 215 | " ORDER BY value /*sort*/", |
| 216 | 216 | TAG_BRANCH |
| 217 | 217 | ); |
| 218 | 218 | while( db_step(&q)==SQLITE_ROW ){ |
| 219 | 219 | 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; | |
| 221 | 221 | printf("%s%s\n", (isCur ? "* " : " "), zBr); |
| 222 | 222 | } |
| 223 | 223 | db_finalize(&q); |
| 224 | 224 | }else{ |
| 225 | 225 | fossil_panic("branch subcommand should be one of: " |
| 226 | 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 && 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 @@ | ||
| 649 | 649 | zPerm = " x"; |
| 650 | 650 | }else{ |
| 651 | 651 | zPerm = ""; |
| 652 | 652 | } |
| 653 | 653 | if( !g.markPrivate ) content_make_public(frid); |
| 654 | - while( pFile && strcmp(pFile->zName,zName)<0 ){ | |
| 654 | + while( pFile && fossil_strcmp(pFile->zName,zName)<0 ){ | |
| 655 | 655 | blob_appendf(pOut, "F %F\n", pFile->zName); |
| 656 | 656 | pFile = manifest_file_next(pBaseline, 0); |
| 657 | 657 | nFBcard++; |
| 658 | 658 | } |
| 659 | 659 | cmp = 1; |
| 660 | 660 | 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 | |
| 663 | 663 | ){ |
| 664 | 664 | blob_resize(&filename, nBasename); |
| 665 | 665 | if( zOrig && !isSelected ){ zName = zOrig; zOrig = 0; } |
| 666 | - if( zOrig==0 || strcmp(zOrig,zName)==0 ){ | |
| 666 | + if( zOrig==0 || fossil_strcmp(zOrig,zName)==0 ){ | |
| 667 | 667 | blob_appendf(pOut, "F %F %s%s\n", zName, zUuid, zPerm); |
| 668 | 668 | }else{ |
| 669 | 669 | if( zPerm[0]==0 ){ zPerm = " w"; } |
| 670 | 670 | blob_appendf(pOut, "F %F %s%s %F\n", zName, zUuid, zPerm, zOrig); |
| 671 | 671 | } |
| 672 | 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 && 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 @@ | ||
| 120 | 120 | ** safely exported. Return 0 if the parameter is not safe to export. |
| 121 | 121 | */ |
| 122 | 122 | int configure_is_exportable(const char *zName){ |
| 123 | 123 | int i; |
| 124 | 124 | for(i=0; i<count(aConfig); i++){ |
| 125 | - if( strcmp(zName, aConfig[i].zName)==0 ){ | |
| 125 | + if( fossil_strcmp(zName, aConfig[i].zName)==0 ){ | |
| 126 | 126 | int m = aConfig[i].groupMask; |
| 127 | 127 | if( !g.okAdmin ){ |
| 128 | 128 | m &= ~CONFIGSET_USER; |
| 129 | 129 | } |
| 130 | 130 | if( !g.okRdAddr ){ |
| @@ -142,19 +142,19 @@ | ||
| 142 | 142 | ** and "@shun" and "@user". This routine writes SQL text into pOut that when |
| 143 | 143 | ** evaluated will populate the corresponding table with data. |
| 144 | 144 | */ |
| 145 | 145 | void configure_render_special_name(const char *zName, Blob *pOut){ |
| 146 | 146 | Stmt q; |
| 147 | - if( strcmp(zName, "@shun")==0 ){ | |
| 147 | + if( fossil_strcmp(zName, "@shun")==0 ){ | |
| 148 | 148 | db_prepare(&q, "SELECT uuid FROM shun"); |
| 149 | 149 | while( db_step(&q)==SQLITE_ROW ){ |
| 150 | 150 | blob_appendf(pOut, "INSERT OR IGNORE INTO shun VALUES('%s');\n", |
| 151 | 151 | db_column_text(&q, 0) |
| 152 | 152 | ); |
| 153 | 153 | } |
| 154 | 154 | db_finalize(&q); |
| 155 | - }else if( strcmp(zName, "@reportfmt")==0 ){ | |
| 155 | + }else if( fossil_strcmp(zName, "@reportfmt")==0 ){ | |
| 156 | 156 | db_prepare(&q, "SELECT title, cols, sqlcode FROM reportfmt"); |
| 157 | 157 | while( db_step(&q)==SQLITE_ROW ){ |
| 158 | 158 | blob_appendf(pOut, "INSERT INTO _xfer_reportfmt(title,cols,sqlcode)" |
| 159 | 159 | " VALUES(%Q,%Q,%Q);\n", |
| 160 | 160 | db_column_text(&q, 0), |
| @@ -161,11 +161,11 @@ | ||
| 161 | 161 | db_column_text(&q, 1), |
| 162 | 162 | db_column_text(&q, 2) |
| 163 | 163 | ); |
| 164 | 164 | } |
| 165 | 165 | db_finalize(&q); |
| 166 | - }else if( strcmp(zName, "@user")==0 ){ | |
| 166 | + }else if( fossil_strcmp(zName, "@user")==0 ){ | |
| 167 | 167 | db_prepare(&q, |
| 168 | 168 | "SELECT login, CASE WHEN length(pw)==40 THEN pw END," |
| 169 | 169 | " cap, info, quote(photo) FROM user"); |
| 170 | 170 | while( db_step(&q)==SQLITE_ROW ){ |
| 171 | 171 | blob_appendf(pOut, "INSERT INTO _xfer_user(login,pw,cap,info,photo)" |
| @@ -176,11 +176,11 @@ | ||
| 176 | 176 | db_column_text(&q, 3), |
| 177 | 177 | db_column_text(&q, 4) |
| 178 | 178 | ); |
| 179 | 179 | } |
| 180 | 180 | db_finalize(&q); |
| 181 | - }else if( strcmp(zName, "@concealed")==0 ){ | |
| 181 | + }else if( fossil_strcmp(zName, "@concealed")==0 ){ | |
| 182 | 182 | db_prepare(&q, "SELECT hash, content FROM concealed"); |
| 183 | 183 | while( db_step(&q)==SQLITE_ROW ){ |
| 184 | 184 | blob_appendf(pOut, "INSERT OR IGNORE INTO concealed(hash,content)" |
| 185 | 185 | " VALUES(%Q,%Q);\n", |
| 186 | 186 | db_column_text(&q, 0), |
| @@ -481,18 +481,18 @@ | ||
| 481 | 481 | for(i=0; i<count(aConfig); i++){ |
| 482 | 482 | const char *zName = aConfig[i].zName; |
| 483 | 483 | if( (aConfig[i].groupMask & mask)==0 ) continue; |
| 484 | 484 | if( zName[0]!='@' ){ |
| 485 | 485 | 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 ){ | |
| 487 | 487 | db_multi_exec("DELETE FROM user"); |
| 488 | 488 | db_create_default_users(0, 0); |
| 489 | - }else if( strcmp(zName,"@concealed")==0 ){ | |
| 489 | + }else if( fossil_strcmp(zName,"@concealed")==0 ){ | |
| 490 | 490 | db_multi_exec("DELETE FROM concealed"); |
| 491 | - }else if( strcmp(zName,"@shun")==0 ){ | |
| 491 | + }else if( fossil_strcmp(zName,"@shun")==0 ){ | |
| 492 | 492 | db_multi_exec("DELETE FROM shun"); |
| 493 | - }else if( strcmp(zName,"@reportfmt")==0 ){ | |
| 493 | + }else if( fossil_strcmp(zName,"@reportfmt")==0 ){ | |
| 494 | 494 | db_multi_exec("DELETE FROM reportfmt"); |
| 495 | 495 | } |
| 496 | 496 | } |
| 497 | 497 | db_end_transaction(0); |
| 498 | 498 | printf("Configuration reset to factory defaults.\n"); |
| 499 | 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( 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 |
M
src/db.c
+3
-3
| --- src/db.c | ||
| +++ src/db.c | ||
| @@ -1309,19 +1309,19 @@ | ||
| 1309 | 1309 | */ |
| 1310 | 1310 | int is_truth(const char *zVal){ |
| 1311 | 1311 | static const char *azOn[] = { "on", "yes", "true", "1" }; |
| 1312 | 1312 | int i; |
| 1313 | 1313 | 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; | |
| 1315 | 1315 | } |
| 1316 | 1316 | return 0; |
| 1317 | 1317 | } |
| 1318 | 1318 | int is_false(const char *zVal){ |
| 1319 | 1319 | static const char *azOff[] = { "off", "no", "false", "0" }; |
| 1320 | 1320 | int i; |
| 1321 | 1321 | 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; | |
| 1323 | 1323 | } |
| 1324 | 1324 | return 0; |
| 1325 | 1325 | } |
| 1326 | 1326 | |
| 1327 | 1327 | /* |
| @@ -1712,11 +1712,11 @@ | ||
| 1712 | 1712 | if( strncmp(ctrlSettings[i].name, zName, n)==0 ) break; |
| 1713 | 1713 | } |
| 1714 | 1714 | if( !ctrlSettings[i].name ){ |
| 1715 | 1715 | fossil_fatal("no such setting: %s", zName); |
| 1716 | 1716 | } |
| 1717 | - isManifest = strcmp(ctrlSettings[i].name, "manifest")==0; | |
| 1717 | + isManifest = fossil_strcmp(ctrlSettings[i].name, "manifest")==0; | |
| 1718 | 1718 | if( isManifest && globalFlag ){ |
| 1719 | 1719 | fossil_fatal("cannot set 'manifest' globally"); |
| 1720 | 1720 | } |
| 1721 | 1721 | if( unsetFlag ){ |
| 1722 | 1722 | db_unset(ctrlSettings[i].name, globalFlag); |
| 1723 | 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( 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 @@ | ||
| 358 | 358 | if( pFromFile==0 ){ |
| 359 | 359 | cmp = +1; |
| 360 | 360 | }else if( pToFile==0 ){ |
| 361 | 361 | cmp = -1; |
| 362 | 362 | }else{ |
| 363 | - cmp = strcmp(pFromFile->zName, pToFile->zName); | |
| 363 | + cmp = fossil_strcmp(pFromFile->zName, pToFile->zName); | |
| 364 | 364 | } |
| 365 | 365 | if( cmp<0 ){ |
| 366 | 366 | printf("DELETED %s\n", pFromFile->zName); |
| 367 | 367 | if( asNewFlag ){ |
| 368 | 368 | diff_manifest_entry(pFromFile, 0, zDiffCmd, ignoreEolWs); |
| @@ -372,11 +372,11 @@ | ||
| 372 | 372 | printf("ADDED %s\n", pToFile->zName); |
| 373 | 373 | if( asNewFlag ){ |
| 374 | 374 | diff_manifest_entry(0, pToFile, zDiffCmd, ignoreEolWs); |
| 375 | 375 | } |
| 376 | 376 | 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 ){ | |
| 378 | 378 | /* No changes */ |
| 379 | 379 | pFromFile = manifest_file_next(pFrom,0); |
| 380 | 380 | pToFile = manifest_file_next(pTo,0); |
| 381 | 381 | }else{ |
| 382 | 382 | printf("CHANGED %s\n", pFromFile->zName); |
| 383 | 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 = 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 @@ | ||
| 297 | 297 | first = 0; |
| 298 | 298 | last = sizeof(aMime)/sizeof(aMime[0]); |
| 299 | 299 | while( first<=last ){ |
| 300 | 300 | int c; |
| 301 | 301 | i = (first+last)/2; |
| 302 | - c = strcmp(zSuffix, aMime[i].zSuffix); | |
| 302 | + c = fossil_strcmp(zSuffix, aMime[i].zSuffix); | |
| 303 | 303 | if( c==0 ) return aMime[i].zMimetype; |
| 304 | 304 | if( c<0 ){ |
| 305 | 305 | last = i-1; |
| 306 | 306 | }else{ |
| 307 | 307 | first = i+1; |
| @@ -346,14 +346,14 @@ | ||
| 346 | 346 | zName += i; |
| 347 | 347 | while( zName[0]=='/' ){ zName++; } |
| 348 | 348 | if( !file_is_simple_pathname(zName) ){ |
| 349 | 349 | goto doc_not_found; |
| 350 | 350 | } |
| 351 | - if( strcmp(zBaseline,"ckout")==0 && db_open_local()==0 ){ | |
| 351 | + if( fossil_strcmp(zBaseline,"ckout")==0 && db_open_local()==0 ){ | |
| 352 | 352 | sqlite3_snprintf(sizeof(zBaseline), zBaseline, "tip"); |
| 353 | 353 | } |
| 354 | - if( strcmp(zBaseline,"ckout")==0 ){ | |
| 354 | + if( fossil_strcmp(zBaseline,"ckout")==0 ){ | |
| 355 | 355 | /* Read from the local checkout */ |
| 356 | 356 | char *zFullpath; |
| 357 | 357 | db_must_be_within_tree(); |
| 358 | 358 | zFullpath = mprintf("%s/%s", g.zLocalRoot, zName); |
| 359 | 359 | if( !file_isfile(zFullpath) ){ |
| @@ -362,11 +362,11 @@ | ||
| 362 | 362 | if( blob_read_from_file(&filebody, zFullpath)<0 ){ |
| 363 | 363 | goto doc_not_found; |
| 364 | 364 | } |
| 365 | 365 | }else{ |
| 366 | 366 | db_begin_transaction(); |
| 367 | - if( strcmp(zBaseline,"tip")==0 ){ | |
| 367 | + if( fossil_strcmp(zBaseline,"tip")==0 ){ | |
| 368 | 368 | vid = db_int(0, "SELECT objid FROM event WHERE type='ci'" |
| 369 | 369 | " ORDER BY mtime DESC LIMIT 1"); |
| 370 | 370 | }else{ |
| 371 | 371 | vid = name_to_rid(zBaseline); |
| 372 | 372 | } |
| @@ -443,21 +443,21 @@ | ||
| 443 | 443 | Th_Store("doc_name", zName); |
| 444 | 444 | Th_Store("doc_version", db_text(0, "SELECT '[' || substr(uuid,1,10) || ']'" |
| 445 | 445 | " FROM blob WHERE rid=%d", vid)); |
| 446 | 446 | Th_Store("doc_date", db_text(0, "SELECT datetime(mtime) FROM event" |
| 447 | 447 | " 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 ){ | |
| 449 | 449 | Blob title, tail; |
| 450 | 450 | if( wiki_find_title(&filebody, &title, &tail) ){ |
| 451 | 451 | style_header(blob_str(&title)); |
| 452 | 452 | wiki_convert(&tail, 0, 0); |
| 453 | 453 | }else{ |
| 454 | 454 | style_header("Documentation"); |
| 455 | 455 | wiki_convert(&filebody, 0, 0); |
| 456 | 456 | } |
| 457 | 457 | style_footer(); |
| 458 | - }else if( strcmp(zMime, "text/plain")==0 ){ | |
| 458 | + }else if( fossil_strcmp(zMime, "text/plain")==0 ){ | |
| 459 | 459 | style_header("Documentation"); |
| 460 | 460 | @ <blockquote><pre> |
| 461 | 461 | @ %h(blob_str(&filebody)) |
| 462 | 462 | @ </pre></blockquote> |
| 463 | 463 | style_footer(); |
| 464 | 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 = 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 @@ | ||
| 169 | 169 | @ [<a href="%s(g.zTop)/timeline?c=%T(zETime)">%s(zETime)</a>] |
| 170 | 170 | @ entered by user <b>%h(pEvent->zUser)</b> on |
| 171 | 171 | @ [<a href="%s(g.zTop)/timeline?c=%T(zATime)">%s(zATime)</a>]:</p> |
| 172 | 172 | @ <blockquote> |
| 173 | 173 | 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 ){ | |
| 175 | 175 | zClr = pEvent->aTag[i].zValue; |
| 176 | 176 | } |
| 177 | 177 | } |
| 178 | 178 | if( zClr && zClr[0]==0 ) zClr = 0; |
| 179 | 179 | if( zClr ){ |
| @@ -248,11 +248,11 @@ | ||
| 248 | 248 | zClr = db_text("", "SELECT bgcolor FROM event WHERE objid=%d", rid); |
| 249 | 249 | }else{ |
| 250 | 250 | zClr = ""; |
| 251 | 251 | } |
| 252 | 252 | zClr = PD("clr",zClr); |
| 253 | - if( strcmp(zClr,"##")==0 ) zClr = PD("cclr",""); | |
| 253 | + if( fossil_strcmp(zClr,"##")==0 ) zClr = PD("cclr",""); | |
| 254 | 254 | |
| 255 | 255 | |
| 256 | 256 | /* If editing an existing event, extract the key fields to use as |
| 257 | 257 | ** a starting point for the edit. |
| 258 | 258 | */ |
| 259 | 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( 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 @@ | ||
| 147 | 147 | ** Note: also used for background color names. |
| 148 | 148 | */ |
| 149 | 149 | static char *persistBranchName(GraphContext *p, const char *zBranch){ |
| 150 | 150 | int i; |
| 151 | 151 | 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]; | |
| 153 | 153 | } |
| 154 | 154 | p->nBranch++; |
| 155 | 155 | p->azBranch = fossil_realloc(p->azBranch, sizeof(char*)*p->nBranch); |
| 156 | 156 | p->azBranch[p->nBranch-1] = mprintf("%s", zBranch); |
| 157 | 157 | return p->azBranch[p->nBranch-1]; |
| 158 | 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( 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 @@ | ||
| 220 | 220 | zFromBranch = db_text(0, "SELECT brnm FROM xbranch WHERE tname=%Q", |
| 221 | 221 | gg.zFromMark); |
| 222 | 222 | }else{ |
| 223 | 223 | zFromBranch = 0; |
| 224 | 224 | } |
| 225 | - if( zFromBranch==0 || strcmp(zFromBranch, gg.zBranch)!=0 ){ | |
| 225 | + if( fossil_strcmp(zFromBranch, gg.zBranch)!=0 ){ | |
| 226 | 226 | blob_appendf(&record, "T *branch * %F\n", gg.zBranch); |
| 227 | 227 | blob_appendf(&record, "T *sym-%F *\n", gg.zBranch); |
| 228 | 228 | if( zFromBranch ){ |
| 229 | 229 | blob_appendf(&record, "T -sym-%F *\n", zFromBranch); |
| 230 | 230 | } |
| @@ -506,11 +506,11 @@ | ||
| 506 | 506 | pFile = import_find_file(zName, &i, gg.nFile); |
| 507 | 507 | if( pFile==0 ){ |
| 508 | 508 | pFile = import_add_file(); |
| 509 | 509 | pFile->zName = import_strdup(zName); |
| 510 | 510 | } |
| 511 | - pFile->isExe = (strcmp(zPerm, "100755")==0); | |
| 511 | + pFile->isExe = (fossil_strcmp(zPerm, "100755")==0); | |
| 512 | 512 | fossil_free(pFile->zUuid); |
| 513 | 513 | pFile->zUuid = resolve_committish(zUuid); |
| 514 | 514 | pFile->isFrom = 0; |
| 515 | 515 | }else |
| 516 | 516 | if( memcmp(zLine, "D ", 2)==0 ){ |
| 517 | 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( 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 @@ | ||
| 677 | 677 | if( pFileFrom==0 ){ |
| 678 | 678 | cmp = +1; |
| 679 | 679 | }else if( pFileTo==0 ){ |
| 680 | 680 | cmp = -1; |
| 681 | 681 | }else{ |
| 682 | - cmp = strcmp(pFileFrom->zName, pFileTo->zName); | |
| 682 | + cmp = fossil_strcmp(pFileFrom->zName, pFileTo->zName); | |
| 683 | 683 | } |
| 684 | 684 | if( cmp<0 ){ |
| 685 | 685 | append_file_change_line(pFileFrom->zName, |
| 686 | 686 | pFileFrom->zUuid, 0, 0); |
| 687 | 687 | pFileFrom = manifest_file_next(pFrom, 0); |
| 688 | 688 | }else if( cmp>0 ){ |
| 689 | 689 | append_file_change_line(pFileTo->zName, |
| 690 | 690 | 0, pFileTo->zUuid, 0); |
| 691 | 691 | 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 ){ | |
| 693 | 693 | /* No changes */ |
| 694 | 694 | pFileFrom = manifest_file_next(pFrom, 0); |
| 695 | 695 | pFileTo = manifest_file_next(pTo, 0); |
| 696 | 696 | }else{ |
| 697 | 697 | append_file_change_line(pFileFrom->zName, |
| @@ -1072,11 +1072,11 @@ | ||
| 1072 | 1072 | cirid = name_to_rid_www("ci"); |
| 1073 | 1073 | pManifest = manifest_get(cirid, CFTYPE_MANIFEST); |
| 1074 | 1074 | if( pManifest==0 ) return 0; |
| 1075 | 1075 | manifest_file_rewind(pManifest); |
| 1076 | 1076 | while( (pFile = manifest_file_next(pManifest,0))!=0 ){ |
| 1077 | - if( strcmp(zFilename, pFile->zName)==0 ){ | |
| 1077 | + if( fossil_strcmp(zFilename, pFile->zName)==0 ){ | |
| 1078 | 1078 | int rid = db_int(0, "SELECT rid FROM blob WHERE uuid=%Q", pFile->zUuid); |
| 1079 | 1079 | manifest_destroy(pManifest); |
| 1080 | 1080 | return rid; |
| 1081 | 1081 | } |
| 1082 | 1082 | } |
| @@ -1128,20 +1128,20 @@ | ||
| 1128 | 1128 | object_description(rid, 0, &downloadName); |
| 1129 | 1129 | style_submenu_element("Download", "Download", |
| 1130 | 1130 | "%s/raw/%T?name=%s", g.zTop, blob_str(&downloadName), zUuid); |
| 1131 | 1131 | zMime = mimetype_from_name(blob_str(&downloadName)); |
| 1132 | 1132 | if( zMime ){ |
| 1133 | - if( strcmp(zMime, "text/html")==0 ){ | |
| 1133 | + if( fossil_strcmp(zMime, "text/html")==0 ){ | |
| 1134 | 1134 | if( P("txt") ){ |
| 1135 | 1135 | style_submenu_element("Html", "Html", |
| 1136 | 1136 | "%s/artifact?name=%s", g.zTop, zUuid); |
| 1137 | 1137 | }else{ |
| 1138 | 1138 | renderAsHtml = 1; |
| 1139 | 1139 | style_submenu_element("Text", "Text", |
| 1140 | 1140 | "%s/artifact?name=%s&txt=1", g.zTop, zUuid); |
| 1141 | 1141 | } |
| 1142 | - }else if( strcmp(zMime, "application/x-fossil-wiki")==0 ){ | |
| 1142 | + }else if( fossil_strcmp(zMime, "application/x-fossil-wiki")==0 ){ | |
| 1143 | 1143 | if( P("txt") ){ |
| 1144 | 1144 | style_submenu_element("Wiki", "Wiki", |
| 1145 | 1145 | "%s/artifact?name=%s", g.zTop, zUuid); |
| 1146 | 1146 | }else{ |
| 1147 | 1147 | renderAsWiki = 1; |
| @@ -1339,11 +1339,11 @@ | ||
| 1339 | 1339 | if( aColor[i].zColor[0] ){ |
| 1340 | 1340 | @ <td style="background-color: %h(aColor[i].zColor);"> |
| 1341 | 1341 | }else{ |
| 1342 | 1342 | @ <td> |
| 1343 | 1343 | } |
| 1344 | - if( strcmp(zDefaultColor, aColor[i].zColor)==0 ){ | |
| 1344 | + if( fossil_strcmp(zDefaultColor, aColor[i].zColor)==0 ){ | |
| 1345 | 1345 | @ <input type="radio" name="%s(zId)" value="%h(aColor[i].zColor)" |
| 1346 | 1346 | @ checked="checked" /> |
| 1347 | 1347 | stdClrFound=1; |
| 1348 | 1348 | }else{ |
| 1349 | 1349 | @ <input type="radio" name="%s(zId)" value="%h(aColor[i].zColor)" /> |
| @@ -1422,11 +1422,11 @@ | ||
| 1422 | 1422 | if( zDate==0 ) fossil_redirect_home(); |
| 1423 | 1423 | zNewDate = PD("dt",zDate); |
| 1424 | 1424 | zColor = db_text("", "SELECT bgcolor" |
| 1425 | 1425 | " FROM event WHERE objid=%d", rid); |
| 1426 | 1426 | zNewColor = PD("clr",zColor); |
| 1427 | - if( strcmp(zNewColor,"##")==0 ){ | |
| 1427 | + if( fossil_strcmp(zNewColor,"##")==0 ){ | |
| 1428 | 1428 | zNewColor = P("clrcust"); |
| 1429 | 1429 | } |
| 1430 | 1430 | fPropagateColor = db_int(0, "SELECT tagtype FROM tagxref" |
| 1431 | 1431 | " WHERE rid=%d AND tagid=%d", |
| 1432 | 1432 | rid, TAG_BGCOLOR)==2; |
| @@ -1458,19 +1458,19 @@ | ||
| 1458 | 1458 | zPrefix, zNewColor); |
| 1459 | 1459 | } |
| 1460 | 1460 | if( zNewColor[0]==0 && zColor[0]!=0 ){ |
| 1461 | 1461 | db_multi_exec("REPLACE INTO newtags VALUES('bgcolor','-',NULL)"); |
| 1462 | 1462 | } |
| 1463 | - if( strcmp(zComment,zNewComment)!=0 ){ | |
| 1463 | + if( fossil_strcmp(zComment,zNewComment)!=0 ){ | |
| 1464 | 1464 | db_multi_exec("REPLACE INTO newtags VALUES('comment','+',%Q)", |
| 1465 | 1465 | zNewComment); |
| 1466 | 1466 | } |
| 1467 | - if( strcmp(zDate,zNewDate)!=0 ){ | |
| 1467 | + if( fossil_strcmp(zDate,zNewDate)!=0 ){ | |
| 1468 | 1468 | db_multi_exec("REPLACE INTO newtags VALUES('date','+',%Q)", |
| 1469 | 1469 | zNewDate); |
| 1470 | 1470 | } |
| 1471 | - if( strcmp(zUser,zNewUser)!=0 ){ | |
| 1471 | + if( fossil_strcmp(zUser,zNewUser)!=0 ){ | |
| 1472 | 1472 | db_multi_exec("REPLACE INTO newtags VALUES('user','+',%Q)", zNewUser); |
| 1473 | 1473 | } |
| 1474 | 1474 | db_prepare(&q, |
| 1475 | 1475 | "SELECT tag.tagid, tagname FROM tagxref, tag" |
| 1476 | 1476 | " WHERE tagxref.rid=%d AND tagtype>0 AND tagxref.tagid=tag.tagid", |
| 1477 | 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 = 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&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&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 @@ | ||
| 157 | 157 | @ <p><span class="loginError"> |
| 158 | 158 | @ You entered an incorrect old password while attempting to change |
| 159 | 159 | @ your password. Your password is unchanged. |
| 160 | 160 | @ </span></p> |
| 161 | 161 | ; |
| 162 | - }else if( strcmp(zNew1,zNew2)!=0 ){ | |
| 162 | + }else if( fossil_strcmp(zNew1,zNew2)!=0 ){ | |
| 163 | 163 | zErrMsg = |
| 164 | 164 | @ <p><span class="loginError"> |
| 165 | 165 | @ The two copies of your new passwords do not match. |
| 166 | 166 | @ Your password is unchanged. |
| 167 | 167 | @ </span></p> |
| @@ -438,11 +438,11 @@ | ||
| 438 | 438 | |
| 439 | 439 | /* Set the global variables recording the userid and login. The |
| 440 | 440 | ** "nobody" user is a special case in that g.zLogin==0. |
| 441 | 441 | */ |
| 442 | 442 | g.userUid = uid; |
| 443 | - if( g.zLogin && strcmp(g.zLogin,"nobody")==0 ){ | |
| 443 | + if( fossil_strcmp(g.zLogin,"nobody")==0 ){ | |
| 444 | 444 | g.zLogin = 0; |
| 445 | 445 | } |
| 446 | 446 | |
| 447 | 447 | /* Set the capabilities */ |
| 448 | 448 | login_set_capabilities(zCap); |
| @@ -458,11 +458,11 @@ | ||
| 458 | 458 | if( g.zLogin && once ){ |
| 459 | 459 | const char *zCap; |
| 460 | 460 | /* All logged-in users inherit privileges from "nobody" */ |
| 461 | 461 | zCap = db_text("", "SELECT cap FROM user WHERE login = 'nobody'"); |
| 462 | 462 | login_set_capabilities(zCap); |
| 463 | - if( strcmp(g.zLogin, "nobody")!=0 ){ | |
| 463 | + if( fossil_strcmp(g.zLogin, "nobody")!=0 ){ | |
| 464 | 464 | /* All logged-in users inherit privileges from "anonymous" */ |
| 465 | 465 | zCap = db_text("", "SELECT cap FROM user WHERE login = 'anonymous'"); |
| 466 | 466 | login_set_capabilities(zCap); |
| 467 | 467 | } |
| 468 | 468 | once = 0; |
| @@ -616,13 +616,12 @@ | ||
| 616 | 616 | ** that ths Anti-CSRF token is present and is valid. If the Anti-CSRF token |
| 617 | 617 | ** is missing or is incorrect, that indicates a cross-site scripting attach |
| 618 | 618 | ** so emits an error message and abort. |
| 619 | 619 | */ |
| 620 | 620 | void login_verify_csrf_secret(void){ |
| 621 | - const char *zCsrf; /* The CSRF secret */ | |
| 622 | 621 | if( g.okCsrf ) return; |
| 623 | - if( (zCsrf = P("csrf"))!=0 && strcmp(zCsrf, g.zCsrfToken)==0 ){ | |
| 622 | + if( fossil_strcmp(P("csrf"), g.zCsrfToken)==0 ){ | |
| 624 | 623 | g.okCsrf = 1; |
| 625 | 624 | return; |
| 626 | 625 | } |
| 627 | 626 | fossil_fatal("Cross-site request forgery attempt"); |
| 628 | 627 | } |
| 629 | 628 |
| --- 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 @@ | ||
| 417 | 417 | */ |
| 418 | 418 | rc = system(zOrigCmd); |
| 419 | 419 | #endif |
| 420 | 420 | return rc; |
| 421 | 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 | +} | |
| 422 | 437 | |
| 423 | 438 | /* |
| 424 | 439 | ** Turn off any NL to CRNL translation on the stream given as an |
| 425 | 440 | ** argument. This is a no-op on unix but is necessary on windows. |
| 426 | 441 | */ |
| @@ -527,11 +542,11 @@ | ||
| 527 | 542 | }else if( z[nLong]==0 ){ |
| 528 | 543 | zReturn = g.argv[i+hasArg]; |
| 529 | 544 | remove_from_argv(i, 1+hasArg); |
| 530 | 545 | break; |
| 531 | 546 | } |
| 532 | - }else if( zShort!=0 && strcmp(z,zShort)==0 ){ | |
| 547 | + }else if( fossil_strcmp(z,zShort)==0 ){ | |
| 533 | 548 | zReturn = g.argv[i+hasArg]; |
| 534 | 549 | remove_from_argv(i, 1+hasArg); |
| 535 | 550 | break; |
| 536 | 551 | } |
| 537 | 552 | } |
| @@ -927,11 +942,11 @@ | ||
| 927 | 942 | */ |
| 928 | 943 | void cmd_cgi(void){ |
| 929 | 944 | const char *zFile; |
| 930 | 945 | const char *zNotFound = 0; |
| 931 | 946 | 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 ){ | |
| 933 | 948 | zFile = g.argv[2]; |
| 934 | 949 | }else{ |
| 935 | 950 | zFile = g.argv[1]; |
| 936 | 951 | } |
| 937 | 952 | g.httpOut = stdout; |
| 938 | 953 |
| --- 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 @@ | ||
| 511 | 511 | i = p->nFile++; |
| 512 | 512 | p->aFile[i].zName = zName; |
| 513 | 513 | p->aFile[i].zUuid = zUuid; |
| 514 | 514 | p->aFile[i].zPerm = zPerm; |
| 515 | 515 | 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 ){ | |
| 517 | 517 | goto manifest_syntax_error; |
| 518 | 518 | } |
| 519 | 519 | break; |
| 520 | 520 | } |
| 521 | 521 | |
| @@ -540,11 +540,11 @@ | ||
| 540 | 540 | p->nFieldAlloc*sizeof(p->aField[0]) ); |
| 541 | 541 | } |
| 542 | 542 | i = p->nField++; |
| 543 | 543 | p->aField[i].zName = zName; |
| 544 | 544 | 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 ){ | |
| 546 | 546 | goto manifest_syntax_error; |
| 547 | 547 | } |
| 548 | 548 | break; |
| 549 | 549 | } |
| 550 | 550 | |
| @@ -596,11 +596,11 @@ | ||
| 596 | 596 | p->azCChild = fossil_realloc(p->azCChild |
| 597 | 597 | , p->nCChildAlloc*sizeof(p->azCChild[0]) ); |
| 598 | 598 | } |
| 599 | 599 | i = p->nCChild++; |
| 600 | 600 | 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 ){ | |
| 602 | 602 | goto manifest_syntax_error; |
| 603 | 603 | } |
| 604 | 604 | break; |
| 605 | 605 | } |
| 606 | 606 | |
| @@ -684,11 +684,11 @@ | ||
| 684 | 684 | } |
| 685 | 685 | i = p->nTag++; |
| 686 | 686 | p->aTag[i].zName = zName; |
| 687 | 687 | p->aTag[i].zUuid = zUuid; |
| 688 | 688 | 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 ){ | |
| 690 | 690 | goto manifest_syntax_error; |
| 691 | 691 | } |
| 692 | 692 | break; |
| 693 | 693 | } |
| 694 | 694 | |
| @@ -1003,11 +1003,11 @@ | ||
| 1003 | 1003 | }else if( p->iFile>=p->nFile ){ |
| 1004 | 1004 | /* We have used all entries from the delta. Return the next |
| 1005 | 1005 | ** entry from the baseline. */ |
| 1006 | 1006 | if( pB->iFile<pB->nFile ) pOut = &pB->aFile[pB->iFile++]; |
| 1007 | 1007 | break; |
| 1008 | - }else if( (cmp = strcmp(pB->aFile[pB->iFile].zName, | |
| 1008 | + }else if( (cmp = fossil_strcmp(pB->aFile[pB->iFile].zName, | |
| 1009 | 1009 | p->aFile[p->iFile].zName)) < 0 ){ |
| 1010 | 1010 | /* The next baseline entry comes before the next delta entry. |
| 1011 | 1011 | ** So return the baseline entry. */ |
| 1012 | 1012 | pOut = &pB->aFile[pB->iFile++]; |
| 1013 | 1013 | break; |
| @@ -1117,11 +1117,11 @@ | ||
| 1117 | 1117 | int c; |
| 1118 | 1118 | int i; |
| 1119 | 1119 | lwr = 0; |
| 1120 | 1120 | upr = p->nFile - 1; |
| 1121 | 1121 | 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); | |
| 1123 | 1123 | if( c==0 ){ |
| 1124 | 1124 | return &p->aFile[++p->iFile]; |
| 1125 | 1125 | }else if( c>0 ){ |
| 1126 | 1126 | upr = p->iFile; |
| 1127 | 1127 | }else{ |
| @@ -1128,11 +1128,11 @@ | ||
| 1128 | 1128 | lwr = p->iFile+1; |
| 1129 | 1129 | } |
| 1130 | 1130 | } |
| 1131 | 1131 | while( lwr<=upr ){ |
| 1132 | 1132 | i = (lwr+upr)/2; |
| 1133 | - c = strcmp(p->aFile[i].zName, zName); | |
| 1133 | + c = fossil_strcmp(p->aFile[i].zName, zName); | |
| 1134 | 1134 | if( c<0 ){ |
| 1135 | 1135 | lwr = i+1; |
| 1136 | 1136 | }else if( c>0 ){ |
| 1137 | 1137 | upr = i-1; |
| 1138 | 1138 | }else{ |
| @@ -1163,24 +1163,10 @@ | ||
| 1163 | 1163 | pFile = manifest_file_seek_base(p->pBaseline, zName); |
| 1164 | 1164 | } |
| 1165 | 1165 | return pFile; |
| 1166 | 1166 | } |
| 1167 | 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 | 1168 | /* |
| 1183 | 1169 | ** Add mlink table entries associated with manifest cid. The |
| 1184 | 1170 | ** parent manifest is pid. |
| 1185 | 1171 | ** |
| 1186 | 1172 | ** A single mlink entry is added for every file that changed content |
| @@ -1249,11 +1235,11 @@ | ||
| 1249 | 1235 | pParentFile = manifest_file_seek(pParent, pChildFile->zName); |
| 1250 | 1236 | if( pParentFile==0 ){ |
| 1251 | 1237 | if( pChildFile->zUuid ){ |
| 1252 | 1238 | add_one_mlink(cid, 0, pChildFile->zUuid, pChildFile->zName, 0); |
| 1253 | 1239 | } |
| 1254 | - }else if( strcmp_null(pChildFile->zUuid, pParentFile->zUuid)!=0 ){ | |
| 1240 | + }else if( fossil_strcmp(pChildFile->zUuid, pParentFile->zUuid)!=0 ){ | |
| 1255 | 1241 | add_one_mlink(cid, pParentFile->zUuid, pChildFile->zUuid, |
| 1256 | 1242 | pChildFile->zName, 0); |
| 1257 | 1243 | } |
| 1258 | 1244 | } |
| 1259 | 1245 | } |
| @@ -1362,11 +1348,11 @@ | ||
| 1362 | 1348 | "SELECT %s FROM ticket WHERE tkt_uuid='%s'", |
| 1363 | 1349 | zTitleExpr, pManifest->zTicketUuid |
| 1364 | 1350 | ); |
| 1365 | 1351 | if( !isNew ){ |
| 1366 | 1352 | 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 ){ | |
| 1368 | 1354 | zNewStatus = pManifest->aField[i].zValue; |
| 1369 | 1355 | } |
| 1370 | 1356 | } |
| 1371 | 1357 | if( zNewStatus ){ |
| 1372 | 1358 | blob_appendf(&comment, "%h ticket [%.10s]: <i>%s</i>", |
| 1373 | 1359 |
| --- 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 @@ | ||
| 182 | 182 | zTagBase, zDate, (useUtc ? "" : ",'utc'") |
| 183 | 183 | ); |
| 184 | 184 | break; |
| 185 | 185 | } |
| 186 | 186 | } |
| 187 | - if( zUuid==0 && strcmp(zTag, "tip")==0 ){ | |
| 187 | + if( zUuid==0 && fossil_strcmp(zTag, "tip")==0 ){ | |
| 188 | 188 | zUuid = db_text(0, |
| 189 | 189 | "SELECT blob.uuid" |
| 190 | 190 | " FROM event, blob" |
| 191 | 191 | " WHERE event.type='ci'" |
| 192 | 192 | " AND blob.rid=event.objid" |
| 193 | 193 | " ORDER BY event.mtime DESC" |
| 194 | 194 | ); |
| 195 | 195 | } |
| 196 | 196 | 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 ){ | |
| 198 | 198 | 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 ){ | |
| 200 | 201 | zUuid = db_text(0, "SELECT uuid FROM blob WHERE rid=" |
| 201 | 202 | "(SELECT pid FROM plink WHERE cid=%d AND isprim)", |
| 202 | 203 | vid); |
| 203 | - }else if( strcmp(zTag, "next")==0 ){ | |
| 204 | + }else if( fossil_strcmp(zTag, "next")==0 ){ | |
| 204 | 205 | zUuid = db_text(0, "SELECT uuid FROM blob WHERE rid=" |
| 205 | 206 | "(SELECT cid FROM plink WHERE pid=%d AND isprim" |
| 206 | 207 | " ORDER BY mtime DESC)", |
| 207 | 208 | vid); |
| 208 | 209 | } |
| 209 | 210 |
| --- 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 @@ | ||
| 64 | 64 | blob_appendf(&ril, "(by <i>%h</i></i>) ", zOwner); |
| 65 | 65 | } |
| 66 | 66 | if( g.okTktFmt ){ |
| 67 | 67 | blob_appendf(&ril, "[<a href=\"rptedit?rn=%d&copy=1\" rel=\"nofollow\">copy</a>] ", rn); |
| 68 | 68 | } |
| 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 | + ){ | |
| 70 | 72 | blob_appendf(&ril, "[<a href=\"rptedit?rn=%d\" rel=\"nofollow\">edit</a>] ", rn); |
| 71 | 73 | } |
| 72 | 74 | if( g.okTktFmt ){ |
| 73 | 75 | blob_appendf(&ril, "[<a href=\"rptsql?rn=%d\" rel=\"nofollow\">sql</a>] ", rn); |
| 74 | 76 | } |
| @@ -423,11 +425,11 @@ | ||
| 423 | 425 | @ color key is displayed.) Each line contains the text for a single |
| 424 | 426 | @ entry in the key. The first token of each line is the background |
| 425 | 427 | @ color for that line.<br /> |
| 426 | 428 | @ <textarea name="k" rows="8" cols="50">%h(zClrKey)</textarea> |
| 427 | 429 | @ </p> |
| 428 | - if( !g.okAdmin && strcmp(zOwner,g.zLogin)!=0 ){ | |
| 430 | + if( !g.okAdmin && fossil_strcmp(zOwner,g.zLogin)!=0 ){ | |
| 429 | 431 | @ <p>This report format is owned by %h(zOwner). You are not allowed |
| 430 | 432 | @ to change it.</p> |
| 431 | 433 | @ </form> |
| 432 | 434 | report_format_hints(); |
| 433 | 435 | style_footer(); |
| 434 | 436 |
| --- 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&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&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 @@ | ||
| 66 | 66 | "SELECT deleted, isexe, mrid, pathname, coalesce(origname,pathname)" |
| 67 | 67 | " FROM vfile" |
| 68 | 68 | " WHERE vid=%d AND (chnged OR deleted OR origname NOT NULL OR mrid==0)", |
| 69 | 69 | vid |
| 70 | 70 | ); |
| 71 | - if( strcmp(zTreename,".")!=0 ){ | |
| 71 | + if( fossil_strcmp(zTreename,".")!=0 ){ | |
| 72 | 72 | blob_appendf(&sql, |
| 73 | 73 | " AND (pathname GLOB '%q/*' OR origname GLOB '%q/*'" |
| 74 | 74 | " OR pathname=%Q OR origname=%Q)", |
| 75 | 75 | zTreename, zTreename, zTreename, zTreename |
| 76 | 76 | ); |
| @@ -213,11 +213,11 @@ | ||
| 213 | 213 | blob_reset(&a); |
| 214 | 214 | blob_reset(&b); |
| 215 | 215 | blob_reset(&disk); |
| 216 | 216 | } |
| 217 | 217 | blob_reset(&delta); |
| 218 | - if( strcmp(zOrig,zNew)!=0 ){ | |
| 218 | + if( fossil_strcmp(zOrig,zNew)!=0 ){ | |
| 219 | 219 | undo_save(zOrig); |
| 220 | 220 | unlink(zOPath); |
| 221 | 221 | } |
| 222 | 222 | } |
| 223 | 223 | db_finalize(&q); |
| 224 | 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( 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 @@ | ||
| 70 | 70 | ** Compare two submenu items for sorting purposes |
| 71 | 71 | */ |
| 72 | 72 | static int submenuCompare(const void *a, const void *b){ |
| 73 | 73 | const struct Submenu *A = (const struct Submenu*)a; |
| 74 | 74 | const struct Submenu *B = (const struct Submenu*)b; |
| 75 | - return strcmp(A->zLabel, B->zLabel); | |
| 75 | + return fossil_strcmp(A->zLabel, B->zLabel); | |
| 76 | 76 | } |
| 77 | 77 | |
| 78 | 78 | /* |
| 79 | 79 | ** Draw the header. |
| 80 | 80 | */ |
| 81 | 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 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 @@ | ||
| 229 | 229 | db_find_and_open_repository(0, 0); |
| 230 | 230 | if( g.argc!=2 && g.argc!=3 ){ |
| 231 | 231 | usage("remote-url ?URL|off?"); |
| 232 | 232 | } |
| 233 | 233 | if( g.argc==3 ){ |
| 234 | - if( strcmp(g.argv[2],"off")==0 ){ | |
| 234 | + if( fossil_strcmp(g.argv[2],"off")==0 ){ | |
| 235 | 235 | db_unset("last-sync-url", 0); |
| 236 | 236 | db_unset("last-sync-pw", 0); |
| 237 | 237 | }else{ |
| 238 | 238 | url_parse(g.argv[2]); |
| 239 | 239 | if( g.urlUser && g.urlPasswd==0 ){ |
| 240 | 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( 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 @@ | ||
| 227 | 227 | @ <tr><td /><td /><td> |
| 228 | 228 | @ <span class="timelineDisabled">... %d(suppressCnt) similar |
| 229 | 229 | @ event%s(suppressCnt>1?"s":"") omitted.</span></td></tr> |
| 230 | 230 | suppressCnt = 0; |
| 231 | 231 | } |
| 232 | - if( strcmp(zType,"div")==0 ){ | |
| 232 | + if( fossil_strcmp(zType,"div")==0 ){ | |
| 233 | 233 | @ <tr><td colspan="3"><hr /></td></tr> |
| 234 | 234 | continue; |
| 235 | 235 | } |
| 236 | 236 | if( memcmp(zDate, zPrevDate, 10) ){ |
| 237 | 237 | sqlite3_snprintf(sizeof(zPrevDate), zPrevDate, "%.10s", zDate); |
| @@ -1051,11 +1051,11 @@ | ||
| 1051 | 1051 | zBrType = "*BRANCH* "; |
| 1052 | 1052 | } |
| 1053 | 1053 | sqlite3_snprintf(sizeof(zPrefix)-n, &zPrefix[n], zBrType); |
| 1054 | 1054 | n = strlen(zPrefix); |
| 1055 | 1055 | } |
| 1056 | - if( zCurrentUuid && strcmp(zCurrentUuid,zId)==0 ){ | |
| 1056 | + if( fossil_strcmp(zCurrentUuid,zId)==0 ){ | |
| 1057 | 1057 | sqlite3_snprintf(sizeof(zPrefix)-n, &zPrefix[n], "*CURRENT* "); |
| 1058 | 1058 | n += strlen(zPrefix); |
| 1059 | 1059 | } |
| 1060 | 1060 | zFree = sqlite3_mprintf("[%.10s] %s%s", zUuid, zPrefix, zCom); |
| 1061 | 1061 | nLine += comment_print(zFree, 9, 79); |
| 1062 | 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( 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 @@ | ||
| 317 | 317 | char *zFullNewPath; /* Full pathname of dest */ |
| 318 | 318 | char nameChng; /* True if the name changed */ |
| 319 | 319 | |
| 320 | 320 | zFullPath = mprintf("%s%s", g.zLocalRoot, zName); |
| 321 | 321 | zFullNewPath = mprintf("%s%s", g.zLocalRoot, zNewName); |
| 322 | - nameChng = strcmp(zName, zNewName); | |
| 322 | + nameChng = fossil_strcmp(zName, zNewName); | |
| 323 | 323 | if( idv>0 && ridv==0 && idt>0 && ridt>0 ){ |
| 324 | 324 | /* Conflict. This file has been added to the current checkout |
| 325 | 325 | ** but also exists in the target checkout. Use the current version. |
| 326 | 326 | */ |
| 327 | 327 | printf("CONFLICT %s\n", zName); |
| @@ -461,11 +461,11 @@ | ||
| 461 | 461 | pManifest = manifest_get(rid, CFTYPE_MANIFEST); |
| 462 | 462 | |
| 463 | 463 | if( pManifest ){ |
| 464 | 464 | manifest_file_rewind(pManifest); |
| 465 | 465 | while( (pFile = manifest_file_next(pManifest,0))!=0 ){ |
| 466 | - if( strcmp(pFile->zName, file)==0 ){ | |
| 466 | + if( fossil_strcmp(pFile->zName, file)==0 ){ | |
| 467 | 467 | rid = uuid_to_rid(pFile->zUuid, 0); |
| 468 | 468 | manifest_destroy(pManifest); |
| 469 | 469 | return content_get(rid, content); |
| 470 | 470 | } |
| 471 | 471 | } |
| 472 | 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 = 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 @@ | ||
| 141 | 141 | } |
| 142 | 142 | if( g.urlPath[i] ){ |
| 143 | 143 | g.urlPath[i] = 0; |
| 144 | 144 | i++; |
| 145 | 145 | } |
| 146 | - if( strcmp(zName,"fossil")==0 ){ | |
| 146 | + if( fossil_strcmp(zName,"fossil")==0 ){ | |
| 147 | 147 | g.urlFossil = zValue; |
| 148 | 148 | dehttpize(g.urlFossil); |
| 149 | 149 | zExe = mprintf("?fossil=%T", g.urlFossil); |
| 150 | 150 | } |
| 151 | 151 | } |
| 152 | 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( 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 |