Fossil SCM
Fix overlong lines and remove trailing whitespace from non-external C files.
Commit
275da70f8cc6b943752b1273a22b572f51018e01794b395814f9fa7bfdd2005c
Parent
9db696ea7879b81…
89 files changed
+3
-3
+1
-1
+2
-1
+1
-1
+3
-3
+11
-11
+4
-3
+4
-3
+4
-4
+2
-2
+1
-1
+5
-5
+6
-6
+2
-2
+1
-1
+1
-1
+13
-12
+9
-8
+14
-14
+16
-15
+4
-4
+4
-4
+8
-8
+1
-1
+10
-10
+4
-4
+3
-3
+7
-7
+1
-1
+3
-3
+4
-4
+49
-30
+9
-6
+3
-2
+2
-2
+15
-10
+4
-2
+2
-1
+20
-11
+2
-1
+11
-8
+11
-11
+1
-1
+7
-7
+3
-3
+4
-3
+2
-2
+2
-2
+1
-1
+4
-4
+13
-13
+2
-2
+3
-2
+3
-2
+9
-7
+2
-2
+7
-7
+3
-3
+1
-1
+2
-1
+2
-2
+2
-2
+2
-2
+1
-1
+12
-12
+1
-1
+13
-13
+3
-3
+2
-2
+2
-1
+2
-1
+6
-3
+20
-16
+2
-2
+2
-1
+1
-1
+3
-3
+2
-1
+5
-4
+12
-11
+1
-1
+7
-7
+4
-4
+17
-17
+1
-1
+4
-2
+1
-1
+2
-2
+4
-2
~
src/alerts.c
~
src/allrepo.c
~
src/attach.c
~
src/backlink.c
~
src/backoffice.c
~
src/blob.c
~
src/branch.c
~
src/browse.c
~
src/builtin.c
~
src/cache.c
~
src/capabilities.c
~
src/cgi.c
~
src/chat.c
~
src/checkin.c
~
src/clone.c
~
src/cookies.c
~
src/db.c
~
src/diff.c
~
src/diffcmd.c
~
src/dispatch.c
~
src/doc.c
~
src/etag.c
~
src/export.c
~
src/file.c
~
src/fileedit.c
~
src/graph.c
~
src/http.c
~
src/http_ssl.c
~
src/import.c
~
src/info.c
~
src/interwiki.c
~
src/json.c
~
src/json_artifact.c
~
src/json_branch.c
~
src/json_config.c
~
src/json_finfo.c
~
src/json_login.c
~
src/json_tag.c
~
src/json_timeline.c
~
src/json_user.c
~
src/json_wiki.c
~
src/login.c
~
src/lookslike.c
~
src/main.c
~
src/manifest.c
~
src/markdown.c
~
src/markdown_html.c
~
src/merge.c
~
src/merge3.c
~
src/name.c
~
src/patch.c
~
src/pikchrshow.c
~
src/rebuild.c
~
src/report.c
~
src/rss.c
~
src/search.c
~
src/security_audit.c
~
src/setup.c
~
src/setupuser.c
~
src/sha1.c
~
src/sitemap.c
~
src/skins.c
~
src/smtp.c
~
src/sqlcmd.c
~
src/stat.c
~
src/statrep.c
~
src/style.c
~
src/sync.c
~
src/tag.c
~
src/tar.c
~
src/th_main.c
~
src/th_tcl.c
~
src/timeline.c
~
src/tkt.c
~
src/unicode.c
~
src/update.c
~
src/url.c
~
src/user.c
~
src/vfile.c
~
src/wiki.c
~
src/wikiformat.c
~
src/winhttp.c
~
src/xfer.c
~
src/zip.c
~
tools/codecheck1.c
~
tools/makeheaders.c
~
tools/mkindex.c
~
tools/skintxt2config.c
~
tools/sqlcompattest.c
+3
-3
| --- src/alerts.c | ||
| +++ src/alerts.c | ||
| @@ -1460,11 +1460,11 @@ | ||
| 1460 | 1460 | } |
| 1461 | 1461 | |
| 1462 | 1462 | /* |
| 1463 | 1463 | ** Text of email message sent in order to confirm a subscription. |
| 1464 | 1464 | */ |
| 1465 | -static const char zConfirmMsg[] = | |
| 1465 | +static const char zConfirmMsg[] = | |
| 1466 | 1466 | @ Someone has signed you up for email alerts on the Fossil repository |
| 1467 | 1467 | @ at %s. |
| 1468 | 1468 | @ |
| 1469 | 1469 | @ To confirm your subscription and begin receiving alerts, click on |
| 1470 | 1470 | @ the following hyperlink: |
| @@ -2563,11 +2563,11 @@ | ||
| 2563 | 2563 | /* |
| 2564 | 2564 | ** Compute a string that is appropriate for the EmailEvent.zPriors field |
| 2565 | 2565 | ** for a particular forum post. |
| 2566 | 2566 | ** |
| 2567 | 2567 | ** This string is an encode list of sender names and rids for all ancestors |
| 2568 | -** of the fpdi post - the post that fpid answer, the post that that parent | |
| 2568 | +** of the fpdi post - the post that fpid answer, the post that that parent | |
| 2569 | 2569 | ** post answers, and so forth back up to the root post. Duplicates sender |
| 2570 | 2570 | ** names are omitted. |
| 2571 | 2571 | ** |
| 2572 | 2572 | ** The EmailEvent.zPriors field is used to screen events for people who |
| 2573 | 2573 | ** only want to see replies to their own posts or to specific posts. |
| @@ -3223,11 +3223,11 @@ | ||
| 3223 | 3223 | db_multi_exec("DELETE FROM pending_alert WHERE sentDigest AND sentSep;"); |
| 3224 | 3224 | |
| 3225 | 3225 | /* Send renewal messages to subscribers whose subscriptions are about |
| 3226 | 3226 | ** to expire. Only do this if: |
| 3227 | 3227 | ** |
| 3228 | - ** (1) email-renew-interval is 14 or greater (or in other words if | |
| 3228 | + ** (1) email-renew-interval is 14 or greater (or in other words if | |
| 3229 | 3229 | ** subscription expiration is enabled). |
| 3230 | 3230 | ** |
| 3231 | 3231 | ** (2) The SENDALERT_RENEWAL flag is set |
| 3232 | 3232 | */ |
| 3233 | 3233 | send_alert_expiration_warnings: |
| 3234 | 3234 |
| --- src/alerts.c | |
| +++ src/alerts.c | |
| @@ -1460,11 +1460,11 @@ | |
| 1460 | } |
| 1461 | |
| 1462 | /* |
| 1463 | ** Text of email message sent in order to confirm a subscription. |
| 1464 | */ |
| 1465 | static const char zConfirmMsg[] = |
| 1466 | @ Someone has signed you up for email alerts on the Fossil repository |
| 1467 | @ at %s. |
| 1468 | @ |
| 1469 | @ To confirm your subscription and begin receiving alerts, click on |
| 1470 | @ the following hyperlink: |
| @@ -2563,11 +2563,11 @@ | |
| 2563 | /* |
| 2564 | ** Compute a string that is appropriate for the EmailEvent.zPriors field |
| 2565 | ** for a particular forum post. |
| 2566 | ** |
| 2567 | ** This string is an encode list of sender names and rids for all ancestors |
| 2568 | ** of the fpdi post - the post that fpid answer, the post that that parent |
| 2569 | ** post answers, and so forth back up to the root post. Duplicates sender |
| 2570 | ** names are omitted. |
| 2571 | ** |
| 2572 | ** The EmailEvent.zPriors field is used to screen events for people who |
| 2573 | ** only want to see replies to their own posts or to specific posts. |
| @@ -3223,11 +3223,11 @@ | |
| 3223 | db_multi_exec("DELETE FROM pending_alert WHERE sentDigest AND sentSep;"); |
| 3224 | |
| 3225 | /* Send renewal messages to subscribers whose subscriptions are about |
| 3226 | ** to expire. Only do this if: |
| 3227 | ** |
| 3228 | ** (1) email-renew-interval is 14 or greater (or in other words if |
| 3229 | ** subscription expiration is enabled). |
| 3230 | ** |
| 3231 | ** (2) The SENDALERT_RENEWAL flag is set |
| 3232 | */ |
| 3233 | send_alert_expiration_warnings: |
| 3234 |
| --- src/alerts.c | |
| +++ src/alerts.c | |
| @@ -1460,11 +1460,11 @@ | |
| 1460 | } |
| 1461 | |
| 1462 | /* |
| 1463 | ** Text of email message sent in order to confirm a subscription. |
| 1464 | */ |
| 1465 | static const char zConfirmMsg[] = |
| 1466 | @ Someone has signed you up for email alerts on the Fossil repository |
| 1467 | @ at %s. |
| 1468 | @ |
| 1469 | @ To confirm your subscription and begin receiving alerts, click on |
| 1470 | @ the following hyperlink: |
| @@ -2563,11 +2563,11 @@ | |
| 2563 | /* |
| 2564 | ** Compute a string that is appropriate for the EmailEvent.zPriors field |
| 2565 | ** for a particular forum post. |
| 2566 | ** |
| 2567 | ** This string is an encode list of sender names and rids for all ancestors |
| 2568 | ** of the fpdi post - the post that fpid answer, the post that that parent |
| 2569 | ** post answers, and so forth back up to the root post. Duplicates sender |
| 2570 | ** names are omitted. |
| 2571 | ** |
| 2572 | ** The EmailEvent.zPriors field is used to screen events for people who |
| 2573 | ** only want to see replies to their own posts or to specific posts. |
| @@ -3223,11 +3223,11 @@ | |
| 3223 | db_multi_exec("DELETE FROM pending_alert WHERE sentDigest AND sentSep;"); |
| 3224 | |
| 3225 | /* Send renewal messages to subscribers whose subscriptions are about |
| 3226 | ** to expire. Only do this if: |
| 3227 | ** |
| 3228 | ** (1) email-renew-interval is 14 or greater (or in other words if |
| 3229 | ** subscription expiration is enabled). |
| 3230 | ** |
| 3231 | ** (2) The SENDALERT_RENEWAL flag is set |
| 3232 | */ |
| 3233 | send_alert_expiration_warnings: |
| 3234 |
+1
-1
| --- src/allrepo.c | ||
| +++ src/allrepo.c | ||
| @@ -134,11 +134,11 @@ | ||
| 134 | 134 | ** but bind to the loopback TCP address only, enable |
| 135 | 135 | ** the --localauth option and automatically launch a |
| 136 | 136 | ** web-browser |
| 137 | 137 | ** |
| 138 | 138 | ** whatis Run the "whatis" command on all repositories. Only |
| 139 | -** show output for repositories that have a match. | |
| 139 | +** show output for repositories that have a match. | |
| 140 | 140 | ** |
| 141 | 141 | ** |
| 142 | 142 | ** In addition, the following maintenance operations are supported: |
| 143 | 143 | ** |
| 144 | 144 | ** add Add all the repositories named to the set of repositories |
| 145 | 145 |
| --- src/allrepo.c | |
| +++ src/allrepo.c | |
| @@ -134,11 +134,11 @@ | |
| 134 | ** but bind to the loopback TCP address only, enable |
| 135 | ** the --localauth option and automatically launch a |
| 136 | ** web-browser |
| 137 | ** |
| 138 | ** whatis Run the "whatis" command on all repositories. Only |
| 139 | ** show output for repositories that have a match. |
| 140 | ** |
| 141 | ** |
| 142 | ** In addition, the following maintenance operations are supported: |
| 143 | ** |
| 144 | ** add Add all the repositories named to the set of repositories |
| 145 |
| --- src/allrepo.c | |
| +++ src/allrepo.c | |
| @@ -134,11 +134,11 @@ | |
| 134 | ** but bind to the loopback TCP address only, enable |
| 135 | ** the --localauth option and automatically launch a |
| 136 | ** web-browser |
| 137 | ** |
| 138 | ** whatis Run the "whatis" command on all repositories. Only |
| 139 | ** show output for repositories that have a match. |
| 140 | ** |
| 141 | ** |
| 142 | ** In addition, the following maintenance operations are supported: |
| 143 | ** |
| 144 | ** add Add all the repositories named to the set of repositories |
| 145 |
+2
-1
| --- src/attach.c | ||
| +++ src/attach.c | ||
| @@ -750,11 +750,12 @@ | ||
| 750 | 750 | } |
| 751 | 751 | if( zBody==0 ){ |
| 752 | 752 | fossil_fatal("technote [%s] not found",zETime); |
| 753 | 753 | } |
| 754 | 754 | zTarget = db_text(0, |
| 755 | - "SELECT substr(tagname,7) FROM tag WHERE tagid=(SELECT tagid FROM event WHERE objid='%d')", | |
| 755 | + "SELECT substr(tagname,7) FROM tag " | |
| 756 | + " WHERE tagid=(SELECT tagid FROM event WHERE objid='%d')", | |
| 756 | 757 | rid |
| 757 | 758 | ); |
| 758 | 759 | zFile = g.argv[3]; |
| 759 | 760 | } |
| 760 | 761 | blob_read_from_file(&content, zFile, ExtFILE); |
| 761 | 762 |
| --- src/attach.c | |
| +++ src/attach.c | |
| @@ -750,11 +750,12 @@ | |
| 750 | } |
| 751 | if( zBody==0 ){ |
| 752 | fossil_fatal("technote [%s] not found",zETime); |
| 753 | } |
| 754 | zTarget = db_text(0, |
| 755 | "SELECT substr(tagname,7) FROM tag WHERE tagid=(SELECT tagid FROM event WHERE objid='%d')", |
| 756 | rid |
| 757 | ); |
| 758 | zFile = g.argv[3]; |
| 759 | } |
| 760 | blob_read_from_file(&content, zFile, ExtFILE); |
| 761 |
| --- src/attach.c | |
| +++ src/attach.c | |
| @@ -750,11 +750,12 @@ | |
| 750 | } |
| 751 | if( zBody==0 ){ |
| 752 | fossil_fatal("technote [%s] not found",zETime); |
| 753 | } |
| 754 | zTarget = db_text(0, |
| 755 | "SELECT substr(tagname,7) FROM tag " |
| 756 | " WHERE tagid=(SELECT tagid FROM event WHERE objid='%d')", |
| 757 | rid |
| 758 | ); |
| 759 | zFile = g.argv[3]; |
| 760 | } |
| 761 | blob_read_from_file(&content, zFile, ExtFILE); |
| 762 |
+1
-1
| --- src/backlink.c | ||
| +++ src/backlink.c | ||
| @@ -249,11 +249,11 @@ | ||
| 249 | 249 | Backlink *p = (Backlink*)opaque; |
| 250 | 250 | char *zTarget = blob_buffer(target); |
| 251 | 251 | int nTarget = blob_size(target); |
| 252 | 252 | |
| 253 | 253 | backlink_create(p, zTarget, nTarget); |
| 254 | - return 1; | |
| 254 | + return 1; | |
| 255 | 255 | } |
| 256 | 256 | |
| 257 | 257 | /* No-op routines for the rendering callbacks that we do not need */ |
| 258 | 258 | static void mkdn_noop_prolog(Blob *b, void *v){ return; } |
| 259 | 259 | static void (*mkdn_noop_epilog)(Blob*, void*) = mkdn_noop_prolog; |
| 260 | 260 |
| --- src/backlink.c | |
| +++ src/backlink.c | |
| @@ -249,11 +249,11 @@ | |
| 249 | Backlink *p = (Backlink*)opaque; |
| 250 | char *zTarget = blob_buffer(target); |
| 251 | int nTarget = blob_size(target); |
| 252 | |
| 253 | backlink_create(p, zTarget, nTarget); |
| 254 | return 1; |
| 255 | } |
| 256 | |
| 257 | /* No-op routines for the rendering callbacks that we do not need */ |
| 258 | static void mkdn_noop_prolog(Blob *b, void *v){ return; } |
| 259 | static void (*mkdn_noop_epilog)(Blob*, void*) = mkdn_noop_prolog; |
| 260 |
| --- src/backlink.c | |
| +++ src/backlink.c | |
| @@ -249,11 +249,11 @@ | |
| 249 | Backlink *p = (Backlink*)opaque; |
| 250 | char *zTarget = blob_buffer(target); |
| 251 | int nTarget = blob_size(target); |
| 252 | |
| 253 | backlink_create(p, zTarget, nTarget); |
| 254 | return 1; |
| 255 | } |
| 256 | |
| 257 | /* No-op routines for the rendering callbacks that we do not need */ |
| 258 | static void mkdn_noop_prolog(Blob *b, void *v){ return; } |
| 259 | static void (*mkdn_noop_epilog)(Blob*, void*) = mkdn_noop_prolog; |
| 260 |
+3
-3
| --- src/backoffice.c | ||
| +++ src/backoffice.c | ||
| @@ -315,11 +315,11 @@ | ||
| 315 | 315 | static int backofficeProcessExists(sqlite3_uint64 pid){ |
| 316 | 316 | #if defined(_WIN32) |
| 317 | 317 | return pid>0 && backofficeWin32ProcessExists((DWORD)pid)!=0; |
| 318 | 318 | #else |
| 319 | 319 | return pid>0 && kill((pid_t)pid, 0)==0; |
| 320 | -#endif | |
| 320 | +#endif | |
| 321 | 321 | } |
| 322 | 322 | |
| 323 | 323 | /* |
| 324 | 324 | ** Check to see if the process identified by pid has finished. If |
| 325 | 325 | ** we cannot prove that the process is still running, return true. |
| @@ -327,11 +327,11 @@ | ||
| 327 | 327 | static int backofficeProcessDone(sqlite3_uint64 pid){ |
| 328 | 328 | #if defined(_WIN32) |
| 329 | 329 | return pid<=0 || backofficeWin32ProcessExists((DWORD)pid)==0; |
| 330 | 330 | #else |
| 331 | 331 | return pid<=0 || kill((pid_t)pid, 0)!=0; |
| 332 | -#endif | |
| 332 | +#endif | |
| 333 | 333 | } |
| 334 | 334 | |
| 335 | 335 | /* |
| 336 | 336 | ** Return a process id number for the current process |
| 337 | 337 | */ |
| @@ -675,11 +675,11 @@ | ||
| 675 | 675 | ** to run this command as a daemon that will periodically invoke backoffice |
| 676 | 676 | ** on a collection of repositories. |
| 677 | 677 | ** |
| 678 | 678 | ** If only a single repository is named and --poll is omitted, then the |
| 679 | 679 | ** backoffice work is done in-process. But if there are multiple repositories |
| 680 | -** or if --poll is used, a separate sub-process is started for each poll of | |
| 680 | +** or if --poll is used, a separate sub-process is started for each poll of | |
| 681 | 681 | ** each repository. |
| 682 | 682 | ** |
| 683 | 683 | ** Standard options: |
| 684 | 684 | ** |
| 685 | 685 | ** --debug Show what this command is doing |
| 686 | 686 |
| --- src/backoffice.c | |
| +++ src/backoffice.c | |
| @@ -315,11 +315,11 @@ | |
| 315 | static int backofficeProcessExists(sqlite3_uint64 pid){ |
| 316 | #if defined(_WIN32) |
| 317 | return pid>0 && backofficeWin32ProcessExists((DWORD)pid)!=0; |
| 318 | #else |
| 319 | return pid>0 && kill((pid_t)pid, 0)==0; |
| 320 | #endif |
| 321 | } |
| 322 | |
| 323 | /* |
| 324 | ** Check to see if the process identified by pid has finished. If |
| 325 | ** we cannot prove that the process is still running, return true. |
| @@ -327,11 +327,11 @@ | |
| 327 | static int backofficeProcessDone(sqlite3_uint64 pid){ |
| 328 | #if defined(_WIN32) |
| 329 | return pid<=0 || backofficeWin32ProcessExists((DWORD)pid)==0; |
| 330 | #else |
| 331 | return pid<=0 || kill((pid_t)pid, 0)!=0; |
| 332 | #endif |
| 333 | } |
| 334 | |
| 335 | /* |
| 336 | ** Return a process id number for the current process |
| 337 | */ |
| @@ -675,11 +675,11 @@ | |
| 675 | ** to run this command as a daemon that will periodically invoke backoffice |
| 676 | ** on a collection of repositories. |
| 677 | ** |
| 678 | ** If only a single repository is named and --poll is omitted, then the |
| 679 | ** backoffice work is done in-process. But if there are multiple repositories |
| 680 | ** or if --poll is used, a separate sub-process is started for each poll of |
| 681 | ** each repository. |
| 682 | ** |
| 683 | ** Standard options: |
| 684 | ** |
| 685 | ** --debug Show what this command is doing |
| 686 |
| --- src/backoffice.c | |
| +++ src/backoffice.c | |
| @@ -315,11 +315,11 @@ | |
| 315 | static int backofficeProcessExists(sqlite3_uint64 pid){ |
| 316 | #if defined(_WIN32) |
| 317 | return pid>0 && backofficeWin32ProcessExists((DWORD)pid)!=0; |
| 318 | #else |
| 319 | return pid>0 && kill((pid_t)pid, 0)==0; |
| 320 | #endif |
| 321 | } |
| 322 | |
| 323 | /* |
| 324 | ** Check to see if the process identified by pid has finished. If |
| 325 | ** we cannot prove that the process is still running, return true. |
| @@ -327,11 +327,11 @@ | |
| 327 | static int backofficeProcessDone(sqlite3_uint64 pid){ |
| 328 | #if defined(_WIN32) |
| 329 | return pid<=0 || backofficeWin32ProcessExists((DWORD)pid)==0; |
| 330 | #else |
| 331 | return pid<=0 || kill((pid_t)pid, 0)!=0; |
| 332 | #endif |
| 333 | } |
| 334 | |
| 335 | /* |
| 336 | ** Return a process id number for the current process |
| 337 | */ |
| @@ -675,11 +675,11 @@ | |
| 675 | ** to run this command as a daemon that will periodically invoke backoffice |
| 676 | ** on a collection of repositories. |
| 677 | ** |
| 678 | ** If only a single repository is named and --poll is omitted, then the |
| 679 | ** backoffice work is done in-process. But if there are multiple repositories |
| 680 | ** or if --poll is used, a separate sub-process is started for each poll of |
| 681 | ** each repository. |
| 682 | ** |
| 683 | ** Standard options: |
| 684 | ** |
| 685 | ** --debug Show what this command is doing |
| 686 |
+11
-11
| --- src/blob.c | ||
| +++ src/blob.c | ||
| @@ -1551,19 +1551,19 @@ | ||
| 1551 | 1551 | } |
| 1552 | 1552 | } |
| 1553 | 1553 | |
| 1554 | 1554 | /* |
| 1555 | 1555 | ** ASCII (for reference): |
| 1556 | -** x0 x1 x2 x3 x4 x5 x6 x7 x8 x9 xa xb xc xd xe xf | |
| 1557 | -** 0x ^` ^a ^b ^c ^d ^e ^f ^g \b \t \n () \f \r ^n ^o | |
| 1558 | -** 1x ^p ^q ^r ^s ^t ^u ^v ^w ^x ^y ^z ^{ ^| ^} ^~ ^ | |
| 1559 | -** 2x () ! " # $ % & ' ( ) * + , - . / | |
| 1560 | -** 3x 0 1 2 3 4 5 6 7 8 9 : ; < = > ? | |
| 1561 | -** 4x @ A B C D E F G H I J K L M N O | |
| 1562 | -** 5x P Q R S T U V W X Y Z [ \ ] ^ _ | |
| 1563 | -** 6x ` a b c d e f g h i j k l m n o | |
| 1564 | -** 7x p q r s t u v w x y z { | } ~ ^_ | |
| 1556 | +** x0 x1 x2 x3 x4 x5 x6 x7 x8 x9 xa xb xc xd xe xf | |
| 1557 | +** 0x ^` ^a ^b ^c ^d ^e ^f ^g \b \t \n () \f \r ^n ^o | |
| 1558 | +** 1x ^p ^q ^r ^s ^t ^u ^v ^w ^x ^y ^z ^{ ^| ^} ^~ ^ | |
| 1559 | +** 2x () ! " # $ % & ' ( ) * + , - . / | |
| 1560 | +** 3x 0 1 2 3 4 5 6 7 8 9 : ; < = > ? | |
| 1561 | +** 4x @ A B C D E F G H I J K L M N O | |
| 1562 | +** 5x P Q R S T U V W X Y Z [ \ ] ^ _ | |
| 1563 | +** 6x ` a b c d e f g h i j k l m n o | |
| 1564 | +** 7x p q r s t u v w x y z { | } ~ ^_ | |
| 1565 | 1565 | */ |
| 1566 | 1566 | |
| 1567 | 1567 | /* |
| 1568 | 1568 | ** Meanings for bytes in a filename: |
| 1569 | 1569 | ** |
| @@ -1665,11 +1665,11 @@ | ||
| 1665 | 1665 | "an illegal UTF-8 character", |
| 1666 | 1666 | zIn, blob_str(&bad)); |
| 1667 | 1667 | } |
| 1668 | 1668 | i += x-2; |
| 1669 | 1669 | } |
| 1670 | - } | |
| 1670 | + } | |
| 1671 | 1671 | } |
| 1672 | 1672 | |
| 1673 | 1673 | /* Separate from the previous argument by a space */ |
| 1674 | 1674 | if( n>0 && !fossil_isspace(z[n-1]) ){ |
| 1675 | 1675 | blob_append_char(pBlob, ' '); |
| @@ -1795,11 +1795,11 @@ | ||
| 1795 | 1795 | if( zBuf[0]=='-' && zArg[0]=='.' && zArg[1]=='\\' ) zArg += 2; |
| 1796 | 1796 | #else |
| 1797 | 1797 | if( zBuf[0]=='-' && zArg[0]=='.' && zArg[1]=='/' ) zArg += 2; |
| 1798 | 1798 | #endif |
| 1799 | 1799 | if( strcmp(zBuf, zArg)!=0 ){ |
| 1800 | - fossil_fatal("argument disagree: \"%s\" (%s) versus \"%s\"", | |
| 1800 | + fossil_fatal("argument disagree: \"%s\" (%s) versus \"%s\"", | |
| 1801 | 1801 | zBuf, g.argv[i-1], zArg); |
| 1802 | 1802 | } |
| 1803 | 1803 | continue; |
| 1804 | 1804 | }else if( fossil_strcmp(zArg, "--fuzz")==0 && i+1<g.argc ){ |
| 1805 | 1805 | int n = atoi(g.argv[++i]); |
| 1806 | 1806 |
| --- src/blob.c | |
| +++ src/blob.c | |
| @@ -1551,19 +1551,19 @@ | |
| 1551 | } |
| 1552 | } |
| 1553 | |
| 1554 | /* |
| 1555 | ** ASCII (for reference): |
| 1556 | ** x0 x1 x2 x3 x4 x5 x6 x7 x8 x9 xa xb xc xd xe xf |
| 1557 | ** 0x ^` ^a ^b ^c ^d ^e ^f ^g \b \t \n () \f \r ^n ^o |
| 1558 | ** 1x ^p ^q ^r ^s ^t ^u ^v ^w ^x ^y ^z ^{ ^| ^} ^~ ^ |
| 1559 | ** 2x () ! " # $ % & ' ( ) * + , - . / |
| 1560 | ** 3x 0 1 2 3 4 5 6 7 8 9 : ; < = > ? |
| 1561 | ** 4x @ A B C D E F G H I J K L M N O |
| 1562 | ** 5x P Q R S T U V W X Y Z [ \ ] ^ _ |
| 1563 | ** 6x ` a b c d e f g h i j k l m n o |
| 1564 | ** 7x p q r s t u v w x y z { | } ~ ^_ |
| 1565 | */ |
| 1566 | |
| 1567 | /* |
| 1568 | ** Meanings for bytes in a filename: |
| 1569 | ** |
| @@ -1665,11 +1665,11 @@ | |
| 1665 | "an illegal UTF-8 character", |
| 1666 | zIn, blob_str(&bad)); |
| 1667 | } |
| 1668 | i += x-2; |
| 1669 | } |
| 1670 | } |
| 1671 | } |
| 1672 | |
| 1673 | /* Separate from the previous argument by a space */ |
| 1674 | if( n>0 && !fossil_isspace(z[n-1]) ){ |
| 1675 | blob_append_char(pBlob, ' '); |
| @@ -1795,11 +1795,11 @@ | |
| 1795 | if( zBuf[0]=='-' && zArg[0]=='.' && zArg[1]=='\\' ) zArg += 2; |
| 1796 | #else |
| 1797 | if( zBuf[0]=='-' && zArg[0]=='.' && zArg[1]=='/' ) zArg += 2; |
| 1798 | #endif |
| 1799 | if( strcmp(zBuf, zArg)!=0 ){ |
| 1800 | fossil_fatal("argument disagree: \"%s\" (%s) versus \"%s\"", |
| 1801 | zBuf, g.argv[i-1], zArg); |
| 1802 | } |
| 1803 | continue; |
| 1804 | }else if( fossil_strcmp(zArg, "--fuzz")==0 && i+1<g.argc ){ |
| 1805 | int n = atoi(g.argv[++i]); |
| 1806 |
| --- src/blob.c | |
| +++ src/blob.c | |
| @@ -1551,19 +1551,19 @@ | |
| 1551 | } |
| 1552 | } |
| 1553 | |
| 1554 | /* |
| 1555 | ** ASCII (for reference): |
| 1556 | ** x0 x1 x2 x3 x4 x5 x6 x7 x8 x9 xa xb xc xd xe xf |
| 1557 | ** 0x ^` ^a ^b ^c ^d ^e ^f ^g \b \t \n () \f \r ^n ^o |
| 1558 | ** 1x ^p ^q ^r ^s ^t ^u ^v ^w ^x ^y ^z ^{ ^| ^} ^~ ^ |
| 1559 | ** 2x () ! " # $ % & ' ( ) * + , - . / |
| 1560 | ** 3x 0 1 2 3 4 5 6 7 8 9 : ; < = > ? |
| 1561 | ** 4x @ A B C D E F G H I J K L M N O |
| 1562 | ** 5x P Q R S T U V W X Y Z [ \ ] ^ _ |
| 1563 | ** 6x ` a b c d e f g h i j k l m n o |
| 1564 | ** 7x p q r s t u v w x y z { | } ~ ^_ |
| 1565 | */ |
| 1566 | |
| 1567 | /* |
| 1568 | ** Meanings for bytes in a filename: |
| 1569 | ** |
| @@ -1665,11 +1665,11 @@ | |
| 1665 | "an illegal UTF-8 character", |
| 1666 | zIn, blob_str(&bad)); |
| 1667 | } |
| 1668 | i += x-2; |
| 1669 | } |
| 1670 | } |
| 1671 | } |
| 1672 | |
| 1673 | /* Separate from the previous argument by a space */ |
| 1674 | if( n>0 && !fossil_isspace(z[n-1]) ){ |
| 1675 | blob_append_char(pBlob, ' '); |
| @@ -1795,11 +1795,11 @@ | |
| 1795 | if( zBuf[0]=='-' && zArg[0]=='.' && zArg[1]=='\\' ) zArg += 2; |
| 1796 | #else |
| 1797 | if( zBuf[0]=='-' && zArg[0]=='.' && zArg[1]=='/' ) zArg += 2; |
| 1798 | #endif |
| 1799 | if( strcmp(zBuf, zArg)!=0 ){ |
| 1800 | fossil_fatal("argument disagree: \"%s\" (%s) versus \"%s\"", |
| 1801 | zBuf, g.argv[i-1], zArg); |
| 1802 | } |
| 1803 | continue; |
| 1804 | }else if( fossil_strcmp(zArg, "--fuzz")==0 && i+1<g.argc ){ |
| 1805 | int n = atoi(g.argv[++i]); |
| 1806 |
+4
-3
| --- src/branch.c | ||
| +++ src/branch.c | ||
| @@ -340,11 +340,12 @@ | ||
| 340 | 340 | ); |
| 341 | 341 | break; |
| 342 | 342 | } |
| 343 | 343 | case BRL_OPEN_ONLY: { |
| 344 | 344 | blob_append_sql(&sql, |
| 345 | - "SELECT name, isprivate, mtime, mergeto FROM tmp_brlist WHERE NOT isclosed" | |
| 345 | + "SELECT name, isprivate, mtime, mergeto FROM tmp_brlist " | |
| 346 | + " WHERE NOT isclosed" | |
| 346 | 347 | ); |
| 347 | 348 | break; |
| 348 | 349 | } |
| 349 | 350 | } |
| 350 | 351 | if( brFlags & BRL_PRIVATE ) blob_append_sql(&sql, " AND isprivate"); |
| @@ -772,11 +773,11 @@ | ||
| 772 | 773 | int isCur = zCurrent!=0 && fossil_strcmp(zCurrent,zBr)==0; |
| 773 | 774 | const char *zUsers = db_column_text(&q, 3); |
| 774 | 775 | if( (brFlags & BRL_MERGED) && fossil_strcmp(zCurrent,zMergeTo)!=0 ){ |
| 775 | 776 | continue; |
| 776 | 777 | } |
| 777 | - if( (brFlags & BRL_UNMERGED) && (fossil_strcmp(zCurrent,zMergeTo)==0 | |
| 778 | + if( (brFlags & BRL_UNMERGED) && (fossil_strcmp(zCurrent,zMergeTo)==0 | |
| 778 | 779 | || isCur) ){ |
| 779 | 780 | continue; |
| 780 | 781 | } |
| 781 | 782 | blob_appendf(&txt, "%s%s%s", |
| 782 | 783 | ( (brFlags & BRL_PRIVATE) ? " " : ( isPriv ? "#" : " ") ), |
| @@ -886,11 +887,11 @@ | ||
| 886 | 887 | if( zBgClr && zBgClr[0] && show_colors ){ |
| 887 | 888 | @ <tr style="background-color:%s(zBgClr)"> |
| 888 | 889 | }else{ |
| 889 | 890 | @ <tr> |
| 890 | 891 | } |
| 891 | - @ <td>%z(href("%R/timeline?r=%T",zBranch))%h(zBranch)</a><input | |
| 892 | + @ <td>%z(href("%R/timeline?r=%T",zBranch))%h(zBranch)</a><input | |
| 892 | 893 | @ type="checkbox" disabled="disabled"/></td> |
| 893 | 894 | @ <td data-sortkey="%016llx(iMtime)">%s(zAge)</td> |
| 894 | 895 | @ <td>%d(nCkin)</td> |
| 895 | 896 | fossil_free(zAge); |
| 896 | 897 | @ <td>%s(isClosed?"closed":"")</td> |
| 897 | 898 |
| --- src/branch.c | |
| +++ src/branch.c | |
| @@ -340,11 +340,12 @@ | |
| 340 | ); |
| 341 | break; |
| 342 | } |
| 343 | case BRL_OPEN_ONLY: { |
| 344 | blob_append_sql(&sql, |
| 345 | "SELECT name, isprivate, mtime, mergeto FROM tmp_brlist WHERE NOT isclosed" |
| 346 | ); |
| 347 | break; |
| 348 | } |
| 349 | } |
| 350 | if( brFlags & BRL_PRIVATE ) blob_append_sql(&sql, " AND isprivate"); |
| @@ -772,11 +773,11 @@ | |
| 772 | int isCur = zCurrent!=0 && fossil_strcmp(zCurrent,zBr)==0; |
| 773 | const char *zUsers = db_column_text(&q, 3); |
| 774 | if( (brFlags & BRL_MERGED) && fossil_strcmp(zCurrent,zMergeTo)!=0 ){ |
| 775 | continue; |
| 776 | } |
| 777 | if( (brFlags & BRL_UNMERGED) && (fossil_strcmp(zCurrent,zMergeTo)==0 |
| 778 | || isCur) ){ |
| 779 | continue; |
| 780 | } |
| 781 | blob_appendf(&txt, "%s%s%s", |
| 782 | ( (brFlags & BRL_PRIVATE) ? " " : ( isPriv ? "#" : " ") ), |
| @@ -886,11 +887,11 @@ | |
| 886 | if( zBgClr && zBgClr[0] && show_colors ){ |
| 887 | @ <tr style="background-color:%s(zBgClr)"> |
| 888 | }else{ |
| 889 | @ <tr> |
| 890 | } |
| 891 | @ <td>%z(href("%R/timeline?r=%T",zBranch))%h(zBranch)</a><input |
| 892 | @ type="checkbox" disabled="disabled"/></td> |
| 893 | @ <td data-sortkey="%016llx(iMtime)">%s(zAge)</td> |
| 894 | @ <td>%d(nCkin)</td> |
| 895 | fossil_free(zAge); |
| 896 | @ <td>%s(isClosed?"closed":"")</td> |
| 897 |
| --- src/branch.c | |
| +++ src/branch.c | |
| @@ -340,11 +340,12 @@ | |
| 340 | ); |
| 341 | break; |
| 342 | } |
| 343 | case BRL_OPEN_ONLY: { |
| 344 | blob_append_sql(&sql, |
| 345 | "SELECT name, isprivate, mtime, mergeto FROM tmp_brlist " |
| 346 | " WHERE NOT isclosed" |
| 347 | ); |
| 348 | break; |
| 349 | } |
| 350 | } |
| 351 | if( brFlags & BRL_PRIVATE ) blob_append_sql(&sql, " AND isprivate"); |
| @@ -772,11 +773,11 @@ | |
| 773 | int isCur = zCurrent!=0 && fossil_strcmp(zCurrent,zBr)==0; |
| 774 | const char *zUsers = db_column_text(&q, 3); |
| 775 | if( (brFlags & BRL_MERGED) && fossil_strcmp(zCurrent,zMergeTo)!=0 ){ |
| 776 | continue; |
| 777 | } |
| 778 | if( (brFlags & BRL_UNMERGED) && (fossil_strcmp(zCurrent,zMergeTo)==0 |
| 779 | || isCur) ){ |
| 780 | continue; |
| 781 | } |
| 782 | blob_appendf(&txt, "%s%s%s", |
| 783 | ( (brFlags & BRL_PRIVATE) ? " " : ( isPriv ? "#" : " ") ), |
| @@ -886,11 +887,11 @@ | |
| 887 | if( zBgClr && zBgClr[0] && show_colors ){ |
| 888 | @ <tr style="background-color:%s(zBgClr)"> |
| 889 | }else{ |
| 890 | @ <tr> |
| 891 | } |
| 892 | @ <td>%z(href("%R/timeline?r=%T",zBranch))%h(zBranch)</a><input |
| 893 | @ type="checkbox" disabled="disabled"/></td> |
| 894 | @ <td data-sortkey="%016llx(iMtime)">%s(zAge)</td> |
| 895 | @ <td>%d(nCkin)</td> |
| 896 | fossil_free(zAge); |
| 897 | @ <td>%s(isClosed?"closed":"")</td> |
| 898 |
+4
-3
| --- src/browse.c | ||
| +++ src/browse.c | ||
| @@ -358,11 +358,11 @@ | ||
| 358 | 358 | ** directory. |
| 359 | 359 | */ |
| 360 | 360 | mxLen = db_int(12, "SELECT max(length(x)) FROM localfiles /*scan*/"); |
| 361 | 361 | if( mxLen<12 ) mxLen = 12; |
| 362 | 362 | mxLen += (mxLen+9)/10; |
| 363 | - db_prepare(&q, | |
| 363 | + db_prepare(&q, | |
| 364 | 364 | "SELECT x, u FROM localfiles ORDER BY x COLLATE uintnocase /*scan*/"); |
| 365 | 365 | @ <div class="columns files" style="columns: %d(mxLen)ex auto"> |
| 366 | 366 | @ <ul class="browser"> |
| 367 | 367 | while( db_step(&q)==SQLITE_ROW ){ |
| 368 | 368 | const char *zFN; |
| @@ -471,11 +471,12 @@ | ||
| 471 | 471 | FileTreeNode *pLastChild; /* Last child on the pChild list */ |
| 472 | 472 | char *zName; /* Name of this entry. The "tail" */ |
| 473 | 473 | char *zFullName; /* Full pathname of this entry */ |
| 474 | 474 | char *zUuid; /* Artifact hash of this file. May be NULL. */ |
| 475 | 475 | double mtime; /* Modification time for this entry */ |
| 476 | - double sortBy; /* Either mtime or size, depending on desired sort order */ | |
| 476 | + double sortBy; /* Either mtime or size, depending on desired | |
| 477 | + sort order */ | |
| 477 | 478 | int iSize; /* Size for this entry */ |
| 478 | 479 | unsigned nFullName; /* Length of zFullName */ |
| 479 | 480 | unsigned iLevel; /* Levels of parent directories */ |
| 480 | 481 | }; |
| 481 | 482 | |
| @@ -508,11 +509,11 @@ | ||
| 508 | 509 | int size, /* Size for this entry */ |
| 509 | 510 | int sortOrder /* 0: filename, 1: mtime, 2: size */ |
| 510 | 511 | ){ |
| 511 | 512 | int i; |
| 512 | 513 | FileTreeNode *pParent; /* Parent (directory) of the next node to insert */ |
| 513 | - | |
| 514 | + | |
| 514 | 515 | /* Make pParent point to the most recent ancestor of zPath, or |
| 515 | 516 | ** NULL if there are no prior entires that are a container for zPath. |
| 516 | 517 | */ |
| 517 | 518 | pParent = pTree->pLast; |
| 518 | 519 | while( pParent!=0 && |
| 519 | 520 |
| --- src/browse.c | |
| +++ src/browse.c | |
| @@ -358,11 +358,11 @@ | |
| 358 | ** directory. |
| 359 | */ |
| 360 | mxLen = db_int(12, "SELECT max(length(x)) FROM localfiles /*scan*/"); |
| 361 | if( mxLen<12 ) mxLen = 12; |
| 362 | mxLen += (mxLen+9)/10; |
| 363 | db_prepare(&q, |
| 364 | "SELECT x, u FROM localfiles ORDER BY x COLLATE uintnocase /*scan*/"); |
| 365 | @ <div class="columns files" style="columns: %d(mxLen)ex auto"> |
| 366 | @ <ul class="browser"> |
| 367 | while( db_step(&q)==SQLITE_ROW ){ |
| 368 | const char *zFN; |
| @@ -471,11 +471,12 @@ | |
| 471 | FileTreeNode *pLastChild; /* Last child on the pChild list */ |
| 472 | char *zName; /* Name of this entry. The "tail" */ |
| 473 | char *zFullName; /* Full pathname of this entry */ |
| 474 | char *zUuid; /* Artifact hash of this file. May be NULL. */ |
| 475 | double mtime; /* Modification time for this entry */ |
| 476 | double sortBy; /* Either mtime or size, depending on desired sort order */ |
| 477 | int iSize; /* Size for this entry */ |
| 478 | unsigned nFullName; /* Length of zFullName */ |
| 479 | unsigned iLevel; /* Levels of parent directories */ |
| 480 | }; |
| 481 | |
| @@ -508,11 +509,11 @@ | |
| 508 | int size, /* Size for this entry */ |
| 509 | int sortOrder /* 0: filename, 1: mtime, 2: size */ |
| 510 | ){ |
| 511 | int i; |
| 512 | FileTreeNode *pParent; /* Parent (directory) of the next node to insert */ |
| 513 | |
| 514 | /* Make pParent point to the most recent ancestor of zPath, or |
| 515 | ** NULL if there are no prior entires that are a container for zPath. |
| 516 | */ |
| 517 | pParent = pTree->pLast; |
| 518 | while( pParent!=0 && |
| 519 |
| --- src/browse.c | |
| +++ src/browse.c | |
| @@ -358,11 +358,11 @@ | |
| 358 | ** directory. |
| 359 | */ |
| 360 | mxLen = db_int(12, "SELECT max(length(x)) FROM localfiles /*scan*/"); |
| 361 | if( mxLen<12 ) mxLen = 12; |
| 362 | mxLen += (mxLen+9)/10; |
| 363 | db_prepare(&q, |
| 364 | "SELECT x, u FROM localfiles ORDER BY x COLLATE uintnocase /*scan*/"); |
| 365 | @ <div class="columns files" style="columns: %d(mxLen)ex auto"> |
| 366 | @ <ul class="browser"> |
| 367 | while( db_step(&q)==SQLITE_ROW ){ |
| 368 | const char *zFN; |
| @@ -471,11 +471,12 @@ | |
| 471 | FileTreeNode *pLastChild; /* Last child on the pChild list */ |
| 472 | char *zName; /* Name of this entry. The "tail" */ |
| 473 | char *zFullName; /* Full pathname of this entry */ |
| 474 | char *zUuid; /* Artifact hash of this file. May be NULL. */ |
| 475 | double mtime; /* Modification time for this entry */ |
| 476 | double sortBy; /* Either mtime or size, depending on desired |
| 477 | sort order */ |
| 478 | int iSize; /* Size for this entry */ |
| 479 | unsigned nFullName; /* Length of zFullName */ |
| 480 | unsigned iLevel; /* Levels of parent directories */ |
| 481 | }; |
| 482 | |
| @@ -508,11 +509,11 @@ | |
| 509 | int size, /* Size for this entry */ |
| 510 | int sortOrder /* 0: filename, 1: mtime, 2: size */ |
| 511 | ){ |
| 512 | int i; |
| 513 | FileTreeNode *pParent; /* Parent (directory) of the next node to insert */ |
| 514 | |
| 515 | /* Make pParent point to the most recent ancestor of zPath, or |
| 516 | ** NULL if there are no prior entires that are a container for zPath. |
| 517 | */ |
| 518 | pParent = pTree->pLast; |
| 519 | while( pParent!=0 && |
| 520 |
+4
-4
| --- src/builtin.c | ||
| +++ src/builtin.c | ||
| @@ -521,15 +521,15 @@ | ||
| 521 | 521 | } |
| 522 | 522 | |
| 523 | 523 | /* |
| 524 | 524 | ** This method is called to "rewind" the builtinVtab_cursor object back |
| 525 | 525 | ** to the first row of output. This method is always called at least |
| 526 | -** once prior to any call to builtinVtabColumn() or builtinVtabRowid() or | |
| 526 | +** once prior to any call to builtinVtabColumn() or builtinVtabRowid() or | |
| 527 | 527 | ** builtinVtabEof(). |
| 528 | 528 | */ |
| 529 | 529 | static int builtinVtabFilter( |
| 530 | - sqlite3_vtab_cursor *pVtabCursor, | |
| 530 | + sqlite3_vtab_cursor *pVtabCursor, | |
| 531 | 531 | int idxNum, const char *idxStr, |
| 532 | 532 | int argc, sqlite3_value **argv |
| 533 | 533 | ){ |
| 534 | 534 | builtinVtab_cursor *pCur = (builtinVtab_cursor *)pVtabCursor; |
| 535 | 535 | pCur->iRowid = 1; |
| @@ -550,11 +550,11 @@ | ||
| 550 | 550 | pIdxInfo->estimatedRows = count(aBuiltinFiles); |
| 551 | 551 | return SQLITE_OK; |
| 552 | 552 | } |
| 553 | 553 | |
| 554 | 554 | /* |
| 555 | -** This following structure defines all the methods for the | |
| 555 | +** This following structure defines all the methods for the | |
| 556 | 556 | ** virtual table. |
| 557 | 557 | */ |
| 558 | 558 | static sqlite3_module builtinVtabModule = { |
| 559 | 559 | /* iVersion */ 0, |
| 560 | 560 | /* xCreate */ 0, /* The builtin vtab is eponymous and read-only */ |
| @@ -816,11 +816,11 @@ | ||
| 816 | 816 | ** This function has an internal mapping of the dependencies for each |
| 817 | 817 | ** of the known fossil.XYZ.js modules and ensures that the |
| 818 | 818 | ** dependencies also get queued (recursively) and that each module is |
| 819 | 819 | ** queued only once. |
| 820 | 820 | ** |
| 821 | -** If passed a name which is not a base fossil module name then it | |
| 821 | +** If passed a name which is not a base fossil module name then it | |
| 822 | 822 | ** will fail fatally! |
| 823 | 823 | ** |
| 824 | 824 | ** DO NOT use this for loading fossil.page.*.js: use |
| 825 | 825 | ** builtin_request_js() for those. |
| 826 | 826 | ** |
| 827 | 827 |
| --- src/builtin.c | |
| +++ src/builtin.c | |
| @@ -521,15 +521,15 @@ | |
| 521 | } |
| 522 | |
| 523 | /* |
| 524 | ** This method is called to "rewind" the builtinVtab_cursor object back |
| 525 | ** to the first row of output. This method is always called at least |
| 526 | ** once prior to any call to builtinVtabColumn() or builtinVtabRowid() or |
| 527 | ** builtinVtabEof(). |
| 528 | */ |
| 529 | static int builtinVtabFilter( |
| 530 | sqlite3_vtab_cursor *pVtabCursor, |
| 531 | int idxNum, const char *idxStr, |
| 532 | int argc, sqlite3_value **argv |
| 533 | ){ |
| 534 | builtinVtab_cursor *pCur = (builtinVtab_cursor *)pVtabCursor; |
| 535 | pCur->iRowid = 1; |
| @@ -550,11 +550,11 @@ | |
| 550 | pIdxInfo->estimatedRows = count(aBuiltinFiles); |
| 551 | return SQLITE_OK; |
| 552 | } |
| 553 | |
| 554 | /* |
| 555 | ** This following structure defines all the methods for the |
| 556 | ** virtual table. |
| 557 | */ |
| 558 | static sqlite3_module builtinVtabModule = { |
| 559 | /* iVersion */ 0, |
| 560 | /* xCreate */ 0, /* The builtin vtab is eponymous and read-only */ |
| @@ -816,11 +816,11 @@ | |
| 816 | ** This function has an internal mapping of the dependencies for each |
| 817 | ** of the known fossil.XYZ.js modules and ensures that the |
| 818 | ** dependencies also get queued (recursively) and that each module is |
| 819 | ** queued only once. |
| 820 | ** |
| 821 | ** If passed a name which is not a base fossil module name then it |
| 822 | ** will fail fatally! |
| 823 | ** |
| 824 | ** DO NOT use this for loading fossil.page.*.js: use |
| 825 | ** builtin_request_js() for those. |
| 826 | ** |
| 827 |
| --- src/builtin.c | |
| +++ src/builtin.c | |
| @@ -521,15 +521,15 @@ | |
| 521 | } |
| 522 | |
| 523 | /* |
| 524 | ** This method is called to "rewind" the builtinVtab_cursor object back |
| 525 | ** to the first row of output. This method is always called at least |
| 526 | ** once prior to any call to builtinVtabColumn() or builtinVtabRowid() or |
| 527 | ** builtinVtabEof(). |
| 528 | */ |
| 529 | static int builtinVtabFilter( |
| 530 | sqlite3_vtab_cursor *pVtabCursor, |
| 531 | int idxNum, const char *idxStr, |
| 532 | int argc, sqlite3_value **argv |
| 533 | ){ |
| 534 | builtinVtab_cursor *pCur = (builtinVtab_cursor *)pVtabCursor; |
| 535 | pCur->iRowid = 1; |
| @@ -550,11 +550,11 @@ | |
| 550 | pIdxInfo->estimatedRows = count(aBuiltinFiles); |
| 551 | return SQLITE_OK; |
| 552 | } |
| 553 | |
| 554 | /* |
| 555 | ** This following structure defines all the methods for the |
| 556 | ** virtual table. |
| 557 | */ |
| 558 | static sqlite3_module builtinVtabModule = { |
| 559 | /* iVersion */ 0, |
| 560 | /* xCreate */ 0, /* The builtin vtab is eponymous and read-only */ |
| @@ -816,11 +816,11 @@ | |
| 816 | ** This function has an internal mapping of the dependencies for each |
| 817 | ** of the known fossil.XYZ.js modules and ensures that the |
| 818 | ** dependencies also get queued (recursively) and that each module is |
| 819 | ** queued only once. |
| 820 | ** |
| 821 | ** If passed a name which is not a base fossil module name then it |
| 822 | ** will fail fatally! |
| 823 | ** |
| 824 | ** DO NOT use this for loading fossil.page.*.js: use |
| 825 | ** builtin_request_js() for those. |
| 826 | ** |
| 827 |
+2
-2
| --- src/cache.c | ||
| +++ src/cache.c | ||
| @@ -313,11 +313,11 @@ | ||
| 313 | 313 | fossil_print("cache cleared\n"); |
| 314 | 314 | }else{ |
| 315 | 315 | fossil_print("nothing to clear; cache does not exist\n"); |
| 316 | 316 | } |
| 317 | 317 | }else if( strncmp(zCmd, "list", nCmd)==0 |
| 318 | - || strncmp(zCmd, "ls", nCmd)==0 | |
| 318 | + || strncmp(zCmd, "ls", nCmd)==0 | |
| 319 | 319 | || strncmp(zCmd, "status", nCmd)==0 |
| 320 | 320 | ){ |
| 321 | 321 | db = cacheOpen(0); |
| 322 | 322 | if( db==0 ){ |
| 323 | 323 | fossil_print("cache does not exist\n"); |
| @@ -432,11 +432,11 @@ | ||
| 432 | 432 | if( zHash ){ |
| 433 | 433 | @ %z(href("%R/timeline?c=%S",zHash))check-in</a>\ |
| 434 | 434 | fossil_free(zHash); |
| 435 | 435 | } |
| 436 | 436 | @ </p></li> |
| 437 | - | |
| 437 | + | |
| 438 | 438 | } |
| 439 | 439 | sqlite3_finalize(pStmt); |
| 440 | 440 | @ </ol> |
| 441 | 441 | } |
| 442 | 442 | zDbName = cacheName(); |
| 443 | 443 |
| --- src/cache.c | |
| +++ src/cache.c | |
| @@ -313,11 +313,11 @@ | |
| 313 | fossil_print("cache cleared\n"); |
| 314 | }else{ |
| 315 | fossil_print("nothing to clear; cache does not exist\n"); |
| 316 | } |
| 317 | }else if( strncmp(zCmd, "list", nCmd)==0 |
| 318 | || strncmp(zCmd, "ls", nCmd)==0 |
| 319 | || strncmp(zCmd, "status", nCmd)==0 |
| 320 | ){ |
| 321 | db = cacheOpen(0); |
| 322 | if( db==0 ){ |
| 323 | fossil_print("cache does not exist\n"); |
| @@ -432,11 +432,11 @@ | |
| 432 | if( zHash ){ |
| 433 | @ %z(href("%R/timeline?c=%S",zHash))check-in</a>\ |
| 434 | fossil_free(zHash); |
| 435 | } |
| 436 | @ </p></li> |
| 437 | |
| 438 | } |
| 439 | sqlite3_finalize(pStmt); |
| 440 | @ </ol> |
| 441 | } |
| 442 | zDbName = cacheName(); |
| 443 |
| --- src/cache.c | |
| +++ src/cache.c | |
| @@ -313,11 +313,11 @@ | |
| 313 | fossil_print("cache cleared\n"); |
| 314 | }else{ |
| 315 | fossil_print("nothing to clear; cache does not exist\n"); |
| 316 | } |
| 317 | }else if( strncmp(zCmd, "list", nCmd)==0 |
| 318 | || strncmp(zCmd, "ls", nCmd)==0 |
| 319 | || strncmp(zCmd, "status", nCmd)==0 |
| 320 | ){ |
| 321 | db = cacheOpen(0); |
| 322 | if( db==0 ){ |
| 323 | fossil_print("cache does not exist\n"); |
| @@ -432,11 +432,11 @@ | |
| 432 | if( zHash ){ |
| 433 | @ %z(href("%R/timeline?c=%S",zHash))check-in</a>\ |
| 434 | fossil_free(zHash); |
| 435 | } |
| 436 | @ </p></li> |
| 437 | |
| 438 | } |
| 439 | sqlite3_finalize(pStmt); |
| 440 | @ </ol> |
| 441 | } |
| 442 | zDbName = cacheName(); |
| 443 |
+1
-1
| --- src/capabilities.c | ||
| +++ src/capabilities.c | ||
| @@ -401,11 +401,11 @@ | ||
| 401 | 401 | const char *zId = db_column_text(&q, 0); |
| 402 | 402 | const char *zCap = db_column_text(&q, 1); |
| 403 | 403 | int n = db_column_int(&q, 3); |
| 404 | 404 | int eType; |
| 405 | 405 | static const char *const azType[] = { "off", "read", "write" }; |
| 406 | - static const char *const azClass[] = | |
| 406 | + static const char *const azClass[] = | |
| 407 | 407 | { "capsumOff", "capsumRead", "capsumWrite" }; |
| 408 | 408 | |
| 409 | 409 | if( n==0 ) continue; |
| 410 | 410 | |
| 411 | 411 | /* Code */ |
| 412 | 412 |
| --- src/capabilities.c | |
| +++ src/capabilities.c | |
| @@ -401,11 +401,11 @@ | |
| 401 | const char *zId = db_column_text(&q, 0); |
| 402 | const char *zCap = db_column_text(&q, 1); |
| 403 | int n = db_column_int(&q, 3); |
| 404 | int eType; |
| 405 | static const char *const azType[] = { "off", "read", "write" }; |
| 406 | static const char *const azClass[] = |
| 407 | { "capsumOff", "capsumRead", "capsumWrite" }; |
| 408 | |
| 409 | if( n==0 ) continue; |
| 410 | |
| 411 | /* Code */ |
| 412 |
| --- src/capabilities.c | |
| +++ src/capabilities.c | |
| @@ -401,11 +401,11 @@ | |
| 401 | const char *zId = db_column_text(&q, 0); |
| 402 | const char *zCap = db_column_text(&q, 1); |
| 403 | int n = db_column_int(&q, 3); |
| 404 | int eType; |
| 405 | static const char *const azType[] = { "off", "read", "write" }; |
| 406 | static const char *const azClass[] = |
| 407 | { "capsumOff", "capsumRead", "capsumWrite" }; |
| 408 | |
| 409 | if( n==0 ) continue; |
| 410 | |
| 411 | /* Code */ |
| 412 |
+5
-5
| --- src/cgi.c | ||
| +++ src/cgi.c | ||
| @@ -37,11 +37,11 @@ | ||
| 37 | 37 | ** received by a variety of means, and to generate well-formatted replies |
| 38 | 38 | ** to those requests. |
| 39 | 39 | ** |
| 40 | 40 | ** The code in this file abstracts the web-request so that downstream |
| 41 | 41 | ** modules that generate the body of the reply (based on the requested page) |
| 42 | -** do not need to know if the request is coming from CGI, direct HTTP, | |
| 42 | +** do not need to know if the request is coming from CGI, direct HTTP, | |
| 43 | 43 | ** SCGI, or some other means. |
| 44 | 44 | ** |
| 45 | 45 | ** This module gathers information about web page request into a key/value |
| 46 | 46 | ** store. Keys and values come from: |
| 47 | 47 | ** |
| @@ -481,11 +481,11 @@ | ||
| 481 | 481 | zReplyStatus = "OK"; |
| 482 | 482 | } |
| 483 | 483 | |
| 484 | 484 | if( g.fullHttpReply ){ |
| 485 | 485 | if( rangeEnd>0 |
| 486 | - && iReplyStatus==200 | |
| 486 | + && iReplyStatus==200 | |
| 487 | 487 | && fossil_strcmp(P("REQUEST_METHOD"),"GET")==0 |
| 488 | 488 | ){ |
| 489 | 489 | iReplyStatus = 206; |
| 490 | 490 | zReplyStatus = "Partial Content"; |
| 491 | 491 | } |
| @@ -562,11 +562,11 @@ | ||
| 562 | 562 | } |
| 563 | 563 | total_size = blob_size(&cgiContent[0]) + blob_size(&cgiContent[1]); |
| 564 | 564 | if( iReplyStatus==206 ){ |
| 565 | 565 | blob_appendf(&hdr, "Content-Range: bytes %d-%d/%d\r\n", |
| 566 | 566 | rangeStart, rangeEnd-1, total_size); |
| 567 | - total_size = rangeEnd - rangeStart; | |
| 567 | + total_size = rangeEnd - rangeStart; | |
| 568 | 568 | } |
| 569 | 569 | blob_appendf(&hdr, "Content-Length: %d\r\n", total_size); |
| 570 | 570 | }else{ |
| 571 | 571 | total_size = 0; |
| 572 | 572 | } |
| @@ -1311,11 +1311,11 @@ | ||
| 1311 | 1311 | ** \___/ \____________/\____/\____________________/ \_/ |
| 1312 | 1312 | ** | | | | | |
| 1313 | 1313 | ** | HTTP_HOST | PATH_INFO QUERY_STRING |
| 1314 | 1314 | ** | | |
| 1315 | 1315 | ** REQUEST_SCHEMA SCRIPT_NAME |
| 1316 | -** | |
| 1316 | +** | |
| 1317 | 1317 | */ |
| 1318 | 1318 | void cgi_init(void){ |
| 1319 | 1319 | char *z; |
| 1320 | 1320 | const char *zType; |
| 1321 | 1321 | char *zSemi; |
| @@ -1348,11 +1348,11 @@ | ||
| 1348 | 1348 | } |
| 1349 | 1349 | |
| 1350 | 1350 | #ifdef _WIN32 |
| 1351 | 1351 | /* The Microsoft IIS web server does not define REQUEST_URI, instead it uses |
| 1352 | 1352 | ** PATH_INFO for virtually the same purpose. Define REQUEST_URI the same as |
| 1353 | - ** PATH_INFO and redefine PATH_INFO with SCRIPT_NAME removed from the | |
| 1353 | + ** PATH_INFO and redefine PATH_INFO with SCRIPT_NAME removed from the | |
| 1354 | 1354 | ** beginning. */ |
| 1355 | 1355 | if( zServerSoftware && strstr(zServerSoftware, "Microsoft-IIS") ){ |
| 1356 | 1356 | int i, j; |
| 1357 | 1357 | cgi_set_parameter("REQUEST_URI", zPathInfo); |
| 1358 | 1358 | for(i=0; zPathInfo[i]==zScriptName[i] && zPathInfo[i]; i++){} |
| 1359 | 1359 |
| --- src/cgi.c | |
| +++ src/cgi.c | |
| @@ -37,11 +37,11 @@ | |
| 37 | ** received by a variety of means, and to generate well-formatted replies |
| 38 | ** to those requests. |
| 39 | ** |
| 40 | ** The code in this file abstracts the web-request so that downstream |
| 41 | ** modules that generate the body of the reply (based on the requested page) |
| 42 | ** do not need to know if the request is coming from CGI, direct HTTP, |
| 43 | ** SCGI, or some other means. |
| 44 | ** |
| 45 | ** This module gathers information about web page request into a key/value |
| 46 | ** store. Keys and values come from: |
| 47 | ** |
| @@ -481,11 +481,11 @@ | |
| 481 | zReplyStatus = "OK"; |
| 482 | } |
| 483 | |
| 484 | if( g.fullHttpReply ){ |
| 485 | if( rangeEnd>0 |
| 486 | && iReplyStatus==200 |
| 487 | && fossil_strcmp(P("REQUEST_METHOD"),"GET")==0 |
| 488 | ){ |
| 489 | iReplyStatus = 206; |
| 490 | zReplyStatus = "Partial Content"; |
| 491 | } |
| @@ -562,11 +562,11 @@ | |
| 562 | } |
| 563 | total_size = blob_size(&cgiContent[0]) + blob_size(&cgiContent[1]); |
| 564 | if( iReplyStatus==206 ){ |
| 565 | blob_appendf(&hdr, "Content-Range: bytes %d-%d/%d\r\n", |
| 566 | rangeStart, rangeEnd-1, total_size); |
| 567 | total_size = rangeEnd - rangeStart; |
| 568 | } |
| 569 | blob_appendf(&hdr, "Content-Length: %d\r\n", total_size); |
| 570 | }else{ |
| 571 | total_size = 0; |
| 572 | } |
| @@ -1311,11 +1311,11 @@ | |
| 1311 | ** \___/ \____________/\____/\____________________/ \_/ |
| 1312 | ** | | | | | |
| 1313 | ** | HTTP_HOST | PATH_INFO QUERY_STRING |
| 1314 | ** | | |
| 1315 | ** REQUEST_SCHEMA SCRIPT_NAME |
| 1316 | ** |
| 1317 | */ |
| 1318 | void cgi_init(void){ |
| 1319 | char *z; |
| 1320 | const char *zType; |
| 1321 | char *zSemi; |
| @@ -1348,11 +1348,11 @@ | |
| 1348 | } |
| 1349 | |
| 1350 | #ifdef _WIN32 |
| 1351 | /* The Microsoft IIS web server does not define REQUEST_URI, instead it uses |
| 1352 | ** PATH_INFO for virtually the same purpose. Define REQUEST_URI the same as |
| 1353 | ** PATH_INFO and redefine PATH_INFO with SCRIPT_NAME removed from the |
| 1354 | ** beginning. */ |
| 1355 | if( zServerSoftware && strstr(zServerSoftware, "Microsoft-IIS") ){ |
| 1356 | int i, j; |
| 1357 | cgi_set_parameter("REQUEST_URI", zPathInfo); |
| 1358 | for(i=0; zPathInfo[i]==zScriptName[i] && zPathInfo[i]; i++){} |
| 1359 |
| --- src/cgi.c | |
| +++ src/cgi.c | |
| @@ -37,11 +37,11 @@ | |
| 37 | ** received by a variety of means, and to generate well-formatted replies |
| 38 | ** to those requests. |
| 39 | ** |
| 40 | ** The code in this file abstracts the web-request so that downstream |
| 41 | ** modules that generate the body of the reply (based on the requested page) |
| 42 | ** do not need to know if the request is coming from CGI, direct HTTP, |
| 43 | ** SCGI, or some other means. |
| 44 | ** |
| 45 | ** This module gathers information about web page request into a key/value |
| 46 | ** store. Keys and values come from: |
| 47 | ** |
| @@ -481,11 +481,11 @@ | |
| 481 | zReplyStatus = "OK"; |
| 482 | } |
| 483 | |
| 484 | if( g.fullHttpReply ){ |
| 485 | if( rangeEnd>0 |
| 486 | && iReplyStatus==200 |
| 487 | && fossil_strcmp(P("REQUEST_METHOD"),"GET")==0 |
| 488 | ){ |
| 489 | iReplyStatus = 206; |
| 490 | zReplyStatus = "Partial Content"; |
| 491 | } |
| @@ -562,11 +562,11 @@ | |
| 562 | } |
| 563 | total_size = blob_size(&cgiContent[0]) + blob_size(&cgiContent[1]); |
| 564 | if( iReplyStatus==206 ){ |
| 565 | blob_appendf(&hdr, "Content-Range: bytes %d-%d/%d\r\n", |
| 566 | rangeStart, rangeEnd-1, total_size); |
| 567 | total_size = rangeEnd - rangeStart; |
| 568 | } |
| 569 | blob_appendf(&hdr, "Content-Length: %d\r\n", total_size); |
| 570 | }else{ |
| 571 | total_size = 0; |
| 572 | } |
| @@ -1311,11 +1311,11 @@ | |
| 1311 | ** \___/ \____________/\____/\____________________/ \_/ |
| 1312 | ** | | | | | |
| 1313 | ** | HTTP_HOST | PATH_INFO QUERY_STRING |
| 1314 | ** | | |
| 1315 | ** REQUEST_SCHEMA SCRIPT_NAME |
| 1316 | ** |
| 1317 | */ |
| 1318 | void cgi_init(void){ |
| 1319 | char *z; |
| 1320 | const char *zType; |
| 1321 | char *zSemi; |
| @@ -1348,11 +1348,11 @@ | |
| 1348 | } |
| 1349 | |
| 1350 | #ifdef _WIN32 |
| 1351 | /* The Microsoft IIS web server does not define REQUEST_URI, instead it uses |
| 1352 | ** PATH_INFO for virtually the same purpose. Define REQUEST_URI the same as |
| 1353 | ** PATH_INFO and redefine PATH_INFO with SCRIPT_NAME removed from the |
| 1354 | ** beginning. */ |
| 1355 | if( zServerSoftware && strstr(zServerSoftware, "Microsoft-IIS") ){ |
| 1356 | int i, j; |
| 1357 | cgi_set_parameter("REQUEST_URI", zPathInfo); |
| 1358 | for(i=0; zPathInfo[i]==zScriptName[i] && zPathInfo[i]; i++){} |
| 1359 |
+6
-6
| --- src/chat.c | ||
| +++ src/chat.c | ||
| @@ -34,11 +34,11 @@ | ||
| 34 | 34 | ** |
| 35 | 35 | ** Notification is accomplished using the "hanging GET" or "long poll" design |
| 36 | 36 | ** in which a GET request is issued but the server does not send a reply until |
| 37 | 37 | ** new content arrives. Newer Web Sockets and Server Sent Event protocols are |
| 38 | 38 | ** more elegant, but are not compatible with CGI, and would thus complicate |
| 39 | -** configuration. | |
| 39 | +** configuration. | |
| 40 | 40 | */ |
| 41 | 41 | #include "config.h" |
| 42 | 42 | #include <assert.h> |
| 43 | 43 | #include "chat.h" |
| 44 | 44 | |
| @@ -319,11 +319,11 @@ | ||
| 319 | 319 | msgid = db_int(0, "SELECT msgid FROM chat" |
| 320 | 320 | " ORDER BY msgid DESC LIMIT 1 OFFSET %d", mxCnt); |
| 321 | 321 | if( msgid>0 ){ |
| 322 | 322 | Stmt s; |
| 323 | 323 | db_multi_exec("PRAGMA secure_delete=ON;"); |
| 324 | - db_prepare(&s, | |
| 324 | + db_prepare(&s, | |
| 325 | 325 | "DELETE FROM chat WHERE mtime<julianday('now')-:mxage" |
| 326 | 326 | " AND msgid<%d", msgid); |
| 327 | 327 | db_bind_double(&s, ":mxage", mxDays); |
| 328 | 328 | db_step(&s); |
| 329 | 329 | db_finalize(&s); |
| @@ -693,11 +693,11 @@ | ||
| 693 | 693 | } |
| 694 | 694 | } /* Exit by "break" */ |
| 695 | 695 | db_finalize(&q1); |
| 696 | 696 | blob_append(&json, "\n]}", 3); |
| 697 | 697 | cgi_set_content(&json); |
| 698 | - return; | |
| 698 | + return; | |
| 699 | 699 | } |
| 700 | 700 | |
| 701 | 701 | /* |
| 702 | 702 | ** WEBPAGE: chat-fetch-one hidden loadavg-exempt |
| 703 | 703 | ** |
| @@ -726,11 +726,11 @@ | ||
| 726 | 726 | return; |
| 727 | 727 | } |
| 728 | 728 | zChatUser = db_get("chat-timeline-user",0); |
| 729 | 729 | chat_create_tables(); |
| 730 | 730 | cgi_set_content_type("application/json"); |
| 731 | - db_prepare(&q, | |
| 731 | + db_prepare(&q, | |
| 732 | 732 | "SELECT datetime(mtime), xfrom, xmsg, octet_length(file)," |
| 733 | 733 | " fname, fmime, lmtime" |
| 734 | 734 | " FROM chat WHERE msgid=%d AND mdel IS NULL", |
| 735 | 735 | msgid); |
| 736 | 736 | if(SQLITE_ROW==db_step(&q)){ |
| @@ -769,11 +769,11 @@ | ||
| 769 | 769 | if( nByte==0 ){ |
| 770 | 770 | blob_appendf(&json, "\"fsize\":0"); |
| 771 | 771 | }else{ |
| 772 | 772 | blob_appendf(&json, "\"fsize\":%d,\"fname\":%!j,\"fmime\":%!j", |
| 773 | 773 | nByte, zFName, zFMime); |
| 774 | - } | |
| 774 | + } | |
| 775 | 775 | blob_append(&json,"}",1); |
| 776 | 776 | cgi_set_content(&json); |
| 777 | 777 | }else{ |
| 778 | 778 | ajax_route_error(404,"Chat message #%d not found.", msgid); |
| 779 | 779 | } |
| @@ -957,11 +957,11 @@ | ||
| 957 | 957 | const char *zType = (const char*)sqlite3_value_text(argv[0]); |
| 958 | 958 | int rid = sqlite3_value_int(argv[1]); |
| 959 | 959 | const char *zUser = (const char*)sqlite3_value_text(argv[2]); |
| 960 | 960 | const char *zMsg = (const char*)sqlite3_value_text(argv[3]); |
| 961 | 961 | char *zRes = 0; |
| 962 | - | |
| 962 | + | |
| 963 | 963 | if( zType==0 || zUser==0 || zMsg==0 ) return; |
| 964 | 964 | if( zType[0]=='c' ){ |
| 965 | 965 | /* Check-ins */ |
| 966 | 966 | char *zBranch; |
| 967 | 967 | char *zUuid; |
| 968 | 968 |
| --- src/chat.c | |
| +++ src/chat.c | |
| @@ -34,11 +34,11 @@ | |
| 34 | ** |
| 35 | ** Notification is accomplished using the "hanging GET" or "long poll" design |
| 36 | ** in which a GET request is issued but the server does not send a reply until |
| 37 | ** new content arrives. Newer Web Sockets and Server Sent Event protocols are |
| 38 | ** more elegant, but are not compatible with CGI, and would thus complicate |
| 39 | ** configuration. |
| 40 | */ |
| 41 | #include "config.h" |
| 42 | #include <assert.h> |
| 43 | #include "chat.h" |
| 44 | |
| @@ -319,11 +319,11 @@ | |
| 319 | msgid = db_int(0, "SELECT msgid FROM chat" |
| 320 | " ORDER BY msgid DESC LIMIT 1 OFFSET %d", mxCnt); |
| 321 | if( msgid>0 ){ |
| 322 | Stmt s; |
| 323 | db_multi_exec("PRAGMA secure_delete=ON;"); |
| 324 | db_prepare(&s, |
| 325 | "DELETE FROM chat WHERE mtime<julianday('now')-:mxage" |
| 326 | " AND msgid<%d", msgid); |
| 327 | db_bind_double(&s, ":mxage", mxDays); |
| 328 | db_step(&s); |
| 329 | db_finalize(&s); |
| @@ -693,11 +693,11 @@ | |
| 693 | } |
| 694 | } /* Exit by "break" */ |
| 695 | db_finalize(&q1); |
| 696 | blob_append(&json, "\n]}", 3); |
| 697 | cgi_set_content(&json); |
| 698 | return; |
| 699 | } |
| 700 | |
| 701 | /* |
| 702 | ** WEBPAGE: chat-fetch-one hidden loadavg-exempt |
| 703 | ** |
| @@ -726,11 +726,11 @@ | |
| 726 | return; |
| 727 | } |
| 728 | zChatUser = db_get("chat-timeline-user",0); |
| 729 | chat_create_tables(); |
| 730 | cgi_set_content_type("application/json"); |
| 731 | db_prepare(&q, |
| 732 | "SELECT datetime(mtime), xfrom, xmsg, octet_length(file)," |
| 733 | " fname, fmime, lmtime" |
| 734 | " FROM chat WHERE msgid=%d AND mdel IS NULL", |
| 735 | msgid); |
| 736 | if(SQLITE_ROW==db_step(&q)){ |
| @@ -769,11 +769,11 @@ | |
| 769 | if( nByte==0 ){ |
| 770 | blob_appendf(&json, "\"fsize\":0"); |
| 771 | }else{ |
| 772 | blob_appendf(&json, "\"fsize\":%d,\"fname\":%!j,\"fmime\":%!j", |
| 773 | nByte, zFName, zFMime); |
| 774 | } |
| 775 | blob_append(&json,"}",1); |
| 776 | cgi_set_content(&json); |
| 777 | }else{ |
| 778 | ajax_route_error(404,"Chat message #%d not found.", msgid); |
| 779 | } |
| @@ -957,11 +957,11 @@ | |
| 957 | const char *zType = (const char*)sqlite3_value_text(argv[0]); |
| 958 | int rid = sqlite3_value_int(argv[1]); |
| 959 | const char *zUser = (const char*)sqlite3_value_text(argv[2]); |
| 960 | const char *zMsg = (const char*)sqlite3_value_text(argv[3]); |
| 961 | char *zRes = 0; |
| 962 | |
| 963 | if( zType==0 || zUser==0 || zMsg==0 ) return; |
| 964 | if( zType[0]=='c' ){ |
| 965 | /* Check-ins */ |
| 966 | char *zBranch; |
| 967 | char *zUuid; |
| 968 |
| --- src/chat.c | |
| +++ src/chat.c | |
| @@ -34,11 +34,11 @@ | |
| 34 | ** |
| 35 | ** Notification is accomplished using the "hanging GET" or "long poll" design |
| 36 | ** in which a GET request is issued but the server does not send a reply until |
| 37 | ** new content arrives. Newer Web Sockets and Server Sent Event protocols are |
| 38 | ** more elegant, but are not compatible with CGI, and would thus complicate |
| 39 | ** configuration. |
| 40 | */ |
| 41 | #include "config.h" |
| 42 | #include <assert.h> |
| 43 | #include "chat.h" |
| 44 | |
| @@ -319,11 +319,11 @@ | |
| 319 | msgid = db_int(0, "SELECT msgid FROM chat" |
| 320 | " ORDER BY msgid DESC LIMIT 1 OFFSET %d", mxCnt); |
| 321 | if( msgid>0 ){ |
| 322 | Stmt s; |
| 323 | db_multi_exec("PRAGMA secure_delete=ON;"); |
| 324 | db_prepare(&s, |
| 325 | "DELETE FROM chat WHERE mtime<julianday('now')-:mxage" |
| 326 | " AND msgid<%d", msgid); |
| 327 | db_bind_double(&s, ":mxage", mxDays); |
| 328 | db_step(&s); |
| 329 | db_finalize(&s); |
| @@ -693,11 +693,11 @@ | |
| 693 | } |
| 694 | } /* Exit by "break" */ |
| 695 | db_finalize(&q1); |
| 696 | blob_append(&json, "\n]}", 3); |
| 697 | cgi_set_content(&json); |
| 698 | return; |
| 699 | } |
| 700 | |
| 701 | /* |
| 702 | ** WEBPAGE: chat-fetch-one hidden loadavg-exempt |
| 703 | ** |
| @@ -726,11 +726,11 @@ | |
| 726 | return; |
| 727 | } |
| 728 | zChatUser = db_get("chat-timeline-user",0); |
| 729 | chat_create_tables(); |
| 730 | cgi_set_content_type("application/json"); |
| 731 | db_prepare(&q, |
| 732 | "SELECT datetime(mtime), xfrom, xmsg, octet_length(file)," |
| 733 | " fname, fmime, lmtime" |
| 734 | " FROM chat WHERE msgid=%d AND mdel IS NULL", |
| 735 | msgid); |
| 736 | if(SQLITE_ROW==db_step(&q)){ |
| @@ -769,11 +769,11 @@ | |
| 769 | if( nByte==0 ){ |
| 770 | blob_appendf(&json, "\"fsize\":0"); |
| 771 | }else{ |
| 772 | blob_appendf(&json, "\"fsize\":%d,\"fname\":%!j,\"fmime\":%!j", |
| 773 | nByte, zFName, zFMime); |
| 774 | } |
| 775 | blob_append(&json,"}",1); |
| 776 | cgi_set_content(&json); |
| 777 | }else{ |
| 778 | ajax_route_error(404,"Chat message #%d not found.", msgid); |
| 779 | } |
| @@ -957,11 +957,11 @@ | |
| 957 | const char *zType = (const char*)sqlite3_value_text(argv[0]); |
| 958 | int rid = sqlite3_value_int(argv[1]); |
| 959 | const char *zUser = (const char*)sqlite3_value_text(argv[2]); |
| 960 | const char *zMsg = (const char*)sqlite3_value_text(argv[3]); |
| 961 | char *zRes = 0; |
| 962 | |
| 963 | if( zType==0 || zUser==0 || zMsg==0 ) return; |
| 964 | if( zType[0]=='c' ){ |
| 965 | /* Check-ins */ |
| 966 | char *zBranch; |
| 967 | char *zUuid; |
| 968 |
+2
-2
| --- src/checkin.c | ||
| +++ src/checkin.c | ||
| @@ -2535,11 +2535,11 @@ | ||
| 2535 | 2535 | }else{ |
| 2536 | 2536 | fossil_fatal("Would fork. \"update\" first or use --branch or " |
| 2537 | 2537 | "--allow-fork."); |
| 2538 | 2538 | } |
| 2539 | 2539 | } |
| 2540 | - | |
| 2540 | + | |
| 2541 | 2541 | /* |
| 2542 | 2542 | ** Do not allow a commit against a closed leaf unless the commit |
| 2543 | 2543 | ** ends up on a different branch. |
| 2544 | 2544 | */ |
| 2545 | 2545 | if( |
| @@ -2556,11 +2556,11 @@ | ||
| 2556 | 2556 | } |
| 2557 | 2557 | |
| 2558 | 2558 | /* Always exit the loop on the second pass */ |
| 2559 | 2559 | if( bRecheck ) break; |
| 2560 | 2560 | |
| 2561 | - | |
| 2561 | + | |
| 2562 | 2562 | /* Get the check-in comment. This might involve prompting the |
| 2563 | 2563 | ** user for the check-in comment, in which case we should resync |
| 2564 | 2564 | ** to renew the check-in lock and repeat the checks for conflicts. |
| 2565 | 2565 | */ |
| 2566 | 2566 | if( zComment ){ |
| 2567 | 2567 |
| --- src/checkin.c | |
| +++ src/checkin.c | |
| @@ -2535,11 +2535,11 @@ | |
| 2535 | }else{ |
| 2536 | fossil_fatal("Would fork. \"update\" first or use --branch or " |
| 2537 | "--allow-fork."); |
| 2538 | } |
| 2539 | } |
| 2540 | |
| 2541 | /* |
| 2542 | ** Do not allow a commit against a closed leaf unless the commit |
| 2543 | ** ends up on a different branch. |
| 2544 | */ |
| 2545 | if( |
| @@ -2556,11 +2556,11 @@ | |
| 2556 | } |
| 2557 | |
| 2558 | /* Always exit the loop on the second pass */ |
| 2559 | if( bRecheck ) break; |
| 2560 | |
| 2561 | |
| 2562 | /* Get the check-in comment. This might involve prompting the |
| 2563 | ** user for the check-in comment, in which case we should resync |
| 2564 | ** to renew the check-in lock and repeat the checks for conflicts. |
| 2565 | */ |
| 2566 | if( zComment ){ |
| 2567 |
| --- src/checkin.c | |
| +++ src/checkin.c | |
| @@ -2535,11 +2535,11 @@ | |
| 2535 | }else{ |
| 2536 | fossil_fatal("Would fork. \"update\" first or use --branch or " |
| 2537 | "--allow-fork."); |
| 2538 | } |
| 2539 | } |
| 2540 | |
| 2541 | /* |
| 2542 | ** Do not allow a commit against a closed leaf unless the commit |
| 2543 | ** ends up on a different branch. |
| 2544 | */ |
| 2545 | if( |
| @@ -2556,11 +2556,11 @@ | |
| 2556 | } |
| 2557 | |
| 2558 | /* Always exit the loop on the second pass */ |
| 2559 | if( bRecheck ) break; |
| 2560 | |
| 2561 | |
| 2562 | /* Get the check-in comment. This might involve prompting the |
| 2563 | ** user for the check-in comment, in which case we should resync |
| 2564 | ** to renew the check-in lock and repeat the checks for conflicts. |
| 2565 | */ |
| 2566 | if( zComment ){ |
| 2567 |
+1
-1
| --- src/clone.c | ||
| +++ src/clone.c | ||
| @@ -196,11 +196,11 @@ | ||
| 196 | 196 | zRepo = mprintf("./%s.fossil", zBase); |
| 197 | 197 | if( zWorkDir==0 ){ |
| 198 | 198 | zWorkDir = mprintf("./%s", zBase); |
| 199 | 199 | } |
| 200 | 200 | fossil_free(zBase); |
| 201 | - } | |
| 201 | + } | |
| 202 | 202 | if( -1 != file_size(zRepo, ExtFILE) ){ |
| 203 | 203 | fossil_fatal("file already exists: %s", zRepo); |
| 204 | 204 | } |
| 205 | 205 | /* Fail before clone if open will fail because inside an open check-out */ |
| 206 | 206 | if( zWorkDir!=0 && zWorkDir[0]!=0 && !noOpen ){ |
| 207 | 207 |
| --- src/clone.c | |
| +++ src/clone.c | |
| @@ -196,11 +196,11 @@ | |
| 196 | zRepo = mprintf("./%s.fossil", zBase); |
| 197 | if( zWorkDir==0 ){ |
| 198 | zWorkDir = mprintf("./%s", zBase); |
| 199 | } |
| 200 | fossil_free(zBase); |
| 201 | } |
| 202 | if( -1 != file_size(zRepo, ExtFILE) ){ |
| 203 | fossil_fatal("file already exists: %s", zRepo); |
| 204 | } |
| 205 | /* Fail before clone if open will fail because inside an open check-out */ |
| 206 | if( zWorkDir!=0 && zWorkDir[0]!=0 && !noOpen ){ |
| 207 |
| --- src/clone.c | |
| +++ src/clone.c | |
| @@ -196,11 +196,11 @@ | |
| 196 | zRepo = mprintf("./%s.fossil", zBase); |
| 197 | if( zWorkDir==0 ){ |
| 198 | zWorkDir = mprintf("./%s", zBase); |
| 199 | } |
| 200 | fossil_free(zBase); |
| 201 | } |
| 202 | if( -1 != file_size(zRepo, ExtFILE) ){ |
| 203 | fossil_fatal("file already exists: %s", zRepo); |
| 204 | } |
| 205 | /* Fail before clone if open will fail because inside an open check-out */ |
| 206 | if( zWorkDir!=0 && zWorkDir[0]!=0 && !noOpen ){ |
| 207 |
+1
-1
| --- src/cookies.c | ||
| +++ src/cookies.c | ||
| @@ -239,11 +239,11 @@ | ||
| 239 | 239 | cgi_set_cookie(zName, "", 0, -1); |
| 240 | 240 | cgi_redirect("cookies"); |
| 241 | 241 | } |
| 242 | 242 | nCookie++; |
| 243 | 243 | @ <li><p><b>%h(zName)</b>: %h(zValue) |
| 244 | - @ <input type="submit" name="%h(zDel)" value="Delete"> | |
| 244 | + @ <input type="submit" name="%h(zDel)" value="Delete"> | |
| 245 | 245 | if( fossil_strcmp(zName, DISPLAY_SETTINGS_COOKIE)==0 && cookies.nParam>0 ){ |
| 246 | 246 | int j; |
| 247 | 247 | @ <ul> |
| 248 | 248 | for(j=0; j<cookies.nParam; j++){ |
| 249 | 249 | @ <li>%h(cookies.aParam[j].zPName): "%h(cookies.aParam[j].zPValue)" |
| 250 | 250 |
| --- src/cookies.c | |
| +++ src/cookies.c | |
| @@ -239,11 +239,11 @@ | |
| 239 | cgi_set_cookie(zName, "", 0, -1); |
| 240 | cgi_redirect("cookies"); |
| 241 | } |
| 242 | nCookie++; |
| 243 | @ <li><p><b>%h(zName)</b>: %h(zValue) |
| 244 | @ <input type="submit" name="%h(zDel)" value="Delete"> |
| 245 | if( fossil_strcmp(zName, DISPLAY_SETTINGS_COOKIE)==0 && cookies.nParam>0 ){ |
| 246 | int j; |
| 247 | @ <ul> |
| 248 | for(j=0; j<cookies.nParam; j++){ |
| 249 | @ <li>%h(cookies.aParam[j].zPName): "%h(cookies.aParam[j].zPValue)" |
| 250 |
| --- src/cookies.c | |
| +++ src/cookies.c | |
| @@ -239,11 +239,11 @@ | |
| 239 | cgi_set_cookie(zName, "", 0, -1); |
| 240 | cgi_redirect("cookies"); |
| 241 | } |
| 242 | nCookie++; |
| 243 | @ <li><p><b>%h(zName)</b>: %h(zValue) |
| 244 | @ <input type="submit" name="%h(zDel)" value="Delete"> |
| 245 | if( fossil_strcmp(zName, DISPLAY_SETTINGS_COOKIE)==0 && cookies.nParam>0 ){ |
| 246 | int j; |
| 247 | @ <ul> |
| 248 | for(j=0; j<cookies.nParam; j++){ |
| 249 | @ <li>%h(cookies.aParam[j].zPName): "%h(cookies.aParam[j].zPValue)" |
| 250 |
M
src/db.c
+13
-12
| --- src/db.c | ||
| +++ src/db.c | ||
| @@ -457,11 +457,11 @@ | ||
| 457 | 457 | void db_protect_only(unsigned flags){ |
| 458 | 458 | if( db.nProtect>=count(db.aProtect)-2 ){ |
| 459 | 459 | fossil_panic("too many db_protect() calls"); |
| 460 | 460 | } |
| 461 | 461 | db.aProtect[db.nProtect++] = db.protectMask; |
| 462 | - if( (flags & PROTECT_SENSITIVE)!=0 | |
| 462 | + if( (flags & PROTECT_SENSITIVE)!=0 | |
| 463 | 463 | && db.bProtectTriggers==0 |
| 464 | 464 | && g.repositoryOpen |
| 465 | 465 | ){ |
| 466 | 466 | /* Create the triggers needed to protect sensitive settings from |
| 467 | 467 | ** being created or modified the first time that PROTECT_SENSITIVE |
| @@ -1557,13 +1557,13 @@ | ||
| 1557 | 1557 | sqlite3_create_function(db, "win_reserved", 1, SQLITE_UTF8, 0, |
| 1558 | 1558 | db_win_reserved_func,0,0); |
| 1559 | 1559 | sqlite3_create_function(db, "url_nouser", 1, SQLITE_UTF8, 0, |
| 1560 | 1560 | url_nouser_func,0,0); |
| 1561 | 1561 | sqlite3_create_function(db, "chat_msg_from_event", 4, |
| 1562 | - SQLITE_UTF8 | SQLITE_INNOCUOUS, 0, | |
| 1562 | + SQLITE_UTF8 | SQLITE_INNOCUOUS, 0, | |
| 1563 | 1563 | chat_msg_from_event, 0, 0); |
| 1564 | - | |
| 1564 | + | |
| 1565 | 1565 | } |
| 1566 | 1566 | |
| 1567 | 1567 | #if USE_SEE |
| 1568 | 1568 | /* |
| 1569 | 1569 | ** This is a pointer to the saved database encryption key string. |
| @@ -2489,11 +2489,11 @@ | ||
| 2489 | 2489 | if( db_local_table_exists_but_lacks_column("undo_vfile", "islink") ){ |
| 2490 | 2490 | db_multi_exec("ALTER TABLE undo_vfile ADD COLUMN islink BOOL DEFAULT 0"); |
| 2491 | 2491 | } |
| 2492 | 2492 | } |
| 2493 | 2493 | |
| 2494 | - /* The design of the check-out database changed on 2019-01-19, adding the mhash | |
| 2494 | + /* The design of the check-out database changed on 2019-01-19 adding the mhash | |
| 2495 | 2495 | ** column to vfile and vmerge and changing the UNIQUE index on vmerge into |
| 2496 | 2496 | ** a PRIMARY KEY that includes the new mhash column. However, we must have |
| 2497 | 2497 | ** the repository database at hand in order to do the migration, so that |
| 2498 | 2498 | ** step is deferred. */ |
| 2499 | 2499 | return 1; |
| @@ -2606,11 +2606,11 @@ | ||
| 2606 | 2606 | sz = file_size(zDbName, ExtFILE); |
| 2607 | 2607 | if( sz<16834 ) return 0; |
| 2608 | 2608 | db = db_open(zDbName); |
| 2609 | 2609 | if( !db ) return 0; |
| 2610 | 2610 | if( !g.zVfsName && sz%512 ) return 0; |
| 2611 | - rc = sqlite3_prepare_v2(db, | |
| 2611 | + rc = sqlite3_prepare_v2(db, | |
| 2612 | 2612 | "SELECT count(*) FROM sqlite_schema" |
| 2613 | 2613 | " WHERE name COLLATE nocase IN" |
| 2614 | 2614 | "('blob','delta','rcvfrom','user','config','mlink','plink');", |
| 2615 | 2615 | -1, &pStmt, 0); |
| 2616 | 2616 | if( rc ) goto is_repo_end; |
| @@ -3716,11 +3716,12 @@ | ||
| 3716 | 3716 | z = fossil_strdup(zDefault); |
| 3717 | 3717 | } |
| 3718 | 3718 | } |
| 3719 | 3719 | return z; |
| 3720 | 3720 | } |
| 3721 | -char *db_get_mtime(const char *zName, const char *zFormat, const char *zDefault){ | |
| 3721 | +char *db_get_mtime(const char *zName, const char *zFormat, | |
| 3722 | + const char *zDefault){ | |
| 3722 | 3723 | char *z = 0; |
| 3723 | 3724 | if( g.repositoryOpen ){ |
| 3724 | 3725 | z = db_text(0, "SELECT mtime FROM config WHERE name=%Q", zName); |
| 3725 | 3726 | } |
| 3726 | 3727 | if( z==0 ){ |
| @@ -4021,11 +4022,11 @@ | ||
| 4021 | 4022 | } |
| 4022 | 4023 | file_canonical_name(zName, &full, 0); |
| 4023 | 4024 | (void)filename_collation(); /* Initialize before connection swap */ |
| 4024 | 4025 | db_swap_connections(); |
| 4025 | 4026 | zRepoSetting = mprintf("repo:%q", blob_str(&full)); |
| 4026 | - | |
| 4027 | + | |
| 4027 | 4028 | db_unprotect(PROTECT_CONFIG); |
| 4028 | 4029 | db_multi_exec( |
| 4029 | 4030 | "DELETE FROM global_config WHERE name %s = %Q;", |
| 4030 | 4031 | filename_collation(), zRepoSetting |
| 4031 | 4032 | ); |
| @@ -4185,11 +4186,11 @@ | ||
| 4185 | 4186 | && (nLocal = file_directory_size(".", 0, 1))>0 |
| 4186 | 4187 | && (nLocal>1 || isUri || !file_in_cwd(zRepo)) |
| 4187 | 4188 | ){ |
| 4188 | 4189 | fossil_fatal("directory %s is not empty\n" |
| 4189 | 4190 | "use the -f (--force) option to override\n" |
| 4190 | - "or the -k (--keep) option to keep local files unchanged", | |
| 4191 | + "or the -k (--keep) option to keep local files unchanged", | |
| 4191 | 4192 | file_getcwd(0,0)); |
| 4192 | 4193 | } |
| 4193 | 4194 | |
| 4194 | 4195 | if( db_open_local_v2(0, allowNested) ){ |
| 4195 | 4196 | fossil_fatal("there is already an open tree at %s", g.zLocalRoot); |
| @@ -4391,11 +4392,11 @@ | ||
| 4391 | 4392 | ** in the "admin_log" table of the repository. |
| 4392 | 4393 | */ |
| 4393 | 4394 | /* |
| 4394 | 4395 | ** SETTING: allow-symlinks boolean default=off sensitive |
| 4395 | 4396 | ** |
| 4396 | -** When allow-symlinks is OFF, Fossil does not see symbolic links | |
| 4397 | +** When allow-symlinks is OFF, Fossil does not see symbolic links | |
| 4397 | 4398 | ** (a.k.a "symlinks") on disk as a separate class of object. Instead Fossil |
| 4398 | 4399 | ** sees the object that the symlink points to. Fossil will only manage files |
| 4399 | 4400 | ** and directories, not symlinks. When a symlink is added to a repository, |
| 4400 | 4401 | ** the object that the symlink points to is added, not the symlink itself. |
| 4401 | 4402 | ** |
| @@ -4449,11 +4450,11 @@ | ||
| 4449 | 4450 | ** after the page load. Suggested values: 50 to 200. |
| 4450 | 4451 | */ |
| 4451 | 4452 | /* |
| 4452 | 4453 | ** SETTING: auto-hyperlink-mouseover boolean default=off |
| 4453 | 4454 | ** |
| 4454 | -** When the auto-hyperlink setting is 1 and this setting is on, the | |
| 4455 | +** When the auto-hyperlink setting is 1 and this setting is on, the | |
| 4455 | 4456 | ** javascript that runs to set the href= attributes of hyperlinks waits |
| 4456 | 4457 | ** until either a mousedown or mousemove event is seen. This helps |
| 4457 | 4458 | ** to distinguish real users from robots. For maximum robot defense, |
| 4458 | 4459 | ** the recommended setting is ON. |
| 4459 | 4460 | */ |
| @@ -4673,11 +4674,11 @@ | ||
| 4673 | 4674 | */ |
| 4674 | 4675 | /* |
| 4675 | 4676 | ** SETTING: forbid-delta-manifests boolean default=off |
| 4676 | 4677 | ** If enabled on a client, new delta manifests are prohibited on |
| 4677 | 4678 | ** commits. If enabled on a server, whenever a client attempts |
| 4678 | -** to obtain a check-in lock during auto-sync, the server will | |
| 4679 | +** to obtain a check-in lock during auto-sync, the server will | |
| 4679 | 4680 | ** send the "pragma avoid-delta-manifests" statement in its reply, |
| 4680 | 4681 | ** which will cause the client to avoid generating a delta |
| 4681 | 4682 | ** manifest. |
| 4682 | 4683 | */ |
| 4683 | 4684 | /* |
| @@ -5014,11 +5015,11 @@ | ||
| 5014 | 5015 | */ |
| 5015 | 5016 | /* |
| 5016 | 5017 | ** SETTING: large-file-size width=10 default=200000000 |
| 5017 | 5018 | ** Fossil considers any file whose size is greater than this value |
| 5018 | 5019 | ** to be a "large file". Fossil might issue warnings if you try to |
| 5019 | -** "add" or "commit" a "large file". Set this value to 0 or less | |
| 5020 | +** "add" or "commit" a "large file". Set this value to 0 or less | |
| 5020 | 5021 | ** to disable all such warnings. |
| 5021 | 5022 | */ |
| 5022 | 5023 | |
| 5023 | 5024 | /* |
| 5024 | 5025 | ** Look up a control setting by its name. Return a pointer to the Setting |
| 5025 | 5026 |
| --- src/db.c | |
| +++ src/db.c | |
| @@ -457,11 +457,11 @@ | |
| 457 | void db_protect_only(unsigned flags){ |
| 458 | if( db.nProtect>=count(db.aProtect)-2 ){ |
| 459 | fossil_panic("too many db_protect() calls"); |
| 460 | } |
| 461 | db.aProtect[db.nProtect++] = db.protectMask; |
| 462 | if( (flags & PROTECT_SENSITIVE)!=0 |
| 463 | && db.bProtectTriggers==0 |
| 464 | && g.repositoryOpen |
| 465 | ){ |
| 466 | /* Create the triggers needed to protect sensitive settings from |
| 467 | ** being created or modified the first time that PROTECT_SENSITIVE |
| @@ -1557,13 +1557,13 @@ | |
| 1557 | sqlite3_create_function(db, "win_reserved", 1, SQLITE_UTF8, 0, |
| 1558 | db_win_reserved_func,0,0); |
| 1559 | sqlite3_create_function(db, "url_nouser", 1, SQLITE_UTF8, 0, |
| 1560 | url_nouser_func,0,0); |
| 1561 | sqlite3_create_function(db, "chat_msg_from_event", 4, |
| 1562 | SQLITE_UTF8 | SQLITE_INNOCUOUS, 0, |
| 1563 | chat_msg_from_event, 0, 0); |
| 1564 | |
| 1565 | } |
| 1566 | |
| 1567 | #if USE_SEE |
| 1568 | /* |
| 1569 | ** This is a pointer to the saved database encryption key string. |
| @@ -2489,11 +2489,11 @@ | |
| 2489 | if( db_local_table_exists_but_lacks_column("undo_vfile", "islink") ){ |
| 2490 | db_multi_exec("ALTER TABLE undo_vfile ADD COLUMN islink BOOL DEFAULT 0"); |
| 2491 | } |
| 2492 | } |
| 2493 | |
| 2494 | /* The design of the check-out database changed on 2019-01-19, adding the mhash |
| 2495 | ** column to vfile and vmerge and changing the UNIQUE index on vmerge into |
| 2496 | ** a PRIMARY KEY that includes the new mhash column. However, we must have |
| 2497 | ** the repository database at hand in order to do the migration, so that |
| 2498 | ** step is deferred. */ |
| 2499 | return 1; |
| @@ -2606,11 +2606,11 @@ | |
| 2606 | sz = file_size(zDbName, ExtFILE); |
| 2607 | if( sz<16834 ) return 0; |
| 2608 | db = db_open(zDbName); |
| 2609 | if( !db ) return 0; |
| 2610 | if( !g.zVfsName && sz%512 ) return 0; |
| 2611 | rc = sqlite3_prepare_v2(db, |
| 2612 | "SELECT count(*) FROM sqlite_schema" |
| 2613 | " WHERE name COLLATE nocase IN" |
| 2614 | "('blob','delta','rcvfrom','user','config','mlink','plink');", |
| 2615 | -1, &pStmt, 0); |
| 2616 | if( rc ) goto is_repo_end; |
| @@ -3716,11 +3716,12 @@ | |
| 3716 | z = fossil_strdup(zDefault); |
| 3717 | } |
| 3718 | } |
| 3719 | return z; |
| 3720 | } |
| 3721 | char *db_get_mtime(const char *zName, const char *zFormat, const char *zDefault){ |
| 3722 | char *z = 0; |
| 3723 | if( g.repositoryOpen ){ |
| 3724 | z = db_text(0, "SELECT mtime FROM config WHERE name=%Q", zName); |
| 3725 | } |
| 3726 | if( z==0 ){ |
| @@ -4021,11 +4022,11 @@ | |
| 4021 | } |
| 4022 | file_canonical_name(zName, &full, 0); |
| 4023 | (void)filename_collation(); /* Initialize before connection swap */ |
| 4024 | db_swap_connections(); |
| 4025 | zRepoSetting = mprintf("repo:%q", blob_str(&full)); |
| 4026 | |
| 4027 | db_unprotect(PROTECT_CONFIG); |
| 4028 | db_multi_exec( |
| 4029 | "DELETE FROM global_config WHERE name %s = %Q;", |
| 4030 | filename_collation(), zRepoSetting |
| 4031 | ); |
| @@ -4185,11 +4186,11 @@ | |
| 4185 | && (nLocal = file_directory_size(".", 0, 1))>0 |
| 4186 | && (nLocal>1 || isUri || !file_in_cwd(zRepo)) |
| 4187 | ){ |
| 4188 | fossil_fatal("directory %s is not empty\n" |
| 4189 | "use the -f (--force) option to override\n" |
| 4190 | "or the -k (--keep) option to keep local files unchanged", |
| 4191 | file_getcwd(0,0)); |
| 4192 | } |
| 4193 | |
| 4194 | if( db_open_local_v2(0, allowNested) ){ |
| 4195 | fossil_fatal("there is already an open tree at %s", g.zLocalRoot); |
| @@ -4391,11 +4392,11 @@ | |
| 4391 | ** in the "admin_log" table of the repository. |
| 4392 | */ |
| 4393 | /* |
| 4394 | ** SETTING: allow-symlinks boolean default=off sensitive |
| 4395 | ** |
| 4396 | ** When allow-symlinks is OFF, Fossil does not see symbolic links |
| 4397 | ** (a.k.a "symlinks") on disk as a separate class of object. Instead Fossil |
| 4398 | ** sees the object that the symlink points to. Fossil will only manage files |
| 4399 | ** and directories, not symlinks. When a symlink is added to a repository, |
| 4400 | ** the object that the symlink points to is added, not the symlink itself. |
| 4401 | ** |
| @@ -4449,11 +4450,11 @@ | |
| 4449 | ** after the page load. Suggested values: 50 to 200. |
| 4450 | */ |
| 4451 | /* |
| 4452 | ** SETTING: auto-hyperlink-mouseover boolean default=off |
| 4453 | ** |
| 4454 | ** When the auto-hyperlink setting is 1 and this setting is on, the |
| 4455 | ** javascript that runs to set the href= attributes of hyperlinks waits |
| 4456 | ** until either a mousedown or mousemove event is seen. This helps |
| 4457 | ** to distinguish real users from robots. For maximum robot defense, |
| 4458 | ** the recommended setting is ON. |
| 4459 | */ |
| @@ -4673,11 +4674,11 @@ | |
| 4673 | */ |
| 4674 | /* |
| 4675 | ** SETTING: forbid-delta-manifests boolean default=off |
| 4676 | ** If enabled on a client, new delta manifests are prohibited on |
| 4677 | ** commits. If enabled on a server, whenever a client attempts |
| 4678 | ** to obtain a check-in lock during auto-sync, the server will |
| 4679 | ** send the "pragma avoid-delta-manifests" statement in its reply, |
| 4680 | ** which will cause the client to avoid generating a delta |
| 4681 | ** manifest. |
| 4682 | */ |
| 4683 | /* |
| @@ -5014,11 +5015,11 @@ | |
| 5014 | */ |
| 5015 | /* |
| 5016 | ** SETTING: large-file-size width=10 default=200000000 |
| 5017 | ** Fossil considers any file whose size is greater than this value |
| 5018 | ** to be a "large file". Fossil might issue warnings if you try to |
| 5019 | ** "add" or "commit" a "large file". Set this value to 0 or less |
| 5020 | ** to disable all such warnings. |
| 5021 | */ |
| 5022 | |
| 5023 | /* |
| 5024 | ** Look up a control setting by its name. Return a pointer to the Setting |
| 5025 |
| --- src/db.c | |
| +++ src/db.c | |
| @@ -457,11 +457,11 @@ | |
| 457 | void db_protect_only(unsigned flags){ |
| 458 | if( db.nProtect>=count(db.aProtect)-2 ){ |
| 459 | fossil_panic("too many db_protect() calls"); |
| 460 | } |
| 461 | db.aProtect[db.nProtect++] = db.protectMask; |
| 462 | if( (flags & PROTECT_SENSITIVE)!=0 |
| 463 | && db.bProtectTriggers==0 |
| 464 | && g.repositoryOpen |
| 465 | ){ |
| 466 | /* Create the triggers needed to protect sensitive settings from |
| 467 | ** being created or modified the first time that PROTECT_SENSITIVE |
| @@ -1557,13 +1557,13 @@ | |
| 1557 | sqlite3_create_function(db, "win_reserved", 1, SQLITE_UTF8, 0, |
| 1558 | db_win_reserved_func,0,0); |
| 1559 | sqlite3_create_function(db, "url_nouser", 1, SQLITE_UTF8, 0, |
| 1560 | url_nouser_func,0,0); |
| 1561 | sqlite3_create_function(db, "chat_msg_from_event", 4, |
| 1562 | SQLITE_UTF8 | SQLITE_INNOCUOUS, 0, |
| 1563 | chat_msg_from_event, 0, 0); |
| 1564 | |
| 1565 | } |
| 1566 | |
| 1567 | #if USE_SEE |
| 1568 | /* |
| 1569 | ** This is a pointer to the saved database encryption key string. |
| @@ -2489,11 +2489,11 @@ | |
| 2489 | if( db_local_table_exists_but_lacks_column("undo_vfile", "islink") ){ |
| 2490 | db_multi_exec("ALTER TABLE undo_vfile ADD COLUMN islink BOOL DEFAULT 0"); |
| 2491 | } |
| 2492 | } |
| 2493 | |
| 2494 | /* The design of the check-out database changed on 2019-01-19 adding the mhash |
| 2495 | ** column to vfile and vmerge and changing the UNIQUE index on vmerge into |
| 2496 | ** a PRIMARY KEY that includes the new mhash column. However, we must have |
| 2497 | ** the repository database at hand in order to do the migration, so that |
| 2498 | ** step is deferred. */ |
| 2499 | return 1; |
| @@ -2606,11 +2606,11 @@ | |
| 2606 | sz = file_size(zDbName, ExtFILE); |
| 2607 | if( sz<16834 ) return 0; |
| 2608 | db = db_open(zDbName); |
| 2609 | if( !db ) return 0; |
| 2610 | if( !g.zVfsName && sz%512 ) return 0; |
| 2611 | rc = sqlite3_prepare_v2(db, |
| 2612 | "SELECT count(*) FROM sqlite_schema" |
| 2613 | " WHERE name COLLATE nocase IN" |
| 2614 | "('blob','delta','rcvfrom','user','config','mlink','plink');", |
| 2615 | -1, &pStmt, 0); |
| 2616 | if( rc ) goto is_repo_end; |
| @@ -3716,11 +3716,12 @@ | |
| 3716 | z = fossil_strdup(zDefault); |
| 3717 | } |
| 3718 | } |
| 3719 | return z; |
| 3720 | } |
| 3721 | char *db_get_mtime(const char *zName, const char *zFormat, |
| 3722 | const char *zDefault){ |
| 3723 | char *z = 0; |
| 3724 | if( g.repositoryOpen ){ |
| 3725 | z = db_text(0, "SELECT mtime FROM config WHERE name=%Q", zName); |
| 3726 | } |
| 3727 | if( z==0 ){ |
| @@ -4021,11 +4022,11 @@ | |
| 4022 | } |
| 4023 | file_canonical_name(zName, &full, 0); |
| 4024 | (void)filename_collation(); /* Initialize before connection swap */ |
| 4025 | db_swap_connections(); |
| 4026 | zRepoSetting = mprintf("repo:%q", blob_str(&full)); |
| 4027 | |
| 4028 | db_unprotect(PROTECT_CONFIG); |
| 4029 | db_multi_exec( |
| 4030 | "DELETE FROM global_config WHERE name %s = %Q;", |
| 4031 | filename_collation(), zRepoSetting |
| 4032 | ); |
| @@ -4185,11 +4186,11 @@ | |
| 4186 | && (nLocal = file_directory_size(".", 0, 1))>0 |
| 4187 | && (nLocal>1 || isUri || !file_in_cwd(zRepo)) |
| 4188 | ){ |
| 4189 | fossil_fatal("directory %s is not empty\n" |
| 4190 | "use the -f (--force) option to override\n" |
| 4191 | "or the -k (--keep) option to keep local files unchanged", |
| 4192 | file_getcwd(0,0)); |
| 4193 | } |
| 4194 | |
| 4195 | if( db_open_local_v2(0, allowNested) ){ |
| 4196 | fossil_fatal("there is already an open tree at %s", g.zLocalRoot); |
| @@ -4391,11 +4392,11 @@ | |
| 4392 | ** in the "admin_log" table of the repository. |
| 4393 | */ |
| 4394 | /* |
| 4395 | ** SETTING: allow-symlinks boolean default=off sensitive |
| 4396 | ** |
| 4397 | ** When allow-symlinks is OFF, Fossil does not see symbolic links |
| 4398 | ** (a.k.a "symlinks") on disk as a separate class of object. Instead Fossil |
| 4399 | ** sees the object that the symlink points to. Fossil will only manage files |
| 4400 | ** and directories, not symlinks. When a symlink is added to a repository, |
| 4401 | ** the object that the symlink points to is added, not the symlink itself. |
| 4402 | ** |
| @@ -4449,11 +4450,11 @@ | |
| 4450 | ** after the page load. Suggested values: 50 to 200. |
| 4451 | */ |
| 4452 | /* |
| 4453 | ** SETTING: auto-hyperlink-mouseover boolean default=off |
| 4454 | ** |
| 4455 | ** When the auto-hyperlink setting is 1 and this setting is on, the |
| 4456 | ** javascript that runs to set the href= attributes of hyperlinks waits |
| 4457 | ** until either a mousedown or mousemove event is seen. This helps |
| 4458 | ** to distinguish real users from robots. For maximum robot defense, |
| 4459 | ** the recommended setting is ON. |
| 4460 | */ |
| @@ -4673,11 +4674,11 @@ | |
| 4674 | */ |
| 4675 | /* |
| 4676 | ** SETTING: forbid-delta-manifests boolean default=off |
| 4677 | ** If enabled on a client, new delta manifests are prohibited on |
| 4678 | ** commits. If enabled on a server, whenever a client attempts |
| 4679 | ** to obtain a check-in lock during auto-sync, the server will |
| 4680 | ** send the "pragma avoid-delta-manifests" statement in its reply, |
| 4681 | ** which will cause the client to avoid generating a delta |
| 4682 | ** manifest. |
| 4683 | */ |
| 4684 | /* |
| @@ -5014,11 +5015,11 @@ | |
| 5015 | */ |
| 5016 | /* |
| 5017 | ** SETTING: large-file-size width=10 default=200000000 |
| 5018 | ** Fossil considers any file whose size is greater than this value |
| 5019 | ** to be a "large file". Fossil might issue warnings if you try to |
| 5020 | ** "add" or "commit" a "large file". Set this value to 0 or less |
| 5021 | ** to disable all such warnings. |
| 5022 | */ |
| 5023 | |
| 5024 | /* |
| 5025 | ** Look up a control setting by its name. Return a pointer to the Setting |
| 5026 |
+9
-8
| --- src/diff.c | ||
| +++ src/diff.c | ||
| @@ -90,16 +90,16 @@ | ||
| 90 | 90 | ** because not all diff operations are started from the command-line. But |
| 91 | 91 | ** the idea is sound. |
| 92 | 92 | ** |
| 93 | 93 | ** Information encoded by this object includes but is not limited to: |
| 94 | 94 | ** |
| 95 | -** * The desired output format (unified vs. side-by-side, | |
| 95 | +** * The desired output format (unified vs. side-by-side, | |
| 96 | 96 | ** TCL, JSON, HTML vs. plain-text). |
| 97 | 97 | ** |
| 98 | 98 | ** * Number of lines of context surrounding each difference block |
| 99 | 99 | ** |
| 100 | -** * Width of output columns for text side-by-side diffop | |
| 100 | +** * Width of output columns for text side-by-side diffop | |
| 101 | 101 | */ |
| 102 | 102 | struct DiffConfig { |
| 103 | 103 | u64 diffFlags; /* Diff flags */ |
| 104 | 104 | int nContext; /* Number of lines of context */ |
| 105 | 105 | int wColumn; /* Column width in -y mode */ |
| @@ -915,11 +915,11 @@ | ||
| 915 | 915 | ** lines and formats them for display. Subclasses of this object format |
| 916 | 916 | ** the diff output in different ways. |
| 917 | 917 | ** |
| 918 | 918 | ** To subclass, create an instance of the DiffBuilder object and fill |
| 919 | 919 | ** in appropriate method implementations. |
| 920 | -*/ | |
| 920 | +*/ | |
| 921 | 921 | typedef struct DiffBuilder DiffBuilder; |
| 922 | 922 | struct DiffBuilder { |
| 923 | 923 | void (*xSkip)(DiffBuilder*, unsigned int, int); |
| 924 | 924 | void (*xCommon)(DiffBuilder*,const DLine*); |
| 925 | 925 | void (*xInsert)(DiffBuilder*,const DLine*); |
| @@ -1100,11 +1100,11 @@ | ||
| 1100 | 1100 | x = chng.a[i].iStart1; |
| 1101 | 1101 | blob_append_char(p->pOut, ' '); |
| 1102 | 1102 | blob_append_tcl_literal(p->pOut, pX->z + x, chng.a[i].iLen1); |
| 1103 | 1103 | x += chng.a[i].iLen1; |
| 1104 | 1104 | blob_append_char(p->pOut, ' '); |
| 1105 | - blob_append_tcl_literal(p->pOut, | |
| 1105 | + blob_append_tcl_literal(p->pOut, | |
| 1106 | 1106 | pY->z + chng.a[i].iStart2, chng.a[i].iLen2); |
| 1107 | 1107 | } |
| 1108 | 1108 | if( x<pX->n ){ |
| 1109 | 1109 | blob_append_char(p->pOut, ' '); |
| 1110 | 1110 | blob_append_tcl_literal(p->pOut, pX->z + x, pX->n - x); |
| @@ -1186,11 +1186,11 @@ | ||
| 1186 | 1186 | x = chng.a[i].iStart1; |
| 1187 | 1187 | blob_append_char(p->pOut, ','); |
| 1188 | 1188 | blob_append_json_literal(p->pOut, pX->z + x, chng.a[i].iLen1); |
| 1189 | 1189 | x += chng.a[i].iLen1; |
| 1190 | 1190 | blob_append_char(p->pOut, ','); |
| 1191 | - blob_append_json_literal(p->pOut, | |
| 1191 | + blob_append_json_literal(p->pOut, | |
| 1192 | 1192 | pY->z + chng.a[i].iStart2, chng.a[i].iLen2); |
| 1193 | 1193 | } |
| 1194 | 1194 | blob_append_char(p->pOut, ','); |
| 1195 | 1195 | blob_append_json_literal(p->pOut, pX->z + x, pX->n - x); |
| 1196 | 1196 | blob_append(p->pOut, "],\n",3); |
| @@ -1268,11 +1268,11 @@ | ||
| 1268 | 1268 | |
| 1269 | 1269 | /* Text of the inserted lines */ |
| 1270 | 1270 | blob_append(&p->aCol[2], "<ins>", 5); |
| 1271 | 1271 | blob_append_xfer(&p->aCol[2], &p->aCol[4]); |
| 1272 | 1272 | blob_append(&p->aCol[2], "</ins>", 6); |
| 1273 | - | |
| 1273 | + | |
| 1274 | 1274 | p->nPending = 0; |
| 1275 | 1275 | } |
| 1276 | 1276 | static void dfunifiedFinishRow(DiffBuilder *p){ |
| 1277 | 1277 | dfunifiedFinishDelete(p); |
| 1278 | 1278 | dfunifiedFinishInsert(p); |
| @@ -2005,11 +2005,11 @@ | ||
| 2005 | 2005 | } |
| 2006 | 2006 | iDivBig = nBig/2; |
| 2007 | 2007 | iDivSmall = nSmall/2; |
| 2008 | 2008 | |
| 2009 | 2009 | if( pCfg->diffFlags & DIFF_DEBUG ){ |
| 2010 | - fossil_print(" Divide at [%.*s]\n", | |
| 2010 | + fossil_print(" Divide at [%.*s]\n", | |
| 2011 | 2011 | aBig[iDivBig].n, aBig[iDivBig].z); |
| 2012 | 2012 | } |
| 2013 | 2013 | |
| 2014 | 2014 | bestScore = 10000; |
| 2015 | 2015 | for(i=0; i<nSmall; i++){ |
| @@ -3493,11 +3493,12 @@ | ||
| 3493 | 3493 | cnt++; |
| 3494 | 3494 | } |
| 3495 | 3495 | |
| 3496 | 3496 | if( p->nVers==0 ){ |
| 3497 | 3497 | if( zRevision ){ |
| 3498 | - fossil_fatal("file %s does not exist in check-in %s", zFilename, zRevision); | |
| 3498 | + fossil_fatal("file %s does not exist in check-in %s", | |
| 3499 | + zFilename, zRevision); | |
| 3499 | 3500 | }else{ |
| 3500 | 3501 | fossil_fatal("no history for file: %s", zFilename); |
| 3501 | 3502 | } |
| 3502 | 3503 | } |
| 3503 | 3504 | |
| 3504 | 3505 |
| --- src/diff.c | |
| +++ src/diff.c | |
| @@ -90,16 +90,16 @@ | |
| 90 | ** because not all diff operations are started from the command-line. But |
| 91 | ** the idea is sound. |
| 92 | ** |
| 93 | ** Information encoded by this object includes but is not limited to: |
| 94 | ** |
| 95 | ** * The desired output format (unified vs. side-by-side, |
| 96 | ** TCL, JSON, HTML vs. plain-text). |
| 97 | ** |
| 98 | ** * Number of lines of context surrounding each difference block |
| 99 | ** |
| 100 | ** * Width of output columns for text side-by-side diffop |
| 101 | */ |
| 102 | struct DiffConfig { |
| 103 | u64 diffFlags; /* Diff flags */ |
| 104 | int nContext; /* Number of lines of context */ |
| 105 | int wColumn; /* Column width in -y mode */ |
| @@ -915,11 +915,11 @@ | |
| 915 | ** lines and formats them for display. Subclasses of this object format |
| 916 | ** the diff output in different ways. |
| 917 | ** |
| 918 | ** To subclass, create an instance of the DiffBuilder object and fill |
| 919 | ** in appropriate method implementations. |
| 920 | */ |
| 921 | typedef struct DiffBuilder DiffBuilder; |
| 922 | struct DiffBuilder { |
| 923 | void (*xSkip)(DiffBuilder*, unsigned int, int); |
| 924 | void (*xCommon)(DiffBuilder*,const DLine*); |
| 925 | void (*xInsert)(DiffBuilder*,const DLine*); |
| @@ -1100,11 +1100,11 @@ | |
| 1100 | x = chng.a[i].iStart1; |
| 1101 | blob_append_char(p->pOut, ' '); |
| 1102 | blob_append_tcl_literal(p->pOut, pX->z + x, chng.a[i].iLen1); |
| 1103 | x += chng.a[i].iLen1; |
| 1104 | blob_append_char(p->pOut, ' '); |
| 1105 | blob_append_tcl_literal(p->pOut, |
| 1106 | pY->z + chng.a[i].iStart2, chng.a[i].iLen2); |
| 1107 | } |
| 1108 | if( x<pX->n ){ |
| 1109 | blob_append_char(p->pOut, ' '); |
| 1110 | blob_append_tcl_literal(p->pOut, pX->z + x, pX->n - x); |
| @@ -1186,11 +1186,11 @@ | |
| 1186 | x = chng.a[i].iStart1; |
| 1187 | blob_append_char(p->pOut, ','); |
| 1188 | blob_append_json_literal(p->pOut, pX->z + x, chng.a[i].iLen1); |
| 1189 | x += chng.a[i].iLen1; |
| 1190 | blob_append_char(p->pOut, ','); |
| 1191 | blob_append_json_literal(p->pOut, |
| 1192 | pY->z + chng.a[i].iStart2, chng.a[i].iLen2); |
| 1193 | } |
| 1194 | blob_append_char(p->pOut, ','); |
| 1195 | blob_append_json_literal(p->pOut, pX->z + x, pX->n - x); |
| 1196 | blob_append(p->pOut, "],\n",3); |
| @@ -1268,11 +1268,11 @@ | |
| 1268 | |
| 1269 | /* Text of the inserted lines */ |
| 1270 | blob_append(&p->aCol[2], "<ins>", 5); |
| 1271 | blob_append_xfer(&p->aCol[2], &p->aCol[4]); |
| 1272 | blob_append(&p->aCol[2], "</ins>", 6); |
| 1273 | |
| 1274 | p->nPending = 0; |
| 1275 | } |
| 1276 | static void dfunifiedFinishRow(DiffBuilder *p){ |
| 1277 | dfunifiedFinishDelete(p); |
| 1278 | dfunifiedFinishInsert(p); |
| @@ -2005,11 +2005,11 @@ | |
| 2005 | } |
| 2006 | iDivBig = nBig/2; |
| 2007 | iDivSmall = nSmall/2; |
| 2008 | |
| 2009 | if( pCfg->diffFlags & DIFF_DEBUG ){ |
| 2010 | fossil_print(" Divide at [%.*s]\n", |
| 2011 | aBig[iDivBig].n, aBig[iDivBig].z); |
| 2012 | } |
| 2013 | |
| 2014 | bestScore = 10000; |
| 2015 | for(i=0; i<nSmall; i++){ |
| @@ -3493,11 +3493,12 @@ | |
| 3493 | cnt++; |
| 3494 | } |
| 3495 | |
| 3496 | if( p->nVers==0 ){ |
| 3497 | if( zRevision ){ |
| 3498 | fossil_fatal("file %s does not exist in check-in %s", zFilename, zRevision); |
| 3499 | }else{ |
| 3500 | fossil_fatal("no history for file: %s", zFilename); |
| 3501 | } |
| 3502 | } |
| 3503 | |
| 3504 |
| --- src/diff.c | |
| +++ src/diff.c | |
| @@ -90,16 +90,16 @@ | |
| 90 | ** because not all diff operations are started from the command-line. But |
| 91 | ** the idea is sound. |
| 92 | ** |
| 93 | ** Information encoded by this object includes but is not limited to: |
| 94 | ** |
| 95 | ** * The desired output format (unified vs. side-by-side, |
| 96 | ** TCL, JSON, HTML vs. plain-text). |
| 97 | ** |
| 98 | ** * Number of lines of context surrounding each difference block |
| 99 | ** |
| 100 | ** * Width of output columns for text side-by-side diffop |
| 101 | */ |
| 102 | struct DiffConfig { |
| 103 | u64 diffFlags; /* Diff flags */ |
| 104 | int nContext; /* Number of lines of context */ |
| 105 | int wColumn; /* Column width in -y mode */ |
| @@ -915,11 +915,11 @@ | |
| 915 | ** lines and formats them for display. Subclasses of this object format |
| 916 | ** the diff output in different ways. |
| 917 | ** |
| 918 | ** To subclass, create an instance of the DiffBuilder object and fill |
| 919 | ** in appropriate method implementations. |
| 920 | */ |
| 921 | typedef struct DiffBuilder DiffBuilder; |
| 922 | struct DiffBuilder { |
| 923 | void (*xSkip)(DiffBuilder*, unsigned int, int); |
| 924 | void (*xCommon)(DiffBuilder*,const DLine*); |
| 925 | void (*xInsert)(DiffBuilder*,const DLine*); |
| @@ -1100,11 +1100,11 @@ | |
| 1100 | x = chng.a[i].iStart1; |
| 1101 | blob_append_char(p->pOut, ' '); |
| 1102 | blob_append_tcl_literal(p->pOut, pX->z + x, chng.a[i].iLen1); |
| 1103 | x += chng.a[i].iLen1; |
| 1104 | blob_append_char(p->pOut, ' '); |
| 1105 | blob_append_tcl_literal(p->pOut, |
| 1106 | pY->z + chng.a[i].iStart2, chng.a[i].iLen2); |
| 1107 | } |
| 1108 | if( x<pX->n ){ |
| 1109 | blob_append_char(p->pOut, ' '); |
| 1110 | blob_append_tcl_literal(p->pOut, pX->z + x, pX->n - x); |
| @@ -1186,11 +1186,11 @@ | |
| 1186 | x = chng.a[i].iStart1; |
| 1187 | blob_append_char(p->pOut, ','); |
| 1188 | blob_append_json_literal(p->pOut, pX->z + x, chng.a[i].iLen1); |
| 1189 | x += chng.a[i].iLen1; |
| 1190 | blob_append_char(p->pOut, ','); |
| 1191 | blob_append_json_literal(p->pOut, |
| 1192 | pY->z + chng.a[i].iStart2, chng.a[i].iLen2); |
| 1193 | } |
| 1194 | blob_append_char(p->pOut, ','); |
| 1195 | blob_append_json_literal(p->pOut, pX->z + x, pX->n - x); |
| 1196 | blob_append(p->pOut, "],\n",3); |
| @@ -1268,11 +1268,11 @@ | |
| 1268 | |
| 1269 | /* Text of the inserted lines */ |
| 1270 | blob_append(&p->aCol[2], "<ins>", 5); |
| 1271 | blob_append_xfer(&p->aCol[2], &p->aCol[4]); |
| 1272 | blob_append(&p->aCol[2], "</ins>", 6); |
| 1273 | |
| 1274 | p->nPending = 0; |
| 1275 | } |
| 1276 | static void dfunifiedFinishRow(DiffBuilder *p){ |
| 1277 | dfunifiedFinishDelete(p); |
| 1278 | dfunifiedFinishInsert(p); |
| @@ -2005,11 +2005,11 @@ | |
| 2005 | } |
| 2006 | iDivBig = nBig/2; |
| 2007 | iDivSmall = nSmall/2; |
| 2008 | |
| 2009 | if( pCfg->diffFlags & DIFF_DEBUG ){ |
| 2010 | fossil_print(" Divide at [%.*s]\n", |
| 2011 | aBig[iDivBig].n, aBig[iDivBig].z); |
| 2012 | } |
| 2013 | |
| 2014 | bestScore = 10000; |
| 2015 | for(i=0; i<nSmall; i++){ |
| @@ -3493,11 +3493,12 @@ | |
| 3493 | cnt++; |
| 3494 | } |
| 3495 | |
| 3496 | if( p->nVers==0 ){ |
| 3497 | if( zRevision ){ |
| 3498 | fossil_fatal("file %s does not exist in check-in %s", |
| 3499 | zFilename, zRevision); |
| 3500 | }else{ |
| 3501 | fossil_fatal("no history for file: %s", zFilename); |
| 3502 | } |
| 3503 | } |
| 3504 | |
| 3505 |
+14
-14
| --- src/diffcmd.c | ||
| +++ src/diffcmd.c | ||
| @@ -113,11 +113,11 @@ | ||
| 113 | 113 | } |
| 114 | 114 | |
| 115 | 115 | /* |
| 116 | 116 | ** Print details about the compared versions - possibly the working directory |
| 117 | 117 | ** or the undo buffer. For check-ins, show hash and commit time. |
| 118 | -** | |
| 118 | +** | |
| 119 | 119 | ** This is intended primarily to go into the "header garbage" that is ignored |
| 120 | 120 | ** by patch(1). |
| 121 | 121 | ** |
| 122 | 122 | ** zFrom and zTo are interpreted as symbolic version names, unless they |
| 123 | 123 | ** start with '(', in which case they are printed directly. |
| @@ -218,11 +218,11 @@ | ||
| 218 | 218 | |
| 219 | 219 | |
| 220 | 220 | /* |
| 221 | 221 | ** Default header texts for diff with --webpage |
| 222 | 222 | */ |
| 223 | -static const char zWebpageHdr[] = | |
| 223 | +static const char zWebpageHdr[] = | |
| 224 | 224 | @ <!DOCTYPE html> |
| 225 | 225 | @ <html> |
| 226 | 226 | @ <head> |
| 227 | 227 | @ <meta charset="UTF-8"> |
| 228 | 228 | @ <style> |
| @@ -342,16 +342,16 @@ | ||
| 342 | 342 | @ } |
| 343 | 343 | @ td.difftxt ins > ins { |
| 344 | 344 | @ background-color: #559855; |
| 345 | 345 | @ } |
| 346 | 346 | @ } |
| 347 | -@ | |
| 347 | +@ | |
| 348 | 348 | @ </style> |
| 349 | 349 | @ </head> |
| 350 | 350 | @ <body> |
| 351 | 351 | ; |
| 352 | -static const char zWebpageHdrDark[] = | |
| 352 | +static const char zWebpageHdrDark[] = | |
| 353 | 353 | @ <!DOCTYPE html> |
| 354 | 354 | @ <html> |
| 355 | 355 | @ <head> |
| 356 | 356 | @ <meta charset="UTF-8"> |
| 357 | 357 | @ <style> |
| @@ -360,11 +360,11 @@ | ||
| 360 | 360 | @ color: #ffffff; |
| 361 | 361 | @ } |
| 362 | 362 | @ h1 { |
| 363 | 363 | @ font-size: 150%; |
| 364 | 364 | @ } |
| 365 | -@ | |
| 365 | +@ | |
| 366 | 366 | @ table.diff { |
| 367 | 367 | @ width: 100%; |
| 368 | 368 | @ border-spacing: 0; |
| 369 | 369 | @ border: 1px solid black; |
| 370 | 370 | @ line-height: inherit; |
| @@ -448,16 +448,16 @@ | ||
| 448 | 448 | @ td.difftxt ins > ins.edit { |
| 449 | 449 | @ background-color: #c0c0ff; |
| 450 | 450 | @ text-decoration: none; |
| 451 | 451 | @ font-weight: bold; |
| 452 | 452 | @ } |
| 453 | -@ | |
| 453 | +@ | |
| 454 | 454 | @ </style> |
| 455 | 455 | @ </head> |
| 456 | 456 | @ <body> |
| 457 | 457 | ; |
| 458 | -const char zWebpageEnd[] = | |
| 458 | +const char zWebpageEnd[] = | |
| 459 | 459 | @ </body> |
| 460 | 460 | @ </html> |
| 461 | 461 | ; |
| 462 | 462 | |
| 463 | 463 | /* |
| @@ -516,20 +516,20 @@ | ||
| 516 | 516 | #else |
| 517 | 517 | SetConsoleCtrlHandler(diff_console_ctrl_handler, TRUE); |
| 518 | 518 | #endif |
| 519 | 519 | } |
| 520 | 520 | if( (pCfg->diffFlags & DIFF_WEBPAGE)!=0 ){ |
| 521 | - fossil_print("%s",(pCfg->diffFlags & DIFF_DARKMODE)!=0 ? zWebpageHdrDark : | |
| 521 | + fossil_print("%s",(pCfg->diffFlags & DIFF_DARKMODE)!=0 ? zWebpageHdrDark : | |
| 522 | 522 | zWebpageHdr); |
| 523 | 523 | fflush(stdout); |
| 524 | 524 | } |
| 525 | 525 | } |
| 526 | 526 | |
| 527 | 527 | /* Do any final output required by a diff and complete the diff |
| 528 | 528 | ** process. |
| 529 | 529 | ** |
| 530 | -** For --browser and --webpage, output any javascript required by | |
| 530 | +** For --browser and --webpage, output any javascript required by | |
| 531 | 531 | ** the diff. (Currently JS is only needed for side-by-side diffs). |
| 532 | 532 | ** |
| 533 | 533 | ** For --browser, close the connection to the temporary file, then |
| 534 | 534 | ** launch a web browser to view the file. After a delay |
| 535 | 535 | ** of FOSSIL_BROWSER_DIFF_DELAY milliseconds, delete the temp file. |
| @@ -947,11 +947,11 @@ | ||
| 947 | 947 | Blob content; |
| 948 | 948 | db_prepare(&q, "SELECT pathname, content FROM undo"); |
| 949 | 949 | blob_init(&content, 0, 0); |
| 950 | 950 | if( (pCfg->diffFlags & DIFF_SHOW_VERS)!=0 ){ |
| 951 | 951 | diff_print_versions("(undo)", "(workdir)", pCfg); |
| 952 | - } | |
| 952 | + } | |
| 953 | 953 | while( db_step(&q)==SQLITE_ROW ){ |
| 954 | 954 | char *zFullName; |
| 955 | 955 | const char *zFile = (const char*)db_column_text(&q, 0); |
| 956 | 956 | if( !file_dir_match(pFileDir, zFile) ) continue; |
| 957 | 957 | zFullName = mprintf("%s%s", g.zLocalRoot, zFile); |
| @@ -1034,11 +1034,11 @@ | ||
| 1034 | 1034 | pTo = manifest_get_by_name(zTo, 0); |
| 1035 | 1035 | manifest_file_rewind(pTo); |
| 1036 | 1036 | pToFile = manifest_file_next(pTo,0); |
| 1037 | 1037 | if( (pCfg->diffFlags & DIFF_SHOW_VERS)!=0 ){ |
| 1038 | 1038 | diff_print_versions(zFrom, zTo, pCfg); |
| 1039 | - } | |
| 1039 | + } | |
| 1040 | 1040 | while( pFromFile || pToFile ){ |
| 1041 | 1041 | int cmp; |
| 1042 | 1042 | if( pFromFile==0 ){ |
| 1043 | 1043 | cmp = +1; |
| 1044 | 1044 | }else if( pToFile==0 ){ |
| @@ -1250,12 +1250,12 @@ | ||
| 1250 | 1250 | ** --brief Show filenames only |
| 1251 | 1251 | ** -b|--browser Show the diff output in a web-browser |
| 1252 | 1252 | ** --by Shorthand for "--browser -y" |
| 1253 | 1253 | ** -ci|--checkin VERSION Show diff of all changes in VERSION |
| 1254 | 1254 | ** --command PROG External diff program. Overrides "diff-command" |
| 1255 | -** -c|--context N Show N lines of context around each change, with | |
| 1256 | -** negative N meaning show all content | |
| 1255 | +** -c|--context N Show N lines of context around each change, | |
| 1256 | +** with negative N meaning show all content | |
| 1257 | 1257 | ** --dark Use dark mode for the Tcl/Tk-based GUI and HTML |
| 1258 | 1258 | ** --diff-binary BOOL Include binary files with external commands |
| 1259 | 1259 | ** --exec-abs-paths Force absolute path names on external commands |
| 1260 | 1260 | ** --exec-rel-paths Force relative path names on external commands |
| 1261 | 1261 | ** -r|--from VERSION Select VERSION as source for the diff |
| @@ -1383,11 +1383,11 @@ | ||
| 1383 | 1383 | } |
| 1384 | 1384 | fossil_free(pFileDir); |
| 1385 | 1385 | } |
| 1386 | 1386 | diff_end(&DCfg, 0); |
| 1387 | 1387 | if ( DCfg.diffFlags & DIFF_NUMSTAT ){ |
| 1388 | - fossil_print("%10d %10d TOTAL over %d changed files\n", | |
| 1388 | + fossil_print("%10d %10d TOTAL over %d changed files\n", | |
| 1389 | 1389 | g.diffCnt[1], g.diffCnt[2], g.diffCnt[0]); |
| 1390 | 1390 | } |
| 1391 | 1391 | } |
| 1392 | 1392 | |
| 1393 | 1393 | /* |
| 1394 | 1394 |
| --- src/diffcmd.c | |
| +++ src/diffcmd.c | |
| @@ -113,11 +113,11 @@ | |
| 113 | } |
| 114 | |
| 115 | /* |
| 116 | ** Print details about the compared versions - possibly the working directory |
| 117 | ** or the undo buffer. For check-ins, show hash and commit time. |
| 118 | ** |
| 119 | ** This is intended primarily to go into the "header garbage" that is ignored |
| 120 | ** by patch(1). |
| 121 | ** |
| 122 | ** zFrom and zTo are interpreted as symbolic version names, unless they |
| 123 | ** start with '(', in which case they are printed directly. |
| @@ -218,11 +218,11 @@ | |
| 218 | |
| 219 | |
| 220 | /* |
| 221 | ** Default header texts for diff with --webpage |
| 222 | */ |
| 223 | static const char zWebpageHdr[] = |
| 224 | @ <!DOCTYPE html> |
| 225 | @ <html> |
| 226 | @ <head> |
| 227 | @ <meta charset="UTF-8"> |
| 228 | @ <style> |
| @@ -342,16 +342,16 @@ | |
| 342 | @ } |
| 343 | @ td.difftxt ins > ins { |
| 344 | @ background-color: #559855; |
| 345 | @ } |
| 346 | @ } |
| 347 | @ |
| 348 | @ </style> |
| 349 | @ </head> |
| 350 | @ <body> |
| 351 | ; |
| 352 | static const char zWebpageHdrDark[] = |
| 353 | @ <!DOCTYPE html> |
| 354 | @ <html> |
| 355 | @ <head> |
| 356 | @ <meta charset="UTF-8"> |
| 357 | @ <style> |
| @@ -360,11 +360,11 @@ | |
| 360 | @ color: #ffffff; |
| 361 | @ } |
| 362 | @ h1 { |
| 363 | @ font-size: 150%; |
| 364 | @ } |
| 365 | @ |
| 366 | @ table.diff { |
| 367 | @ width: 100%; |
| 368 | @ border-spacing: 0; |
| 369 | @ border: 1px solid black; |
| 370 | @ line-height: inherit; |
| @@ -448,16 +448,16 @@ | |
| 448 | @ td.difftxt ins > ins.edit { |
| 449 | @ background-color: #c0c0ff; |
| 450 | @ text-decoration: none; |
| 451 | @ font-weight: bold; |
| 452 | @ } |
| 453 | @ |
| 454 | @ </style> |
| 455 | @ </head> |
| 456 | @ <body> |
| 457 | ; |
| 458 | const char zWebpageEnd[] = |
| 459 | @ </body> |
| 460 | @ </html> |
| 461 | ; |
| 462 | |
| 463 | /* |
| @@ -516,20 +516,20 @@ | |
| 516 | #else |
| 517 | SetConsoleCtrlHandler(diff_console_ctrl_handler, TRUE); |
| 518 | #endif |
| 519 | } |
| 520 | if( (pCfg->diffFlags & DIFF_WEBPAGE)!=0 ){ |
| 521 | fossil_print("%s",(pCfg->diffFlags & DIFF_DARKMODE)!=0 ? zWebpageHdrDark : |
| 522 | zWebpageHdr); |
| 523 | fflush(stdout); |
| 524 | } |
| 525 | } |
| 526 | |
| 527 | /* Do any final output required by a diff and complete the diff |
| 528 | ** process. |
| 529 | ** |
| 530 | ** For --browser and --webpage, output any javascript required by |
| 531 | ** the diff. (Currently JS is only needed for side-by-side diffs). |
| 532 | ** |
| 533 | ** For --browser, close the connection to the temporary file, then |
| 534 | ** launch a web browser to view the file. After a delay |
| 535 | ** of FOSSIL_BROWSER_DIFF_DELAY milliseconds, delete the temp file. |
| @@ -947,11 +947,11 @@ | |
| 947 | Blob content; |
| 948 | db_prepare(&q, "SELECT pathname, content FROM undo"); |
| 949 | blob_init(&content, 0, 0); |
| 950 | if( (pCfg->diffFlags & DIFF_SHOW_VERS)!=0 ){ |
| 951 | diff_print_versions("(undo)", "(workdir)", pCfg); |
| 952 | } |
| 953 | while( db_step(&q)==SQLITE_ROW ){ |
| 954 | char *zFullName; |
| 955 | const char *zFile = (const char*)db_column_text(&q, 0); |
| 956 | if( !file_dir_match(pFileDir, zFile) ) continue; |
| 957 | zFullName = mprintf("%s%s", g.zLocalRoot, zFile); |
| @@ -1034,11 +1034,11 @@ | |
| 1034 | pTo = manifest_get_by_name(zTo, 0); |
| 1035 | manifest_file_rewind(pTo); |
| 1036 | pToFile = manifest_file_next(pTo,0); |
| 1037 | if( (pCfg->diffFlags & DIFF_SHOW_VERS)!=0 ){ |
| 1038 | diff_print_versions(zFrom, zTo, pCfg); |
| 1039 | } |
| 1040 | while( pFromFile || pToFile ){ |
| 1041 | int cmp; |
| 1042 | if( pFromFile==0 ){ |
| 1043 | cmp = +1; |
| 1044 | }else if( pToFile==0 ){ |
| @@ -1250,12 +1250,12 @@ | |
| 1250 | ** --brief Show filenames only |
| 1251 | ** -b|--browser Show the diff output in a web-browser |
| 1252 | ** --by Shorthand for "--browser -y" |
| 1253 | ** -ci|--checkin VERSION Show diff of all changes in VERSION |
| 1254 | ** --command PROG External diff program. Overrides "diff-command" |
| 1255 | ** -c|--context N Show N lines of context around each change, with |
| 1256 | ** negative N meaning show all content |
| 1257 | ** --dark Use dark mode for the Tcl/Tk-based GUI and HTML |
| 1258 | ** --diff-binary BOOL Include binary files with external commands |
| 1259 | ** --exec-abs-paths Force absolute path names on external commands |
| 1260 | ** --exec-rel-paths Force relative path names on external commands |
| 1261 | ** -r|--from VERSION Select VERSION as source for the diff |
| @@ -1383,11 +1383,11 @@ | |
| 1383 | } |
| 1384 | fossil_free(pFileDir); |
| 1385 | } |
| 1386 | diff_end(&DCfg, 0); |
| 1387 | if ( DCfg.diffFlags & DIFF_NUMSTAT ){ |
| 1388 | fossil_print("%10d %10d TOTAL over %d changed files\n", |
| 1389 | g.diffCnt[1], g.diffCnt[2], g.diffCnt[0]); |
| 1390 | } |
| 1391 | } |
| 1392 | |
| 1393 | /* |
| 1394 |
| --- src/diffcmd.c | |
| +++ src/diffcmd.c | |
| @@ -113,11 +113,11 @@ | |
| 113 | } |
| 114 | |
| 115 | /* |
| 116 | ** Print details about the compared versions - possibly the working directory |
| 117 | ** or the undo buffer. For check-ins, show hash and commit time. |
| 118 | ** |
| 119 | ** This is intended primarily to go into the "header garbage" that is ignored |
| 120 | ** by patch(1). |
| 121 | ** |
| 122 | ** zFrom and zTo are interpreted as symbolic version names, unless they |
| 123 | ** start with '(', in which case they are printed directly. |
| @@ -218,11 +218,11 @@ | |
| 218 | |
| 219 | |
| 220 | /* |
| 221 | ** Default header texts for diff with --webpage |
| 222 | */ |
| 223 | static const char zWebpageHdr[] = |
| 224 | @ <!DOCTYPE html> |
| 225 | @ <html> |
| 226 | @ <head> |
| 227 | @ <meta charset="UTF-8"> |
| 228 | @ <style> |
| @@ -342,16 +342,16 @@ | |
| 342 | @ } |
| 343 | @ td.difftxt ins > ins { |
| 344 | @ background-color: #559855; |
| 345 | @ } |
| 346 | @ } |
| 347 | @ |
| 348 | @ </style> |
| 349 | @ </head> |
| 350 | @ <body> |
| 351 | ; |
| 352 | static const char zWebpageHdrDark[] = |
| 353 | @ <!DOCTYPE html> |
| 354 | @ <html> |
| 355 | @ <head> |
| 356 | @ <meta charset="UTF-8"> |
| 357 | @ <style> |
| @@ -360,11 +360,11 @@ | |
| 360 | @ color: #ffffff; |
| 361 | @ } |
| 362 | @ h1 { |
| 363 | @ font-size: 150%; |
| 364 | @ } |
| 365 | @ |
| 366 | @ table.diff { |
| 367 | @ width: 100%; |
| 368 | @ border-spacing: 0; |
| 369 | @ border: 1px solid black; |
| 370 | @ line-height: inherit; |
| @@ -448,16 +448,16 @@ | |
| 448 | @ td.difftxt ins > ins.edit { |
| 449 | @ background-color: #c0c0ff; |
| 450 | @ text-decoration: none; |
| 451 | @ font-weight: bold; |
| 452 | @ } |
| 453 | @ |
| 454 | @ </style> |
| 455 | @ </head> |
| 456 | @ <body> |
| 457 | ; |
| 458 | const char zWebpageEnd[] = |
| 459 | @ </body> |
| 460 | @ </html> |
| 461 | ; |
| 462 | |
| 463 | /* |
| @@ -516,20 +516,20 @@ | |
| 516 | #else |
| 517 | SetConsoleCtrlHandler(diff_console_ctrl_handler, TRUE); |
| 518 | #endif |
| 519 | } |
| 520 | if( (pCfg->diffFlags & DIFF_WEBPAGE)!=0 ){ |
| 521 | fossil_print("%s",(pCfg->diffFlags & DIFF_DARKMODE)!=0 ? zWebpageHdrDark : |
| 522 | zWebpageHdr); |
| 523 | fflush(stdout); |
| 524 | } |
| 525 | } |
| 526 | |
| 527 | /* Do any final output required by a diff and complete the diff |
| 528 | ** process. |
| 529 | ** |
| 530 | ** For --browser and --webpage, output any javascript required by |
| 531 | ** the diff. (Currently JS is only needed for side-by-side diffs). |
| 532 | ** |
| 533 | ** For --browser, close the connection to the temporary file, then |
| 534 | ** launch a web browser to view the file. After a delay |
| 535 | ** of FOSSIL_BROWSER_DIFF_DELAY milliseconds, delete the temp file. |
| @@ -947,11 +947,11 @@ | |
| 947 | Blob content; |
| 948 | db_prepare(&q, "SELECT pathname, content FROM undo"); |
| 949 | blob_init(&content, 0, 0); |
| 950 | if( (pCfg->diffFlags & DIFF_SHOW_VERS)!=0 ){ |
| 951 | diff_print_versions("(undo)", "(workdir)", pCfg); |
| 952 | } |
| 953 | while( db_step(&q)==SQLITE_ROW ){ |
| 954 | char *zFullName; |
| 955 | const char *zFile = (const char*)db_column_text(&q, 0); |
| 956 | if( !file_dir_match(pFileDir, zFile) ) continue; |
| 957 | zFullName = mprintf("%s%s", g.zLocalRoot, zFile); |
| @@ -1034,11 +1034,11 @@ | |
| 1034 | pTo = manifest_get_by_name(zTo, 0); |
| 1035 | manifest_file_rewind(pTo); |
| 1036 | pToFile = manifest_file_next(pTo,0); |
| 1037 | if( (pCfg->diffFlags & DIFF_SHOW_VERS)!=0 ){ |
| 1038 | diff_print_versions(zFrom, zTo, pCfg); |
| 1039 | } |
| 1040 | while( pFromFile || pToFile ){ |
| 1041 | int cmp; |
| 1042 | if( pFromFile==0 ){ |
| 1043 | cmp = +1; |
| 1044 | }else if( pToFile==0 ){ |
| @@ -1250,12 +1250,12 @@ | |
| 1250 | ** --brief Show filenames only |
| 1251 | ** -b|--browser Show the diff output in a web-browser |
| 1252 | ** --by Shorthand for "--browser -y" |
| 1253 | ** -ci|--checkin VERSION Show diff of all changes in VERSION |
| 1254 | ** --command PROG External diff program. Overrides "diff-command" |
| 1255 | ** -c|--context N Show N lines of context around each change, |
| 1256 | ** with negative N meaning show all content |
| 1257 | ** --dark Use dark mode for the Tcl/Tk-based GUI and HTML |
| 1258 | ** --diff-binary BOOL Include binary files with external commands |
| 1259 | ** --exec-abs-paths Force absolute path names on external commands |
| 1260 | ** --exec-rel-paths Force relative path names on external commands |
| 1261 | ** -r|--from VERSION Select VERSION as source for the diff |
| @@ -1383,11 +1383,11 @@ | |
| 1383 | } |
| 1384 | fossil_free(pFileDir); |
| 1385 | } |
| 1386 | diff_end(&DCfg, 0); |
| 1387 | if ( DCfg.diffFlags & DIFF_NUMSTAT ){ |
| 1388 | fossil_print("%10d %10d TOTAL over %d changed files\n", |
| 1389 | g.diffCnt[1], g.diffCnt[2], g.diffCnt[0]); |
| 1390 | } |
| 1391 | } |
| 1392 | |
| 1393 | /* |
| 1394 |
+16
-15
| --- src/dispatch.c | ||
| +++ src/dispatch.c | ||
| @@ -453,11 +453,11 @@ | ||
| 453 | 453 | if( wantP ){ |
| 454 | 454 | blob_append(pHtml,"<p>", 3); |
| 455 | 455 | wantP = 0; |
| 456 | 456 | } |
| 457 | 457 | blob_append(pHtml, "<ul>\n", 5); |
| 458 | - }else if( isDT | |
| 458 | + }else if( isDT | |
| 459 | 459 | || zHelp[nIndent]=='-' |
| 460 | 460 | || hasGap(zHelp+nIndent,i-nIndent) ){ |
| 461 | 461 | iLevel++; |
| 462 | 462 | aIndent[iLevel] = nIndent; |
| 463 | 463 | azEnd[iLevel] = zEndDL; |
| @@ -547,15 +547,15 @@ | ||
| 547 | 547 | zHelp += i+2; |
| 548 | 548 | blob_append(pText, zHelp, x-3); |
| 549 | 549 | zHelp += x-1; |
| 550 | 550 | i = -1; |
| 551 | 551 | continue; |
| 552 | - } | |
| 552 | + } | |
| 553 | 553 | } |
| 554 | 554 | if( i>0 ){ |
| 555 | 555 | blob_append(pText, zHelp, i); |
| 556 | - } | |
| 556 | + } | |
| 557 | 557 | } |
| 558 | 558 | |
| 559 | 559 | /* |
| 560 | 560 | ** Display help for all commands based on provided flags. |
| 561 | 561 | */ |
| @@ -635,11 +635,11 @@ | ||
| 635 | 635 | ** Defaults to just the CLI commands. Specify --www to see only the |
| 636 | 636 | ** web pages, or --everything to see both commands and pages. |
| 637 | 637 | ** |
| 638 | 638 | ** Options: |
| 639 | 639 | ** -a|--aliases Show aliases |
| 640 | -** -e|--everything Show all commands and pages. Omit aliases to | |
| 640 | +** -e|--everything Show all commands and pages. Omit aliases to | |
| 641 | 641 | ** avoid duplicates. |
| 642 | 642 | ** -h|--html Transform output to HTML |
| 643 | 643 | ** -o|--options Show global options |
| 644 | 644 | ** -r|--raw No output formatting |
| 645 | 645 | ** -s|--settings Show settings |
| @@ -661,11 +661,11 @@ | ||
| 661 | 661 | if( find_option("settings","s",0) ){ |
| 662 | 662 | mask = CMDFLAG_SETTING; |
| 663 | 663 | } |
| 664 | 664 | if( find_option("aliases","a",0) ){ |
| 665 | 665 | mask = CMDFLAG_ALIAS; |
| 666 | - } | |
| 666 | + } | |
| 667 | 667 | if( find_option("test","t",0) ){ |
| 668 | 668 | mask |= CMDFLAG_TEST; |
| 669 | 669 | } |
| 670 | 670 | display_all_help(mask, useHtml, rawOut); |
| 671 | 671 | } |
| @@ -768,11 +768,11 @@ | ||
| 768 | 768 | iFirst = FOSSIL_FIRST_CMD; |
| 769 | 769 | iLast = MX_COMMAND-1; |
| 770 | 770 | } |
| 771 | 771 | |
| 772 | 772 | while( n<nArray ){ |
| 773 | - bestScore = mxScore; | |
| 773 | + bestScore = mxScore; | |
| 774 | 774 | for(i=iFirst; i<=iLast; i++){ |
| 775 | 775 | m = edit_distance(zIn, aCommand[i].zName); |
| 776 | 776 | if( m<mnScore ) continue; |
| 777 | 777 | if( m==mnScore ){ |
| 778 | 778 | azArray[n++] = aCommand[i].zName; |
| @@ -897,11 +897,12 @@ | ||
| 897 | 897 | if( occHelp[aCommand[i].iHelp] > 1 ){ |
| 898 | 898 | int j; |
| 899 | 899 | int aliases[MX_HELP_DUP], nAliases=0; |
| 900 | 900 | for(j=0; j<occHelp[aCommand[i].iHelp]; j++){ |
| 901 | 901 | if( bktHelp[aCommand[i].iHelp][j] != i ){ |
| 902 | - if( aCommand[bktHelp[aCommand[i].iHelp][j]].eCmdFlags & CMDFLAG_ALIAS ){ | |
| 902 | + if( aCommand[bktHelp[aCommand[i].iHelp][j]].eCmdFlags | |
| 903 | + & CMDFLAG_ALIAS ){ | |
| 903 | 904 | aliases[nAliases++] = bktHelp[aCommand[i].iHelp][j]; |
| 904 | 905 | } |
| 905 | 906 | } |
| 906 | 907 | } |
| 907 | 908 | if( nAliases>0 ){ |
| @@ -987,11 +988,11 @@ | ||
| 987 | 988 | @ <dl> |
| 988 | 989 | /* Fill in help string buckets */ |
| 989 | 990 | for(i=0; i<MX_COMMAND; i++){ |
| 990 | 991 | if(aCommand[i].eCmdFlags & CMDFLAG_HIDDEN) continue; |
| 991 | 992 | bktHelp[aCommand[i].iHelp][occHelp[aCommand[i].iHelp]++] = i; |
| 992 | - } | |
| 993 | + } | |
| 993 | 994 | for(i=0; i<MX_COMMAND; i++){ |
| 994 | 995 | const char *zDesc; |
| 995 | 996 | unsigned int e = aCommand[i].eCmdFlags; |
| 996 | 997 | if( e & CMDFLAG_1ST_TIER ){ |
| 997 | 998 | zDesc = "1st tier command"; |
| @@ -1039,11 +1040,11 @@ | ||
| 1039 | 1040 | zDesc = "raw-content web page"; |
| 1040 | 1041 | }else{ |
| 1041 | 1042 | zDesc = "web page"; |
| 1042 | 1043 | } |
| 1043 | 1044 | } |
| 1044 | - | |
| 1045 | + | |
| 1045 | 1046 | @ <dt><big><b>%s(aCommand[bktHelp[aCommand[i].iHelp][j]].zName)</b> |
| 1046 | 1047 | @</big> (%s(zDesc))</dt> |
| 1047 | 1048 | } |
| 1048 | 1049 | @ <p><dd> |
| 1049 | 1050 | help_to_html(aCommand[i].zHelp, cgi_output_blob()); |
| @@ -1118,18 +1119,18 @@ | ||
| 1118 | 1119 | ** Documentation on universal command-line options. |
| 1119 | 1120 | */ |
| 1120 | 1121 | /* @-comment: # */ |
| 1121 | 1122 | static const char zOptions[] = |
| 1122 | 1123 | @ Command-line options common to all commands: |
| 1123 | -@ | |
| 1124 | +@ | |
| 1124 | 1125 | @ --args FILENAME Read additional arguments and options from FILENAME |
| 1125 | 1126 | @ --case-sensitive BOOL Set case sensitivity for file names |
| 1126 | 1127 | @ --cgitrace Active CGI tracing |
| 1127 | -@ --chdir PATH Change to PATH before performing any operations | |
| 1128 | +@ --chdir PATH Change to PATH before performing any operations | |
| 1128 | 1129 | @ --comfmtflags VALUE Set comment formatting flags to VALUE |
| 1129 | 1130 | @ --comment-format VALUE Alias for --comfmtflags |
| 1130 | -@ --errorlog FILENAME Log errors to FILENAME | |
| 1131 | +@ --errorlog FILENAME Log errors to FILENAME | |
| 1131 | 1132 | @ --help Show help on the command rather than running it |
| 1132 | 1133 | @ --httptrace Trace outbound HTTP requests |
| 1133 | 1134 | @ --localtime Display times using the local timezone |
| 1134 | 1135 | @ --nocgi Do not act as CGI |
| 1135 | 1136 | @ --no-th-hook Do not run TH1 hooks |
| @@ -1487,15 +1488,15 @@ | ||
| 1487 | 1488 | } |
| 1488 | 1489 | |
| 1489 | 1490 | /* |
| 1490 | 1491 | ** This method is called to "rewind" the helptextVtab_cursor object back |
| 1491 | 1492 | ** to the first row of output. This method is always called at least |
| 1492 | -** once prior to any call to helptextVtabColumn() or helptextVtabRowid() or | |
| 1493 | +** once prior to any call to helptextVtabColumn() or helptextVtabRowid() or | |
| 1493 | 1494 | ** helptextVtabEof(). |
| 1494 | 1495 | */ |
| 1495 | 1496 | static int helptextVtabFilter( |
| 1496 | - sqlite3_vtab_cursor *pVtabCursor, | |
| 1497 | + sqlite3_vtab_cursor *pVtabCursor, | |
| 1497 | 1498 | int idxNum, const char *idxStr, |
| 1498 | 1499 | int argc, sqlite3_value **argv |
| 1499 | 1500 | ){ |
| 1500 | 1501 | helptextVtab_cursor *pCur = (helptextVtab_cursor *)pVtabCursor; |
| 1501 | 1502 | pCur->iRowid = 1; |
| @@ -1516,11 +1517,11 @@ | ||
| 1516 | 1517 | pIdxInfo->estimatedRows = MX_COMMAND; |
| 1517 | 1518 | return SQLITE_OK; |
| 1518 | 1519 | } |
| 1519 | 1520 | |
| 1520 | 1521 | /* |
| 1521 | -** This following structure defines all the methods for the | |
| 1522 | +** This following structure defines all the methods for the | |
| 1522 | 1523 | ** virtual table. |
| 1523 | 1524 | */ |
| 1524 | 1525 | static sqlite3_module helptextVtabModule = { |
| 1525 | 1526 | /* iVersion */ 0, |
| 1526 | 1527 | /* xCreate */ 0, /* Helptext is eponymous and read-only */ |
| 1527 | 1528 |
| --- src/dispatch.c | |
| +++ src/dispatch.c | |
| @@ -453,11 +453,11 @@ | |
| 453 | if( wantP ){ |
| 454 | blob_append(pHtml,"<p>", 3); |
| 455 | wantP = 0; |
| 456 | } |
| 457 | blob_append(pHtml, "<ul>\n", 5); |
| 458 | }else if( isDT |
| 459 | || zHelp[nIndent]=='-' |
| 460 | || hasGap(zHelp+nIndent,i-nIndent) ){ |
| 461 | iLevel++; |
| 462 | aIndent[iLevel] = nIndent; |
| 463 | azEnd[iLevel] = zEndDL; |
| @@ -547,15 +547,15 @@ | |
| 547 | zHelp += i+2; |
| 548 | blob_append(pText, zHelp, x-3); |
| 549 | zHelp += x-1; |
| 550 | i = -1; |
| 551 | continue; |
| 552 | } |
| 553 | } |
| 554 | if( i>0 ){ |
| 555 | blob_append(pText, zHelp, i); |
| 556 | } |
| 557 | } |
| 558 | |
| 559 | /* |
| 560 | ** Display help for all commands based on provided flags. |
| 561 | */ |
| @@ -635,11 +635,11 @@ | |
| 635 | ** Defaults to just the CLI commands. Specify --www to see only the |
| 636 | ** web pages, or --everything to see both commands and pages. |
| 637 | ** |
| 638 | ** Options: |
| 639 | ** -a|--aliases Show aliases |
| 640 | ** -e|--everything Show all commands and pages. Omit aliases to |
| 641 | ** avoid duplicates. |
| 642 | ** -h|--html Transform output to HTML |
| 643 | ** -o|--options Show global options |
| 644 | ** -r|--raw No output formatting |
| 645 | ** -s|--settings Show settings |
| @@ -661,11 +661,11 @@ | |
| 661 | if( find_option("settings","s",0) ){ |
| 662 | mask = CMDFLAG_SETTING; |
| 663 | } |
| 664 | if( find_option("aliases","a",0) ){ |
| 665 | mask = CMDFLAG_ALIAS; |
| 666 | } |
| 667 | if( find_option("test","t",0) ){ |
| 668 | mask |= CMDFLAG_TEST; |
| 669 | } |
| 670 | display_all_help(mask, useHtml, rawOut); |
| 671 | } |
| @@ -768,11 +768,11 @@ | |
| 768 | iFirst = FOSSIL_FIRST_CMD; |
| 769 | iLast = MX_COMMAND-1; |
| 770 | } |
| 771 | |
| 772 | while( n<nArray ){ |
| 773 | bestScore = mxScore; |
| 774 | for(i=iFirst; i<=iLast; i++){ |
| 775 | m = edit_distance(zIn, aCommand[i].zName); |
| 776 | if( m<mnScore ) continue; |
| 777 | if( m==mnScore ){ |
| 778 | azArray[n++] = aCommand[i].zName; |
| @@ -897,11 +897,12 @@ | |
| 897 | if( occHelp[aCommand[i].iHelp] > 1 ){ |
| 898 | int j; |
| 899 | int aliases[MX_HELP_DUP], nAliases=0; |
| 900 | for(j=0; j<occHelp[aCommand[i].iHelp]; j++){ |
| 901 | if( bktHelp[aCommand[i].iHelp][j] != i ){ |
| 902 | if( aCommand[bktHelp[aCommand[i].iHelp][j]].eCmdFlags & CMDFLAG_ALIAS ){ |
| 903 | aliases[nAliases++] = bktHelp[aCommand[i].iHelp][j]; |
| 904 | } |
| 905 | } |
| 906 | } |
| 907 | if( nAliases>0 ){ |
| @@ -987,11 +988,11 @@ | |
| 987 | @ <dl> |
| 988 | /* Fill in help string buckets */ |
| 989 | for(i=0; i<MX_COMMAND; i++){ |
| 990 | if(aCommand[i].eCmdFlags & CMDFLAG_HIDDEN) continue; |
| 991 | bktHelp[aCommand[i].iHelp][occHelp[aCommand[i].iHelp]++] = i; |
| 992 | } |
| 993 | for(i=0; i<MX_COMMAND; i++){ |
| 994 | const char *zDesc; |
| 995 | unsigned int e = aCommand[i].eCmdFlags; |
| 996 | if( e & CMDFLAG_1ST_TIER ){ |
| 997 | zDesc = "1st tier command"; |
| @@ -1039,11 +1040,11 @@ | |
| 1039 | zDesc = "raw-content web page"; |
| 1040 | }else{ |
| 1041 | zDesc = "web page"; |
| 1042 | } |
| 1043 | } |
| 1044 | |
| 1045 | @ <dt><big><b>%s(aCommand[bktHelp[aCommand[i].iHelp][j]].zName)</b> |
| 1046 | @</big> (%s(zDesc))</dt> |
| 1047 | } |
| 1048 | @ <p><dd> |
| 1049 | help_to_html(aCommand[i].zHelp, cgi_output_blob()); |
| @@ -1118,18 +1119,18 @@ | |
| 1118 | ** Documentation on universal command-line options. |
| 1119 | */ |
| 1120 | /* @-comment: # */ |
| 1121 | static const char zOptions[] = |
| 1122 | @ Command-line options common to all commands: |
| 1123 | @ |
| 1124 | @ --args FILENAME Read additional arguments and options from FILENAME |
| 1125 | @ --case-sensitive BOOL Set case sensitivity for file names |
| 1126 | @ --cgitrace Active CGI tracing |
| 1127 | @ --chdir PATH Change to PATH before performing any operations |
| 1128 | @ --comfmtflags VALUE Set comment formatting flags to VALUE |
| 1129 | @ --comment-format VALUE Alias for --comfmtflags |
| 1130 | @ --errorlog FILENAME Log errors to FILENAME |
| 1131 | @ --help Show help on the command rather than running it |
| 1132 | @ --httptrace Trace outbound HTTP requests |
| 1133 | @ --localtime Display times using the local timezone |
| 1134 | @ --nocgi Do not act as CGI |
| 1135 | @ --no-th-hook Do not run TH1 hooks |
| @@ -1487,15 +1488,15 @@ | |
| 1487 | } |
| 1488 | |
| 1489 | /* |
| 1490 | ** This method is called to "rewind" the helptextVtab_cursor object back |
| 1491 | ** to the first row of output. This method is always called at least |
| 1492 | ** once prior to any call to helptextVtabColumn() or helptextVtabRowid() or |
| 1493 | ** helptextVtabEof(). |
| 1494 | */ |
| 1495 | static int helptextVtabFilter( |
| 1496 | sqlite3_vtab_cursor *pVtabCursor, |
| 1497 | int idxNum, const char *idxStr, |
| 1498 | int argc, sqlite3_value **argv |
| 1499 | ){ |
| 1500 | helptextVtab_cursor *pCur = (helptextVtab_cursor *)pVtabCursor; |
| 1501 | pCur->iRowid = 1; |
| @@ -1516,11 +1517,11 @@ | |
| 1516 | pIdxInfo->estimatedRows = MX_COMMAND; |
| 1517 | return SQLITE_OK; |
| 1518 | } |
| 1519 | |
| 1520 | /* |
| 1521 | ** This following structure defines all the methods for the |
| 1522 | ** virtual table. |
| 1523 | */ |
| 1524 | static sqlite3_module helptextVtabModule = { |
| 1525 | /* iVersion */ 0, |
| 1526 | /* xCreate */ 0, /* Helptext is eponymous and read-only */ |
| 1527 |
| --- src/dispatch.c | |
| +++ src/dispatch.c | |
| @@ -453,11 +453,11 @@ | |
| 453 | if( wantP ){ |
| 454 | blob_append(pHtml,"<p>", 3); |
| 455 | wantP = 0; |
| 456 | } |
| 457 | blob_append(pHtml, "<ul>\n", 5); |
| 458 | }else if( isDT |
| 459 | || zHelp[nIndent]=='-' |
| 460 | || hasGap(zHelp+nIndent,i-nIndent) ){ |
| 461 | iLevel++; |
| 462 | aIndent[iLevel] = nIndent; |
| 463 | azEnd[iLevel] = zEndDL; |
| @@ -547,15 +547,15 @@ | |
| 547 | zHelp += i+2; |
| 548 | blob_append(pText, zHelp, x-3); |
| 549 | zHelp += x-1; |
| 550 | i = -1; |
| 551 | continue; |
| 552 | } |
| 553 | } |
| 554 | if( i>0 ){ |
| 555 | blob_append(pText, zHelp, i); |
| 556 | } |
| 557 | } |
| 558 | |
| 559 | /* |
| 560 | ** Display help for all commands based on provided flags. |
| 561 | */ |
| @@ -635,11 +635,11 @@ | |
| 635 | ** Defaults to just the CLI commands. Specify --www to see only the |
| 636 | ** web pages, or --everything to see both commands and pages. |
| 637 | ** |
| 638 | ** Options: |
| 639 | ** -a|--aliases Show aliases |
| 640 | ** -e|--everything Show all commands and pages. Omit aliases to |
| 641 | ** avoid duplicates. |
| 642 | ** -h|--html Transform output to HTML |
| 643 | ** -o|--options Show global options |
| 644 | ** -r|--raw No output formatting |
| 645 | ** -s|--settings Show settings |
| @@ -661,11 +661,11 @@ | |
| 661 | if( find_option("settings","s",0) ){ |
| 662 | mask = CMDFLAG_SETTING; |
| 663 | } |
| 664 | if( find_option("aliases","a",0) ){ |
| 665 | mask = CMDFLAG_ALIAS; |
| 666 | } |
| 667 | if( find_option("test","t",0) ){ |
| 668 | mask |= CMDFLAG_TEST; |
| 669 | } |
| 670 | display_all_help(mask, useHtml, rawOut); |
| 671 | } |
| @@ -768,11 +768,11 @@ | |
| 768 | iFirst = FOSSIL_FIRST_CMD; |
| 769 | iLast = MX_COMMAND-1; |
| 770 | } |
| 771 | |
| 772 | while( n<nArray ){ |
| 773 | bestScore = mxScore; |
| 774 | for(i=iFirst; i<=iLast; i++){ |
| 775 | m = edit_distance(zIn, aCommand[i].zName); |
| 776 | if( m<mnScore ) continue; |
| 777 | if( m==mnScore ){ |
| 778 | azArray[n++] = aCommand[i].zName; |
| @@ -897,11 +897,12 @@ | |
| 897 | if( occHelp[aCommand[i].iHelp] > 1 ){ |
| 898 | int j; |
| 899 | int aliases[MX_HELP_DUP], nAliases=0; |
| 900 | for(j=0; j<occHelp[aCommand[i].iHelp]; j++){ |
| 901 | if( bktHelp[aCommand[i].iHelp][j] != i ){ |
| 902 | if( aCommand[bktHelp[aCommand[i].iHelp][j]].eCmdFlags |
| 903 | & CMDFLAG_ALIAS ){ |
| 904 | aliases[nAliases++] = bktHelp[aCommand[i].iHelp][j]; |
| 905 | } |
| 906 | } |
| 907 | } |
| 908 | if( nAliases>0 ){ |
| @@ -987,11 +988,11 @@ | |
| 988 | @ <dl> |
| 989 | /* Fill in help string buckets */ |
| 990 | for(i=0; i<MX_COMMAND; i++){ |
| 991 | if(aCommand[i].eCmdFlags & CMDFLAG_HIDDEN) continue; |
| 992 | bktHelp[aCommand[i].iHelp][occHelp[aCommand[i].iHelp]++] = i; |
| 993 | } |
| 994 | for(i=0; i<MX_COMMAND; i++){ |
| 995 | const char *zDesc; |
| 996 | unsigned int e = aCommand[i].eCmdFlags; |
| 997 | if( e & CMDFLAG_1ST_TIER ){ |
| 998 | zDesc = "1st tier command"; |
| @@ -1039,11 +1040,11 @@ | |
| 1040 | zDesc = "raw-content web page"; |
| 1041 | }else{ |
| 1042 | zDesc = "web page"; |
| 1043 | } |
| 1044 | } |
| 1045 | |
| 1046 | @ <dt><big><b>%s(aCommand[bktHelp[aCommand[i].iHelp][j]].zName)</b> |
| 1047 | @</big> (%s(zDesc))</dt> |
| 1048 | } |
| 1049 | @ <p><dd> |
| 1050 | help_to_html(aCommand[i].zHelp, cgi_output_blob()); |
| @@ -1118,18 +1119,18 @@ | |
| 1119 | ** Documentation on universal command-line options. |
| 1120 | */ |
| 1121 | /* @-comment: # */ |
| 1122 | static const char zOptions[] = |
| 1123 | @ Command-line options common to all commands: |
| 1124 | @ |
| 1125 | @ --args FILENAME Read additional arguments and options from FILENAME |
| 1126 | @ --case-sensitive BOOL Set case sensitivity for file names |
| 1127 | @ --cgitrace Active CGI tracing |
| 1128 | @ --chdir PATH Change to PATH before performing any operations |
| 1129 | @ --comfmtflags VALUE Set comment formatting flags to VALUE |
| 1130 | @ --comment-format VALUE Alias for --comfmtflags |
| 1131 | @ --errorlog FILENAME Log errors to FILENAME |
| 1132 | @ --help Show help on the command rather than running it |
| 1133 | @ --httptrace Trace outbound HTTP requests |
| 1134 | @ --localtime Display times using the local timezone |
| 1135 | @ --nocgi Do not act as CGI |
| 1136 | @ --no-th-hook Do not run TH1 hooks |
| @@ -1487,15 +1488,15 @@ | |
| 1488 | } |
| 1489 | |
| 1490 | /* |
| 1491 | ** This method is called to "rewind" the helptextVtab_cursor object back |
| 1492 | ** to the first row of output. This method is always called at least |
| 1493 | ** once prior to any call to helptextVtabColumn() or helptextVtabRowid() or |
| 1494 | ** helptextVtabEof(). |
| 1495 | */ |
| 1496 | static int helptextVtabFilter( |
| 1497 | sqlite3_vtab_cursor *pVtabCursor, |
| 1498 | int idxNum, const char *idxStr, |
| 1499 | int argc, sqlite3_value **argv |
| 1500 | ){ |
| 1501 | helptextVtab_cursor *pCur = (helptextVtab_cursor *)pVtabCursor; |
| 1502 | pCur->iRowid = 1; |
| @@ -1516,11 +1517,11 @@ | |
| 1517 | pIdxInfo->estimatedRows = MX_COMMAND; |
| 1518 | return SQLITE_OK; |
| 1519 | } |
| 1520 | |
| 1521 | /* |
| 1522 | ** This following structure defines all the methods for the |
| 1523 | ** virtual table. |
| 1524 | */ |
| 1525 | static sqlite3_module helptextVtabModule = { |
| 1526 | /* iVersion */ 0, |
| 1527 | /* xCreate */ 0, /* Helptext is eponymous and read-only */ |
| 1528 |
+4
-4
| --- src/doc.c | ||
| +++ src/doc.c | ||
| @@ -341,11 +341,11 @@ | ||
| 341 | 341 | static int once = 0; |
| 342 | 342 | char * z; |
| 343 | 343 | int tokenizerState /* 0=expecting a key, 1=skip next token, |
| 344 | 344 | ** 2=accept next token */; |
| 345 | 345 | if(once==0){ |
| 346 | - once = 1; | |
| 346 | + once = 1; | |
| 347 | 347 | zList = db_get("mimetypes",0); |
| 348 | 348 | if(zList==0){ |
| 349 | 349 | return 0; |
| 350 | 350 | } |
| 351 | 351 | /* Transform zList to simplify the main loop: |
| @@ -729,13 +729,13 @@ | ||
| 729 | 729 | ** |
| 730 | 730 | ** href="$ROOT/..." |
| 731 | 731 | ** action="$ROOT/..." |
| 732 | 732 | ** href=".../doc/$CURRENT/..." |
| 733 | 733 | ** |
| 734 | -** Convert $ROOT to the root URI of the repository, and $CURRENT to the | |
| 734 | +** Convert $ROOT to the root URI of the repository, and $CURRENT to the | |
| 735 | 735 | ** version number of the /doc/ document currently being displayed (if any). |
| 736 | -** Allow ' in place of " and any case for href or action. | |
| 736 | +** Allow ' in place of " and any case for href or action. | |
| 737 | 737 | ** |
| 738 | 738 | ** Efforts are made to limit this translation to cases where the text is |
| 739 | 739 | ** fully contained with an HTML markup element. |
| 740 | 740 | */ |
| 741 | 741 | void convert_href_and_output(Blob *pIn){ |
| @@ -1211,11 +1211,11 @@ | ||
| 1211 | 1211 | ** command. For a permanent website, the recommended process is for |
| 1212 | 1212 | ** the admin to set up a project-specific icon and reference that icon |
| 1213 | 1213 | ** in the HTML header using a line like: |
| 1214 | 1214 | ** |
| 1215 | 1215 | ** <link rel="icon" href="URL-FOR-YOUR-ICON" type="MIMETYPE"/> |
| 1216 | -** | |
| 1216 | +** | |
| 1217 | 1217 | */ |
| 1218 | 1218 | void favicon_page(void){ |
| 1219 | 1219 | Blob icon; |
| 1220 | 1220 | char *zMime; |
| 1221 | 1221 | |
| 1222 | 1222 |
| --- src/doc.c | |
| +++ src/doc.c | |
| @@ -341,11 +341,11 @@ | |
| 341 | static int once = 0; |
| 342 | char * z; |
| 343 | int tokenizerState /* 0=expecting a key, 1=skip next token, |
| 344 | ** 2=accept next token */; |
| 345 | if(once==0){ |
| 346 | once = 1; |
| 347 | zList = db_get("mimetypes",0); |
| 348 | if(zList==0){ |
| 349 | return 0; |
| 350 | } |
| 351 | /* Transform zList to simplify the main loop: |
| @@ -729,13 +729,13 @@ | |
| 729 | ** |
| 730 | ** href="$ROOT/..." |
| 731 | ** action="$ROOT/..." |
| 732 | ** href=".../doc/$CURRENT/..." |
| 733 | ** |
| 734 | ** Convert $ROOT to the root URI of the repository, and $CURRENT to the |
| 735 | ** version number of the /doc/ document currently being displayed (if any). |
| 736 | ** Allow ' in place of " and any case for href or action. |
| 737 | ** |
| 738 | ** Efforts are made to limit this translation to cases where the text is |
| 739 | ** fully contained with an HTML markup element. |
| 740 | */ |
| 741 | void convert_href_and_output(Blob *pIn){ |
| @@ -1211,11 +1211,11 @@ | |
| 1211 | ** command. For a permanent website, the recommended process is for |
| 1212 | ** the admin to set up a project-specific icon and reference that icon |
| 1213 | ** in the HTML header using a line like: |
| 1214 | ** |
| 1215 | ** <link rel="icon" href="URL-FOR-YOUR-ICON" type="MIMETYPE"/> |
| 1216 | ** |
| 1217 | */ |
| 1218 | void favicon_page(void){ |
| 1219 | Blob icon; |
| 1220 | char *zMime; |
| 1221 | |
| 1222 |
| --- src/doc.c | |
| +++ src/doc.c | |
| @@ -341,11 +341,11 @@ | |
| 341 | static int once = 0; |
| 342 | char * z; |
| 343 | int tokenizerState /* 0=expecting a key, 1=skip next token, |
| 344 | ** 2=accept next token */; |
| 345 | if(once==0){ |
| 346 | once = 1; |
| 347 | zList = db_get("mimetypes",0); |
| 348 | if(zList==0){ |
| 349 | return 0; |
| 350 | } |
| 351 | /* Transform zList to simplify the main loop: |
| @@ -729,13 +729,13 @@ | |
| 729 | ** |
| 730 | ** href="$ROOT/..." |
| 731 | ** action="$ROOT/..." |
| 732 | ** href=".../doc/$CURRENT/..." |
| 733 | ** |
| 734 | ** Convert $ROOT to the root URI of the repository, and $CURRENT to the |
| 735 | ** version number of the /doc/ document currently being displayed (if any). |
| 736 | ** Allow ' in place of " and any case for href or action. |
| 737 | ** |
| 738 | ** Efforts are made to limit this translation to cases where the text is |
| 739 | ** fully contained with an HTML markup element. |
| 740 | */ |
| 741 | void convert_href_and_output(Blob *pIn){ |
| @@ -1211,11 +1211,11 @@ | |
| 1211 | ** command. For a permanent website, the recommended process is for |
| 1212 | ** the admin to set up a project-specific icon and reference that icon |
| 1213 | ** in the HTML header using a line like: |
| 1214 | ** |
| 1215 | ** <link rel="icon" href="URL-FOR-YOUR-ICON" type="MIMETYPE"/> |
| 1216 | ** |
| 1217 | */ |
| 1218 | void favicon_page(void){ |
| 1219 | Blob icon; |
| 1220 | char *zMime; |
| 1221 | |
| 1222 |
+4
-4
| --- src/etag.c | ||
| +++ src/etag.c | ||
| @@ -100,18 +100,18 @@ | ||
| 100 | 100 | |
| 101 | 101 | if( etagCancelled ) return; |
| 102 | 102 | |
| 103 | 103 | /* By default, ETagged URLs never expire since the ETag will change |
| 104 | 104 | * when the content changes. Approximate this policy as 10 years. */ |
| 105 | - iMaxAge = 10 * 365 * 24 * 60 * 60; | |
| 105 | + iMaxAge = 10 * 365 * 24 * 60 * 60; | |
| 106 | 106 | md5sum_init(); |
| 107 | 107 | |
| 108 | 108 | /* Always include the executable ID as part of the hash */ |
| 109 | 109 | md5sum_step_text("exe-id: ", -1); |
| 110 | 110 | md5sum_step_text(fossil_exe_id(), -1); |
| 111 | 111 | md5sum_step_text("\n", 1); |
| 112 | - | |
| 112 | + | |
| 113 | 113 | if( (eFlags & ETAG_HASH)!=0 && zHash ){ |
| 114 | 114 | md5sum_step_text("hash: ", -1); |
| 115 | 115 | md5sum_step_text(zHash, -1); |
| 116 | 116 | md5sum_step_text("\n", 1); |
| 117 | 117 | iMaxAge = 0; |
| @@ -210,11 +210,11 @@ | ||
| 210 | 210 | zIfModifiedSince = P("HTTP_IF_MODIFIED_SINCE"); |
| 211 | 211 | if( zIfModifiedSince==0 ) return; |
| 212 | 212 | x = cgi_rfc822_parsedate(zIfModifiedSince); |
| 213 | 213 | if( x<mtime ) return; |
| 214 | 214 | |
| 215 | -#if 0 | |
| 215 | +#if 0 | |
| 216 | 216 | /* If the Fossil executable is more recent than If-Modified-Since, |
| 217 | 217 | ** go ahead and regenerate the resource. */ |
| 218 | 218 | if( file_mtime(g.nameOfExe, ExtFILE)>x ) return; |
| 219 | 219 | #endif |
| 220 | 220 | |
| @@ -244,11 +244,11 @@ | ||
| 244 | 244 | */ |
| 245 | 245 | sqlite3_int64 etag_mtime(void){ |
| 246 | 246 | return iEtagMtime; |
| 247 | 247 | } |
| 248 | 248 | |
| 249 | -/* | |
| 249 | +/* | |
| 250 | 250 | ** COMMAND: test-etag |
| 251 | 251 | ** |
| 252 | 252 | ** Usage: fossil test-etag -key KEY-NUMBER -hash HASH |
| 253 | 253 | ** |
| 254 | 254 | ** Generate an etag given a KEY-NUMBER and/or a HASH. |
| 255 | 255 |
| --- src/etag.c | |
| +++ src/etag.c | |
| @@ -100,18 +100,18 @@ | |
| 100 | |
| 101 | if( etagCancelled ) return; |
| 102 | |
| 103 | /* By default, ETagged URLs never expire since the ETag will change |
| 104 | * when the content changes. Approximate this policy as 10 years. */ |
| 105 | iMaxAge = 10 * 365 * 24 * 60 * 60; |
| 106 | md5sum_init(); |
| 107 | |
| 108 | /* Always include the executable ID as part of the hash */ |
| 109 | md5sum_step_text("exe-id: ", -1); |
| 110 | md5sum_step_text(fossil_exe_id(), -1); |
| 111 | md5sum_step_text("\n", 1); |
| 112 | |
| 113 | if( (eFlags & ETAG_HASH)!=0 && zHash ){ |
| 114 | md5sum_step_text("hash: ", -1); |
| 115 | md5sum_step_text(zHash, -1); |
| 116 | md5sum_step_text("\n", 1); |
| 117 | iMaxAge = 0; |
| @@ -210,11 +210,11 @@ | |
| 210 | zIfModifiedSince = P("HTTP_IF_MODIFIED_SINCE"); |
| 211 | if( zIfModifiedSince==0 ) return; |
| 212 | x = cgi_rfc822_parsedate(zIfModifiedSince); |
| 213 | if( x<mtime ) return; |
| 214 | |
| 215 | #if 0 |
| 216 | /* If the Fossil executable is more recent than If-Modified-Since, |
| 217 | ** go ahead and regenerate the resource. */ |
| 218 | if( file_mtime(g.nameOfExe, ExtFILE)>x ) return; |
| 219 | #endif |
| 220 | |
| @@ -244,11 +244,11 @@ | |
| 244 | */ |
| 245 | sqlite3_int64 etag_mtime(void){ |
| 246 | return iEtagMtime; |
| 247 | } |
| 248 | |
| 249 | /* |
| 250 | ** COMMAND: test-etag |
| 251 | ** |
| 252 | ** Usage: fossil test-etag -key KEY-NUMBER -hash HASH |
| 253 | ** |
| 254 | ** Generate an etag given a KEY-NUMBER and/or a HASH. |
| 255 |
| --- src/etag.c | |
| +++ src/etag.c | |
| @@ -100,18 +100,18 @@ | |
| 100 | |
| 101 | if( etagCancelled ) return; |
| 102 | |
| 103 | /* By default, ETagged URLs never expire since the ETag will change |
| 104 | * when the content changes. Approximate this policy as 10 years. */ |
| 105 | iMaxAge = 10 * 365 * 24 * 60 * 60; |
| 106 | md5sum_init(); |
| 107 | |
| 108 | /* Always include the executable ID as part of the hash */ |
| 109 | md5sum_step_text("exe-id: ", -1); |
| 110 | md5sum_step_text(fossil_exe_id(), -1); |
| 111 | md5sum_step_text("\n", 1); |
| 112 | |
| 113 | if( (eFlags & ETAG_HASH)!=0 && zHash ){ |
| 114 | md5sum_step_text("hash: ", -1); |
| 115 | md5sum_step_text(zHash, -1); |
| 116 | md5sum_step_text("\n", 1); |
| 117 | iMaxAge = 0; |
| @@ -210,11 +210,11 @@ | |
| 210 | zIfModifiedSince = P("HTTP_IF_MODIFIED_SINCE"); |
| 211 | if( zIfModifiedSince==0 ) return; |
| 212 | x = cgi_rfc822_parsedate(zIfModifiedSince); |
| 213 | if( x<mtime ) return; |
| 214 | |
| 215 | #if 0 |
| 216 | /* If the Fossil executable is more recent than If-Modified-Since, |
| 217 | ** go ahead and regenerate the resource. */ |
| 218 | if( file_mtime(g.nameOfExe, ExtFILE)>x ) return; |
| 219 | #endif |
| 220 | |
| @@ -244,11 +244,11 @@ | |
| 244 | */ |
| 245 | sqlite3_int64 etag_mtime(void){ |
| 246 | return iEtagMtime; |
| 247 | } |
| 248 | |
| 249 | /* |
| 250 | ** COMMAND: test-etag |
| 251 | ** |
| 252 | ** Usage: fossil test-etag -key KEY-NUMBER -hash HASH |
| 253 | ** |
| 254 | ** Generate an etag given a KEY-NUMBER and/or a HASH. |
| 255 |
+8
-8
| --- src/export.c | ||
| +++ src/export.c | ||
| @@ -449,11 +449,11 @@ | ||
| 449 | 449 | } |
| 450 | 450 | } |
| 451 | 451 | |
| 452 | 452 | /* This is the original header command (and hence documentation) for |
| 453 | 453 | ** the "fossil export" command: |
| 454 | -** | |
| 454 | +** | |
| 455 | 455 | ** Usage: %fossil export --git ?OPTIONS? ?REPOSITORY? |
| 456 | 456 | ** |
| 457 | 457 | ** Write an export of all check-ins to standard output. The export is |
| 458 | 458 | ** written in the git-fast-export file format assuming the --git option is |
| 459 | 459 | ** provided. The git-fast-export format is currently the only VCS |
| @@ -1004,11 +1004,11 @@ | ||
| 1004 | 1004 | db_reset(&sIns); |
| 1005 | 1005 | return mprintf(":%d", db_last_insert_rowid()); |
| 1006 | 1006 | } |
| 1007 | 1007 | |
| 1008 | 1008 | /* This is the SHA3-256 hash of an empty file */ |
| 1009 | -static const char zEmptySha3[] = | |
| 1009 | +static const char zEmptySha3[] = | |
| 1010 | 1010 | "a7ffc6f8bf1ed76651c14756a061d662f580ff4de43b49fa82d80a4b80f8434a"; |
| 1011 | 1011 | |
| 1012 | 1012 | /* |
| 1013 | 1013 | ** Export a single file named by zUuid. |
| 1014 | 1014 | ** |
| @@ -1037,11 +1037,11 @@ | ||
| 1037 | 1037 | if( rc==0 ){ |
| 1038 | 1038 | if( bPhantomOk ){ |
| 1039 | 1039 | blob_init(&data, 0, 0); |
| 1040 | 1040 | gitmirror_message(VERB_EXTRA, "missing file: %s\n", zUuid); |
| 1041 | 1041 | zUuid = zEmptySha3; |
| 1042 | - }else{ | |
| 1042 | + }else{ | |
| 1043 | 1043 | return 1; |
| 1044 | 1044 | } |
| 1045 | 1045 | } |
| 1046 | 1046 | } |
| 1047 | 1047 | zMark = gitmirror_find_mark(zUuid, 1, 1); |
| @@ -1350,11 +1350,11 @@ | ||
| 1350 | 1350 | gitmirror_message(VERB_NORMAL, "%s\n", zCmd); |
| 1351 | 1351 | xCmd = popen(zCmd, "r"); |
| 1352 | 1352 | if( xCmd==0 ){ |
| 1353 | 1353 | fossil_fatal("git command failed: %s", zCmd); |
| 1354 | 1354 | } |
| 1355 | - | |
| 1355 | + | |
| 1356 | 1356 | z = fgets(zLine, sizeof(zLine), xCmd); |
| 1357 | 1357 | pclose(xCmd); |
| 1358 | 1358 | if( z==0 ){ |
| 1359 | 1359 | fossil_fatal("no output from \"%s\"", zCmd); |
| 1360 | 1360 | } |
| @@ -1361,11 +1361,11 @@ | ||
| 1361 | 1361 | for(i=0; z[i] && !fossil_isspace(z[i]); i++){} |
| 1362 | 1362 | z[i] = 0; |
| 1363 | 1363 | zMainBr = fossil_strdup(z); |
| 1364 | 1364 | } |
| 1365 | 1365 | return zMainBr; |
| 1366 | -} | |
| 1366 | +} | |
| 1367 | 1367 | |
| 1368 | 1368 | /* |
| 1369 | 1369 | ** Implementation of the "fossil git export" command. |
| 1370 | 1370 | */ |
| 1371 | 1371 | void gitmirror_export_command(void){ |
| @@ -1436,11 +1436,11 @@ | ||
| 1436 | 1436 | if( !file_isdir(z, ExtFILE) ){ |
| 1437 | 1437 | zMainBr = gitmirror_init(zMirror, zMainBr); |
| 1438 | 1438 | bNeedRepack = 1; |
| 1439 | 1439 | } |
| 1440 | 1440 | fossil_free(z); |
| 1441 | - | |
| 1441 | + | |
| 1442 | 1442 | /* Make sure the .mirror_state subdirectory exists */ |
| 1443 | 1443 | z = mprintf("%s/.mirror_state", zMirror); |
| 1444 | 1444 | rc = file_mkdir(z, ExtFILE, 0); |
| 1445 | 1445 | if( rc ) fossil_fatal("cannot create directory \"%s\"", z); |
| 1446 | 1446 | fossil_free(z); |
| @@ -1743,11 +1743,11 @@ | ||
| 1743 | 1743 | int bByAll = 0; /* Undocumented option meaning this command was invoked |
| 1744 | 1744 | ** from "fossil all" and should modify output accordingly */ |
| 1745 | 1745 | |
| 1746 | 1746 | db_find_and_open_repository(0, 0); |
| 1747 | 1747 | bQuiet = find_option("quiet","q",0)!=0; |
| 1748 | - bByAll = find_option("by-all",0,0)!=0; | |
| 1748 | + bByAll = find_option("by-all",0,0)!=0; | |
| 1749 | 1749 | verify_all_options(); |
| 1750 | 1750 | zMirror = db_get("last-git-export-repo", 0); |
| 1751 | 1751 | if( zMirror==0 ){ |
| 1752 | 1752 | if( bQuiet ) return; |
| 1753 | 1753 | if( bByAll ) return; |
| @@ -1856,11 +1856,11 @@ | ||
| 1856 | 1856 | ** -q|--quiet Reduce output. Repeat for even less output. |
| 1857 | 1857 | ** -v|--verbose More output |
| 1858 | 1858 | ** |
| 1859 | 1859 | ** > fossil git import MIRROR |
| 1860 | 1860 | ** |
| 1861 | -** TBD... | |
| 1861 | +** TBD... | |
| 1862 | 1862 | ** |
| 1863 | 1863 | ** > fossil git status |
| 1864 | 1864 | ** |
| 1865 | 1865 | ** Show the status of the current Git mirror, if there is one. |
| 1866 | 1866 | ** |
| 1867 | 1867 |
| --- src/export.c | |
| +++ src/export.c | |
| @@ -449,11 +449,11 @@ | |
| 449 | } |
| 450 | } |
| 451 | |
| 452 | /* This is the original header command (and hence documentation) for |
| 453 | ** the "fossil export" command: |
| 454 | ** |
| 455 | ** Usage: %fossil export --git ?OPTIONS? ?REPOSITORY? |
| 456 | ** |
| 457 | ** Write an export of all check-ins to standard output. The export is |
| 458 | ** written in the git-fast-export file format assuming the --git option is |
| 459 | ** provided. The git-fast-export format is currently the only VCS |
| @@ -1004,11 +1004,11 @@ | |
| 1004 | db_reset(&sIns); |
| 1005 | return mprintf(":%d", db_last_insert_rowid()); |
| 1006 | } |
| 1007 | |
| 1008 | /* This is the SHA3-256 hash of an empty file */ |
| 1009 | static const char zEmptySha3[] = |
| 1010 | "a7ffc6f8bf1ed76651c14756a061d662f580ff4de43b49fa82d80a4b80f8434a"; |
| 1011 | |
| 1012 | /* |
| 1013 | ** Export a single file named by zUuid. |
| 1014 | ** |
| @@ -1037,11 +1037,11 @@ | |
| 1037 | if( rc==0 ){ |
| 1038 | if( bPhantomOk ){ |
| 1039 | blob_init(&data, 0, 0); |
| 1040 | gitmirror_message(VERB_EXTRA, "missing file: %s\n", zUuid); |
| 1041 | zUuid = zEmptySha3; |
| 1042 | }else{ |
| 1043 | return 1; |
| 1044 | } |
| 1045 | } |
| 1046 | } |
| 1047 | zMark = gitmirror_find_mark(zUuid, 1, 1); |
| @@ -1350,11 +1350,11 @@ | |
| 1350 | gitmirror_message(VERB_NORMAL, "%s\n", zCmd); |
| 1351 | xCmd = popen(zCmd, "r"); |
| 1352 | if( xCmd==0 ){ |
| 1353 | fossil_fatal("git command failed: %s", zCmd); |
| 1354 | } |
| 1355 | |
| 1356 | z = fgets(zLine, sizeof(zLine), xCmd); |
| 1357 | pclose(xCmd); |
| 1358 | if( z==0 ){ |
| 1359 | fossil_fatal("no output from \"%s\"", zCmd); |
| 1360 | } |
| @@ -1361,11 +1361,11 @@ | |
| 1361 | for(i=0; z[i] && !fossil_isspace(z[i]); i++){} |
| 1362 | z[i] = 0; |
| 1363 | zMainBr = fossil_strdup(z); |
| 1364 | } |
| 1365 | return zMainBr; |
| 1366 | } |
| 1367 | |
| 1368 | /* |
| 1369 | ** Implementation of the "fossil git export" command. |
| 1370 | */ |
| 1371 | void gitmirror_export_command(void){ |
| @@ -1436,11 +1436,11 @@ | |
| 1436 | if( !file_isdir(z, ExtFILE) ){ |
| 1437 | zMainBr = gitmirror_init(zMirror, zMainBr); |
| 1438 | bNeedRepack = 1; |
| 1439 | } |
| 1440 | fossil_free(z); |
| 1441 | |
| 1442 | /* Make sure the .mirror_state subdirectory exists */ |
| 1443 | z = mprintf("%s/.mirror_state", zMirror); |
| 1444 | rc = file_mkdir(z, ExtFILE, 0); |
| 1445 | if( rc ) fossil_fatal("cannot create directory \"%s\"", z); |
| 1446 | fossil_free(z); |
| @@ -1743,11 +1743,11 @@ | |
| 1743 | int bByAll = 0; /* Undocumented option meaning this command was invoked |
| 1744 | ** from "fossil all" and should modify output accordingly */ |
| 1745 | |
| 1746 | db_find_and_open_repository(0, 0); |
| 1747 | bQuiet = find_option("quiet","q",0)!=0; |
| 1748 | bByAll = find_option("by-all",0,0)!=0; |
| 1749 | verify_all_options(); |
| 1750 | zMirror = db_get("last-git-export-repo", 0); |
| 1751 | if( zMirror==0 ){ |
| 1752 | if( bQuiet ) return; |
| 1753 | if( bByAll ) return; |
| @@ -1856,11 +1856,11 @@ | |
| 1856 | ** -q|--quiet Reduce output. Repeat for even less output. |
| 1857 | ** -v|--verbose More output |
| 1858 | ** |
| 1859 | ** > fossil git import MIRROR |
| 1860 | ** |
| 1861 | ** TBD... |
| 1862 | ** |
| 1863 | ** > fossil git status |
| 1864 | ** |
| 1865 | ** Show the status of the current Git mirror, if there is one. |
| 1866 | ** |
| 1867 |
| --- src/export.c | |
| +++ src/export.c | |
| @@ -449,11 +449,11 @@ | |
| 449 | } |
| 450 | } |
| 451 | |
| 452 | /* This is the original header command (and hence documentation) for |
| 453 | ** the "fossil export" command: |
| 454 | ** |
| 455 | ** Usage: %fossil export --git ?OPTIONS? ?REPOSITORY? |
| 456 | ** |
| 457 | ** Write an export of all check-ins to standard output. The export is |
| 458 | ** written in the git-fast-export file format assuming the --git option is |
| 459 | ** provided. The git-fast-export format is currently the only VCS |
| @@ -1004,11 +1004,11 @@ | |
| 1004 | db_reset(&sIns); |
| 1005 | return mprintf(":%d", db_last_insert_rowid()); |
| 1006 | } |
| 1007 | |
| 1008 | /* This is the SHA3-256 hash of an empty file */ |
| 1009 | static const char zEmptySha3[] = |
| 1010 | "a7ffc6f8bf1ed76651c14756a061d662f580ff4de43b49fa82d80a4b80f8434a"; |
| 1011 | |
| 1012 | /* |
| 1013 | ** Export a single file named by zUuid. |
| 1014 | ** |
| @@ -1037,11 +1037,11 @@ | |
| 1037 | if( rc==0 ){ |
| 1038 | if( bPhantomOk ){ |
| 1039 | blob_init(&data, 0, 0); |
| 1040 | gitmirror_message(VERB_EXTRA, "missing file: %s\n", zUuid); |
| 1041 | zUuid = zEmptySha3; |
| 1042 | }else{ |
| 1043 | return 1; |
| 1044 | } |
| 1045 | } |
| 1046 | } |
| 1047 | zMark = gitmirror_find_mark(zUuid, 1, 1); |
| @@ -1350,11 +1350,11 @@ | |
| 1350 | gitmirror_message(VERB_NORMAL, "%s\n", zCmd); |
| 1351 | xCmd = popen(zCmd, "r"); |
| 1352 | if( xCmd==0 ){ |
| 1353 | fossil_fatal("git command failed: %s", zCmd); |
| 1354 | } |
| 1355 | |
| 1356 | z = fgets(zLine, sizeof(zLine), xCmd); |
| 1357 | pclose(xCmd); |
| 1358 | if( z==0 ){ |
| 1359 | fossil_fatal("no output from \"%s\"", zCmd); |
| 1360 | } |
| @@ -1361,11 +1361,11 @@ | |
| 1361 | for(i=0; z[i] && !fossil_isspace(z[i]); i++){} |
| 1362 | z[i] = 0; |
| 1363 | zMainBr = fossil_strdup(z); |
| 1364 | } |
| 1365 | return zMainBr; |
| 1366 | } |
| 1367 | |
| 1368 | /* |
| 1369 | ** Implementation of the "fossil git export" command. |
| 1370 | */ |
| 1371 | void gitmirror_export_command(void){ |
| @@ -1436,11 +1436,11 @@ | |
| 1436 | if( !file_isdir(z, ExtFILE) ){ |
| 1437 | zMainBr = gitmirror_init(zMirror, zMainBr); |
| 1438 | bNeedRepack = 1; |
| 1439 | } |
| 1440 | fossil_free(z); |
| 1441 | |
| 1442 | /* Make sure the .mirror_state subdirectory exists */ |
| 1443 | z = mprintf("%s/.mirror_state", zMirror); |
| 1444 | rc = file_mkdir(z, ExtFILE, 0); |
| 1445 | if( rc ) fossil_fatal("cannot create directory \"%s\"", z); |
| 1446 | fossil_free(z); |
| @@ -1743,11 +1743,11 @@ | |
| 1743 | int bByAll = 0; /* Undocumented option meaning this command was invoked |
| 1744 | ** from "fossil all" and should modify output accordingly */ |
| 1745 | |
| 1746 | db_find_and_open_repository(0, 0); |
| 1747 | bQuiet = find_option("quiet","q",0)!=0; |
| 1748 | bByAll = find_option("by-all",0,0)!=0; |
| 1749 | verify_all_options(); |
| 1750 | zMirror = db_get("last-git-export-repo", 0); |
| 1751 | if( zMirror==0 ){ |
| 1752 | if( bQuiet ) return; |
| 1753 | if( bByAll ) return; |
| @@ -1856,11 +1856,11 @@ | |
| 1856 | ** -q|--quiet Reduce output. Repeat for even less output. |
| 1857 | ** -v|--verbose More output |
| 1858 | ** |
| 1859 | ** > fossil git import MIRROR |
| 1860 | ** |
| 1861 | ** TBD... |
| 1862 | ** |
| 1863 | ** > fossil git status |
| 1864 | ** |
| 1865 | ** Show the status of the current Git mirror, if there is one. |
| 1866 | ** |
| 1867 |
+1
-1
| --- src/file.c | ||
| +++ src/file.c | ||
| @@ -2245,11 +2245,11 @@ | ||
| 2245 | 2245 | ** Return non-NULL if zFilename contains pathname elements that |
| 2246 | 2246 | ** are reserved on Windows. The returned string is the disallowed |
| 2247 | 2247 | ** path element. |
| 2248 | 2248 | */ |
| 2249 | 2249 | const char *file_is_win_reserved(const char *zPath){ |
| 2250 | - static const char *const azRes[] = { "CON", "PRN", "AUX", "NUL", "COM", "LPT" }; | |
| 2250 | + static const char *const azRes[] = { "CON","PRN","AUX","NUL","COM","LPT" }; | |
| 2251 | 2251 | static char zReturn[5]; |
| 2252 | 2252 | int i; |
| 2253 | 2253 | while( zPath[0] ){ |
| 2254 | 2254 | for(i=0; i<count(azRes); i++){ |
| 2255 | 2255 | if( sqlite3_strnicmp(zPath, azRes[i], 3)==0 |
| 2256 | 2256 |
| --- src/file.c | |
| +++ src/file.c | |
| @@ -2245,11 +2245,11 @@ | |
| 2245 | ** Return non-NULL if zFilename contains pathname elements that |
| 2246 | ** are reserved on Windows. The returned string is the disallowed |
| 2247 | ** path element. |
| 2248 | */ |
| 2249 | const char *file_is_win_reserved(const char *zPath){ |
| 2250 | static const char *const azRes[] = { "CON", "PRN", "AUX", "NUL", "COM", "LPT" }; |
| 2251 | static char zReturn[5]; |
| 2252 | int i; |
| 2253 | while( zPath[0] ){ |
| 2254 | for(i=0; i<count(azRes); i++){ |
| 2255 | if( sqlite3_strnicmp(zPath, azRes[i], 3)==0 |
| 2256 |
| --- src/file.c | |
| +++ src/file.c | |
| @@ -2245,11 +2245,11 @@ | |
| 2245 | ** Return non-NULL if zFilename contains pathname elements that |
| 2246 | ** are reserved on Windows. The returned string is the disallowed |
| 2247 | ** path element. |
| 2248 | */ |
| 2249 | const char *file_is_win_reserved(const char *zPath){ |
| 2250 | static const char *const azRes[] = { "CON","PRN","AUX","NUL","COM","LPT" }; |
| 2251 | static char zReturn[5]; |
| 2252 | int i; |
| 2253 | while( zPath[0] ){ |
| 2254 | for(i=0; i<count(azRes); i++){ |
| 2255 | if( sqlite3_strnicmp(zPath, azRes[i], 3)==0 |
| 2256 |
+10
-10
| --- src/fileedit.c | ||
| +++ src/fileedit.c | ||
| @@ -436,11 +436,11 @@ | ||
| 436 | 436 | ** This function validates pCI's state and fails if any validation |
| 437 | 437 | ** fails. |
| 438 | 438 | ** |
| 439 | 439 | ** On error, returns false (0) and, if pErr is not NULL, writes a |
| 440 | 440 | ** diagnostic message there. |
| 441 | -** | |
| 441 | +** | |
| 442 | 442 | ** Returns true on success. If pRid is not NULL, the RID of the |
| 443 | 443 | ** resulting manifest is written to *pRid. |
| 444 | 444 | ** |
| 445 | 445 | ** The check-in process is largely influenced by pCI->flags, and that |
| 446 | 446 | ** must be populated before calling this. See the fossil_cimini_flags |
| @@ -573,11 +573,11 @@ | ||
| 573 | 573 | /* Convert to the requested EOL style. Note that this inherently |
| 574 | 574 | ** runs a risk of breaking content, e.g. string literals which |
| 575 | 575 | ** contain embedded newlines. Note that HTML5 specifies that |
| 576 | 576 | ** form-submitted TEXTAREA content gets normalized to CRLF-style: |
| 577 | 577 | ** |
| 578 | - ** https://html.spec.whatwg.org/multipage/form-elements.html#the-textarea-element | |
| 578 | + ** https://html.spec.whatwg.org/#the-textarea-element | |
| 579 | 579 | */ |
| 580 | 580 | const int pseudoBinary = LOOK_LONG | LOOK_NUL; |
| 581 | 581 | const int lookFlags = LOOK_CRLF | LOOK_LONE_LF | pseudoBinary; |
| 582 | 582 | const int lookNew = looks_like_utf8( &pCI->fileContent, lookFlags ); |
| 583 | 583 | if(!(pseudoBinary & lookNew)){ |
| @@ -981,11 +981,11 @@ | ||
| 981 | 981 | const char * zFilename, |
| 982 | 982 | int * frid){ |
| 983 | 983 | char * zFileUuid = 0; /* file content UUID */ |
| 984 | 984 | const int checkFile = zFilename!=0 || frid!=0; |
| 985 | 985 | int vid = 0; |
| 986 | - | |
| 986 | + | |
| 987 | 987 | if(checkFile && !fileedit_ajax_check_filename(zFilename)){ |
| 988 | 988 | return 0; |
| 989 | 989 | } |
| 990 | 990 | vid = symbolic_name_to_rid(zRev, "ci"); |
| 991 | 991 | if(0==vid){ |
| @@ -1176,11 +1176,11 @@ | ||
| 1176 | 1176 | */ |
| 1177 | 1177 | static int fileedit_setup_cimi_from_p(CheckinMiniInfo * p, Blob * pErr, |
| 1178 | 1178 | int * bIsMissingArg){ |
| 1179 | 1179 | char * zFileUuid = 0; /* UUID of file content */ |
| 1180 | 1180 | const char * zFlag; /* generic flag */ |
| 1181 | - int rc = 0, vid = 0, frid = 0; /* result code, check-in/file rids */ | |
| 1181 | + int rc = 0, vid = 0, frid = 0; /* result code, check-in/file rids */ | |
| 1182 | 1182 | |
| 1183 | 1183 | #define fail(EXPR) blob_appendf EXPR; goto end_fail |
| 1184 | 1184 | zFlag = PD("filename",P("fn")); |
| 1185 | 1185 | if(zFlag==0 || !*zFlag){ |
| 1186 | 1186 | rc = 400; |
| @@ -1371,11 +1371,11 @@ | ||
| 1371 | 1371 | } |
| 1372 | 1372 | CX("%!j", zFilename); |
| 1373 | 1373 | } |
| 1374 | 1374 | } |
| 1375 | 1375 | db_finalize(&q); |
| 1376 | - CX("]}"); | |
| 1376 | + CX("]}"); | |
| 1377 | 1377 | } |
| 1378 | 1378 | |
| 1379 | 1379 | /* |
| 1380 | 1380 | ** AJAX route /fileedit?ajax=filelist |
| 1381 | 1381 | ** |
| @@ -1427,11 +1427,11 @@ | ||
| 1427 | 1427 | |
| 1428 | 1428 | /* |
| 1429 | 1429 | ** AJAX route /fileedit?ajax=commit |
| 1430 | 1430 | ** |
| 1431 | 1431 | ** Required query parameters: |
| 1432 | -** | |
| 1432 | +** | |
| 1433 | 1433 | ** filename=FILENAME |
| 1434 | 1434 | ** checkin=Parent check-in UUID |
| 1435 | 1435 | ** content=text |
| 1436 | 1436 | ** comment=non-empty text |
| 1437 | 1437 | ** |
| @@ -1441,11 +1441,11 @@ | ||
| 1441 | 1441 | ** |
| 1442 | 1442 | ** dry_run=int (1 or 0) |
| 1443 | 1443 | ** |
| 1444 | 1444 | ** include_manifest=int (1 or 0), whether to include |
| 1445 | 1445 | ** the generated manifest in the response. |
| 1446 | -** | |
| 1446 | +** | |
| 1447 | 1447 | ** |
| 1448 | 1448 | ** User must have Write permissions to use this page. |
| 1449 | 1449 | ** |
| 1450 | 1450 | ** Responds with JSON (with some state repeated |
| 1451 | 1451 | ** from the input in order to avoid certain race conditions |
| @@ -1577,11 +1577,11 @@ | ||
| 1577 | 1577 | ** Which additional parameters are used by each distinct ajax route |
| 1578 | 1578 | ** is an internal implementation detail and may change with any |
| 1579 | 1579 | ** given build of this code. An unknown "name" value triggers an |
| 1580 | 1580 | ** error, as documented for ajax_route_error(). |
| 1581 | 1581 | */ |
| 1582 | - | |
| 1582 | + | |
| 1583 | 1583 | /* Allow no access to this page without check-in privilege */ |
| 1584 | 1584 | login_check_credentials(); |
| 1585 | 1585 | if( !g.perm.Write ){ |
| 1586 | 1586 | if(zAjax!=0){ |
| 1587 | 1587 | ajax_route_error(403, "Write permissions required."); |
| @@ -1670,11 +1670,11 @@ | ||
| 1670 | 1670 | ** whatever CSS we wish... |
| 1671 | 1671 | */ |
| 1672 | 1672 | style_script_begin(__FILE__,__LINE__); |
| 1673 | 1673 | CX("document.body.classList.add('fileedit');\n"); |
| 1674 | 1674 | style_script_end(); |
| 1675 | - | |
| 1675 | + | |
| 1676 | 1676 | /* Status bar */ |
| 1677 | 1677 | CX("<div id='fossil-status-bar' " |
| 1678 | 1678 | "title='Status message area. Double-click to clear them.'>" |
| 1679 | 1679 | "Status messages will go here.</div>\n" |
| 1680 | 1680 | /* will be moved into the tab container via JS */); |
| @@ -1939,11 +1939,11 @@ | ||
| 1939 | 1939 | "Comment style:", |
| 1940 | 1940 | "Specify how fossil will interpret the " |
| 1941 | 1941 | "comment string.", |
| 1942 | 1942 | NULL, |
| 1943 | 1943 | "Fossil", "text/x-fossil-wiki", |
| 1944 | - "Markdown", "text/x-markdown", | |
| 1944 | + "Markdown", "text/x-markdown", | |
| 1945 | 1945 | "Plain text", "text/plain", |
| 1946 | 1946 | NULL); |
| 1947 | 1947 | CX("</div>\n"); |
| 1948 | 1948 | } |
| 1949 | 1949 | CX("<div class='fileedit-hint flex-container flex-row'>" |
| 1950 | 1950 |
| --- src/fileedit.c | |
| +++ src/fileedit.c | |
| @@ -436,11 +436,11 @@ | |
| 436 | ** This function validates pCI's state and fails if any validation |
| 437 | ** fails. |
| 438 | ** |
| 439 | ** On error, returns false (0) and, if pErr is not NULL, writes a |
| 440 | ** diagnostic message there. |
| 441 | ** |
| 442 | ** Returns true on success. If pRid is not NULL, the RID of the |
| 443 | ** resulting manifest is written to *pRid. |
| 444 | ** |
| 445 | ** The check-in process is largely influenced by pCI->flags, and that |
| 446 | ** must be populated before calling this. See the fossil_cimini_flags |
| @@ -573,11 +573,11 @@ | |
| 573 | /* Convert to the requested EOL style. Note that this inherently |
| 574 | ** runs a risk of breaking content, e.g. string literals which |
| 575 | ** contain embedded newlines. Note that HTML5 specifies that |
| 576 | ** form-submitted TEXTAREA content gets normalized to CRLF-style: |
| 577 | ** |
| 578 | ** https://html.spec.whatwg.org/multipage/form-elements.html#the-textarea-element |
| 579 | */ |
| 580 | const int pseudoBinary = LOOK_LONG | LOOK_NUL; |
| 581 | const int lookFlags = LOOK_CRLF | LOOK_LONE_LF | pseudoBinary; |
| 582 | const int lookNew = looks_like_utf8( &pCI->fileContent, lookFlags ); |
| 583 | if(!(pseudoBinary & lookNew)){ |
| @@ -981,11 +981,11 @@ | |
| 981 | const char * zFilename, |
| 982 | int * frid){ |
| 983 | char * zFileUuid = 0; /* file content UUID */ |
| 984 | const int checkFile = zFilename!=0 || frid!=0; |
| 985 | int vid = 0; |
| 986 | |
| 987 | if(checkFile && !fileedit_ajax_check_filename(zFilename)){ |
| 988 | return 0; |
| 989 | } |
| 990 | vid = symbolic_name_to_rid(zRev, "ci"); |
| 991 | if(0==vid){ |
| @@ -1176,11 +1176,11 @@ | |
| 1176 | */ |
| 1177 | static int fileedit_setup_cimi_from_p(CheckinMiniInfo * p, Blob * pErr, |
| 1178 | int * bIsMissingArg){ |
| 1179 | char * zFileUuid = 0; /* UUID of file content */ |
| 1180 | const char * zFlag; /* generic flag */ |
| 1181 | int rc = 0, vid = 0, frid = 0; /* result code, check-in/file rids */ |
| 1182 | |
| 1183 | #define fail(EXPR) blob_appendf EXPR; goto end_fail |
| 1184 | zFlag = PD("filename",P("fn")); |
| 1185 | if(zFlag==0 || !*zFlag){ |
| 1186 | rc = 400; |
| @@ -1371,11 +1371,11 @@ | |
| 1371 | } |
| 1372 | CX("%!j", zFilename); |
| 1373 | } |
| 1374 | } |
| 1375 | db_finalize(&q); |
| 1376 | CX("]}"); |
| 1377 | } |
| 1378 | |
| 1379 | /* |
| 1380 | ** AJAX route /fileedit?ajax=filelist |
| 1381 | ** |
| @@ -1427,11 +1427,11 @@ | |
| 1427 | |
| 1428 | /* |
| 1429 | ** AJAX route /fileedit?ajax=commit |
| 1430 | ** |
| 1431 | ** Required query parameters: |
| 1432 | ** |
| 1433 | ** filename=FILENAME |
| 1434 | ** checkin=Parent check-in UUID |
| 1435 | ** content=text |
| 1436 | ** comment=non-empty text |
| 1437 | ** |
| @@ -1441,11 +1441,11 @@ | |
| 1441 | ** |
| 1442 | ** dry_run=int (1 or 0) |
| 1443 | ** |
| 1444 | ** include_manifest=int (1 or 0), whether to include |
| 1445 | ** the generated manifest in the response. |
| 1446 | ** |
| 1447 | ** |
| 1448 | ** User must have Write permissions to use this page. |
| 1449 | ** |
| 1450 | ** Responds with JSON (with some state repeated |
| 1451 | ** from the input in order to avoid certain race conditions |
| @@ -1577,11 +1577,11 @@ | |
| 1577 | ** Which additional parameters are used by each distinct ajax route |
| 1578 | ** is an internal implementation detail and may change with any |
| 1579 | ** given build of this code. An unknown "name" value triggers an |
| 1580 | ** error, as documented for ajax_route_error(). |
| 1581 | */ |
| 1582 | |
| 1583 | /* Allow no access to this page without check-in privilege */ |
| 1584 | login_check_credentials(); |
| 1585 | if( !g.perm.Write ){ |
| 1586 | if(zAjax!=0){ |
| 1587 | ajax_route_error(403, "Write permissions required."); |
| @@ -1670,11 +1670,11 @@ | |
| 1670 | ** whatever CSS we wish... |
| 1671 | */ |
| 1672 | style_script_begin(__FILE__,__LINE__); |
| 1673 | CX("document.body.classList.add('fileedit');\n"); |
| 1674 | style_script_end(); |
| 1675 | |
| 1676 | /* Status bar */ |
| 1677 | CX("<div id='fossil-status-bar' " |
| 1678 | "title='Status message area. Double-click to clear them.'>" |
| 1679 | "Status messages will go here.</div>\n" |
| 1680 | /* will be moved into the tab container via JS */); |
| @@ -1939,11 +1939,11 @@ | |
| 1939 | "Comment style:", |
| 1940 | "Specify how fossil will interpret the " |
| 1941 | "comment string.", |
| 1942 | NULL, |
| 1943 | "Fossil", "text/x-fossil-wiki", |
| 1944 | "Markdown", "text/x-markdown", |
| 1945 | "Plain text", "text/plain", |
| 1946 | NULL); |
| 1947 | CX("</div>\n"); |
| 1948 | } |
| 1949 | CX("<div class='fileedit-hint flex-container flex-row'>" |
| 1950 |
| --- src/fileedit.c | |
| +++ src/fileedit.c | |
| @@ -436,11 +436,11 @@ | |
| 436 | ** This function validates pCI's state and fails if any validation |
| 437 | ** fails. |
| 438 | ** |
| 439 | ** On error, returns false (0) and, if pErr is not NULL, writes a |
| 440 | ** diagnostic message there. |
| 441 | ** |
| 442 | ** Returns true on success. If pRid is not NULL, the RID of the |
| 443 | ** resulting manifest is written to *pRid. |
| 444 | ** |
| 445 | ** The check-in process is largely influenced by pCI->flags, and that |
| 446 | ** must be populated before calling this. See the fossil_cimini_flags |
| @@ -573,11 +573,11 @@ | |
| 573 | /* Convert to the requested EOL style. Note that this inherently |
| 574 | ** runs a risk of breaking content, e.g. string literals which |
| 575 | ** contain embedded newlines. Note that HTML5 specifies that |
| 576 | ** form-submitted TEXTAREA content gets normalized to CRLF-style: |
| 577 | ** |
| 578 | ** https://html.spec.whatwg.org/#the-textarea-element |
| 579 | */ |
| 580 | const int pseudoBinary = LOOK_LONG | LOOK_NUL; |
| 581 | const int lookFlags = LOOK_CRLF | LOOK_LONE_LF | pseudoBinary; |
| 582 | const int lookNew = looks_like_utf8( &pCI->fileContent, lookFlags ); |
| 583 | if(!(pseudoBinary & lookNew)){ |
| @@ -981,11 +981,11 @@ | |
| 981 | const char * zFilename, |
| 982 | int * frid){ |
| 983 | char * zFileUuid = 0; /* file content UUID */ |
| 984 | const int checkFile = zFilename!=0 || frid!=0; |
| 985 | int vid = 0; |
| 986 | |
| 987 | if(checkFile && !fileedit_ajax_check_filename(zFilename)){ |
| 988 | return 0; |
| 989 | } |
| 990 | vid = symbolic_name_to_rid(zRev, "ci"); |
| 991 | if(0==vid){ |
| @@ -1176,11 +1176,11 @@ | |
| 1176 | */ |
| 1177 | static int fileedit_setup_cimi_from_p(CheckinMiniInfo * p, Blob * pErr, |
| 1178 | int * bIsMissingArg){ |
| 1179 | char * zFileUuid = 0; /* UUID of file content */ |
| 1180 | const char * zFlag; /* generic flag */ |
| 1181 | int rc = 0, vid = 0, frid = 0; /* result code, check-in/file rids */ |
| 1182 | |
| 1183 | #define fail(EXPR) blob_appendf EXPR; goto end_fail |
| 1184 | zFlag = PD("filename",P("fn")); |
| 1185 | if(zFlag==0 || !*zFlag){ |
| 1186 | rc = 400; |
| @@ -1371,11 +1371,11 @@ | |
| 1371 | } |
| 1372 | CX("%!j", zFilename); |
| 1373 | } |
| 1374 | } |
| 1375 | db_finalize(&q); |
| 1376 | CX("]}"); |
| 1377 | } |
| 1378 | |
| 1379 | /* |
| 1380 | ** AJAX route /fileedit?ajax=filelist |
| 1381 | ** |
| @@ -1427,11 +1427,11 @@ | |
| 1427 | |
| 1428 | /* |
| 1429 | ** AJAX route /fileedit?ajax=commit |
| 1430 | ** |
| 1431 | ** Required query parameters: |
| 1432 | ** |
| 1433 | ** filename=FILENAME |
| 1434 | ** checkin=Parent check-in UUID |
| 1435 | ** content=text |
| 1436 | ** comment=non-empty text |
| 1437 | ** |
| @@ -1441,11 +1441,11 @@ | |
| 1441 | ** |
| 1442 | ** dry_run=int (1 or 0) |
| 1443 | ** |
| 1444 | ** include_manifest=int (1 or 0), whether to include |
| 1445 | ** the generated manifest in the response. |
| 1446 | ** |
| 1447 | ** |
| 1448 | ** User must have Write permissions to use this page. |
| 1449 | ** |
| 1450 | ** Responds with JSON (with some state repeated |
| 1451 | ** from the input in order to avoid certain race conditions |
| @@ -1577,11 +1577,11 @@ | |
| 1577 | ** Which additional parameters are used by each distinct ajax route |
| 1578 | ** is an internal implementation detail and may change with any |
| 1579 | ** given build of this code. An unknown "name" value triggers an |
| 1580 | ** error, as documented for ajax_route_error(). |
| 1581 | */ |
| 1582 | |
| 1583 | /* Allow no access to this page without check-in privilege */ |
| 1584 | login_check_credentials(); |
| 1585 | if( !g.perm.Write ){ |
| 1586 | if(zAjax!=0){ |
| 1587 | ajax_route_error(403, "Write permissions required."); |
| @@ -1670,11 +1670,11 @@ | |
| 1670 | ** whatever CSS we wish... |
| 1671 | */ |
| 1672 | style_script_begin(__FILE__,__LINE__); |
| 1673 | CX("document.body.classList.add('fileedit');\n"); |
| 1674 | style_script_end(); |
| 1675 | |
| 1676 | /* Status bar */ |
| 1677 | CX("<div id='fossil-status-bar' " |
| 1678 | "title='Status message area. Double-click to clear them.'>" |
| 1679 | "Status messages will go here.</div>\n" |
| 1680 | /* will be moved into the tab container via JS */); |
| @@ -1939,11 +1939,11 @@ | |
| 1939 | "Comment style:", |
| 1940 | "Specify how fossil will interpret the " |
| 1941 | "comment string.", |
| 1942 | NULL, |
| 1943 | "Fossil", "text/x-fossil-wiki", |
| 1944 | "Markdown", "text/x-markdown", |
| 1945 | "Plain text", "text/plain", |
| 1946 | NULL); |
| 1947 | CX("</div>\n"); |
| 1948 | } |
| 1949 | CX("<div class='fileedit-hint flex-container flex-row'>" |
| 1950 |
+4
-4
| --- src/graph.c | ||
| +++ src/graph.c | ||
| @@ -311,11 +311,11 @@ | ||
| 311 | 311 | if( dist<iBestDist ){ |
| 312 | 312 | iBestDist = dist; |
| 313 | 313 | iBest = i; |
| 314 | 314 | } |
| 315 | 315 | } |
| 316 | - | |
| 316 | + | |
| 317 | 317 | /* If no match, consider all possible rails */ |
| 318 | 318 | if( iBestDist>1000 ){ |
| 319 | 319 | for(i=0; i<=p->mxRail+1; i++){ |
| 320 | 320 | int dist; |
| 321 | 321 | if( inUseMask & BIT(i) ) continue; |
| @@ -539,11 +539,11 @@ | ||
| 539 | 539 | if( (tmFlags & (TIMELINE_DISJOINT|TIMELINE_XMERGE))!=0 ){ |
| 540 | 540 | for(pRow=p->pFirst; pRow; pRow=pRow->pNext){ |
| 541 | 541 | for(i=1; i<pRow->nParent; i++){ |
| 542 | 542 | GraphRow *pParent = hashFind(p, pRow->aParent[i]); |
| 543 | 543 | if( pParent==0 ){ |
| 544 | - memmove(pRow->aParent+i, pRow->aParent+i+1, | |
| 544 | + memmove(pRow->aParent+i, pRow->aParent+i+1, | |
| 545 | 545 | sizeof(pRow->aParent[0])*(pRow->nParent-i-1)); |
| 546 | 546 | pRow->nParent--; |
| 547 | 547 | if( i<pRow->nNonCherrypick ){ |
| 548 | 548 | pRow->nNonCherrypick--; |
| 549 | 549 | }else{ |
| @@ -552,11 +552,11 @@ | ||
| 552 | 552 | i--; |
| 553 | 553 | } |
| 554 | 554 | } |
| 555 | 555 | } |
| 556 | 556 | } |
| 557 | - | |
| 557 | + | |
| 558 | 558 | /* Put the deepest (earliest) merge parent first in the list. |
| 559 | 559 | ** An off-screen merge parent is considered deepest. |
| 560 | 560 | */ |
| 561 | 561 | for(pRow=p->pFirst; pRow; pRow=pRow->pNext ){ |
| 562 | 562 | if( pRow->nParent<=1 ) continue; |
| @@ -940,11 +940,11 @@ | ||
| 940 | 940 | ** branch directly above its parent. */ |
| 941 | 941 | continue; |
| 942 | 942 | } |
| 943 | 943 | |
| 944 | 944 | /* All clear. Make the translation |
| 945 | - */ | |
| 945 | + */ | |
| 946 | 946 | for(pLoop=pRow; pLoop && pLoop->idx<=pBottom->idx; pLoop=pLoop->pNext){ |
| 947 | 947 | if( pLoop->iRail==iFrom ){ |
| 948 | 948 | pLoop->iRail = iTo; |
| 949 | 949 | pLoop->aiRiser[iTo] = pLoop->aiRiser[iFrom]; |
| 950 | 950 | pLoop->aiRiser[iFrom] = -1; |
| 951 | 951 |
| --- src/graph.c | |
| +++ src/graph.c | |
| @@ -311,11 +311,11 @@ | |
| 311 | if( dist<iBestDist ){ |
| 312 | iBestDist = dist; |
| 313 | iBest = i; |
| 314 | } |
| 315 | } |
| 316 | |
| 317 | /* If no match, consider all possible rails */ |
| 318 | if( iBestDist>1000 ){ |
| 319 | for(i=0; i<=p->mxRail+1; i++){ |
| 320 | int dist; |
| 321 | if( inUseMask & BIT(i) ) continue; |
| @@ -539,11 +539,11 @@ | |
| 539 | if( (tmFlags & (TIMELINE_DISJOINT|TIMELINE_XMERGE))!=0 ){ |
| 540 | for(pRow=p->pFirst; pRow; pRow=pRow->pNext){ |
| 541 | for(i=1; i<pRow->nParent; i++){ |
| 542 | GraphRow *pParent = hashFind(p, pRow->aParent[i]); |
| 543 | if( pParent==0 ){ |
| 544 | memmove(pRow->aParent+i, pRow->aParent+i+1, |
| 545 | sizeof(pRow->aParent[0])*(pRow->nParent-i-1)); |
| 546 | pRow->nParent--; |
| 547 | if( i<pRow->nNonCherrypick ){ |
| 548 | pRow->nNonCherrypick--; |
| 549 | }else{ |
| @@ -552,11 +552,11 @@ | |
| 552 | i--; |
| 553 | } |
| 554 | } |
| 555 | } |
| 556 | } |
| 557 | |
| 558 | /* Put the deepest (earliest) merge parent first in the list. |
| 559 | ** An off-screen merge parent is considered deepest. |
| 560 | */ |
| 561 | for(pRow=p->pFirst; pRow; pRow=pRow->pNext ){ |
| 562 | if( pRow->nParent<=1 ) continue; |
| @@ -940,11 +940,11 @@ | |
| 940 | ** branch directly above its parent. */ |
| 941 | continue; |
| 942 | } |
| 943 | |
| 944 | /* All clear. Make the translation |
| 945 | */ |
| 946 | for(pLoop=pRow; pLoop && pLoop->idx<=pBottom->idx; pLoop=pLoop->pNext){ |
| 947 | if( pLoop->iRail==iFrom ){ |
| 948 | pLoop->iRail = iTo; |
| 949 | pLoop->aiRiser[iTo] = pLoop->aiRiser[iFrom]; |
| 950 | pLoop->aiRiser[iFrom] = -1; |
| 951 |
| --- src/graph.c | |
| +++ src/graph.c | |
| @@ -311,11 +311,11 @@ | |
| 311 | if( dist<iBestDist ){ |
| 312 | iBestDist = dist; |
| 313 | iBest = i; |
| 314 | } |
| 315 | } |
| 316 | |
| 317 | /* If no match, consider all possible rails */ |
| 318 | if( iBestDist>1000 ){ |
| 319 | for(i=0; i<=p->mxRail+1; i++){ |
| 320 | int dist; |
| 321 | if( inUseMask & BIT(i) ) continue; |
| @@ -539,11 +539,11 @@ | |
| 539 | if( (tmFlags & (TIMELINE_DISJOINT|TIMELINE_XMERGE))!=0 ){ |
| 540 | for(pRow=p->pFirst; pRow; pRow=pRow->pNext){ |
| 541 | for(i=1; i<pRow->nParent; i++){ |
| 542 | GraphRow *pParent = hashFind(p, pRow->aParent[i]); |
| 543 | if( pParent==0 ){ |
| 544 | memmove(pRow->aParent+i, pRow->aParent+i+1, |
| 545 | sizeof(pRow->aParent[0])*(pRow->nParent-i-1)); |
| 546 | pRow->nParent--; |
| 547 | if( i<pRow->nNonCherrypick ){ |
| 548 | pRow->nNonCherrypick--; |
| 549 | }else{ |
| @@ -552,11 +552,11 @@ | |
| 552 | i--; |
| 553 | } |
| 554 | } |
| 555 | } |
| 556 | } |
| 557 | |
| 558 | /* Put the deepest (earliest) merge parent first in the list. |
| 559 | ** An off-screen merge parent is considered deepest. |
| 560 | */ |
| 561 | for(pRow=p->pFirst; pRow; pRow=pRow->pNext ){ |
| 562 | if( pRow->nParent<=1 ) continue; |
| @@ -940,11 +940,11 @@ | |
| 940 | ** branch directly above its parent. */ |
| 941 | continue; |
| 942 | } |
| 943 | |
| 944 | /* All clear. Make the translation |
| 945 | */ |
| 946 | for(pLoop=pRow; pLoop && pLoop->idx<=pBottom->idx; pLoop=pLoop->pNext){ |
| 947 | if( pLoop->iRail==iFrom ){ |
| 948 | pLoop->iRail = iTo; |
| 949 | pLoop->aiRiser[iTo] = pLoop->aiRiser[iFrom]; |
| 950 | pLoop->aiRiser[iFrom] = -1; |
| 951 |
+3
-3
| --- src/http.c | ||
| +++ src/http.c | ||
| @@ -98,11 +98,11 @@ | ||
| 98 | 98 | ** |
| 99 | 99 | ** We assume that a hexadecimal string of exactly 40 characters is a |
| 100 | 100 | ** SHA1 hash, not an original password. If a user has a password which |
| 101 | 101 | ** just happens to be a 40-character hex string, then this routine won't |
| 102 | 102 | ** be able to distinguish it from a hash, the translation will not be |
| 103 | - ** performed, and the sync won't work. | |
| 103 | + ** performed, and the sync won't work. | |
| 104 | 104 | */ |
| 105 | 105 | if( zPw && zPw[0] && (strlen(zPw)!=40 || !validate16(zPw,40)) ){ |
| 106 | 106 | const char *zProjectCode = 0; |
| 107 | 107 | if( g.url.flags & URL_USE_PARENT ){ |
| 108 | 108 | zProjectCode = db_get("parent-project-code", 0); |
| @@ -258,20 +258,20 @@ | ||
| 258 | 258 | fossil_print("RUN %s\n", zCmd); |
| 259 | 259 | } |
| 260 | 260 | rc = fossil_system(zCmd); |
| 261 | 261 | if( rc ){ |
| 262 | 262 | fossil_warning("Transport command failed: %s\n", zCmd); |
| 263 | - } | |
| 263 | + } | |
| 264 | 264 | fossil_free(zCmd); |
| 265 | 265 | file_delete(zUplink); |
| 266 | 266 | if( file_size(zDownlink, ExtFILE)<0 ){ |
| 267 | 267 | blob_zero(pReply); |
| 268 | 268 | }else{ |
| 269 | 269 | blob_read_from_file(pReply, zDownlink, ExtFILE); |
| 270 | 270 | file_delete(zDownlink); |
| 271 | 271 | } |
| 272 | - return rc; | |
| 272 | + return rc; | |
| 273 | 273 | } |
| 274 | 274 | |
| 275 | 275 | /* |
| 276 | 276 | ** Sign the content in pSend, compress it, and send it to the server |
| 277 | 277 | ** via HTTP or HTTPS. Get a reply, uncompress the reply, and store the reply |
| 278 | 278 |
| --- src/http.c | |
| +++ src/http.c | |
| @@ -98,11 +98,11 @@ | |
| 98 | ** |
| 99 | ** We assume that a hexadecimal string of exactly 40 characters is a |
| 100 | ** SHA1 hash, not an original password. If a user has a password which |
| 101 | ** just happens to be a 40-character hex string, then this routine won't |
| 102 | ** be able to distinguish it from a hash, the translation will not be |
| 103 | ** performed, and the sync won't work. |
| 104 | */ |
| 105 | if( zPw && zPw[0] && (strlen(zPw)!=40 || !validate16(zPw,40)) ){ |
| 106 | const char *zProjectCode = 0; |
| 107 | if( g.url.flags & URL_USE_PARENT ){ |
| 108 | zProjectCode = db_get("parent-project-code", 0); |
| @@ -258,20 +258,20 @@ | |
| 258 | fossil_print("RUN %s\n", zCmd); |
| 259 | } |
| 260 | rc = fossil_system(zCmd); |
| 261 | if( rc ){ |
| 262 | fossil_warning("Transport command failed: %s\n", zCmd); |
| 263 | } |
| 264 | fossil_free(zCmd); |
| 265 | file_delete(zUplink); |
| 266 | if( file_size(zDownlink, ExtFILE)<0 ){ |
| 267 | blob_zero(pReply); |
| 268 | }else{ |
| 269 | blob_read_from_file(pReply, zDownlink, ExtFILE); |
| 270 | file_delete(zDownlink); |
| 271 | } |
| 272 | return rc; |
| 273 | } |
| 274 | |
| 275 | /* |
| 276 | ** Sign the content in pSend, compress it, and send it to the server |
| 277 | ** via HTTP or HTTPS. Get a reply, uncompress the reply, and store the reply |
| 278 |
| --- src/http.c | |
| +++ src/http.c | |
| @@ -98,11 +98,11 @@ | |
| 98 | ** |
| 99 | ** We assume that a hexadecimal string of exactly 40 characters is a |
| 100 | ** SHA1 hash, not an original password. If a user has a password which |
| 101 | ** just happens to be a 40-character hex string, then this routine won't |
| 102 | ** be able to distinguish it from a hash, the translation will not be |
| 103 | ** performed, and the sync won't work. |
| 104 | */ |
| 105 | if( zPw && zPw[0] && (strlen(zPw)!=40 || !validate16(zPw,40)) ){ |
| 106 | const char *zProjectCode = 0; |
| 107 | if( g.url.flags & URL_USE_PARENT ){ |
| 108 | zProjectCode = db_get("parent-project-code", 0); |
| @@ -258,20 +258,20 @@ | |
| 258 | fossil_print("RUN %s\n", zCmd); |
| 259 | } |
| 260 | rc = fossil_system(zCmd); |
| 261 | if( rc ){ |
| 262 | fossil_warning("Transport command failed: %s\n", zCmd); |
| 263 | } |
| 264 | fossil_free(zCmd); |
| 265 | file_delete(zUplink); |
| 266 | if( file_size(zDownlink, ExtFILE)<0 ){ |
| 267 | blob_zero(pReply); |
| 268 | }else{ |
| 269 | blob_read_from_file(pReply, zDownlink, ExtFILE); |
| 270 | file_delete(zDownlink); |
| 271 | } |
| 272 | return rc; |
| 273 | } |
| 274 | |
| 275 | /* |
| 276 | ** Sign the content in pSend, compress it, and send it to the server |
| 277 | ** via HTTP or HTTPS. Get a reply, uncompress the reply, and store the reply |
| 278 |
+7
-7
| --- src/http_ssl.c | ||
| +++ src/http_ssl.c | ||
| @@ -59,11 +59,11 @@ | ||
| 59 | 59 | |
| 60 | 60 | |
| 61 | 61 | /* This is a self-signed cert in the PEM format that can be used when |
| 62 | 62 | ** no other certs are available. |
| 63 | 63 | */ |
| 64 | -static const char sslSelfCert[] = | |
| 64 | +static const char sslSelfCert[] = | |
| 65 | 65 | "-----BEGIN CERTIFICATE-----\n" |
| 66 | 66 | "MIIDMTCCAhkCFGrDmuJkkzWERP/ITBvzwwI2lv0TMA0GCSqGSIb3DQEBCwUAMFQx\n" |
| 67 | 67 | "CzAJBgNVBAYTAlVTMQswCQYDVQQIDAJOQzESMBAGA1UEBwwJQ2hhcmxvdHRlMRMw\n" |
| 68 | 68 | "EQYDVQQKDApGb3NzaWwtU0NNMQ8wDQYDVQQDDAZGb3NzaWwwIBcNMjExMjI3MTEz\n" |
| 69 | 69 | "MTU2WhgPMjEyMTEyMjcxMTMxNTZaMFQxCzAJBgNVBAYTAlVTMQswCQYDVQQIDAJO\n" |
| @@ -83,11 +83,11 @@ | ||
| 83 | 83 | "s/TsrXk=\n" |
| 84 | 84 | "-----END CERTIFICATE-----\n"; |
| 85 | 85 | |
| 86 | 86 | /* This is the private-key corresponding to the cert above |
| 87 | 87 | */ |
| 88 | -static const char sslSelfPKey[] = | |
| 88 | +static const char sslSelfPKey[] = | |
| 89 | 89 | "-----BEGIN PRIVATE KEY-----\n" |
| 90 | 90 | "MIIEvAIBADANBgkqhkiG9w0BAQEFAASCBKYwggSiAgEAAoIBAQCCbTU26GRQHQqL\n" |
| 91 | 91 | "q7vyZ0OxpAxmgfAKCxt6eIz+jBi2ZM/CB5vVXWVh2+SkSiWEA3UZiUqXxZlzmS/C\n" |
| 92 | 92 | "glZdiwLLDJML8B4OiV72oivFH/vJ7+cbvh1dTxnYiHuww7GfQngPrLfefiIYPDk1\n" |
| 93 | 93 | "GTUJHBQ7Ue477F7F8vKuHdVgwktF/JDM6M60aSqlo2D/oysirrb+dlurTlv0rjsY\n" |
| @@ -206,11 +206,11 @@ | ||
| 206 | 206 | } |
| 207 | 207 | |
| 208 | 208 | /* |
| 209 | 209 | ** Convert an OpenSSL ASN1_TIME to an ISO8601 timestamp. |
| 210 | 210 | ** |
| 211 | -** Per RFC 5280, ASN1 timestamps in X.509 certificates must | |
| 211 | +** Per RFC 5280, ASN1 timestamps in X.509 certificates must | |
| 212 | 212 | ** be in UTC (Zulu timezone) with no fractional seconds. |
| 213 | 213 | ** |
| 214 | 214 | ** If showUtc==1, add " UTC" at the end of the returned string. This is |
| 215 | 215 | ** not ISO8601-compliant, but makes the displayed value more user-friendly. |
| 216 | 216 | */ |
| @@ -412,11 +412,11 @@ | ||
| 412 | 412 | ** be accepted. Communication will still be encrypted, but the |
| 413 | 413 | ** client has no way of knowing whether it is talking to the |
| 414 | 414 | ** real server or a man-in-the-middle imposter. |
| 415 | 415 | */ |
| 416 | 416 | void ssl_disable_cert_verification(void){ |
| 417 | - sslNoCertVerify = 1; | |
| 417 | + sslNoCertVerify = 1; | |
| 418 | 418 | } |
| 419 | 419 | |
| 420 | 420 | /* |
| 421 | 421 | ** Open an SSL connection as a client that is to connect to the server |
| 422 | 422 | ** identified by pUrlData. |
| @@ -565,16 +565,16 @@ | ||
| 565 | 565 | ssl_asn1time_to_iso8601(X509_get_notBefore(cert), 1)); |
| 566 | 566 | BIO_printf(mem, "\n notAfter: %s", |
| 567 | 567 | ssl_asn1time_to_iso8601(X509_get_notAfter(cert), 1)); |
| 568 | 568 | BIO_printf(mem, "\n sha256: %s", zHash); |
| 569 | 569 | desclen = BIO_get_mem_data(mem, &desc); |
| 570 | - | |
| 570 | + | |
| 571 | 571 | prompt = mprintf("Unable to verify SSL cert from %s\n%.*s\n" |
| 572 | 572 | "accept this cert and continue (y/N/fingerprint)? ", |
| 573 | 573 | pUrlData->name, desclen, desc); |
| 574 | 574 | BIO_free(mem); |
| 575 | - | |
| 575 | + | |
| 576 | 576 | prompt_user(prompt, &ans); |
| 577 | 577 | free(prompt); |
| 578 | 578 | cReply = blob_str(&ans)[0]; |
| 579 | 579 | if( cReply!='y' && cReply!='Y' |
| 580 | 580 | && fossil_stricmp(blob_str(&ans),zHash)!=0 |
| @@ -1185,12 +1185,12 @@ | ||
| 1185 | 1185 | ** Return the OpenSSL version number being used. Space to hold |
| 1186 | 1186 | ** this name is obtained from fossil_malloc() and should be |
| 1187 | 1187 | ** freed by the caller. |
| 1188 | 1188 | */ |
| 1189 | 1189 | char *fossil_openssl_version(void){ |
| 1190 | -#if defined(FOSSIL_ENABLE_SSL) | |
| 1190 | +#if defined(FOSSIL_ENABLE_SSL) | |
| 1191 | 1191 | return mprintf("%s (0x%09x)\n", |
| 1192 | 1192 | SSLeay_version(SSLEAY_VERSION), OPENSSL_VERSION_NUMBER); |
| 1193 | 1193 | #else |
| 1194 | 1194 | return mprintf("none"); |
| 1195 | 1195 | #endif |
| 1196 | 1196 | } |
| 1197 | 1197 |
| --- src/http_ssl.c | |
| +++ src/http_ssl.c | |
| @@ -59,11 +59,11 @@ | |
| 59 | |
| 60 | |
| 61 | /* This is a self-signed cert in the PEM format that can be used when |
| 62 | ** no other certs are available. |
| 63 | */ |
| 64 | static const char sslSelfCert[] = |
| 65 | "-----BEGIN CERTIFICATE-----\n" |
| 66 | "MIIDMTCCAhkCFGrDmuJkkzWERP/ITBvzwwI2lv0TMA0GCSqGSIb3DQEBCwUAMFQx\n" |
| 67 | "CzAJBgNVBAYTAlVTMQswCQYDVQQIDAJOQzESMBAGA1UEBwwJQ2hhcmxvdHRlMRMw\n" |
| 68 | "EQYDVQQKDApGb3NzaWwtU0NNMQ8wDQYDVQQDDAZGb3NzaWwwIBcNMjExMjI3MTEz\n" |
| 69 | "MTU2WhgPMjEyMTEyMjcxMTMxNTZaMFQxCzAJBgNVBAYTAlVTMQswCQYDVQQIDAJO\n" |
| @@ -83,11 +83,11 @@ | |
| 83 | "s/TsrXk=\n" |
| 84 | "-----END CERTIFICATE-----\n"; |
| 85 | |
| 86 | /* This is the private-key corresponding to the cert above |
| 87 | */ |
| 88 | static const char sslSelfPKey[] = |
| 89 | "-----BEGIN PRIVATE KEY-----\n" |
| 90 | "MIIEvAIBADANBgkqhkiG9w0BAQEFAASCBKYwggSiAgEAAoIBAQCCbTU26GRQHQqL\n" |
| 91 | "q7vyZ0OxpAxmgfAKCxt6eIz+jBi2ZM/CB5vVXWVh2+SkSiWEA3UZiUqXxZlzmS/C\n" |
| 92 | "glZdiwLLDJML8B4OiV72oivFH/vJ7+cbvh1dTxnYiHuww7GfQngPrLfefiIYPDk1\n" |
| 93 | "GTUJHBQ7Ue477F7F8vKuHdVgwktF/JDM6M60aSqlo2D/oysirrb+dlurTlv0rjsY\n" |
| @@ -206,11 +206,11 @@ | |
| 206 | } |
| 207 | |
| 208 | /* |
| 209 | ** Convert an OpenSSL ASN1_TIME to an ISO8601 timestamp. |
| 210 | ** |
| 211 | ** Per RFC 5280, ASN1 timestamps in X.509 certificates must |
| 212 | ** be in UTC (Zulu timezone) with no fractional seconds. |
| 213 | ** |
| 214 | ** If showUtc==1, add " UTC" at the end of the returned string. This is |
| 215 | ** not ISO8601-compliant, but makes the displayed value more user-friendly. |
| 216 | */ |
| @@ -412,11 +412,11 @@ | |
| 412 | ** be accepted. Communication will still be encrypted, but the |
| 413 | ** client has no way of knowing whether it is talking to the |
| 414 | ** real server or a man-in-the-middle imposter. |
| 415 | */ |
| 416 | void ssl_disable_cert_verification(void){ |
| 417 | sslNoCertVerify = 1; |
| 418 | } |
| 419 | |
| 420 | /* |
| 421 | ** Open an SSL connection as a client that is to connect to the server |
| 422 | ** identified by pUrlData. |
| @@ -565,16 +565,16 @@ | |
| 565 | ssl_asn1time_to_iso8601(X509_get_notBefore(cert), 1)); |
| 566 | BIO_printf(mem, "\n notAfter: %s", |
| 567 | ssl_asn1time_to_iso8601(X509_get_notAfter(cert), 1)); |
| 568 | BIO_printf(mem, "\n sha256: %s", zHash); |
| 569 | desclen = BIO_get_mem_data(mem, &desc); |
| 570 | |
| 571 | prompt = mprintf("Unable to verify SSL cert from %s\n%.*s\n" |
| 572 | "accept this cert and continue (y/N/fingerprint)? ", |
| 573 | pUrlData->name, desclen, desc); |
| 574 | BIO_free(mem); |
| 575 | |
| 576 | prompt_user(prompt, &ans); |
| 577 | free(prompt); |
| 578 | cReply = blob_str(&ans)[0]; |
| 579 | if( cReply!='y' && cReply!='Y' |
| 580 | && fossil_stricmp(blob_str(&ans),zHash)!=0 |
| @@ -1185,12 +1185,12 @@ | |
| 1185 | ** Return the OpenSSL version number being used. Space to hold |
| 1186 | ** this name is obtained from fossil_malloc() and should be |
| 1187 | ** freed by the caller. |
| 1188 | */ |
| 1189 | char *fossil_openssl_version(void){ |
| 1190 | #if defined(FOSSIL_ENABLE_SSL) |
| 1191 | return mprintf("%s (0x%09x)\n", |
| 1192 | SSLeay_version(SSLEAY_VERSION), OPENSSL_VERSION_NUMBER); |
| 1193 | #else |
| 1194 | return mprintf("none"); |
| 1195 | #endif |
| 1196 | } |
| 1197 |
| --- src/http_ssl.c | |
| +++ src/http_ssl.c | |
| @@ -59,11 +59,11 @@ | |
| 59 | |
| 60 | |
| 61 | /* This is a self-signed cert in the PEM format that can be used when |
| 62 | ** no other certs are available. |
| 63 | */ |
| 64 | static const char sslSelfCert[] = |
| 65 | "-----BEGIN CERTIFICATE-----\n" |
| 66 | "MIIDMTCCAhkCFGrDmuJkkzWERP/ITBvzwwI2lv0TMA0GCSqGSIb3DQEBCwUAMFQx\n" |
| 67 | "CzAJBgNVBAYTAlVTMQswCQYDVQQIDAJOQzESMBAGA1UEBwwJQ2hhcmxvdHRlMRMw\n" |
| 68 | "EQYDVQQKDApGb3NzaWwtU0NNMQ8wDQYDVQQDDAZGb3NzaWwwIBcNMjExMjI3MTEz\n" |
| 69 | "MTU2WhgPMjEyMTEyMjcxMTMxNTZaMFQxCzAJBgNVBAYTAlVTMQswCQYDVQQIDAJO\n" |
| @@ -83,11 +83,11 @@ | |
| 83 | "s/TsrXk=\n" |
| 84 | "-----END CERTIFICATE-----\n"; |
| 85 | |
| 86 | /* This is the private-key corresponding to the cert above |
| 87 | */ |
| 88 | static const char sslSelfPKey[] = |
| 89 | "-----BEGIN PRIVATE KEY-----\n" |
| 90 | "MIIEvAIBADANBgkqhkiG9w0BAQEFAASCBKYwggSiAgEAAoIBAQCCbTU26GRQHQqL\n" |
| 91 | "q7vyZ0OxpAxmgfAKCxt6eIz+jBi2ZM/CB5vVXWVh2+SkSiWEA3UZiUqXxZlzmS/C\n" |
| 92 | "glZdiwLLDJML8B4OiV72oivFH/vJ7+cbvh1dTxnYiHuww7GfQngPrLfefiIYPDk1\n" |
| 93 | "GTUJHBQ7Ue477F7F8vKuHdVgwktF/JDM6M60aSqlo2D/oysirrb+dlurTlv0rjsY\n" |
| @@ -206,11 +206,11 @@ | |
| 206 | } |
| 207 | |
| 208 | /* |
| 209 | ** Convert an OpenSSL ASN1_TIME to an ISO8601 timestamp. |
| 210 | ** |
| 211 | ** Per RFC 5280, ASN1 timestamps in X.509 certificates must |
| 212 | ** be in UTC (Zulu timezone) with no fractional seconds. |
| 213 | ** |
| 214 | ** If showUtc==1, add " UTC" at the end of the returned string. This is |
| 215 | ** not ISO8601-compliant, but makes the displayed value more user-friendly. |
| 216 | */ |
| @@ -412,11 +412,11 @@ | |
| 412 | ** be accepted. Communication will still be encrypted, but the |
| 413 | ** client has no way of knowing whether it is talking to the |
| 414 | ** real server or a man-in-the-middle imposter. |
| 415 | */ |
| 416 | void ssl_disable_cert_verification(void){ |
| 417 | sslNoCertVerify = 1; |
| 418 | } |
| 419 | |
| 420 | /* |
| 421 | ** Open an SSL connection as a client that is to connect to the server |
| 422 | ** identified by pUrlData. |
| @@ -565,16 +565,16 @@ | |
| 565 | ssl_asn1time_to_iso8601(X509_get_notBefore(cert), 1)); |
| 566 | BIO_printf(mem, "\n notAfter: %s", |
| 567 | ssl_asn1time_to_iso8601(X509_get_notAfter(cert), 1)); |
| 568 | BIO_printf(mem, "\n sha256: %s", zHash); |
| 569 | desclen = BIO_get_mem_data(mem, &desc); |
| 570 | |
| 571 | prompt = mprintf("Unable to verify SSL cert from %s\n%.*s\n" |
| 572 | "accept this cert and continue (y/N/fingerprint)? ", |
| 573 | pUrlData->name, desclen, desc); |
| 574 | BIO_free(mem); |
| 575 | |
| 576 | prompt_user(prompt, &ans); |
| 577 | free(prompt); |
| 578 | cReply = blob_str(&ans)[0]; |
| 579 | if( cReply!='y' && cReply!='Y' |
| 580 | && fossil_stricmp(blob_str(&ans),zHash)!=0 |
| @@ -1185,12 +1185,12 @@ | |
| 1185 | ** Return the OpenSSL version number being used. Space to hold |
| 1186 | ** this name is obtained from fossil_malloc() and should be |
| 1187 | ** freed by the caller. |
| 1188 | */ |
| 1189 | char *fossil_openssl_version(void){ |
| 1190 | #if defined(FOSSIL_ENABLE_SSL) |
| 1191 | return mprintf("%s (0x%09x)\n", |
| 1192 | SSLeay_version(SSLEAY_VERSION), OPENSSL_VERSION_NUMBER); |
| 1193 | #else |
| 1194 | return mprintf("none"); |
| 1195 | #endif |
| 1196 | } |
| 1197 |
+1
-1
| --- src/import.c | ||
| +++ src/import.c | ||
| @@ -817,11 +817,11 @@ | ||
| 817 | 817 | if( strncmp(zLine, "N ", 2)==0 ){ |
| 818 | 818 | /* No-op */ |
| 819 | 819 | }else |
| 820 | 820 | if( strncmp(zLine, "property branch-nick ", 21)==0 ){ |
| 821 | 821 | /* Breezy uses this property to store the branch name. |
| 822 | - ** It has two values. Integer branch number, then the | |
| 822 | + ** It has two values. Integer branch number, then the | |
| 823 | 823 | ** user-readable branch name. */ |
| 824 | 824 | z = &zLine[21]; |
| 825 | 825 | next_token(&z); |
| 826 | 826 | fossil_free(gg.zBranch); |
| 827 | 827 | gg.zBranch = fossil_strdup(next_token(&z)); |
| 828 | 828 |
| --- src/import.c | |
| +++ src/import.c | |
| @@ -817,11 +817,11 @@ | |
| 817 | if( strncmp(zLine, "N ", 2)==0 ){ |
| 818 | /* No-op */ |
| 819 | }else |
| 820 | if( strncmp(zLine, "property branch-nick ", 21)==0 ){ |
| 821 | /* Breezy uses this property to store the branch name. |
| 822 | ** It has two values. Integer branch number, then the |
| 823 | ** user-readable branch name. */ |
| 824 | z = &zLine[21]; |
| 825 | next_token(&z); |
| 826 | fossil_free(gg.zBranch); |
| 827 | gg.zBranch = fossil_strdup(next_token(&z)); |
| 828 |
| --- src/import.c | |
| +++ src/import.c | |
| @@ -817,11 +817,11 @@ | |
| 817 | if( strncmp(zLine, "N ", 2)==0 ){ |
| 818 | /* No-op */ |
| 819 | }else |
| 820 | if( strncmp(zLine, "property branch-nick ", 21)==0 ){ |
| 821 | /* Breezy uses this property to store the branch name. |
| 822 | ** It has two values. Integer branch number, then the |
| 823 | ** user-readable branch name. */ |
| 824 | z = &zLine[21]; |
| 825 | next_token(&z); |
| 826 | fossil_free(gg.zBranch); |
| 827 | gg.zBranch = fossil_strdup(next_token(&z)); |
| 828 |
+3
-3
| --- src/info.c | ||
| +++ src/info.c | ||
| @@ -2502,11 +2502,11 @@ | ||
| 2502 | 2502 | page_tree(); |
| 2503 | 2503 | return; |
| 2504 | 2504 | } |
| 2505 | 2505 | /* No directory found, look for an historic version of the file |
| 2506 | 2506 | ** that was subsequently deleted. */ |
| 2507 | - db_prepare(&q, | |
| 2507 | + db_prepare(&q, | |
| 2508 | 2508 | "SELECT fid, uuid FROM mlink, filename, event, blob" |
| 2509 | 2509 | " WHERE filename.name=%Q" |
| 2510 | 2510 | " AND mlink.fnid=filename.fnid AND mlink.fid>0" |
| 2511 | 2511 | " AND event.objid=mlink.mid" |
| 2512 | 2512 | " AND blob.rid=mlink.mid" |
| @@ -2800,11 +2800,11 @@ | ||
| 2800 | 2800 | if( strcmp(zModAction,"approve")==0 ){ |
| 2801 | 2801 | moderation_approve('t', rid); |
| 2802 | 2802 | } |
| 2803 | 2803 | } |
| 2804 | 2804 | zTktTitle = db_table_has_column("repository", "ticket", "title" ) |
| 2805 | - ? db_text("(No title)", | |
| 2805 | + ? db_text("(No title)", | |
| 2806 | 2806 | "SELECT title FROM ticket WHERE tkt_uuid=%Q", zTktName) |
| 2807 | 2807 | : 0; |
| 2808 | 2808 | style_set_current_feature("tinfo"); |
| 2809 | 2809 | style_header("Ticket Change Details"); |
| 2810 | 2810 | style_submenu_element("Raw", "%R/artifact/%s", zUuid); |
| @@ -3832,11 +3832,11 @@ | ||
| 3832 | 3832 | ** If VERSION and the found ancestor refer to the same commit, the last two |
| 3833 | 3833 | ** components are omitted, unless --long is provided. When no fitting tagged |
| 3834 | 3834 | ** ancestor is found, show only the short hash of VERSION. |
| 3835 | 3835 | ** |
| 3836 | 3836 | ** Options: |
| 3837 | -** --digits Display so many hex digits of the hash | |
| 3837 | +** --digits Display so many hex digits of the hash | |
| 3838 | 3838 | ** (default: the larger of 6 and the 'hash-digit' setting) |
| 3839 | 3839 | ** -d|--dirty Show whether there are changes to be committed |
| 3840 | 3840 | ** --long Always show all three components |
| 3841 | 3841 | ** --match GLOB Consider only non-propagating tags matching GLOB |
| 3842 | 3842 | */ |
| 3843 | 3843 |
| --- src/info.c | |
| +++ src/info.c | |
| @@ -2502,11 +2502,11 @@ | |
| 2502 | page_tree(); |
| 2503 | return; |
| 2504 | } |
| 2505 | /* No directory found, look for an historic version of the file |
| 2506 | ** that was subsequently deleted. */ |
| 2507 | db_prepare(&q, |
| 2508 | "SELECT fid, uuid FROM mlink, filename, event, blob" |
| 2509 | " WHERE filename.name=%Q" |
| 2510 | " AND mlink.fnid=filename.fnid AND mlink.fid>0" |
| 2511 | " AND event.objid=mlink.mid" |
| 2512 | " AND blob.rid=mlink.mid" |
| @@ -2800,11 +2800,11 @@ | |
| 2800 | if( strcmp(zModAction,"approve")==0 ){ |
| 2801 | moderation_approve('t', rid); |
| 2802 | } |
| 2803 | } |
| 2804 | zTktTitle = db_table_has_column("repository", "ticket", "title" ) |
| 2805 | ? db_text("(No title)", |
| 2806 | "SELECT title FROM ticket WHERE tkt_uuid=%Q", zTktName) |
| 2807 | : 0; |
| 2808 | style_set_current_feature("tinfo"); |
| 2809 | style_header("Ticket Change Details"); |
| 2810 | style_submenu_element("Raw", "%R/artifact/%s", zUuid); |
| @@ -3832,11 +3832,11 @@ | |
| 3832 | ** If VERSION and the found ancestor refer to the same commit, the last two |
| 3833 | ** components are omitted, unless --long is provided. When no fitting tagged |
| 3834 | ** ancestor is found, show only the short hash of VERSION. |
| 3835 | ** |
| 3836 | ** Options: |
| 3837 | ** --digits Display so many hex digits of the hash |
| 3838 | ** (default: the larger of 6 and the 'hash-digit' setting) |
| 3839 | ** -d|--dirty Show whether there are changes to be committed |
| 3840 | ** --long Always show all three components |
| 3841 | ** --match GLOB Consider only non-propagating tags matching GLOB |
| 3842 | */ |
| 3843 |
| --- src/info.c | |
| +++ src/info.c | |
| @@ -2502,11 +2502,11 @@ | |
| 2502 | page_tree(); |
| 2503 | return; |
| 2504 | } |
| 2505 | /* No directory found, look for an historic version of the file |
| 2506 | ** that was subsequently deleted. */ |
| 2507 | db_prepare(&q, |
| 2508 | "SELECT fid, uuid FROM mlink, filename, event, blob" |
| 2509 | " WHERE filename.name=%Q" |
| 2510 | " AND mlink.fnid=filename.fnid AND mlink.fid>0" |
| 2511 | " AND event.objid=mlink.mid" |
| 2512 | " AND blob.rid=mlink.mid" |
| @@ -2800,11 +2800,11 @@ | |
| 2800 | if( strcmp(zModAction,"approve")==0 ){ |
| 2801 | moderation_approve('t', rid); |
| 2802 | } |
| 2803 | } |
| 2804 | zTktTitle = db_table_has_column("repository", "ticket", "title" ) |
| 2805 | ? db_text("(No title)", |
| 2806 | "SELECT title FROM ticket WHERE tkt_uuid=%Q", zTktName) |
| 2807 | : 0; |
| 2808 | style_set_current_feature("tinfo"); |
| 2809 | style_header("Ticket Change Details"); |
| 2810 | style_submenu_element("Raw", "%R/artifact/%s", zUuid); |
| @@ -3832,11 +3832,11 @@ | |
| 3832 | ** If VERSION and the found ancestor refer to the same commit, the last two |
| 3833 | ** components are omitted, unless --long is provided. When no fitting tagged |
| 3834 | ** ancestor is found, show only the short hash of VERSION. |
| 3835 | ** |
| 3836 | ** Options: |
| 3837 | ** --digits Display so many hex digits of the hash |
| 3838 | ** (default: the larger of 6 and the 'hash-digit' setting) |
| 3839 | ** -d|--dirty Show whether there are changes to be committed |
| 3840 | ** --long Always show all three components |
| 3841 | ** --match GLOB Consider only non-propagating tags matching GLOB |
| 3842 | */ |
| 3843 |
+4
-4
| --- src/interwiki.c | ||
| +++ src/interwiki.c | ||
| @@ -45,14 +45,14 @@ | ||
| 45 | 45 | ** "base": Base URL for the remote site. |
| 46 | 46 | ** "hash": Append this to "base" for Hash targets. |
| 47 | 47 | ** "wiki": Append this to "base" for Wiki targets. |
| 48 | 48 | ** } |
| 49 | 49 | ** |
| 50 | -** If the remote wiki is Fossil, then the correct value for "hash" | |
| 50 | +** If the remote wiki is Fossil, then the correct value for "hash" | |
| 51 | 51 | ** is "/info/" and the correct value for "wiki" is "/wiki?name=". |
| 52 | 52 | ** If (for example) Wikipedia is the remote, then "hash" should be |
| 53 | -** omitted and the correct value for "wiki" is "/wiki/". | |
| 53 | +** omitted and the correct value for "wiki" is "/wiki/". | |
| 54 | 54 | ** |
| 55 | 55 | ** PageName is link name of the target wiki. Several different forms |
| 56 | 56 | ** of PageName are recognized. |
| 57 | 57 | ** |
| 58 | 58 | ** Path If PageName is empty or begins with a "/" character, then |
| @@ -82,11 +82,11 @@ | ||
| 82 | 82 | if( zTarget[i]!=':' ) return 0; |
| 83 | 83 | nCode = i; |
| 84 | 84 | if( nCode==4 && strncmp(zTarget,"wiki",4)==0 ) return 0; |
| 85 | 85 | zPage = zTarget + nCode + 1; |
| 86 | 86 | nPage = (int)strlen(zPage); |
| 87 | - db_static_prepare(&q, | |
| 87 | + db_static_prepare(&q, | |
| 88 | 88 | "SELECT value->>'base', value->>'hash', value->>'wiki'" |
| 89 | 89 | " FROM config WHERE name=lower($name) AND json_valid(value)" |
| 90 | 90 | ); |
| 91 | 91 | zName = mprintf("interwiki:%.*s", nCode, zTarget); |
| 92 | 92 | db_bind_text(&q, "$name", zName); |
| @@ -222,11 +222,11 @@ | ||
| 222 | 222 | db_begin_write(); |
| 223 | 223 | db_unprotect(PROTECT_CONFIG); |
| 224 | 224 | for(i=3; i<g.argc; i++){ |
| 225 | 225 | const char *zName = g.argv[i]; |
| 226 | 226 | db_multi_exec( |
| 227 | - "DELETE FROM config WHERE name='interwiki:%q'", | |
| 227 | + "DELETE FROM config WHERE name='interwiki:%q'", | |
| 228 | 228 | zName |
| 229 | 229 | ); |
| 230 | 230 | } |
| 231 | 231 | setup_incr_cfgcnt(); |
| 232 | 232 | db_protect_pop(); |
| 233 | 233 |
| --- src/interwiki.c | |
| +++ src/interwiki.c | |
| @@ -45,14 +45,14 @@ | |
| 45 | ** "base": Base URL for the remote site. |
| 46 | ** "hash": Append this to "base" for Hash targets. |
| 47 | ** "wiki": Append this to "base" for Wiki targets. |
| 48 | ** } |
| 49 | ** |
| 50 | ** If the remote wiki is Fossil, then the correct value for "hash" |
| 51 | ** is "/info/" and the correct value for "wiki" is "/wiki?name=". |
| 52 | ** If (for example) Wikipedia is the remote, then "hash" should be |
| 53 | ** omitted and the correct value for "wiki" is "/wiki/". |
| 54 | ** |
| 55 | ** PageName is link name of the target wiki. Several different forms |
| 56 | ** of PageName are recognized. |
| 57 | ** |
| 58 | ** Path If PageName is empty or begins with a "/" character, then |
| @@ -82,11 +82,11 @@ | |
| 82 | if( zTarget[i]!=':' ) return 0; |
| 83 | nCode = i; |
| 84 | if( nCode==4 && strncmp(zTarget,"wiki",4)==0 ) return 0; |
| 85 | zPage = zTarget + nCode + 1; |
| 86 | nPage = (int)strlen(zPage); |
| 87 | db_static_prepare(&q, |
| 88 | "SELECT value->>'base', value->>'hash', value->>'wiki'" |
| 89 | " FROM config WHERE name=lower($name) AND json_valid(value)" |
| 90 | ); |
| 91 | zName = mprintf("interwiki:%.*s", nCode, zTarget); |
| 92 | db_bind_text(&q, "$name", zName); |
| @@ -222,11 +222,11 @@ | |
| 222 | db_begin_write(); |
| 223 | db_unprotect(PROTECT_CONFIG); |
| 224 | for(i=3; i<g.argc; i++){ |
| 225 | const char *zName = g.argv[i]; |
| 226 | db_multi_exec( |
| 227 | "DELETE FROM config WHERE name='interwiki:%q'", |
| 228 | zName |
| 229 | ); |
| 230 | } |
| 231 | setup_incr_cfgcnt(); |
| 232 | db_protect_pop(); |
| 233 |
| --- src/interwiki.c | |
| +++ src/interwiki.c | |
| @@ -45,14 +45,14 @@ | |
| 45 | ** "base": Base URL for the remote site. |
| 46 | ** "hash": Append this to "base" for Hash targets. |
| 47 | ** "wiki": Append this to "base" for Wiki targets. |
| 48 | ** } |
| 49 | ** |
| 50 | ** If the remote wiki is Fossil, then the correct value for "hash" |
| 51 | ** is "/info/" and the correct value for "wiki" is "/wiki?name=". |
| 52 | ** If (for example) Wikipedia is the remote, then "hash" should be |
| 53 | ** omitted and the correct value for "wiki" is "/wiki/". |
| 54 | ** |
| 55 | ** PageName is link name of the target wiki. Several different forms |
| 56 | ** of PageName are recognized. |
| 57 | ** |
| 58 | ** Path If PageName is empty or begins with a "/" character, then |
| @@ -82,11 +82,11 @@ | |
| 82 | if( zTarget[i]!=':' ) return 0; |
| 83 | nCode = i; |
| 84 | if( nCode==4 && strncmp(zTarget,"wiki",4)==0 ) return 0; |
| 85 | zPage = zTarget + nCode + 1; |
| 86 | nPage = (int)strlen(zPage); |
| 87 | db_static_prepare(&q, |
| 88 | "SELECT value->>'base', value->>'hash', value->>'wiki'" |
| 89 | " FROM config WHERE name=lower($name) AND json_valid(value)" |
| 90 | ); |
| 91 | zName = mprintf("interwiki:%.*s", nCode, zTarget); |
| 92 | db_bind_text(&q, "$name", zName); |
| @@ -222,11 +222,11 @@ | |
| 222 | db_begin_write(); |
| 223 | db_unprotect(PROTECT_CONFIG); |
| 224 | for(i=3; i<g.argc; i++){ |
| 225 | const char *zName = g.argv[i]; |
| 226 | db_multi_exec( |
| 227 | "DELETE FROM config WHERE name='interwiki:%q'", |
| 228 | zName |
| 229 | ); |
| 230 | } |
| 231 | setup_incr_cfgcnt(); |
| 232 | db_protect_pop(); |
| 233 |
+49
-30
| --- src/json.c | ||
| +++ src/json.c | ||
| @@ -23,12 +23,13 @@ | ||
| 23 | 23 | ** https://fossil-scm.org/fossil/doc/trunk/www/json-api/index.md |
| 24 | 24 | ** |
| 25 | 25 | ** Notes for hackers... |
| 26 | 26 | ** |
| 27 | 27 | ** Here's how command/page dispatching works: json_page_top() (in HTTP mode) or |
| 28 | -** json_cmd_top() (in CLI mode) catch the "json" path/command. Those functions then | |
| 29 | -** dispatch to a JSON-mode-specific command/page handler with the type fossil_json_f(). | |
| 28 | +** json_cmd_top() (in CLI mode) catch the "json" path/command. Those functions | |
| 29 | +** then dispatch to a JSON-mode-specific command/page handler with the type | |
| 30 | +** fossil_json_f(). | |
| 30 | 31 | ** See the API docs for that typedef (below) for the semantics of the callbacks. |
| 31 | 32 | ** |
| 32 | 33 | ** |
| 33 | 34 | */ |
| 34 | 35 | #include "VERSION.h" |
| @@ -36,11 +37,12 @@ | ||
| 36 | 37 | #include "json.h" |
| 37 | 38 | #include <assert.h> |
| 38 | 39 | #include <time.h> |
| 39 | 40 | |
| 40 | 41 | #if INTERFACE |
| 41 | -#include "json_detail.h" /* workaround for apparent enum limitation in makeheaders */ | |
| 42 | +#include "json_detail.h" /* workaround for apparent enum limitation | |
| 43 | + in makeheaders */ | |
| 42 | 44 | #endif |
| 43 | 45 | |
| 44 | 46 | const FossilJsonKeys_ FossilJsonKeys = { |
| 45 | 47 | "anonymousSeed" /*anonymousSeed*/, |
| 46 | 48 | "authToken" /*authToken*/, |
| @@ -176,11 +178,12 @@ | ||
| 176 | 178 | |
| 177 | 179 | /* |
| 178 | 180 | ** Convenience wrapper around cson_output() which appends the output |
| 179 | 181 | ** to pDest. pOpt may be NULL, in which case g.json.outOpt will be used. |
| 180 | 182 | */ |
| 181 | -int cson_output_Blob( cson_value const * pVal, Blob * pDest, cson_output_opt const * pOpt ){ | |
| 183 | +int cson_output_Blob( cson_value const * pVal, Blob * pDest, | |
| 184 | + cson_output_opt const * pOpt ){ | |
| 182 | 185 | return cson_output( pVal, cson_data_dest_Blob, |
| 183 | 186 | pDest, pOpt ? pOpt : &g.json.outOpt ); |
| 184 | 187 | } |
| 185 | 188 | |
| 186 | 189 | /* |
| @@ -707,11 +710,12 @@ | ||
| 707 | 710 | the form: login_cookie_name()=... |
| 708 | 711 | |
| 709 | 712 | Then again, the hardened cookie value helps ensure that |
| 710 | 713 | only a proper key/value match is valid. |
| 711 | 714 | */ |
| 712 | - cgi_replace_parameter( login_cookie_name(), cson_value_get_cstr(g.json.authToken) ); | |
| 715 | + cgi_replace_parameter( login_cookie_name(), | |
| 716 | + cson_value_get_cstr(g.json.authToken) ); | |
| 713 | 717 | }else if( g.isHTTP ){ |
| 714 | 718 | /* try fossil's conventional cookie. */ |
| 715 | 719 | /* Reminder: chicken/egg scenario regarding db access in CLI |
| 716 | 720 | mode because login_cookie_name() needs the db. CLI |
| 717 | 721 | mode does not use any authentication, so we don't need |
| @@ -904,11 +908,12 @@ | ||
| 904 | 908 | memcpy(zPart, head, len); |
| 905 | 909 | zPart[len] = 0; |
| 906 | 910 | if(doDeHttp){ |
| 907 | 911 | dehttpize(zPart); |
| 908 | 912 | } |
| 909 | - if( *zPart ){ /* should only fail if someone manages to url-encoded a NUL byte */ | |
| 913 | + if( *zPart ){ | |
| 914 | + /* should only fail if someone manages to url-encoded a NUL byte */ | |
| 910 | 915 | part = cson_value_new_string(zPart, strlen(zPart)); |
| 911 | 916 | if( 0 != cson_array_append( target, part ) ){ |
| 912 | 917 | cson_value_free(part); |
| 913 | 918 | rc = -rc; |
| 914 | 919 | break; |
| @@ -1086,11 +1091,11 @@ | ||
| 1086 | 1091 | |
| 1087 | 1092 | /* g.json.reqPayload exists only to simplify some of our access to |
| 1088 | 1093 | the request payload. We currently only use this in the context of |
| 1089 | 1094 | Object payloads, not Arrays, strings, etc. |
| 1090 | 1095 | */ |
| 1091 | - g.json.reqPayload.v = cson_object_get( g.json.post.o, FossilJsonKeys.payload ); | |
| 1096 | + g.json.reqPayload.v = cson_object_get( g.json.post.o,FossilJsonKeys.payload ); | |
| 1092 | 1097 | if( g.json.reqPayload.v ){ |
| 1093 | 1098 | g.json.reqPayload.o = cson_value_get_object( g.json.reqPayload.v ) |
| 1094 | 1099 | /* g.json.reqPayload.o may legally be NULL, which means only that |
| 1095 | 1100 | g.json.reqPayload.v is-not-a Object. |
| 1096 | 1101 | */; |
| @@ -1115,11 +1120,11 @@ | ||
| 1115 | 1120 | |
| 1116 | 1121 | if(!g.json.jsonp){ |
| 1117 | 1122 | g.json.jsonp = json_find_option_cstr("jsonp",NULL,NULL); |
| 1118 | 1123 | } |
| 1119 | 1124 | if(!g.isHTTP){ |
| 1120 | - g.json.errorDetailParanoia = 0 /*disable error code dumb-down for CLI mode*/; | |
| 1125 | + g.json.errorDetailParanoia = 0;/*disable error code dumb-down for CLI mode*/ | |
| 1121 | 1126 | } |
| 1122 | 1127 | |
| 1123 | 1128 | {/* set up JSON output formatting options. */ |
| 1124 | 1129 | int indent = -1; |
| 1125 | 1130 | indent = json_find_option_int("indent",NULL,"I",-1); |
| @@ -1166,11 +1171,11 @@ | ||
| 1166 | 1171 | ** |
| 1167 | 1172 | */ |
| 1168 | 1173 | char const * json_command_arg(unsigned short ndx){ |
| 1169 | 1174 | cson_array * ar = g.json.cmd.a; |
| 1170 | 1175 | assert((NULL!=ar) && "Internal error. Was json_bootstrap_late() called?"); |
| 1171 | - assert((g.argc>1) && "Internal error - we never should have gotten this far."); | |
| 1176 | + assert((g.argc>1) &&"Internal error - we never should have gotten this far."); | |
| 1172 | 1177 | if( g.json.cmd.offset < 0 ){ |
| 1173 | 1178 | /* first-time setup. */ |
| 1174 | 1179 | short i = 0; |
| 1175 | 1180 | #define NEXT cson_string_cstr( \ |
| 1176 | 1181 | cson_value_get_string( \ |
| @@ -1192,11 +1197,12 @@ | ||
| 1192 | 1197 | #undef NEXT |
| 1193 | 1198 | if(g.json.cmd.offset < 0){ |
| 1194 | 1199 | return NULL; |
| 1195 | 1200 | }else{ |
| 1196 | 1201 | ndx = g.json.cmd.offset + ndx; |
| 1197 | - return cson_string_cstr(cson_value_get_string(cson_array_get( ar, g.json.cmd.offset + ndx ))); | |
| 1202 | + return cson_string_cstr(cson_value_get_string( | |
| 1203 | + cson_array_get( ar, g.json.cmd.offset + ndx ))); | |
| 1198 | 1204 | } |
| 1199 | 1205 | } |
| 1200 | 1206 | |
| 1201 | 1207 | /* Returns the C-string form of json_auth_token(), or NULL |
| 1202 | 1208 | ** if json_auth_token() returns NULL. |
| @@ -1210,11 +1216,12 @@ | ||
| 1210 | 1216 | ** found. |
| 1211 | 1217 | ** |
| 1212 | 1218 | ** head must be a pointer to an array of JsonPageDefs in which the |
| 1213 | 1219 | ** last entry has a NULL name. |
| 1214 | 1220 | */ |
| 1215 | -JsonPageDef const * json_handler_for_name( char const * name, JsonPageDef const * head ){ | |
| 1221 | +JsonPageDef const * json_handler_for_name( char const * name, | |
| 1222 | + JsonPageDef const * head ){ | |
| 1216 | 1223 | JsonPageDef const * pageDef = head; |
| 1217 | 1224 | assert( head != NULL ); |
| 1218 | 1225 | if(name && *name) for( ; pageDef->name; ++pageDef ){ |
| 1219 | 1226 | if( 0 == strcmp(name, pageDef->name) ){ |
| 1220 | 1227 | return pageDef; |
| @@ -1292,14 +1299,16 @@ | ||
| 1292 | 1299 | if(!g.json.cmd.a){ |
| 1293 | 1300 | return NULL; |
| 1294 | 1301 | }else{ |
| 1295 | 1302 | cson_value * rc = NULL; |
| 1296 | 1303 | Blob path = empty_blob; |
| 1297 | - unsigned int aLen = g.json.dispatchDepth+1; /*cson_array_length_get(g.json.cmd.a);*/ | |
| 1304 | + unsigned int aLen = g.json.dispatchDepth+1; | |
| 1305 | + /*cson_array_length_get(g.json.cmd.a);*/ | |
| 1298 | 1306 | unsigned int i = 1; |
| 1299 | 1307 | for( ; i < aLen; ++i ){ |
| 1300 | - char const * part = cson_string_cstr(cson_value_get_string(cson_array_get(g.json.cmd.a, i))); | |
| 1308 | + char const * part = cson_string_cstr(cson_value_get_string( | |
| 1309 | + cson_array_get(g.json.cmd.a, i))); | |
| 1301 | 1310 | if(!part){ |
| 1302 | 1311 | #if 1 |
| 1303 | 1312 | fossil_warning("Iterating further than expected in %s.", |
| 1304 | 1313 | __FILE__); |
| 1305 | 1314 | #endif |
| @@ -1329,11 +1338,12 @@ | ||
| 1329 | 1338 | cson_object * o = NULL; |
| 1330 | 1339 | cson_object * pay = NULL; |
| 1331 | 1340 | pay = o = cson_new_object(); |
| 1332 | 1341 | |
| 1333 | 1342 | #define INT(OBJ,K) cson_object_set(o, #K, json_new_int(OBJ.K)) |
| 1334 | -#define CSTR(OBJ,K) cson_object_set(o, #K, OBJ.K ? json_new_string(OBJ.K) : cson_value_null()) | |
| 1343 | +#define CSTR(OBJ,K) cson_object_set(o, #K, OBJ.K ? json_new_string(OBJ.K) \ | |
| 1344 | + : cson_value_null()) | |
| 1335 | 1345 | #define VAL(K,V) cson_object_set(o, #K, (V) ? (V) : cson_value_null()) |
| 1336 | 1346 | VAL(capabilities, json_cap_value()); |
| 1337 | 1347 | INT(g, argc); |
| 1338 | 1348 | INT(g, isConst); |
| 1339 | 1349 | CSTR(g, zConfigDbName); |
| @@ -1813,14 +1823,15 @@ | ||
| 1813 | 1823 | kRC = cson_new_string("resultCode",10); |
| 1814 | 1824 | kSymbol = cson_new_string("cSymbol",7); |
| 1815 | 1825 | kNumber = cson_new_string("number",6); |
| 1816 | 1826 | kDesc = cson_new_string("description",11); |
| 1817 | 1827 | #define C(K) obj = cson_new_object(); \ |
| 1818 | - cson_object_set_s(obj, kRC, json_new_string(json_rc_cstr(FSL_JSON_E_##K)) ); \ | |
| 1819 | - cson_object_set_s(obj, kSymbol, json_new_string("FSL_JSON_E_"#K) ); \ | |
| 1820 | - cson_object_set_s(obj, kNumber, cson_value_new_integer(FSL_JSON_E_##K) ); \ | |
| 1821 | - cson_object_set_s(obj, kDesc, json_new_string(json_err_cstr(FSL_JSON_E_##K))); \ | |
| 1828 | + cson_object_set_s(obj, kRC,json_new_string(json_rc_cstr(FSL_JSON_E_##K))); \ | |
| 1829 | + cson_object_set_s(obj, kSymbol, json_new_string("FSL_JSON_E_"#K) ); \ | |
| 1830 | + cson_object_set_s(obj, kNumber, cson_value_new_integer(FSL_JSON_E_##K) ); \ | |
| 1831 | + cson_object_set_s(obj, kDesc, \ | |
| 1832 | + json_new_string(json_err_cstr(FSL_JSON_E_##K))); \ | |
| 1822 | 1833 | cson_array_append( list, cson_object_value(obj) ); obj = NULL; |
| 1823 | 1834 | |
| 1824 | 1835 | C(GENERIC); |
| 1825 | 1836 | C(INVALID_REQUEST); |
| 1826 | 1837 | C(UNKNOWN_COMMAND); |
| @@ -2006,11 +2017,12 @@ | ||
| 2006 | 2017 | "Requires 'o' permissions."); |
| 2007 | 2018 | return NULL; |
| 2008 | 2019 | } |
| 2009 | 2020 | full = json_find_option_bool("full",NULL,"f", |
| 2010 | 2021 | json_find_option_bool("verbose",NULL,"v",0)); |
| 2011 | -#define SETBUF(O,K) cson_object_set(O, K, cson_value_new_string(zBuf, strlen(zBuf))); | |
| 2022 | +#define SETBUF(O,K) cson_object_set(O, K, \ | |
| 2023 | + cson_value_new_string(zBuf, strlen(zBuf))); | |
| 2012 | 2024 | |
| 2013 | 2025 | jv = cson_value_new_object(); |
| 2014 | 2026 | jo = cson_value_get_object(jv); |
| 2015 | 2027 | |
| 2016 | 2028 | zTmp = db_get("project-name",NULL); |
| @@ -2019,11 +2031,11 @@ | ||
| 2019 | 2031 | zTmp = db_get("project-description",NULL); |
| 2020 | 2032 | cson_object_set(jo, "projectDescription", json_new_string(zTmp)); |
| 2021 | 2033 | fossil_free(zTmp); |
| 2022 | 2034 | zTmp = NULL; |
| 2023 | 2035 | fsize = file_size(g.zRepositoryName, ExtFILE); |
| 2024 | - cson_object_set(jo, "repositorySize", | |
| 2036 | + cson_object_set(jo, "repositorySize", | |
| 2025 | 2037 | cson_value_new_integer((cson_int_t)fsize)); |
| 2026 | 2038 | |
| 2027 | 2039 | if(full){ |
| 2028 | 2040 | n = db_int(0, "SELECT count(*) FROM blob"); |
| 2029 | 2041 | m = db_int(0, "SELECT count(*) FROM delta"); |
| @@ -2068,25 +2080,31 @@ | ||
| 2068 | 2080 | " + 0.99"); |
| 2069 | 2081 | cson_object_set(jo, "ageDays", cson_value_new_integer((cson_int_t)n)); |
| 2070 | 2082 | cson_object_set(jo, "ageYears", cson_value_new_double(n/365.2425)); |
| 2071 | 2083 | sqlite3_snprintf(BufLen, zBuf, db_get("project-code","")); |
| 2072 | 2084 | SETBUF(jo, "projectCode"); |
| 2073 | - cson_object_set(jo, "compiler", cson_value_new_string(COMPILER_NAME, strlen(COMPILER_NAME))); | |
| 2085 | + cson_object_set(jo, "compiler", | |
| 2086 | + cson_value_new_string(COMPILER_NAME, strlen(COMPILER_NAME))); | |
| 2074 | 2087 | |
| 2075 | 2088 | jv2 = cson_value_new_object(); |
| 2076 | 2089 | jo2 = cson_value_get_object(jv2); |
| 2077 | 2090 | cson_object_set(jo, "sqlite", jv2); |
| 2078 | - sqlite3_snprintf(BufLen, zBuf, "%.19s [%.10s] (%s)", | |
| 2079 | - sqlite3_sourceid(), &sqlite3_sourceid()[20], sqlite3_libversion()); | |
| 2091 | + sqlite3_snprintf(BufLen, zBuf, "%.19s [%.10s] (%s)", sqlite3_sourceid(), | |
| 2092 | + &sqlite3_sourceid()[20], sqlite3_libversion()); | |
| 2080 | 2093 | SETBUF(jo2, "version"); |
| 2081 | - cson_object_set(jo2, "pageCount", cson_value_new_integer((cson_int_t)db_int(0, "PRAGMA repository.page_count"))); | |
| 2082 | - cson_object_set(jo2, "pageSize", cson_value_new_integer((cson_int_t)db_int(0, "PRAGMA repository.page_size"))); | |
| 2083 | - cson_object_set(jo2, "freeList", cson_value_new_integer((cson_int_t)db_int(0, "PRAGMA repository.freelist_count"))); | |
| 2084 | - sqlite3_snprintf(BufLen, zBuf, "%s", db_text(0, "PRAGMA repository.encoding")); | |
| 2094 | + cson_object_set(jo2, "pageCount", cson_value_new_integer( | |
| 2095 | + (cson_int_t)db_int(0, "PRAGMA repository.page_count"))); | |
| 2096 | + cson_object_set(jo2, "pageSize", cson_value_new_integer( | |
| 2097 | + (cson_int_t)db_int(0, "PRAGMA repository.page_size"))); | |
| 2098 | + cson_object_set(jo2, "freeList", cson_value_new_integer( | |
| 2099 | + (cson_int_t)db_int(0, "PRAGMA repository.freelist_count"))); | |
| 2100 | + sqlite3_snprintf(BufLen, zBuf, "%s", db_text(0,"PRAGMA repository.encoding")); | |
| 2085 | 2101 | SETBUF(jo2, "encoding"); |
| 2086 | - sqlite3_snprintf(BufLen, zBuf, "%s", db_text(0, "PRAGMA repository.journal_mode")); | |
| 2087 | - cson_object_set(jo2, "journalMode", *zBuf ? cson_value_new_string(zBuf, strlen(zBuf)) : cson_value_null()); | |
| 2102 | + sqlite3_snprintf(BufLen, zBuf, "%s", | |
| 2103 | + db_text(0, "PRAGMA repository.journal_mode")); | |
| 2104 | + cson_object_set(jo2, "journalMode", *zBuf ? | |
| 2105 | + cson_value_new_string(zBuf, strlen(zBuf)) : cson_value_null()); | |
| 2088 | 2106 | return jv; |
| 2089 | 2107 | #undef SETBUF |
| 2090 | 2108 | } |
| 2091 | 2109 | |
| 2092 | 2110 | |
| @@ -2237,11 +2255,12 @@ | ||
| 2237 | 2255 | /* |
| 2238 | 2256 | ** Mapping of names to JSON pages/commands. Each name is a subpath of |
| 2239 | 2257 | ** /json (in CGI mode) or a subcommand of the json command in CLI mode |
| 2240 | 2258 | */ |
| 2241 | 2259 | static const JsonPageDef JsonPageDefs[] = { |
| 2242 | -/* please keep alphabetically sorted (case-insensitive) for maintenance reasons. */ | |
| 2260 | +/* please keep alphabetically sorted (case-insensitive) | |
| 2261 | + for maintenance reasons. */ | |
| 2243 | 2262 | {"anonymousPassword", json_page_anon_password, 0}, |
| 2244 | 2263 | {"artifact", json_page_artifact, 0}, |
| 2245 | 2264 | {"branch", json_page_branch,0}, |
| 2246 | 2265 | {"cap", json_page_cap, 0}, |
| 2247 | 2266 | {"config", json_page_config, 0 }, |
| 2248 | 2267 |
| --- src/json.c | |
| +++ src/json.c | |
| @@ -23,12 +23,13 @@ | |
| 23 | ** https://fossil-scm.org/fossil/doc/trunk/www/json-api/index.md |
| 24 | ** |
| 25 | ** Notes for hackers... |
| 26 | ** |
| 27 | ** Here's how command/page dispatching works: json_page_top() (in HTTP mode) or |
| 28 | ** json_cmd_top() (in CLI mode) catch the "json" path/command. Those functions then |
| 29 | ** dispatch to a JSON-mode-specific command/page handler with the type fossil_json_f(). |
| 30 | ** See the API docs for that typedef (below) for the semantics of the callbacks. |
| 31 | ** |
| 32 | ** |
| 33 | */ |
| 34 | #include "VERSION.h" |
| @@ -36,11 +37,12 @@ | |
| 36 | #include "json.h" |
| 37 | #include <assert.h> |
| 38 | #include <time.h> |
| 39 | |
| 40 | #if INTERFACE |
| 41 | #include "json_detail.h" /* workaround for apparent enum limitation in makeheaders */ |
| 42 | #endif |
| 43 | |
| 44 | const FossilJsonKeys_ FossilJsonKeys = { |
| 45 | "anonymousSeed" /*anonymousSeed*/, |
| 46 | "authToken" /*authToken*/, |
| @@ -176,11 +178,12 @@ | |
| 176 | |
| 177 | /* |
| 178 | ** Convenience wrapper around cson_output() which appends the output |
| 179 | ** to pDest. pOpt may be NULL, in which case g.json.outOpt will be used. |
| 180 | */ |
| 181 | int cson_output_Blob( cson_value const * pVal, Blob * pDest, cson_output_opt const * pOpt ){ |
| 182 | return cson_output( pVal, cson_data_dest_Blob, |
| 183 | pDest, pOpt ? pOpt : &g.json.outOpt ); |
| 184 | } |
| 185 | |
| 186 | /* |
| @@ -707,11 +710,12 @@ | |
| 707 | the form: login_cookie_name()=... |
| 708 | |
| 709 | Then again, the hardened cookie value helps ensure that |
| 710 | only a proper key/value match is valid. |
| 711 | */ |
| 712 | cgi_replace_parameter( login_cookie_name(), cson_value_get_cstr(g.json.authToken) ); |
| 713 | }else if( g.isHTTP ){ |
| 714 | /* try fossil's conventional cookie. */ |
| 715 | /* Reminder: chicken/egg scenario regarding db access in CLI |
| 716 | mode because login_cookie_name() needs the db. CLI |
| 717 | mode does not use any authentication, so we don't need |
| @@ -904,11 +908,12 @@ | |
| 904 | memcpy(zPart, head, len); |
| 905 | zPart[len] = 0; |
| 906 | if(doDeHttp){ |
| 907 | dehttpize(zPart); |
| 908 | } |
| 909 | if( *zPart ){ /* should only fail if someone manages to url-encoded a NUL byte */ |
| 910 | part = cson_value_new_string(zPart, strlen(zPart)); |
| 911 | if( 0 != cson_array_append( target, part ) ){ |
| 912 | cson_value_free(part); |
| 913 | rc = -rc; |
| 914 | break; |
| @@ -1086,11 +1091,11 @@ | |
| 1086 | |
| 1087 | /* g.json.reqPayload exists only to simplify some of our access to |
| 1088 | the request payload. We currently only use this in the context of |
| 1089 | Object payloads, not Arrays, strings, etc. |
| 1090 | */ |
| 1091 | g.json.reqPayload.v = cson_object_get( g.json.post.o, FossilJsonKeys.payload ); |
| 1092 | if( g.json.reqPayload.v ){ |
| 1093 | g.json.reqPayload.o = cson_value_get_object( g.json.reqPayload.v ) |
| 1094 | /* g.json.reqPayload.o may legally be NULL, which means only that |
| 1095 | g.json.reqPayload.v is-not-a Object. |
| 1096 | */; |
| @@ -1115,11 +1120,11 @@ | |
| 1115 | |
| 1116 | if(!g.json.jsonp){ |
| 1117 | g.json.jsonp = json_find_option_cstr("jsonp",NULL,NULL); |
| 1118 | } |
| 1119 | if(!g.isHTTP){ |
| 1120 | g.json.errorDetailParanoia = 0 /*disable error code dumb-down for CLI mode*/; |
| 1121 | } |
| 1122 | |
| 1123 | {/* set up JSON output formatting options. */ |
| 1124 | int indent = -1; |
| 1125 | indent = json_find_option_int("indent",NULL,"I",-1); |
| @@ -1166,11 +1171,11 @@ | |
| 1166 | ** |
| 1167 | */ |
| 1168 | char const * json_command_arg(unsigned short ndx){ |
| 1169 | cson_array * ar = g.json.cmd.a; |
| 1170 | assert((NULL!=ar) && "Internal error. Was json_bootstrap_late() called?"); |
| 1171 | assert((g.argc>1) && "Internal error - we never should have gotten this far."); |
| 1172 | if( g.json.cmd.offset < 0 ){ |
| 1173 | /* first-time setup. */ |
| 1174 | short i = 0; |
| 1175 | #define NEXT cson_string_cstr( \ |
| 1176 | cson_value_get_string( \ |
| @@ -1192,11 +1197,12 @@ | |
| 1192 | #undef NEXT |
| 1193 | if(g.json.cmd.offset < 0){ |
| 1194 | return NULL; |
| 1195 | }else{ |
| 1196 | ndx = g.json.cmd.offset + ndx; |
| 1197 | return cson_string_cstr(cson_value_get_string(cson_array_get( ar, g.json.cmd.offset + ndx ))); |
| 1198 | } |
| 1199 | } |
| 1200 | |
| 1201 | /* Returns the C-string form of json_auth_token(), or NULL |
| 1202 | ** if json_auth_token() returns NULL. |
| @@ -1210,11 +1216,12 @@ | |
| 1210 | ** found. |
| 1211 | ** |
| 1212 | ** head must be a pointer to an array of JsonPageDefs in which the |
| 1213 | ** last entry has a NULL name. |
| 1214 | */ |
| 1215 | JsonPageDef const * json_handler_for_name( char const * name, JsonPageDef const * head ){ |
| 1216 | JsonPageDef const * pageDef = head; |
| 1217 | assert( head != NULL ); |
| 1218 | if(name && *name) for( ; pageDef->name; ++pageDef ){ |
| 1219 | if( 0 == strcmp(name, pageDef->name) ){ |
| 1220 | return pageDef; |
| @@ -1292,14 +1299,16 @@ | |
| 1292 | if(!g.json.cmd.a){ |
| 1293 | return NULL; |
| 1294 | }else{ |
| 1295 | cson_value * rc = NULL; |
| 1296 | Blob path = empty_blob; |
| 1297 | unsigned int aLen = g.json.dispatchDepth+1; /*cson_array_length_get(g.json.cmd.a);*/ |
| 1298 | unsigned int i = 1; |
| 1299 | for( ; i < aLen; ++i ){ |
| 1300 | char const * part = cson_string_cstr(cson_value_get_string(cson_array_get(g.json.cmd.a, i))); |
| 1301 | if(!part){ |
| 1302 | #if 1 |
| 1303 | fossil_warning("Iterating further than expected in %s.", |
| 1304 | __FILE__); |
| 1305 | #endif |
| @@ -1329,11 +1338,12 @@ | |
| 1329 | cson_object * o = NULL; |
| 1330 | cson_object * pay = NULL; |
| 1331 | pay = o = cson_new_object(); |
| 1332 | |
| 1333 | #define INT(OBJ,K) cson_object_set(o, #K, json_new_int(OBJ.K)) |
| 1334 | #define CSTR(OBJ,K) cson_object_set(o, #K, OBJ.K ? json_new_string(OBJ.K) : cson_value_null()) |
| 1335 | #define VAL(K,V) cson_object_set(o, #K, (V) ? (V) : cson_value_null()) |
| 1336 | VAL(capabilities, json_cap_value()); |
| 1337 | INT(g, argc); |
| 1338 | INT(g, isConst); |
| 1339 | CSTR(g, zConfigDbName); |
| @@ -1813,14 +1823,15 @@ | |
| 1813 | kRC = cson_new_string("resultCode",10); |
| 1814 | kSymbol = cson_new_string("cSymbol",7); |
| 1815 | kNumber = cson_new_string("number",6); |
| 1816 | kDesc = cson_new_string("description",11); |
| 1817 | #define C(K) obj = cson_new_object(); \ |
| 1818 | cson_object_set_s(obj, kRC, json_new_string(json_rc_cstr(FSL_JSON_E_##K)) ); \ |
| 1819 | cson_object_set_s(obj, kSymbol, json_new_string("FSL_JSON_E_"#K) ); \ |
| 1820 | cson_object_set_s(obj, kNumber, cson_value_new_integer(FSL_JSON_E_##K) ); \ |
| 1821 | cson_object_set_s(obj, kDesc, json_new_string(json_err_cstr(FSL_JSON_E_##K))); \ |
| 1822 | cson_array_append( list, cson_object_value(obj) ); obj = NULL; |
| 1823 | |
| 1824 | C(GENERIC); |
| 1825 | C(INVALID_REQUEST); |
| 1826 | C(UNKNOWN_COMMAND); |
| @@ -2006,11 +2017,12 @@ | |
| 2006 | "Requires 'o' permissions."); |
| 2007 | return NULL; |
| 2008 | } |
| 2009 | full = json_find_option_bool("full",NULL,"f", |
| 2010 | json_find_option_bool("verbose",NULL,"v",0)); |
| 2011 | #define SETBUF(O,K) cson_object_set(O, K, cson_value_new_string(zBuf, strlen(zBuf))); |
| 2012 | |
| 2013 | jv = cson_value_new_object(); |
| 2014 | jo = cson_value_get_object(jv); |
| 2015 | |
| 2016 | zTmp = db_get("project-name",NULL); |
| @@ -2019,11 +2031,11 @@ | |
| 2019 | zTmp = db_get("project-description",NULL); |
| 2020 | cson_object_set(jo, "projectDescription", json_new_string(zTmp)); |
| 2021 | fossil_free(zTmp); |
| 2022 | zTmp = NULL; |
| 2023 | fsize = file_size(g.zRepositoryName, ExtFILE); |
| 2024 | cson_object_set(jo, "repositorySize", |
| 2025 | cson_value_new_integer((cson_int_t)fsize)); |
| 2026 | |
| 2027 | if(full){ |
| 2028 | n = db_int(0, "SELECT count(*) FROM blob"); |
| 2029 | m = db_int(0, "SELECT count(*) FROM delta"); |
| @@ -2068,25 +2080,31 @@ | |
| 2068 | " + 0.99"); |
| 2069 | cson_object_set(jo, "ageDays", cson_value_new_integer((cson_int_t)n)); |
| 2070 | cson_object_set(jo, "ageYears", cson_value_new_double(n/365.2425)); |
| 2071 | sqlite3_snprintf(BufLen, zBuf, db_get("project-code","")); |
| 2072 | SETBUF(jo, "projectCode"); |
| 2073 | cson_object_set(jo, "compiler", cson_value_new_string(COMPILER_NAME, strlen(COMPILER_NAME))); |
| 2074 | |
| 2075 | jv2 = cson_value_new_object(); |
| 2076 | jo2 = cson_value_get_object(jv2); |
| 2077 | cson_object_set(jo, "sqlite", jv2); |
| 2078 | sqlite3_snprintf(BufLen, zBuf, "%.19s [%.10s] (%s)", |
| 2079 | sqlite3_sourceid(), &sqlite3_sourceid()[20], sqlite3_libversion()); |
| 2080 | SETBUF(jo2, "version"); |
| 2081 | cson_object_set(jo2, "pageCount", cson_value_new_integer((cson_int_t)db_int(0, "PRAGMA repository.page_count"))); |
| 2082 | cson_object_set(jo2, "pageSize", cson_value_new_integer((cson_int_t)db_int(0, "PRAGMA repository.page_size"))); |
| 2083 | cson_object_set(jo2, "freeList", cson_value_new_integer((cson_int_t)db_int(0, "PRAGMA repository.freelist_count"))); |
| 2084 | sqlite3_snprintf(BufLen, zBuf, "%s", db_text(0, "PRAGMA repository.encoding")); |
| 2085 | SETBUF(jo2, "encoding"); |
| 2086 | sqlite3_snprintf(BufLen, zBuf, "%s", db_text(0, "PRAGMA repository.journal_mode")); |
| 2087 | cson_object_set(jo2, "journalMode", *zBuf ? cson_value_new_string(zBuf, strlen(zBuf)) : cson_value_null()); |
| 2088 | return jv; |
| 2089 | #undef SETBUF |
| 2090 | } |
| 2091 | |
| 2092 | |
| @@ -2237,11 +2255,12 @@ | |
| 2237 | /* |
| 2238 | ** Mapping of names to JSON pages/commands. Each name is a subpath of |
| 2239 | ** /json (in CGI mode) or a subcommand of the json command in CLI mode |
| 2240 | */ |
| 2241 | static const JsonPageDef JsonPageDefs[] = { |
| 2242 | /* please keep alphabetically sorted (case-insensitive) for maintenance reasons. */ |
| 2243 | {"anonymousPassword", json_page_anon_password, 0}, |
| 2244 | {"artifact", json_page_artifact, 0}, |
| 2245 | {"branch", json_page_branch,0}, |
| 2246 | {"cap", json_page_cap, 0}, |
| 2247 | {"config", json_page_config, 0 }, |
| 2248 |
| --- src/json.c | |
| +++ src/json.c | |
| @@ -23,12 +23,13 @@ | |
| 23 | ** https://fossil-scm.org/fossil/doc/trunk/www/json-api/index.md |
| 24 | ** |
| 25 | ** Notes for hackers... |
| 26 | ** |
| 27 | ** Here's how command/page dispatching works: json_page_top() (in HTTP mode) or |
| 28 | ** json_cmd_top() (in CLI mode) catch the "json" path/command. Those functions |
| 29 | ** then dispatch to a JSON-mode-specific command/page handler with the type |
| 30 | ** fossil_json_f(). |
| 31 | ** See the API docs for that typedef (below) for the semantics of the callbacks. |
| 32 | ** |
| 33 | ** |
| 34 | */ |
| 35 | #include "VERSION.h" |
| @@ -36,11 +37,12 @@ | |
| 37 | #include "json.h" |
| 38 | #include <assert.h> |
| 39 | #include <time.h> |
| 40 | |
| 41 | #if INTERFACE |
| 42 | #include "json_detail.h" /* workaround for apparent enum limitation |
| 43 | in makeheaders */ |
| 44 | #endif |
| 45 | |
| 46 | const FossilJsonKeys_ FossilJsonKeys = { |
| 47 | "anonymousSeed" /*anonymousSeed*/, |
| 48 | "authToken" /*authToken*/, |
| @@ -176,11 +178,12 @@ | |
| 178 | |
| 179 | /* |
| 180 | ** Convenience wrapper around cson_output() which appends the output |
| 181 | ** to pDest. pOpt may be NULL, in which case g.json.outOpt will be used. |
| 182 | */ |
| 183 | int cson_output_Blob( cson_value const * pVal, Blob * pDest, |
| 184 | cson_output_opt const * pOpt ){ |
| 185 | return cson_output( pVal, cson_data_dest_Blob, |
| 186 | pDest, pOpt ? pOpt : &g.json.outOpt ); |
| 187 | } |
| 188 | |
| 189 | /* |
| @@ -707,11 +710,12 @@ | |
| 710 | the form: login_cookie_name()=... |
| 711 | |
| 712 | Then again, the hardened cookie value helps ensure that |
| 713 | only a proper key/value match is valid. |
| 714 | */ |
| 715 | cgi_replace_parameter( login_cookie_name(), |
| 716 | cson_value_get_cstr(g.json.authToken) ); |
| 717 | }else if( g.isHTTP ){ |
| 718 | /* try fossil's conventional cookie. */ |
| 719 | /* Reminder: chicken/egg scenario regarding db access in CLI |
| 720 | mode because login_cookie_name() needs the db. CLI |
| 721 | mode does not use any authentication, so we don't need |
| @@ -904,11 +908,12 @@ | |
| 908 | memcpy(zPart, head, len); |
| 909 | zPart[len] = 0; |
| 910 | if(doDeHttp){ |
| 911 | dehttpize(zPart); |
| 912 | } |
| 913 | if( *zPart ){ |
| 914 | /* should only fail if someone manages to url-encoded a NUL byte */ |
| 915 | part = cson_value_new_string(zPart, strlen(zPart)); |
| 916 | if( 0 != cson_array_append( target, part ) ){ |
| 917 | cson_value_free(part); |
| 918 | rc = -rc; |
| 919 | break; |
| @@ -1086,11 +1091,11 @@ | |
| 1091 | |
| 1092 | /* g.json.reqPayload exists only to simplify some of our access to |
| 1093 | the request payload. We currently only use this in the context of |
| 1094 | Object payloads, not Arrays, strings, etc. |
| 1095 | */ |
| 1096 | g.json.reqPayload.v = cson_object_get( g.json.post.o,FossilJsonKeys.payload ); |
| 1097 | if( g.json.reqPayload.v ){ |
| 1098 | g.json.reqPayload.o = cson_value_get_object( g.json.reqPayload.v ) |
| 1099 | /* g.json.reqPayload.o may legally be NULL, which means only that |
| 1100 | g.json.reqPayload.v is-not-a Object. |
| 1101 | */; |
| @@ -1115,11 +1120,11 @@ | |
| 1120 | |
| 1121 | if(!g.json.jsonp){ |
| 1122 | g.json.jsonp = json_find_option_cstr("jsonp",NULL,NULL); |
| 1123 | } |
| 1124 | if(!g.isHTTP){ |
| 1125 | g.json.errorDetailParanoia = 0;/*disable error code dumb-down for CLI mode*/ |
| 1126 | } |
| 1127 | |
| 1128 | {/* set up JSON output formatting options. */ |
| 1129 | int indent = -1; |
| 1130 | indent = json_find_option_int("indent",NULL,"I",-1); |
| @@ -1166,11 +1171,11 @@ | |
| 1171 | ** |
| 1172 | */ |
| 1173 | char const * json_command_arg(unsigned short ndx){ |
| 1174 | cson_array * ar = g.json.cmd.a; |
| 1175 | assert((NULL!=ar) && "Internal error. Was json_bootstrap_late() called?"); |
| 1176 | assert((g.argc>1) &&"Internal error - we never should have gotten this far."); |
| 1177 | if( g.json.cmd.offset < 0 ){ |
| 1178 | /* first-time setup. */ |
| 1179 | short i = 0; |
| 1180 | #define NEXT cson_string_cstr( \ |
| 1181 | cson_value_get_string( \ |
| @@ -1192,11 +1197,12 @@ | |
| 1197 | #undef NEXT |
| 1198 | if(g.json.cmd.offset < 0){ |
| 1199 | return NULL; |
| 1200 | }else{ |
| 1201 | ndx = g.json.cmd.offset + ndx; |
| 1202 | return cson_string_cstr(cson_value_get_string( |
| 1203 | cson_array_get( ar, g.json.cmd.offset + ndx ))); |
| 1204 | } |
| 1205 | } |
| 1206 | |
| 1207 | /* Returns the C-string form of json_auth_token(), or NULL |
| 1208 | ** if json_auth_token() returns NULL. |
| @@ -1210,11 +1216,12 @@ | |
| 1216 | ** found. |
| 1217 | ** |
| 1218 | ** head must be a pointer to an array of JsonPageDefs in which the |
| 1219 | ** last entry has a NULL name. |
| 1220 | */ |
| 1221 | JsonPageDef const * json_handler_for_name( char const * name, |
| 1222 | JsonPageDef const * head ){ |
| 1223 | JsonPageDef const * pageDef = head; |
| 1224 | assert( head != NULL ); |
| 1225 | if(name && *name) for( ; pageDef->name; ++pageDef ){ |
| 1226 | if( 0 == strcmp(name, pageDef->name) ){ |
| 1227 | return pageDef; |
| @@ -1292,14 +1299,16 @@ | |
| 1299 | if(!g.json.cmd.a){ |
| 1300 | return NULL; |
| 1301 | }else{ |
| 1302 | cson_value * rc = NULL; |
| 1303 | Blob path = empty_blob; |
| 1304 | unsigned int aLen = g.json.dispatchDepth+1; |
| 1305 | /*cson_array_length_get(g.json.cmd.a);*/ |
| 1306 | unsigned int i = 1; |
| 1307 | for( ; i < aLen; ++i ){ |
| 1308 | char const * part = cson_string_cstr(cson_value_get_string( |
| 1309 | cson_array_get(g.json.cmd.a, i))); |
| 1310 | if(!part){ |
| 1311 | #if 1 |
| 1312 | fossil_warning("Iterating further than expected in %s.", |
| 1313 | __FILE__); |
| 1314 | #endif |
| @@ -1329,11 +1338,12 @@ | |
| 1338 | cson_object * o = NULL; |
| 1339 | cson_object * pay = NULL; |
| 1340 | pay = o = cson_new_object(); |
| 1341 | |
| 1342 | #define INT(OBJ,K) cson_object_set(o, #K, json_new_int(OBJ.K)) |
| 1343 | #define CSTR(OBJ,K) cson_object_set(o, #K, OBJ.K ? json_new_string(OBJ.K) \ |
| 1344 | : cson_value_null()) |
| 1345 | #define VAL(K,V) cson_object_set(o, #K, (V) ? (V) : cson_value_null()) |
| 1346 | VAL(capabilities, json_cap_value()); |
| 1347 | INT(g, argc); |
| 1348 | INT(g, isConst); |
| 1349 | CSTR(g, zConfigDbName); |
| @@ -1813,14 +1823,15 @@ | |
| 1823 | kRC = cson_new_string("resultCode",10); |
| 1824 | kSymbol = cson_new_string("cSymbol",7); |
| 1825 | kNumber = cson_new_string("number",6); |
| 1826 | kDesc = cson_new_string("description",11); |
| 1827 | #define C(K) obj = cson_new_object(); \ |
| 1828 | cson_object_set_s(obj, kRC,json_new_string(json_rc_cstr(FSL_JSON_E_##K))); \ |
| 1829 | cson_object_set_s(obj, kSymbol, json_new_string("FSL_JSON_E_"#K) ); \ |
| 1830 | cson_object_set_s(obj, kNumber, cson_value_new_integer(FSL_JSON_E_##K) ); \ |
| 1831 | cson_object_set_s(obj, kDesc, \ |
| 1832 | json_new_string(json_err_cstr(FSL_JSON_E_##K))); \ |
| 1833 | cson_array_append( list, cson_object_value(obj) ); obj = NULL; |
| 1834 | |
| 1835 | C(GENERIC); |
| 1836 | C(INVALID_REQUEST); |
| 1837 | C(UNKNOWN_COMMAND); |
| @@ -2006,11 +2017,12 @@ | |
| 2017 | "Requires 'o' permissions."); |
| 2018 | return NULL; |
| 2019 | } |
| 2020 | full = json_find_option_bool("full",NULL,"f", |
| 2021 | json_find_option_bool("verbose",NULL,"v",0)); |
| 2022 | #define SETBUF(O,K) cson_object_set(O, K, \ |
| 2023 | cson_value_new_string(zBuf, strlen(zBuf))); |
| 2024 | |
| 2025 | jv = cson_value_new_object(); |
| 2026 | jo = cson_value_get_object(jv); |
| 2027 | |
| 2028 | zTmp = db_get("project-name",NULL); |
| @@ -2019,11 +2031,11 @@ | |
| 2031 | zTmp = db_get("project-description",NULL); |
| 2032 | cson_object_set(jo, "projectDescription", json_new_string(zTmp)); |
| 2033 | fossil_free(zTmp); |
| 2034 | zTmp = NULL; |
| 2035 | fsize = file_size(g.zRepositoryName, ExtFILE); |
| 2036 | cson_object_set(jo, "repositorySize", |
| 2037 | cson_value_new_integer((cson_int_t)fsize)); |
| 2038 | |
| 2039 | if(full){ |
| 2040 | n = db_int(0, "SELECT count(*) FROM blob"); |
| 2041 | m = db_int(0, "SELECT count(*) FROM delta"); |
| @@ -2068,25 +2080,31 @@ | |
| 2080 | " + 0.99"); |
| 2081 | cson_object_set(jo, "ageDays", cson_value_new_integer((cson_int_t)n)); |
| 2082 | cson_object_set(jo, "ageYears", cson_value_new_double(n/365.2425)); |
| 2083 | sqlite3_snprintf(BufLen, zBuf, db_get("project-code","")); |
| 2084 | SETBUF(jo, "projectCode"); |
| 2085 | cson_object_set(jo, "compiler", |
| 2086 | cson_value_new_string(COMPILER_NAME, strlen(COMPILER_NAME))); |
| 2087 | |
| 2088 | jv2 = cson_value_new_object(); |
| 2089 | jo2 = cson_value_get_object(jv2); |
| 2090 | cson_object_set(jo, "sqlite", jv2); |
| 2091 | sqlite3_snprintf(BufLen, zBuf, "%.19s [%.10s] (%s)", sqlite3_sourceid(), |
| 2092 | &sqlite3_sourceid()[20], sqlite3_libversion()); |
| 2093 | SETBUF(jo2, "version"); |
| 2094 | cson_object_set(jo2, "pageCount", cson_value_new_integer( |
| 2095 | (cson_int_t)db_int(0, "PRAGMA repository.page_count"))); |
| 2096 | cson_object_set(jo2, "pageSize", cson_value_new_integer( |
| 2097 | (cson_int_t)db_int(0, "PRAGMA repository.page_size"))); |
| 2098 | cson_object_set(jo2, "freeList", cson_value_new_integer( |
| 2099 | (cson_int_t)db_int(0, "PRAGMA repository.freelist_count"))); |
| 2100 | sqlite3_snprintf(BufLen, zBuf, "%s", db_text(0,"PRAGMA repository.encoding")); |
| 2101 | SETBUF(jo2, "encoding"); |
| 2102 | sqlite3_snprintf(BufLen, zBuf, "%s", |
| 2103 | db_text(0, "PRAGMA repository.journal_mode")); |
| 2104 | cson_object_set(jo2, "journalMode", *zBuf ? |
| 2105 | cson_value_new_string(zBuf, strlen(zBuf)) : cson_value_null()); |
| 2106 | return jv; |
| 2107 | #undef SETBUF |
| 2108 | } |
| 2109 | |
| 2110 | |
| @@ -2237,11 +2255,12 @@ | |
| 2255 | /* |
| 2256 | ** Mapping of names to JSON pages/commands. Each name is a subpath of |
| 2257 | ** /json (in CGI mode) or a subcommand of the json command in CLI mode |
| 2258 | */ |
| 2259 | static const JsonPageDef JsonPageDefs[] = { |
| 2260 | /* please keep alphabetically sorted (case-insensitive) |
| 2261 | for maintenance reasons. */ |
| 2262 | {"anonymousPassword", json_page_anon_password, 0}, |
| 2263 | {"artifact", json_page_artifact, 0}, |
| 2264 | {"branch", json_page_branch,0}, |
| 2265 | {"cap", json_page_cap, 0}, |
| 2266 | {"config", json_page_config, 0 }, |
| 2267 |
+9
-6
| --- src/json_artifact.c | ||
| +++ src/json_artifact.c | ||
| @@ -211,11 +211,12 @@ | ||
| 211 | 211 | /* |
| 212 | 212 | ** Sub-impl of /json/artifact for check-ins. |
| 213 | 213 | */ |
| 214 | 214 | static cson_value * json_artifact_ci( cson_object * zParent, int rid ){ |
| 215 | 215 | if(!g.perm.Read){ |
| 216 | - json_set_err( FSL_JSON_E_DENIED, "Viewing check-ins requires 'o' privileges." ); | |
| 216 | + json_set_err( FSL_JSON_E_DENIED, | |
| 217 | + "Viewing check-ins requires 'o' privileges." ); | |
| 217 | 218 | return NULL; |
| 218 | 219 | }else{ |
| 219 | 220 | cson_value * artV = json_artifact_for_ci(rid, 1); |
| 220 | 221 | cson_object * art = cson_value_get_object(artV); |
| 221 | 222 | if(art){ |
| @@ -250,16 +251,17 @@ | ||
| 250 | 251 | */ |
| 251 | 252 | static int json_artifact_get_content_format_flag(void){ |
| 252 | 253 | enum { MagicValue = -9 }; |
| 253 | 254 | int contentFormat = json_wiki_get_content_format_flag(MagicValue); |
| 254 | 255 | if(MagicValue == contentFormat){ |
| 255 | - contentFormat = json_find_option_bool("includeContent","content","c",0) /* deprecated */ ? -1 : 0; | |
| 256 | + contentFormat = json_find_option_bool("includeContent", | |
| 257 | + "content","c",0) /* deprecated */ ? -1 : 0; | |
| 256 | 258 | } |
| 257 | 259 | return contentFormat; |
| 258 | 260 | } |
| 259 | 261 | |
| 260 | -extern int json_wiki_get_content_format_flag( int defaultValue ) /* json_wiki.c */; | |
| 262 | +extern int json_wiki_get_content_format_flag(int defaultValue) /* json_wiki.c*/; | |
| 261 | 263 | |
| 262 | 264 | cson_value * json_artifact_wiki(cson_object * zParent, int rid){ |
| 263 | 265 | if( ! g.perm.RdWiki ){ |
| 264 | 266 | json_set_err(FSL_JSON_E_DENIED, |
| 265 | 267 | "Requires 'j' privileges."); |
| @@ -380,18 +382,19 @@ | ||
| 380 | 382 | e.g. "modified", "new", "deleted". |
| 381 | 383 | */ |
| 382 | 384 | checkin_arr = cson_new_array(); |
| 383 | 385 | cson_object_set(pay, "checkins", cson_array_value(checkin_arr)); |
| 384 | 386 | while( (SQLITE_ROW==db_step(&q) ) ){ |
| 385 | - cson_object * row = cson_value_get_object(cson_sqlite3_row_to_object(q.pStmt)); | |
| 387 | + cson_object * row = cson_value_get_object( | |
| 388 | + cson_sqlite3_row_to_object(q.pStmt)); | |
| 386 | 389 | /* FIXME: move this isNew/isDel stuff into an SQL CASE statement. */ |
| 387 | 390 | char const isNew = cson_value_get_bool(cson_object_get(row,"isNew")); |
| 388 | 391 | char const isDel = cson_value_get_bool(cson_object_get(row,"isDel")); |
| 389 | 392 | cson_object_set(row, "isNew", NULL); |
| 390 | 393 | cson_object_set(row, "isDel", NULL); |
| 391 | - cson_object_set(row, "state", | |
| 392 | - json_new_string(json_artifact_status_to_string(isNew, isDel))); | |
| 394 | + cson_object_set(row, "state", json_new_string( | |
| 395 | + json_artifact_status_to_string(isNew, isDel))); | |
| 393 | 396 | cson_array_append( checkin_arr, cson_object_value(row) ); |
| 394 | 397 | } |
| 395 | 398 | db_finalize(&q); |
| 396 | 399 | return cson_object_value(pay); |
| 397 | 400 | } |
| 398 | 401 |
| --- src/json_artifact.c | |
| +++ src/json_artifact.c | |
| @@ -211,11 +211,12 @@ | |
| 211 | /* |
| 212 | ** Sub-impl of /json/artifact for check-ins. |
| 213 | */ |
| 214 | static cson_value * json_artifact_ci( cson_object * zParent, int rid ){ |
| 215 | if(!g.perm.Read){ |
| 216 | json_set_err( FSL_JSON_E_DENIED, "Viewing check-ins requires 'o' privileges." ); |
| 217 | return NULL; |
| 218 | }else{ |
| 219 | cson_value * artV = json_artifact_for_ci(rid, 1); |
| 220 | cson_object * art = cson_value_get_object(artV); |
| 221 | if(art){ |
| @@ -250,16 +251,17 @@ | |
| 250 | */ |
| 251 | static int json_artifact_get_content_format_flag(void){ |
| 252 | enum { MagicValue = -9 }; |
| 253 | int contentFormat = json_wiki_get_content_format_flag(MagicValue); |
| 254 | if(MagicValue == contentFormat){ |
| 255 | contentFormat = json_find_option_bool("includeContent","content","c",0) /* deprecated */ ? -1 : 0; |
| 256 | } |
| 257 | return contentFormat; |
| 258 | } |
| 259 | |
| 260 | extern int json_wiki_get_content_format_flag( int defaultValue ) /* json_wiki.c */; |
| 261 | |
| 262 | cson_value * json_artifact_wiki(cson_object * zParent, int rid){ |
| 263 | if( ! g.perm.RdWiki ){ |
| 264 | json_set_err(FSL_JSON_E_DENIED, |
| 265 | "Requires 'j' privileges."); |
| @@ -380,18 +382,19 @@ | |
| 380 | e.g. "modified", "new", "deleted". |
| 381 | */ |
| 382 | checkin_arr = cson_new_array(); |
| 383 | cson_object_set(pay, "checkins", cson_array_value(checkin_arr)); |
| 384 | while( (SQLITE_ROW==db_step(&q) ) ){ |
| 385 | cson_object * row = cson_value_get_object(cson_sqlite3_row_to_object(q.pStmt)); |
| 386 | /* FIXME: move this isNew/isDel stuff into an SQL CASE statement. */ |
| 387 | char const isNew = cson_value_get_bool(cson_object_get(row,"isNew")); |
| 388 | char const isDel = cson_value_get_bool(cson_object_get(row,"isDel")); |
| 389 | cson_object_set(row, "isNew", NULL); |
| 390 | cson_object_set(row, "isDel", NULL); |
| 391 | cson_object_set(row, "state", |
| 392 | json_new_string(json_artifact_status_to_string(isNew, isDel))); |
| 393 | cson_array_append( checkin_arr, cson_object_value(row) ); |
| 394 | } |
| 395 | db_finalize(&q); |
| 396 | return cson_object_value(pay); |
| 397 | } |
| 398 |
| --- src/json_artifact.c | |
| +++ src/json_artifact.c | |
| @@ -211,11 +211,12 @@ | |
| 211 | /* |
| 212 | ** Sub-impl of /json/artifact for check-ins. |
| 213 | */ |
| 214 | static cson_value * json_artifact_ci( cson_object * zParent, int rid ){ |
| 215 | if(!g.perm.Read){ |
| 216 | json_set_err( FSL_JSON_E_DENIED, |
| 217 | "Viewing check-ins requires 'o' privileges." ); |
| 218 | return NULL; |
| 219 | }else{ |
| 220 | cson_value * artV = json_artifact_for_ci(rid, 1); |
| 221 | cson_object * art = cson_value_get_object(artV); |
| 222 | if(art){ |
| @@ -250,16 +251,17 @@ | |
| 251 | */ |
| 252 | static int json_artifact_get_content_format_flag(void){ |
| 253 | enum { MagicValue = -9 }; |
| 254 | int contentFormat = json_wiki_get_content_format_flag(MagicValue); |
| 255 | if(MagicValue == contentFormat){ |
| 256 | contentFormat = json_find_option_bool("includeContent", |
| 257 | "content","c",0) /* deprecated */ ? -1 : 0; |
| 258 | } |
| 259 | return contentFormat; |
| 260 | } |
| 261 | |
| 262 | extern int json_wiki_get_content_format_flag(int defaultValue) /* json_wiki.c*/; |
| 263 | |
| 264 | cson_value * json_artifact_wiki(cson_object * zParent, int rid){ |
| 265 | if( ! g.perm.RdWiki ){ |
| 266 | json_set_err(FSL_JSON_E_DENIED, |
| 267 | "Requires 'j' privileges."); |
| @@ -380,18 +382,19 @@ | |
| 382 | e.g. "modified", "new", "deleted". |
| 383 | */ |
| 384 | checkin_arr = cson_new_array(); |
| 385 | cson_object_set(pay, "checkins", cson_array_value(checkin_arr)); |
| 386 | while( (SQLITE_ROW==db_step(&q) ) ){ |
| 387 | cson_object * row = cson_value_get_object( |
| 388 | cson_sqlite3_row_to_object(q.pStmt)); |
| 389 | /* FIXME: move this isNew/isDel stuff into an SQL CASE statement. */ |
| 390 | char const isNew = cson_value_get_bool(cson_object_get(row,"isNew")); |
| 391 | char const isDel = cson_value_get_bool(cson_object_get(row,"isDel")); |
| 392 | cson_object_set(row, "isNew", NULL); |
| 393 | cson_object_set(row, "isDel", NULL); |
| 394 | cson_object_set(row, "state", json_new_string( |
| 395 | json_artifact_status_to_string(isNew, isDel))); |
| 396 | cson_array_append( checkin_arr, cson_object_value(row) ); |
| 397 | } |
| 398 | db_finalize(&q); |
| 399 | return cson_object_value(pay); |
| 400 | } |
| 401 |
+3
-2
| --- src/json_branch.c | ||
| +++ src/json_branch.c | ||
| @@ -202,11 +202,11 @@ | ||
| 202 | 202 | int bAutoColor = 0; /* Value of "--bgcolor" is "auto" */ |
| 203 | 203 | |
| 204 | 204 | if( fossil_strncmp(zColor, "auto", 4)==0 ) { |
| 205 | 205 | bAutoColor = 1; |
| 206 | 206 | zColor = 0; |
| 207 | - } | |
| 207 | + } | |
| 208 | 208 | /* fossil branch new name */ |
| 209 | 209 | if( zBranch==0 || zBranch[0]==0 ){ |
| 210 | 210 | zOpt->rcErrMsg = "Branch name may not be null/empty."; |
| 211 | 211 | return FSL_JSON_E_INVALID_ARGS; |
| 212 | 212 | } |
| @@ -335,11 +335,12 @@ | ||
| 335 | 335 | if(!opt.zName){ |
| 336 | 336 | opt.zName = json_command_arg(g.json.dispatchDepth+1); |
| 337 | 337 | } |
| 338 | 338 | |
| 339 | 339 | if(!opt.zName){ |
| 340 | - json_set_err(FSL_JSON_E_MISSING_ARGS, "'name' parameter was not specified." ); | |
| 340 | + json_set_err(FSL_JSON_E_MISSING_ARGS, | |
| 341 | + "'name' parameter was not specified." ); | |
| 341 | 342 | return NULL; |
| 342 | 343 | } |
| 343 | 344 | |
| 344 | 345 | opt.zColor = json_find_option_cstr("bgColor","bgcolor",NULL); |
| 345 | 346 | opt.zBasis = json_find_option_cstr("basis",NULL,NULL); |
| 346 | 347 |
| --- src/json_branch.c | |
| +++ src/json_branch.c | |
| @@ -202,11 +202,11 @@ | |
| 202 | int bAutoColor = 0; /* Value of "--bgcolor" is "auto" */ |
| 203 | |
| 204 | if( fossil_strncmp(zColor, "auto", 4)==0 ) { |
| 205 | bAutoColor = 1; |
| 206 | zColor = 0; |
| 207 | } |
| 208 | /* fossil branch new name */ |
| 209 | if( zBranch==0 || zBranch[0]==0 ){ |
| 210 | zOpt->rcErrMsg = "Branch name may not be null/empty."; |
| 211 | return FSL_JSON_E_INVALID_ARGS; |
| 212 | } |
| @@ -335,11 +335,12 @@ | |
| 335 | if(!opt.zName){ |
| 336 | opt.zName = json_command_arg(g.json.dispatchDepth+1); |
| 337 | } |
| 338 | |
| 339 | if(!opt.zName){ |
| 340 | json_set_err(FSL_JSON_E_MISSING_ARGS, "'name' parameter was not specified." ); |
| 341 | return NULL; |
| 342 | } |
| 343 | |
| 344 | opt.zColor = json_find_option_cstr("bgColor","bgcolor",NULL); |
| 345 | opt.zBasis = json_find_option_cstr("basis",NULL,NULL); |
| 346 |
| --- src/json_branch.c | |
| +++ src/json_branch.c | |
| @@ -202,11 +202,11 @@ | |
| 202 | int bAutoColor = 0; /* Value of "--bgcolor" is "auto" */ |
| 203 | |
| 204 | if( fossil_strncmp(zColor, "auto", 4)==0 ) { |
| 205 | bAutoColor = 1; |
| 206 | zColor = 0; |
| 207 | } |
| 208 | /* fossil branch new name */ |
| 209 | if( zBranch==0 || zBranch[0]==0 ){ |
| 210 | zOpt->rcErrMsg = "Branch name may not be null/empty."; |
| 211 | return FSL_JSON_E_INVALID_ARGS; |
| 212 | } |
| @@ -335,11 +335,12 @@ | |
| 335 | if(!opt.zName){ |
| 336 | opt.zName = json_command_arg(g.json.dispatchDepth+1); |
| 337 | } |
| 338 | |
| 339 | if(!opt.zName){ |
| 340 | json_set_err(FSL_JSON_E_MISSING_ARGS, |
| 341 | "'name' parameter was not specified." ); |
| 342 | return NULL; |
| 343 | } |
| 344 | |
| 345 | opt.zColor = json_find_option_cstr("bgColor","bgcolor",NULL); |
| 346 | opt.zBasis = json_find_option_cstr("basis",NULL,NULL); |
| 347 |
+2
-2
| --- src/json_config.c | ||
| +++ src/json_config.c | ||
| @@ -257,11 +257,11 @@ | ||
| 257 | 257 | const Setting *pSet = &aSetting[i]; |
| 258 | 258 | cson_object * jSet; |
| 259 | 259 | cson_value * pVal = 0, * pSrc = 0; |
| 260 | 260 | jSet = cson_new_object(); |
| 261 | 261 | cson_object_set(pay, pSet->name, cson_object_value(jSet)); |
| 262 | - cson_object_set(jSet, "versionable", cson_value_new_bool(pSet->versionable)); | |
| 262 | + cson_object_set(jSet, "versionable",cson_value_new_bool(pSet->versionable)); | |
| 263 | 263 | cson_object_set(jSet, "sensitive", cson_value_new_bool(pSet->sensitive)); |
| 264 | 264 | cson_object_set(jSet, "defaultValue", (pSet->def && pSet->def[0]) |
| 265 | 265 | ? json_new_string(pSet->def) |
| 266 | 266 | : cson_value_null()); |
| 267 | 267 | if( 0==pSet->sensitive || 0!=g.perm.Setup ){ |
| @@ -292,11 +292,11 @@ | ||
| 292 | 292 | blob_appendf(&versionedPathname, "%s.fossil-settings/%s", |
| 293 | 293 | g.zLocalRoot, pSet->name); |
| 294 | 294 | if( file_size(blob_str(&versionedPathname), ExtFILE)>=0 ){ |
| 295 | 295 | Blob content; |
| 296 | 296 | blob_zero(&content); |
| 297 | - blob_read_from_file(&content, blob_str(&versionedPathname), ExtFILE); | |
| 297 | + blob_read_from_file(&content, blob_str(&versionedPathname),ExtFILE); | |
| 298 | 298 | pSrc = json_new_string("versioned"); |
| 299 | 299 | pVal = json_new_string(blob_str(&content)); |
| 300 | 300 | blob_reset(&content); |
| 301 | 301 | } |
| 302 | 302 | blob_reset(&versionedPathname); |
| 303 | 303 |
| --- src/json_config.c | |
| +++ src/json_config.c | |
| @@ -257,11 +257,11 @@ | |
| 257 | const Setting *pSet = &aSetting[i]; |
| 258 | cson_object * jSet; |
| 259 | cson_value * pVal = 0, * pSrc = 0; |
| 260 | jSet = cson_new_object(); |
| 261 | cson_object_set(pay, pSet->name, cson_object_value(jSet)); |
| 262 | cson_object_set(jSet, "versionable", cson_value_new_bool(pSet->versionable)); |
| 263 | cson_object_set(jSet, "sensitive", cson_value_new_bool(pSet->sensitive)); |
| 264 | cson_object_set(jSet, "defaultValue", (pSet->def && pSet->def[0]) |
| 265 | ? json_new_string(pSet->def) |
| 266 | : cson_value_null()); |
| 267 | if( 0==pSet->sensitive || 0!=g.perm.Setup ){ |
| @@ -292,11 +292,11 @@ | |
| 292 | blob_appendf(&versionedPathname, "%s.fossil-settings/%s", |
| 293 | g.zLocalRoot, pSet->name); |
| 294 | if( file_size(blob_str(&versionedPathname), ExtFILE)>=0 ){ |
| 295 | Blob content; |
| 296 | blob_zero(&content); |
| 297 | blob_read_from_file(&content, blob_str(&versionedPathname), ExtFILE); |
| 298 | pSrc = json_new_string("versioned"); |
| 299 | pVal = json_new_string(blob_str(&content)); |
| 300 | blob_reset(&content); |
| 301 | } |
| 302 | blob_reset(&versionedPathname); |
| 303 |
| --- src/json_config.c | |
| +++ src/json_config.c | |
| @@ -257,11 +257,11 @@ | |
| 257 | const Setting *pSet = &aSetting[i]; |
| 258 | cson_object * jSet; |
| 259 | cson_value * pVal = 0, * pSrc = 0; |
| 260 | jSet = cson_new_object(); |
| 261 | cson_object_set(pay, pSet->name, cson_object_value(jSet)); |
| 262 | cson_object_set(jSet, "versionable",cson_value_new_bool(pSet->versionable)); |
| 263 | cson_object_set(jSet, "sensitive", cson_value_new_bool(pSet->sensitive)); |
| 264 | cson_object_set(jSet, "defaultValue", (pSet->def && pSet->def[0]) |
| 265 | ? json_new_string(pSet->def) |
| 266 | : cson_value_null()); |
| 267 | if( 0==pSet->sensitive || 0!=g.perm.Setup ){ |
| @@ -292,11 +292,11 @@ | |
| 292 | blob_appendf(&versionedPathname, "%s.fossil-settings/%s", |
| 293 | g.zLocalRoot, pSet->name); |
| 294 | if( file_size(blob_str(&versionedPathname), ExtFILE)>=0 ){ |
| 295 | Blob content; |
| 296 | blob_zero(&content); |
| 297 | blob_read_from_file(&content, blob_str(&versionedPathname),ExtFILE); |
| 298 | pSrc = json_new_string("versioned"); |
| 299 | pVal = json_new_string(blob_str(&content)); |
| 300 | blob_reset(&content); |
| 301 | } |
| 302 | blob_reset(&versionedPathname); |
| 303 |
+15
-10
| --- src/json_finfo.c | ||
| +++ src/json_finfo.c | ||
| @@ -41,14 +41,15 @@ | ||
| 41 | 41 | signed char sort = -1; |
| 42 | 42 | if(!g.perm.Read){ |
| 43 | 43 | json_set_err(FSL_JSON_E_DENIED,"Requires 'o' privileges."); |
| 44 | 44 | return NULL; |
| 45 | 45 | } |
| 46 | - json_warn( FSL_JSON_W_UNKNOWN, "Achtung: the output of the finfo command is up for change."); | |
| 46 | + json_warn( FSL_JSON_W_UNKNOWN, | |
| 47 | + "Achtung: the output of the finfo command is up for change."); | |
| 47 | 48 | |
| 48 | - /* For the "name" argument we have to jump through some hoops to make sure that we don't | |
| 49 | - get the fossil-internally-assigned "name" option. | |
| 49 | + /* For the "name" argument we have to jump through some hoops to make sure | |
| 50 | + that we don't get the fossil-internally-assigned "name" option. | |
| 50 | 51 | */ |
| 51 | 52 | zFilename = json_find_option_cstr2("name",NULL,NULL, g.json.dispatchDepth+1); |
| 52 | 53 | if(!zFilename || !*zFilename){ |
| 53 | 54 | json_set_err(FSL_JSON_E_MISSING_ARGS, "Missing 'name' parameter."); |
| 54 | 55 | return NULL; |
| @@ -65,11 +66,11 @@ | ||
| 65 | 66 | zCheckin = json_find_option_cstr("checkin",NULL,"ci"); |
| 66 | 67 | |
| 67 | 68 | blob_append_sql(&sql, |
| 68 | 69 | /*0*/ "SELECT b.uuid," |
| 69 | 70 | /*1*/ " ci.uuid," |
| 70 | -/*2*/ " (SELECT uuid FROM blob WHERE rid=mlink.fid)," /* Current file uuid */ | |
| 71 | +/*2*/ " (SELECT uuid FROM blob WHERE rid=mlink.fid),"/* Current file uuid */ | |
| 71 | 72 | /*3*/ " cast(strftime('%%s',event.mtime) AS INTEGER)," |
| 72 | 73 | /*4*/ " coalesce(event.euser, event.user)," |
| 73 | 74 | /*5*/ " coalesce(event.ecomment, event.comment)," |
| 74 | 75 | /*6*/ " (SELECT uuid FROM blob WHERE rid=mlink.pid)," /* Parent file uuid */ |
| 75 | 76 | /*7*/ " event.bgcolor," |
| @@ -88,11 +89,12 @@ | ||
| 88 | 89 | if( zCheckin && *zCheckin ){ |
| 89 | 90 | char * zU = NULL; |
| 90 | 91 | int rc = name_to_uuid2( zCheckin, "ci", &zU ); |
| 91 | 92 | /*printf("zCheckin=[%s], zU=[%s]", zCheckin, zU);*/ |
| 92 | 93 | if(rc<=0){ |
| 93 | - json_set_err((rc<0) ? FSL_JSON_E_AMBIGUOUS_UUID : FSL_JSON_E_RESOURCE_NOT_FOUND, | |
| 94 | + json_set_err((rc<0) ? FSL_JSON_E_AMBIGUOUS_UUID : | |
| 95 | + FSL_JSON_E_RESOURCE_NOT_FOUND, | |
| 94 | 96 | "Check-in hash %s.", (rc<0) ? "is ambiguous" : "not found"); |
| 95 | 97 | blob_reset(&sql); |
| 96 | 98 | return NULL; |
| 97 | 99 | } |
| 98 | 100 | blob_append_sql(&sql, " AND ci.uuid='%q'", zU); |
| @@ -104,11 +106,12 @@ | ||
| 104 | 106 | }else if( zBefore && *zBefore ){ |
| 105 | 107 | blob_append_sql(&sql, " AND event.mtime<=julianday('%q')", zBefore); |
| 106 | 108 | } |
| 107 | 109 | } |
| 108 | 110 | |
| 109 | - blob_append_sql(&sql," ORDER BY event.mtime %s /*sort*/", (sort>0?"ASC":"DESC")); | |
| 111 | + blob_append_sql(&sql," ORDER BY event.mtime %s /*sort*/", | |
| 112 | + (sort>0 ? "ASC" : "DESC")); | |
| 110 | 113 | /*printf("SQL=\n%s\n",blob_str(&sql));*/ |
| 111 | 114 | db_prepare(&q, "%s", blob_sql_text(&sql)); |
| 112 | 115 | blob_reset(&sql); |
| 113 | 116 | |
| 114 | 117 | pay = cson_new_object(); |
| @@ -123,18 +126,20 @@ | ||
| 123 | 126 | int const isNew = db_column_int(&q,9); |
| 124 | 127 | int const isDel = db_column_int(&q,10); |
| 125 | 128 | cson_array_append( checkins, cson_object_value(row) ); |
| 126 | 129 | cson_object_set(row, "checkin", json_new_string( db_column_text(&q,1) )); |
| 127 | 130 | cson_object_set(row, "uuid", json_new_string( db_column_text(&q,2) )); |
| 128 | - /*cson_object_set(row, "parentArtifact", json_new_string( db_column_text(&q,6) ));*/ | |
| 131 | + /*cson_object_set(row, "parentArtifact", | |
| 132 | + json_new_string( db_column_text(&q,6) ));*/ | |
| 129 | 133 | cson_object_set(row, "timestamp", json_new_int( db_column_int64(&q,3) )); |
| 130 | 134 | cson_object_set(row, "user", json_new_string( db_column_text(&q,4) )); |
| 131 | 135 | cson_object_set(row, "comment", json_new_string( db_column_text(&q,5) )); |
| 132 | - /*cson_object_set(row, "bgColor", json_new_string( db_column_text(&q,7) ));*/ | |
| 136 | + /*cson_object_set(row, "bgColor", | |
| 137 | + json_new_string( db_column_text(&q,7) ));*/ | |
| 133 | 138 | cson_object_set(row, "size", json_new_int( db_column_int64(&q,8) )); |
| 134 | - cson_object_set(row, "state", | |
| 135 | - json_new_string(json_artifact_status_to_string(isNew,isDel))); | |
| 139 | + cson_object_set(row, "state", json_new_string( | |
| 140 | + json_artifact_status_to_string(isNew, isDel))); | |
| 136 | 141 | if( (0 < limit) && (++currentRow >= limit) ){ |
| 137 | 142 | break; |
| 138 | 143 | } |
| 139 | 144 | } |
| 140 | 145 | db_finalize(&q); |
| 141 | 146 |
| --- src/json_finfo.c | |
| +++ src/json_finfo.c | |
| @@ -41,14 +41,15 @@ | |
| 41 | signed char sort = -1; |
| 42 | if(!g.perm.Read){ |
| 43 | json_set_err(FSL_JSON_E_DENIED,"Requires 'o' privileges."); |
| 44 | return NULL; |
| 45 | } |
| 46 | json_warn( FSL_JSON_W_UNKNOWN, "Achtung: the output of the finfo command is up for change."); |
| 47 | |
| 48 | /* For the "name" argument we have to jump through some hoops to make sure that we don't |
| 49 | get the fossil-internally-assigned "name" option. |
| 50 | */ |
| 51 | zFilename = json_find_option_cstr2("name",NULL,NULL, g.json.dispatchDepth+1); |
| 52 | if(!zFilename || !*zFilename){ |
| 53 | json_set_err(FSL_JSON_E_MISSING_ARGS, "Missing 'name' parameter."); |
| 54 | return NULL; |
| @@ -65,11 +66,11 @@ | |
| 65 | zCheckin = json_find_option_cstr("checkin",NULL,"ci"); |
| 66 | |
| 67 | blob_append_sql(&sql, |
| 68 | /*0*/ "SELECT b.uuid," |
| 69 | /*1*/ " ci.uuid," |
| 70 | /*2*/ " (SELECT uuid FROM blob WHERE rid=mlink.fid)," /* Current file uuid */ |
| 71 | /*3*/ " cast(strftime('%%s',event.mtime) AS INTEGER)," |
| 72 | /*4*/ " coalesce(event.euser, event.user)," |
| 73 | /*5*/ " coalesce(event.ecomment, event.comment)," |
| 74 | /*6*/ " (SELECT uuid FROM blob WHERE rid=mlink.pid)," /* Parent file uuid */ |
| 75 | /*7*/ " event.bgcolor," |
| @@ -88,11 +89,12 @@ | |
| 88 | if( zCheckin && *zCheckin ){ |
| 89 | char * zU = NULL; |
| 90 | int rc = name_to_uuid2( zCheckin, "ci", &zU ); |
| 91 | /*printf("zCheckin=[%s], zU=[%s]", zCheckin, zU);*/ |
| 92 | if(rc<=0){ |
| 93 | json_set_err((rc<0) ? FSL_JSON_E_AMBIGUOUS_UUID : FSL_JSON_E_RESOURCE_NOT_FOUND, |
| 94 | "Check-in hash %s.", (rc<0) ? "is ambiguous" : "not found"); |
| 95 | blob_reset(&sql); |
| 96 | return NULL; |
| 97 | } |
| 98 | blob_append_sql(&sql, " AND ci.uuid='%q'", zU); |
| @@ -104,11 +106,12 @@ | |
| 104 | }else if( zBefore && *zBefore ){ |
| 105 | blob_append_sql(&sql, " AND event.mtime<=julianday('%q')", zBefore); |
| 106 | } |
| 107 | } |
| 108 | |
| 109 | blob_append_sql(&sql," ORDER BY event.mtime %s /*sort*/", (sort>0?"ASC":"DESC")); |
| 110 | /*printf("SQL=\n%s\n",blob_str(&sql));*/ |
| 111 | db_prepare(&q, "%s", blob_sql_text(&sql)); |
| 112 | blob_reset(&sql); |
| 113 | |
| 114 | pay = cson_new_object(); |
| @@ -123,18 +126,20 @@ | |
| 123 | int const isNew = db_column_int(&q,9); |
| 124 | int const isDel = db_column_int(&q,10); |
| 125 | cson_array_append( checkins, cson_object_value(row) ); |
| 126 | cson_object_set(row, "checkin", json_new_string( db_column_text(&q,1) )); |
| 127 | cson_object_set(row, "uuid", json_new_string( db_column_text(&q,2) )); |
| 128 | /*cson_object_set(row, "parentArtifact", json_new_string( db_column_text(&q,6) ));*/ |
| 129 | cson_object_set(row, "timestamp", json_new_int( db_column_int64(&q,3) )); |
| 130 | cson_object_set(row, "user", json_new_string( db_column_text(&q,4) )); |
| 131 | cson_object_set(row, "comment", json_new_string( db_column_text(&q,5) )); |
| 132 | /*cson_object_set(row, "bgColor", json_new_string( db_column_text(&q,7) ));*/ |
| 133 | cson_object_set(row, "size", json_new_int( db_column_int64(&q,8) )); |
| 134 | cson_object_set(row, "state", |
| 135 | json_new_string(json_artifact_status_to_string(isNew,isDel))); |
| 136 | if( (0 < limit) && (++currentRow >= limit) ){ |
| 137 | break; |
| 138 | } |
| 139 | } |
| 140 | db_finalize(&q); |
| 141 |
| --- src/json_finfo.c | |
| +++ src/json_finfo.c | |
| @@ -41,14 +41,15 @@ | |
| 41 | signed char sort = -1; |
| 42 | if(!g.perm.Read){ |
| 43 | json_set_err(FSL_JSON_E_DENIED,"Requires 'o' privileges."); |
| 44 | return NULL; |
| 45 | } |
| 46 | json_warn( FSL_JSON_W_UNKNOWN, |
| 47 | "Achtung: the output of the finfo command is up for change."); |
| 48 | |
| 49 | /* For the "name" argument we have to jump through some hoops to make sure |
| 50 | that we don't get the fossil-internally-assigned "name" option. |
| 51 | */ |
| 52 | zFilename = json_find_option_cstr2("name",NULL,NULL, g.json.dispatchDepth+1); |
| 53 | if(!zFilename || !*zFilename){ |
| 54 | json_set_err(FSL_JSON_E_MISSING_ARGS, "Missing 'name' parameter."); |
| 55 | return NULL; |
| @@ -65,11 +66,11 @@ | |
| 66 | zCheckin = json_find_option_cstr("checkin",NULL,"ci"); |
| 67 | |
| 68 | blob_append_sql(&sql, |
| 69 | /*0*/ "SELECT b.uuid," |
| 70 | /*1*/ " ci.uuid," |
| 71 | /*2*/ " (SELECT uuid FROM blob WHERE rid=mlink.fid),"/* Current file uuid */ |
| 72 | /*3*/ " cast(strftime('%%s',event.mtime) AS INTEGER)," |
| 73 | /*4*/ " coalesce(event.euser, event.user)," |
| 74 | /*5*/ " coalesce(event.ecomment, event.comment)," |
| 75 | /*6*/ " (SELECT uuid FROM blob WHERE rid=mlink.pid)," /* Parent file uuid */ |
| 76 | /*7*/ " event.bgcolor," |
| @@ -88,11 +89,12 @@ | |
| 89 | if( zCheckin && *zCheckin ){ |
| 90 | char * zU = NULL; |
| 91 | int rc = name_to_uuid2( zCheckin, "ci", &zU ); |
| 92 | /*printf("zCheckin=[%s], zU=[%s]", zCheckin, zU);*/ |
| 93 | if(rc<=0){ |
| 94 | json_set_err((rc<0) ? FSL_JSON_E_AMBIGUOUS_UUID : |
| 95 | FSL_JSON_E_RESOURCE_NOT_FOUND, |
| 96 | "Check-in hash %s.", (rc<0) ? "is ambiguous" : "not found"); |
| 97 | blob_reset(&sql); |
| 98 | return NULL; |
| 99 | } |
| 100 | blob_append_sql(&sql, " AND ci.uuid='%q'", zU); |
| @@ -104,11 +106,12 @@ | |
| 106 | }else if( zBefore && *zBefore ){ |
| 107 | blob_append_sql(&sql, " AND event.mtime<=julianday('%q')", zBefore); |
| 108 | } |
| 109 | } |
| 110 | |
| 111 | blob_append_sql(&sql," ORDER BY event.mtime %s /*sort*/", |
| 112 | (sort>0 ? "ASC" : "DESC")); |
| 113 | /*printf("SQL=\n%s\n",blob_str(&sql));*/ |
| 114 | db_prepare(&q, "%s", blob_sql_text(&sql)); |
| 115 | blob_reset(&sql); |
| 116 | |
| 117 | pay = cson_new_object(); |
| @@ -123,18 +126,20 @@ | |
| 126 | int const isNew = db_column_int(&q,9); |
| 127 | int const isDel = db_column_int(&q,10); |
| 128 | cson_array_append( checkins, cson_object_value(row) ); |
| 129 | cson_object_set(row, "checkin", json_new_string( db_column_text(&q,1) )); |
| 130 | cson_object_set(row, "uuid", json_new_string( db_column_text(&q,2) )); |
| 131 | /*cson_object_set(row, "parentArtifact", |
| 132 | json_new_string( db_column_text(&q,6) ));*/ |
| 133 | cson_object_set(row, "timestamp", json_new_int( db_column_int64(&q,3) )); |
| 134 | cson_object_set(row, "user", json_new_string( db_column_text(&q,4) )); |
| 135 | cson_object_set(row, "comment", json_new_string( db_column_text(&q,5) )); |
| 136 | /*cson_object_set(row, "bgColor", |
| 137 | json_new_string( db_column_text(&q,7) ));*/ |
| 138 | cson_object_set(row, "size", json_new_int( db_column_int64(&q,8) )); |
| 139 | cson_object_set(row, "state", json_new_string( |
| 140 | json_artifact_status_to_string(isNew, isDel))); |
| 141 | if( (0 < limit) && (++currentRow >= limit) ){ |
| 142 | break; |
| 143 | } |
| 144 | } |
| 145 | db_finalize(&q); |
| 146 |
+4
-2
| --- src/json_login.c | ||
| +++ src/json_login.c | ||
| @@ -155,13 +155,15 @@ | ||
| 155 | 155 | po = cson_value_get_object(payload); |
| 156 | 156 | cson_object_set(po, "authToken", json_new_string(cookie)); |
| 157 | 157 | free(cookie); |
| 158 | 158 | cson_object_set(po, "name", json_new_string(name)); |
| 159 | 159 | cap = db_text(NULL, "SELECT cap FROM user WHERE login=%Q", name); |
| 160 | - cson_object_set(po, "capabilities", cap ? json_new_string(cap) : cson_value_null() ); | |
| 160 | + cson_object_set(po, "capabilities", | |
| 161 | + cap ? json_new_string(cap) : cson_value_null() ); | |
| 161 | 162 | free(cap); |
| 162 | - cson_object_set(po, "loginCookieName", json_new_string( login_cookie_name() ) ); | |
| 163 | + cson_object_set(po, "loginCookieName", | |
| 164 | + json_new_string( login_cookie_name() ) ); | |
| 163 | 165 | /* TODO: add loginExpiryTime to the payload. To do this properly |
| 164 | 166 | we "should" add an ([unsigned] int *) to |
| 165 | 167 | login_set_user_cookie() and login_set_anon_cookie(), to which |
| 166 | 168 | the expiry time is assigned. (Remember that JSON doesn't do |
| 167 | 169 | unsigned int.) |
| 168 | 170 |
| --- src/json_login.c | |
| +++ src/json_login.c | |
| @@ -155,13 +155,15 @@ | |
| 155 | po = cson_value_get_object(payload); |
| 156 | cson_object_set(po, "authToken", json_new_string(cookie)); |
| 157 | free(cookie); |
| 158 | cson_object_set(po, "name", json_new_string(name)); |
| 159 | cap = db_text(NULL, "SELECT cap FROM user WHERE login=%Q", name); |
| 160 | cson_object_set(po, "capabilities", cap ? json_new_string(cap) : cson_value_null() ); |
| 161 | free(cap); |
| 162 | cson_object_set(po, "loginCookieName", json_new_string( login_cookie_name() ) ); |
| 163 | /* TODO: add loginExpiryTime to the payload. To do this properly |
| 164 | we "should" add an ([unsigned] int *) to |
| 165 | login_set_user_cookie() and login_set_anon_cookie(), to which |
| 166 | the expiry time is assigned. (Remember that JSON doesn't do |
| 167 | unsigned int.) |
| 168 |
| --- src/json_login.c | |
| +++ src/json_login.c | |
| @@ -155,13 +155,15 @@ | |
| 155 | po = cson_value_get_object(payload); |
| 156 | cson_object_set(po, "authToken", json_new_string(cookie)); |
| 157 | free(cookie); |
| 158 | cson_object_set(po, "name", json_new_string(name)); |
| 159 | cap = db_text(NULL, "SELECT cap FROM user WHERE login=%Q", name); |
| 160 | cson_object_set(po, "capabilities", |
| 161 | cap ? json_new_string(cap) : cson_value_null() ); |
| 162 | free(cap); |
| 163 | cson_object_set(po, "loginCookieName", |
| 164 | json_new_string( login_cookie_name() ) ); |
| 165 | /* TODO: add loginExpiryTime to the payload. To do this properly |
| 166 | we "should" add an ([unsigned] int *) to |
| 167 | login_set_user_cookie() and login_set_anon_cookie(), to which |
| 168 | the expiry time is assigned. (Remember that JSON doesn't do |
| 169 | unsigned int.) |
| 170 |
+2
-1
| --- src/json_tag.c | ||
| +++ src/json_tag.c | ||
| @@ -117,11 +117,12 @@ | ||
| 117 | 117 | Blob uu = empty_blob; |
| 118 | 118 | int rc; |
| 119 | 119 | blob_append(&uu, zName, -1); |
| 120 | 120 | rc = name_to_uuid(&uu, 9, "*"); |
| 121 | 121 | if(0!=rc){ |
| 122 | - json_set_err(FSL_JSON_E_UNKNOWN,"Could not convert name back to artifact hash!"); | |
| 122 | + json_set_err(FSL_JSON_E_UNKNOWN, | |
| 123 | + "Could not convert name back to artifact hash!"); | |
| 123 | 124 | blob_reset(&uu); |
| 124 | 125 | goto error; |
| 125 | 126 | } |
| 126 | 127 | cson_object_set(pay, "appliedTo", json_new_string(blob_buffer(&uu))); |
| 127 | 128 | blob_reset(&uu); |
| 128 | 129 |
| --- src/json_tag.c | |
| +++ src/json_tag.c | |
| @@ -117,11 +117,12 @@ | |
| 117 | Blob uu = empty_blob; |
| 118 | int rc; |
| 119 | blob_append(&uu, zName, -1); |
| 120 | rc = name_to_uuid(&uu, 9, "*"); |
| 121 | if(0!=rc){ |
| 122 | json_set_err(FSL_JSON_E_UNKNOWN,"Could not convert name back to artifact hash!"); |
| 123 | blob_reset(&uu); |
| 124 | goto error; |
| 125 | } |
| 126 | cson_object_set(pay, "appliedTo", json_new_string(blob_buffer(&uu))); |
| 127 | blob_reset(&uu); |
| 128 |
| --- src/json_tag.c | |
| +++ src/json_tag.c | |
| @@ -117,11 +117,12 @@ | |
| 117 | Blob uu = empty_blob; |
| 118 | int rc; |
| 119 | blob_append(&uu, zName, -1); |
| 120 | rc = name_to_uuid(&uu, 9, "*"); |
| 121 | if(0!=rc){ |
| 122 | json_set_err(FSL_JSON_E_UNKNOWN, |
| 123 | "Could not convert name back to artifact hash!"); |
| 124 | blob_reset(&uu); |
| 125 | goto error; |
| 126 | } |
| 127 | cson_object_set(pay, "appliedTo", json_new_string(blob_buffer(&uu))); |
| 128 | blob_reset(&uu); |
| 129 |
+20
-11
| --- src/json_timeline.c | ||
| +++ src/json_timeline.c | ||
| @@ -169,20 +169,22 @@ | ||
| 169 | 169 | zTag); |
| 170 | 170 | if(tagid<=0){ |
| 171 | 171 | return -1; |
| 172 | 172 | } |
| 173 | 173 | if(pPayload){ |
| 174 | - cson_object_set( pPayload, zBranch ? "branch" : "tag", json_new_string(zTag) ); | |
| 174 | + cson_object_set( pPayload, zBranch ? "branch" : "tag", | |
| 175 | + json_new_string(zTag) ); | |
| 175 | 176 | } |
| 176 | 177 | blob_appendf(pSql, |
| 177 | 178 | " AND (" |
| 178 | 179 | " EXISTS(SELECT 1 FROM tagxref" |
| 179 | 180 | " WHERE tagid=%d AND tagtype>0 AND rid=blob.rid)", |
| 180 | 181 | tagid); |
| 181 | 182 | if(!zUnhide){ |
| 182 | 183 | blob_appendf(pSql, |
| 183 | - " AND NOT EXISTS(SELECT 1 FROM plink JOIN tagxref ON rid=blob.rid" | |
| 184 | + " AND NOT EXISTS(SELECT 1 FROM plink " | |
| 185 | + " JOIN tagxref ON rid=blob.rid" | |
| 184 | 186 | " WHERE tagid=%d AND tagtype>0 AND rid=blob.rid)", |
| 185 | 187 | TAG_HIDDEN); |
| 186 | 188 | } |
| 187 | 189 | if(zBranch){ |
| 188 | 190 | /* from "r" flag code in page_timeline().*/ |
| @@ -352,13 +354,14 @@ | ||
| 352 | 354 | cson_object_set(row, "parent", json_new_string(db_column_text(&q,4))); |
| 353 | 355 | } |
| 354 | 356 | cson_object_set(row, "size", json_new_int(db_column_int(&q,5))); |
| 355 | 357 | |
| 356 | 358 | cson_object_set(row, "state", |
| 357 | - json_new_string(json_artifact_status_to_string(isNew,isDel))); | |
| 359 | + json_new_string(json_artifact_status_to_string(isNew,isDel))); | |
| 358 | 360 | zDownload = mprintf("/raw/%s?name=%s", |
| 359 | - /* reminder: g.zBaseURL is of course not set for CLI mode. */ | |
| 361 | + /* reminder: g.zBaseURL is of course not set | |
| 362 | + for CLI mode. */ | |
| 360 | 363 | db_column_text(&q,2), |
| 361 | 364 | db_column_text(&q,3)); |
| 362 | 365 | cson_object_set(row, "downloadPath", json_new_string(zDownload)); |
| 363 | 366 | free(zDownload); |
| 364 | 367 | } |
| @@ -505,11 +508,11 @@ | ||
| 505 | 508 | cson_object * row = cson_value_get_object(rowV); |
| 506 | 509 | if(!row){ |
| 507 | 510 | if( !warnRowToJsonFailed ){ |
| 508 | 511 | warnRowToJsonFailed = 1; |
| 509 | 512 | json_warn( FSL_JSON_W_ROW_TO_JSON_FAILED, |
| 510 | - "Could not convert at least one timeline result row to JSON." ); | |
| 513 | + "Could not convert at least one timeline result row to JSON." ); | |
| 511 | 514 | } |
| 512 | 515 | continue; |
| 513 | 516 | } |
| 514 | 517 | cson_array_append(list, rowV); |
| 515 | 518 | } |
| @@ -548,19 +551,22 @@ | ||
| 548 | 551 | goto error; |
| 549 | 552 | } |
| 550 | 553 | |
| 551 | 554 | #if 0 |
| 552 | 555 | /* only for testing! */ |
| 553 | - cson_object_set(pay, "timelineSql", cson_value_new_string(blob_buffer(&sql),strlen(blob_buffer(&sql)))); | |
| 556 | + cson_object_set(pay, "timelineSql", cson_value_new_string(blob_buffer(&sql), | |
| 557 | + strlen(blob_buffer(&sql)))); | |
| 554 | 558 | #endif |
| 555 | 559 | db_multi_exec("%s", blob_buffer(&sql) /*safe-for-%s*/); |
| 556 | 560 | blob_reset(&sql); |
| 557 | 561 | db_prepare(&q, "SELECT" |
| 558 | 562 | /* For events, the name is generally more useful than |
| 559 | 563 | the uuid, but the uuid is unambiguous and can be used |
| 560 | 564 | with commands like 'artifact'. */ |
| 561 | - " substr((SELECT tagname FROM tag AS tn WHERE tn.tagid=json_timeline.tagId AND tagname LIKE 'event-%%'),7) AS name," | |
| 565 | + " substr((SELECT tagname FROM tag AS tn " | |
| 566 | + " WHERE tn.tagid=json_timeline.tagId " | |
| 567 | + " AND tagname LIKE 'event-%%'),7) AS name," | |
| 562 | 568 | " uuid as uuid," |
| 563 | 569 | " mtime AS timestamp," |
| 564 | 570 | " comment AS comment, " |
| 565 | 571 | " user AS user," |
| 566 | 572 | " eventType AS eventType" |
| @@ -591,11 +597,12 @@ | ||
| 591 | 597 | cson_array * list = NULL; |
| 592 | 598 | int check = 0; |
| 593 | 599 | Stmt q = empty_Stmt; |
| 594 | 600 | Blob sql = empty_blob; |
| 595 | 601 | if( !g.perm.RdWiki && !g.perm.Read ){ |
| 596 | - json_set_err( FSL_JSON_E_DENIED, "Wiki timeline requires 'o' or 'j' access."); | |
| 602 | + json_set_err( FSL_JSON_E_DENIED, | |
| 603 | + "Wiki timeline requires 'o' or 'j' access."); | |
| 597 | 604 | return NULL; |
| 598 | 605 | } |
| 599 | 606 | payV = cson_value_new_object(); |
| 600 | 607 | pay = cson_value_get_object(payV); |
| 601 | 608 | check = json_timeline_setup_sql( "w", &sql, pay ); |
| @@ -604,11 +611,12 @@ | ||
| 604 | 611 | goto error; |
| 605 | 612 | } |
| 606 | 613 | |
| 607 | 614 | #if 0 |
| 608 | 615 | /* only for testing! */ |
| 609 | - cson_object_set(pay, "timelineSql", cson_value_new_string(blob_buffer(&sql),strlen(blob_buffer(&sql)))); | |
| 616 | + cson_object_set(pay, "timelineSql", cson_value_new_string(blob_buffer(&sql), | |
| 617 | + strlen(blob_buffer(&sql)))); | |
| 610 | 618 | #endif |
| 611 | 619 | db_multi_exec("%s", blob_buffer(&sql) /*safe-for-%s*/); |
| 612 | 620 | blob_reset(&sql); |
| 613 | 621 | db_prepare(&q, "SELECT" |
| 614 | 622 | " uuid AS uuid," |
| @@ -654,11 +662,12 @@ | ||
| 654 | 662 | cson_array * list = NULL; |
| 655 | 663 | int check = 0; |
| 656 | 664 | Stmt q = empty_Stmt; |
| 657 | 665 | Blob sql = empty_blob; |
| 658 | 666 | if( !g.perm.RdTkt && !g.perm.Read ){ |
| 659 | - json_set_err(FSL_JSON_E_DENIED, "Ticket timeline requires 'o' or 'r' access."); | |
| 667 | + json_set_err(FSL_JSON_E_DENIED, | |
| 668 | + "Ticket timeline requires 'o' or 'r' access."); | |
| 660 | 669 | return NULL; |
| 661 | 670 | } |
| 662 | 671 | payV = cson_value_new_object(); |
| 663 | 672 | pay = cson_value_get_object(payV); |
| 664 | 673 | check = json_timeline_setup_sql( "t", &sql, pay ); |
| @@ -726,11 +735,11 @@ | ||
| 726 | 735 | rowV = cson_sqlite3_row_to_object(q.pStmt); |
| 727 | 736 | row = cson_value_get_object(rowV); |
| 728 | 737 | if(!row){ |
| 729 | 738 | manifest_destroy(pMan); |
| 730 | 739 | json_warn( FSL_JSON_W_ROW_TO_JSON_FAILED, |
| 731 | - "Could not convert at least one timeline result row to JSON." ); | |
| 740 | + "Could not convert at least one timeline result row to JSON." ); | |
| 732 | 741 | continue; |
| 733 | 742 | } |
| 734 | 743 | /* FIXME: certainly there's a more efficient way for use to get |
| 735 | 744 | the ticket UUIDs? |
| 736 | 745 | */ |
| 737 | 746 |
| --- src/json_timeline.c | |
| +++ src/json_timeline.c | |
| @@ -169,20 +169,22 @@ | |
| 169 | zTag); |
| 170 | if(tagid<=0){ |
| 171 | return -1; |
| 172 | } |
| 173 | if(pPayload){ |
| 174 | cson_object_set( pPayload, zBranch ? "branch" : "tag", json_new_string(zTag) ); |
| 175 | } |
| 176 | blob_appendf(pSql, |
| 177 | " AND (" |
| 178 | " EXISTS(SELECT 1 FROM tagxref" |
| 179 | " WHERE tagid=%d AND tagtype>0 AND rid=blob.rid)", |
| 180 | tagid); |
| 181 | if(!zUnhide){ |
| 182 | blob_appendf(pSql, |
| 183 | " AND NOT EXISTS(SELECT 1 FROM plink JOIN tagxref ON rid=blob.rid" |
| 184 | " WHERE tagid=%d AND tagtype>0 AND rid=blob.rid)", |
| 185 | TAG_HIDDEN); |
| 186 | } |
| 187 | if(zBranch){ |
| 188 | /* from "r" flag code in page_timeline().*/ |
| @@ -352,13 +354,14 @@ | |
| 352 | cson_object_set(row, "parent", json_new_string(db_column_text(&q,4))); |
| 353 | } |
| 354 | cson_object_set(row, "size", json_new_int(db_column_int(&q,5))); |
| 355 | |
| 356 | cson_object_set(row, "state", |
| 357 | json_new_string(json_artifact_status_to_string(isNew,isDel))); |
| 358 | zDownload = mprintf("/raw/%s?name=%s", |
| 359 | /* reminder: g.zBaseURL is of course not set for CLI mode. */ |
| 360 | db_column_text(&q,2), |
| 361 | db_column_text(&q,3)); |
| 362 | cson_object_set(row, "downloadPath", json_new_string(zDownload)); |
| 363 | free(zDownload); |
| 364 | } |
| @@ -505,11 +508,11 @@ | |
| 505 | cson_object * row = cson_value_get_object(rowV); |
| 506 | if(!row){ |
| 507 | if( !warnRowToJsonFailed ){ |
| 508 | warnRowToJsonFailed = 1; |
| 509 | json_warn( FSL_JSON_W_ROW_TO_JSON_FAILED, |
| 510 | "Could not convert at least one timeline result row to JSON." ); |
| 511 | } |
| 512 | continue; |
| 513 | } |
| 514 | cson_array_append(list, rowV); |
| 515 | } |
| @@ -548,19 +551,22 @@ | |
| 548 | goto error; |
| 549 | } |
| 550 | |
| 551 | #if 0 |
| 552 | /* only for testing! */ |
| 553 | cson_object_set(pay, "timelineSql", cson_value_new_string(blob_buffer(&sql),strlen(blob_buffer(&sql)))); |
| 554 | #endif |
| 555 | db_multi_exec("%s", blob_buffer(&sql) /*safe-for-%s*/); |
| 556 | blob_reset(&sql); |
| 557 | db_prepare(&q, "SELECT" |
| 558 | /* For events, the name is generally more useful than |
| 559 | the uuid, but the uuid is unambiguous and can be used |
| 560 | with commands like 'artifact'. */ |
| 561 | " substr((SELECT tagname FROM tag AS tn WHERE tn.tagid=json_timeline.tagId AND tagname LIKE 'event-%%'),7) AS name," |
| 562 | " uuid as uuid," |
| 563 | " mtime AS timestamp," |
| 564 | " comment AS comment, " |
| 565 | " user AS user," |
| 566 | " eventType AS eventType" |
| @@ -591,11 +597,12 @@ | |
| 591 | cson_array * list = NULL; |
| 592 | int check = 0; |
| 593 | Stmt q = empty_Stmt; |
| 594 | Blob sql = empty_blob; |
| 595 | if( !g.perm.RdWiki && !g.perm.Read ){ |
| 596 | json_set_err( FSL_JSON_E_DENIED, "Wiki timeline requires 'o' or 'j' access."); |
| 597 | return NULL; |
| 598 | } |
| 599 | payV = cson_value_new_object(); |
| 600 | pay = cson_value_get_object(payV); |
| 601 | check = json_timeline_setup_sql( "w", &sql, pay ); |
| @@ -604,11 +611,12 @@ | |
| 604 | goto error; |
| 605 | } |
| 606 | |
| 607 | #if 0 |
| 608 | /* only for testing! */ |
| 609 | cson_object_set(pay, "timelineSql", cson_value_new_string(blob_buffer(&sql),strlen(blob_buffer(&sql)))); |
| 610 | #endif |
| 611 | db_multi_exec("%s", blob_buffer(&sql) /*safe-for-%s*/); |
| 612 | blob_reset(&sql); |
| 613 | db_prepare(&q, "SELECT" |
| 614 | " uuid AS uuid," |
| @@ -654,11 +662,12 @@ | |
| 654 | cson_array * list = NULL; |
| 655 | int check = 0; |
| 656 | Stmt q = empty_Stmt; |
| 657 | Blob sql = empty_blob; |
| 658 | if( !g.perm.RdTkt && !g.perm.Read ){ |
| 659 | json_set_err(FSL_JSON_E_DENIED, "Ticket timeline requires 'o' or 'r' access."); |
| 660 | return NULL; |
| 661 | } |
| 662 | payV = cson_value_new_object(); |
| 663 | pay = cson_value_get_object(payV); |
| 664 | check = json_timeline_setup_sql( "t", &sql, pay ); |
| @@ -726,11 +735,11 @@ | |
| 726 | rowV = cson_sqlite3_row_to_object(q.pStmt); |
| 727 | row = cson_value_get_object(rowV); |
| 728 | if(!row){ |
| 729 | manifest_destroy(pMan); |
| 730 | json_warn( FSL_JSON_W_ROW_TO_JSON_FAILED, |
| 731 | "Could not convert at least one timeline result row to JSON." ); |
| 732 | continue; |
| 733 | } |
| 734 | /* FIXME: certainly there's a more efficient way for use to get |
| 735 | the ticket UUIDs? |
| 736 | */ |
| 737 |
| --- src/json_timeline.c | |
| +++ src/json_timeline.c | |
| @@ -169,20 +169,22 @@ | |
| 169 | zTag); |
| 170 | if(tagid<=0){ |
| 171 | return -1; |
| 172 | } |
| 173 | if(pPayload){ |
| 174 | cson_object_set( pPayload, zBranch ? "branch" : "tag", |
| 175 | json_new_string(zTag) ); |
| 176 | } |
| 177 | blob_appendf(pSql, |
| 178 | " AND (" |
| 179 | " EXISTS(SELECT 1 FROM tagxref" |
| 180 | " WHERE tagid=%d AND tagtype>0 AND rid=blob.rid)", |
| 181 | tagid); |
| 182 | if(!zUnhide){ |
| 183 | blob_appendf(pSql, |
| 184 | " AND NOT EXISTS(SELECT 1 FROM plink " |
| 185 | " JOIN tagxref ON rid=blob.rid" |
| 186 | " WHERE tagid=%d AND tagtype>0 AND rid=blob.rid)", |
| 187 | TAG_HIDDEN); |
| 188 | } |
| 189 | if(zBranch){ |
| 190 | /* from "r" flag code in page_timeline().*/ |
| @@ -352,13 +354,14 @@ | |
| 354 | cson_object_set(row, "parent", json_new_string(db_column_text(&q,4))); |
| 355 | } |
| 356 | cson_object_set(row, "size", json_new_int(db_column_int(&q,5))); |
| 357 | |
| 358 | cson_object_set(row, "state", |
| 359 | json_new_string(json_artifact_status_to_string(isNew,isDel))); |
| 360 | zDownload = mprintf("/raw/%s?name=%s", |
| 361 | /* reminder: g.zBaseURL is of course not set |
| 362 | for CLI mode. */ |
| 363 | db_column_text(&q,2), |
| 364 | db_column_text(&q,3)); |
| 365 | cson_object_set(row, "downloadPath", json_new_string(zDownload)); |
| 366 | free(zDownload); |
| 367 | } |
| @@ -505,11 +508,11 @@ | |
| 508 | cson_object * row = cson_value_get_object(rowV); |
| 509 | if(!row){ |
| 510 | if( !warnRowToJsonFailed ){ |
| 511 | warnRowToJsonFailed = 1; |
| 512 | json_warn( FSL_JSON_W_ROW_TO_JSON_FAILED, |
| 513 | "Could not convert at least one timeline result row to JSON." ); |
| 514 | } |
| 515 | continue; |
| 516 | } |
| 517 | cson_array_append(list, rowV); |
| 518 | } |
| @@ -548,19 +551,22 @@ | |
| 551 | goto error; |
| 552 | } |
| 553 | |
| 554 | #if 0 |
| 555 | /* only for testing! */ |
| 556 | cson_object_set(pay, "timelineSql", cson_value_new_string(blob_buffer(&sql), |
| 557 | strlen(blob_buffer(&sql)))); |
| 558 | #endif |
| 559 | db_multi_exec("%s", blob_buffer(&sql) /*safe-for-%s*/); |
| 560 | blob_reset(&sql); |
| 561 | db_prepare(&q, "SELECT" |
| 562 | /* For events, the name is generally more useful than |
| 563 | the uuid, but the uuid is unambiguous and can be used |
| 564 | with commands like 'artifact'. */ |
| 565 | " substr((SELECT tagname FROM tag AS tn " |
| 566 | " WHERE tn.tagid=json_timeline.tagId " |
| 567 | " AND tagname LIKE 'event-%%'),7) AS name," |
| 568 | " uuid as uuid," |
| 569 | " mtime AS timestamp," |
| 570 | " comment AS comment, " |
| 571 | " user AS user," |
| 572 | " eventType AS eventType" |
| @@ -591,11 +597,12 @@ | |
| 597 | cson_array * list = NULL; |
| 598 | int check = 0; |
| 599 | Stmt q = empty_Stmt; |
| 600 | Blob sql = empty_blob; |
| 601 | if( !g.perm.RdWiki && !g.perm.Read ){ |
| 602 | json_set_err( FSL_JSON_E_DENIED, |
| 603 | "Wiki timeline requires 'o' or 'j' access."); |
| 604 | return NULL; |
| 605 | } |
| 606 | payV = cson_value_new_object(); |
| 607 | pay = cson_value_get_object(payV); |
| 608 | check = json_timeline_setup_sql( "w", &sql, pay ); |
| @@ -604,11 +611,12 @@ | |
| 611 | goto error; |
| 612 | } |
| 613 | |
| 614 | #if 0 |
| 615 | /* only for testing! */ |
| 616 | cson_object_set(pay, "timelineSql", cson_value_new_string(blob_buffer(&sql), |
| 617 | strlen(blob_buffer(&sql)))); |
| 618 | #endif |
| 619 | db_multi_exec("%s", blob_buffer(&sql) /*safe-for-%s*/); |
| 620 | blob_reset(&sql); |
| 621 | db_prepare(&q, "SELECT" |
| 622 | " uuid AS uuid," |
| @@ -654,11 +662,12 @@ | |
| 662 | cson_array * list = NULL; |
| 663 | int check = 0; |
| 664 | Stmt q = empty_Stmt; |
| 665 | Blob sql = empty_blob; |
| 666 | if( !g.perm.RdTkt && !g.perm.Read ){ |
| 667 | json_set_err(FSL_JSON_E_DENIED, |
| 668 | "Ticket timeline requires 'o' or 'r' access."); |
| 669 | return NULL; |
| 670 | } |
| 671 | payV = cson_value_new_object(); |
| 672 | pay = cson_value_get_object(payV); |
| 673 | check = json_timeline_setup_sql( "t", &sql, pay ); |
| @@ -726,11 +735,11 @@ | |
| 735 | rowV = cson_sqlite3_row_to_object(q.pStmt); |
| 736 | row = cson_value_get_object(rowV); |
| 737 | if(!row){ |
| 738 | manifest_destroy(pMan); |
| 739 | json_warn( FSL_JSON_W_ROW_TO_JSON_FAILED, |
| 740 | "Could not convert at least one timeline result row to JSON." ); |
| 741 | continue; |
| 742 | } |
| 743 | /* FIXME: certainly there's a more efficient way for use to get |
| 744 | the ticket UUIDs? |
| 745 | */ |
| 746 |
+2
-1
| --- src/json_user.c | ||
| +++ src/json_user.c | ||
| @@ -170,11 +170,12 @@ | ||
| 170 | 170 | ** not modify the 's' permission. Admin users without setup |
| 171 | 171 | ** permissions may not edit any other user who has the 's' permission. |
| 172 | 172 | ** |
| 173 | 173 | */ |
| 174 | 174 | int json_user_update_from_json( cson_object * pUser ){ |
| 175 | -#define CSTR(X) cson_string_cstr(cson_value_get_string( cson_object_get(pUser, X ) )) | |
| 175 | +#define CSTR(X) cson_string_cstr(cson_value_get_string( cson_object_get(pUser, \ | |
| 176 | + X ) )) | |
| 176 | 177 | char const * zName = CSTR("name"); |
| 177 | 178 | char const * zNameNew = zName; |
| 178 | 179 | char * zNameFree = NULL; |
| 179 | 180 | char const * zInfo = CSTR("info"); |
| 180 | 181 | char const * zCap = CSTR("capabilities"); |
| 181 | 182 |
| --- src/json_user.c | |
| +++ src/json_user.c | |
| @@ -170,11 +170,12 @@ | |
| 170 | ** not modify the 's' permission. Admin users without setup |
| 171 | ** permissions may not edit any other user who has the 's' permission. |
| 172 | ** |
| 173 | */ |
| 174 | int json_user_update_from_json( cson_object * pUser ){ |
| 175 | #define CSTR(X) cson_string_cstr(cson_value_get_string( cson_object_get(pUser, X ) )) |
| 176 | char const * zName = CSTR("name"); |
| 177 | char const * zNameNew = zName; |
| 178 | char * zNameFree = NULL; |
| 179 | char const * zInfo = CSTR("info"); |
| 180 | char const * zCap = CSTR("capabilities"); |
| 181 |
| --- src/json_user.c | |
| +++ src/json_user.c | |
| @@ -170,11 +170,12 @@ | |
| 170 | ** not modify the 's' permission. Admin users without setup |
| 171 | ** permissions may not edit any other user who has the 's' permission. |
| 172 | ** |
| 173 | */ |
| 174 | int json_user_update_from_json( cson_object * pUser ){ |
| 175 | #define CSTR(X) cson_string_cstr(cson_value_get_string( cson_object_get(pUser, \ |
| 176 | X ) )) |
| 177 | char const * zName = CSTR("name"); |
| 178 | char const * zNameNew = zName; |
| 179 | char * zNameFree = NULL; |
| 180 | char const * zInfo = CSTR("info"); |
| 181 | char const * zCap = CSTR("capabilities"); |
| 182 |
+11
-8
| --- src/json_wiki.c | ||
| +++ src/json_wiki.c | ||
| @@ -163,11 +163,12 @@ | ||
| 163 | 163 | /* |
| 164 | 164 | ** Searches for the latest version of a wiki page with the given |
| 165 | 165 | ** name. If found it behaves like json_get_wiki_page_by_rid(theRid, |
| 166 | 166 | ** contentFormat), else it returns NULL. |
| 167 | 167 | */ |
| 168 | -cson_value * json_get_wiki_page_by_name(char const * zPageName, int contentFormat){ | |
| 168 | +cson_value * json_get_wiki_page_by_name(char const * zPageName, | |
| 169 | + int contentFormat){ | |
| 169 | 170 | int rid; |
| 170 | 171 | rid = db_int(0, |
| 171 | 172 | "SELECT x.rid FROM tag t, tagxref x, blob b" |
| 172 | 173 | " WHERE x.tagid=t.tagid AND t.tagname='wiki-%q' " |
| 173 | 174 | " AND b.rid=x.rid" |
| @@ -259,11 +260,11 @@ | ||
| 259 | 260 | |
| 260 | 261 | zSymName = json_find_option_cstr("uuid",NULL,"u"); |
| 261 | 262 | |
| 262 | 263 | if((!zPageName||!*zPageName) && (!zSymName || !*zSymName)){ |
| 263 | 264 | json_set_err(FSL_JSON_E_MISSING_ARGS, |
| 264 | - "At least one of the 'name' or 'uuid' arguments must be provided."); | |
| 265 | + "At least one of the 'name' or 'uuid' arguments must be provided."); | |
| 265 | 266 | return NULL; |
| 266 | 267 | } |
| 267 | 268 | |
| 268 | 269 | /* TODO: see if we have a page named zPageName. If not, try to resolve |
| 269 | 270 | zPageName as a UUID. |
| @@ -297,17 +298,17 @@ | ||
| 297 | 298 | }else{ |
| 298 | 299 | sContent = cson_value_get_string(g.json.reqPayload.v); |
| 299 | 300 | } |
| 300 | 301 | if(!sContent) { |
| 301 | 302 | json_set_err(FSL_JSON_E_MISSING_ARGS, |
| 302 | - "The 'payload' property must be either a string containing the " | |
| 303 | - "Fossil wiki code to preview or an object with body + mimetype " | |
| 304 | - "properties."); | |
| 303 | + "The 'payload' property must be either a string containing the " | |
| 304 | + "Fossil wiki code to preview or an object with body + mimetype " | |
| 305 | + "properties."); | |
| 305 | 306 | return NULL; |
| 306 | 307 | } |
| 307 | 308 | zContent = cson_string_cstr(sContent); |
| 308 | - blob_append( &contentOrig, zContent, (int)cson_string_length_bytes(sContent) ); | |
| 309 | + blob_append( &contentOrig, zContent, (int)cson_string_length_bytes(sContent)); | |
| 309 | 310 | zMime = wiki_filter_mimetypes(zMime); |
| 310 | 311 | if( 0==fossil_strcmp(zMime, "text/x-markdown") ){ |
| 311 | 312 | markdown_to_html(&contentOrig, 0, &contentHtml); |
| 312 | 313 | }else if( 0==fossil_strcmp(zMime, "text/plain") ){ |
| 313 | 314 | blob_append(&contentHtml, "<pre class='textPlain'>", -1); |
| @@ -315,11 +316,12 @@ | ||
| 315 | 316 | blob_append(&contentHtml, "</pre>", -1); |
| 316 | 317 | }else{ |
| 317 | 318 | wiki_convert( &contentOrig, &contentHtml, 0 ); |
| 318 | 319 | } |
| 319 | 320 | blob_reset( &contentOrig ); |
| 320 | - pay = cson_value_new_string( blob_str(&contentHtml), (unsigned int)blob_size(&contentHtml)); | |
| 321 | + pay = cson_value_new_string( blob_str(&contentHtml), | |
| 322 | + (unsigned int)blob_size(&contentHtml)); | |
| 321 | 323 | blob_reset( &contentHtml ); |
| 322 | 324 | return pay; |
| 323 | 325 | } |
| 324 | 326 | |
| 325 | 327 | |
| @@ -346,11 +348,12 @@ | ||
| 346 | 348 | cson_value * nameV; /* wiki page name */ |
| 347 | 349 | char const * zPageName; /* cstr form of page name */ |
| 348 | 350 | cson_value * contentV; /* passed-in content */ |
| 349 | 351 | cson_value * emptyContent = NULL; /* placeholder for empty content. */ |
| 350 | 352 | cson_value * payV = NULL; /* payload/return value */ |
| 351 | - cson_string const * jstr = NULL; /* temp for cson_value-to-cson_string conversions. */ | |
| 353 | + cson_string const * jstr = NULL; /* temp for cson_value-to-cson_string | |
| 354 | + conversions. */ | |
| 352 | 355 | char const * zMimeType = 0; |
| 353 | 356 | unsigned int contentLen = 0; |
| 354 | 357 | int rid; |
| 355 | 358 | if( (createMode && !g.perm.NewWiki) |
| 356 | 359 | || (!createMode && !g.perm.WrWiki)){ |
| 357 | 360 |
| --- src/json_wiki.c | |
| +++ src/json_wiki.c | |
| @@ -163,11 +163,12 @@ | |
| 163 | /* |
| 164 | ** Searches for the latest version of a wiki page with the given |
| 165 | ** name. If found it behaves like json_get_wiki_page_by_rid(theRid, |
| 166 | ** contentFormat), else it returns NULL. |
| 167 | */ |
| 168 | cson_value * json_get_wiki_page_by_name(char const * zPageName, int contentFormat){ |
| 169 | int rid; |
| 170 | rid = db_int(0, |
| 171 | "SELECT x.rid FROM tag t, tagxref x, blob b" |
| 172 | " WHERE x.tagid=t.tagid AND t.tagname='wiki-%q' " |
| 173 | " AND b.rid=x.rid" |
| @@ -259,11 +260,11 @@ | |
| 259 | |
| 260 | zSymName = json_find_option_cstr("uuid",NULL,"u"); |
| 261 | |
| 262 | if((!zPageName||!*zPageName) && (!zSymName || !*zSymName)){ |
| 263 | json_set_err(FSL_JSON_E_MISSING_ARGS, |
| 264 | "At least one of the 'name' or 'uuid' arguments must be provided."); |
| 265 | return NULL; |
| 266 | } |
| 267 | |
| 268 | /* TODO: see if we have a page named zPageName. If not, try to resolve |
| 269 | zPageName as a UUID. |
| @@ -297,17 +298,17 @@ | |
| 297 | }else{ |
| 298 | sContent = cson_value_get_string(g.json.reqPayload.v); |
| 299 | } |
| 300 | if(!sContent) { |
| 301 | json_set_err(FSL_JSON_E_MISSING_ARGS, |
| 302 | "The 'payload' property must be either a string containing the " |
| 303 | "Fossil wiki code to preview or an object with body + mimetype " |
| 304 | "properties."); |
| 305 | return NULL; |
| 306 | } |
| 307 | zContent = cson_string_cstr(sContent); |
| 308 | blob_append( &contentOrig, zContent, (int)cson_string_length_bytes(sContent) ); |
| 309 | zMime = wiki_filter_mimetypes(zMime); |
| 310 | if( 0==fossil_strcmp(zMime, "text/x-markdown") ){ |
| 311 | markdown_to_html(&contentOrig, 0, &contentHtml); |
| 312 | }else if( 0==fossil_strcmp(zMime, "text/plain") ){ |
| 313 | blob_append(&contentHtml, "<pre class='textPlain'>", -1); |
| @@ -315,11 +316,12 @@ | |
| 315 | blob_append(&contentHtml, "</pre>", -1); |
| 316 | }else{ |
| 317 | wiki_convert( &contentOrig, &contentHtml, 0 ); |
| 318 | } |
| 319 | blob_reset( &contentOrig ); |
| 320 | pay = cson_value_new_string( blob_str(&contentHtml), (unsigned int)blob_size(&contentHtml)); |
| 321 | blob_reset( &contentHtml ); |
| 322 | return pay; |
| 323 | } |
| 324 | |
| 325 | |
| @@ -346,11 +348,12 @@ | |
| 346 | cson_value * nameV; /* wiki page name */ |
| 347 | char const * zPageName; /* cstr form of page name */ |
| 348 | cson_value * contentV; /* passed-in content */ |
| 349 | cson_value * emptyContent = NULL; /* placeholder for empty content. */ |
| 350 | cson_value * payV = NULL; /* payload/return value */ |
| 351 | cson_string const * jstr = NULL; /* temp for cson_value-to-cson_string conversions. */ |
| 352 | char const * zMimeType = 0; |
| 353 | unsigned int contentLen = 0; |
| 354 | int rid; |
| 355 | if( (createMode && !g.perm.NewWiki) |
| 356 | || (!createMode && !g.perm.WrWiki)){ |
| 357 |
| --- src/json_wiki.c | |
| +++ src/json_wiki.c | |
| @@ -163,11 +163,12 @@ | |
| 163 | /* |
| 164 | ** Searches for the latest version of a wiki page with the given |
| 165 | ** name. If found it behaves like json_get_wiki_page_by_rid(theRid, |
| 166 | ** contentFormat), else it returns NULL. |
| 167 | */ |
| 168 | cson_value * json_get_wiki_page_by_name(char const * zPageName, |
| 169 | int contentFormat){ |
| 170 | int rid; |
| 171 | rid = db_int(0, |
| 172 | "SELECT x.rid FROM tag t, tagxref x, blob b" |
| 173 | " WHERE x.tagid=t.tagid AND t.tagname='wiki-%q' " |
| 174 | " AND b.rid=x.rid" |
| @@ -259,11 +260,11 @@ | |
| 260 | |
| 261 | zSymName = json_find_option_cstr("uuid",NULL,"u"); |
| 262 | |
| 263 | if((!zPageName||!*zPageName) && (!zSymName || !*zSymName)){ |
| 264 | json_set_err(FSL_JSON_E_MISSING_ARGS, |
| 265 | "At least one of the 'name' or 'uuid' arguments must be provided."); |
| 266 | return NULL; |
| 267 | } |
| 268 | |
| 269 | /* TODO: see if we have a page named zPageName. If not, try to resolve |
| 270 | zPageName as a UUID. |
| @@ -297,17 +298,17 @@ | |
| 298 | }else{ |
| 299 | sContent = cson_value_get_string(g.json.reqPayload.v); |
| 300 | } |
| 301 | if(!sContent) { |
| 302 | json_set_err(FSL_JSON_E_MISSING_ARGS, |
| 303 | "The 'payload' property must be either a string containing the " |
| 304 | "Fossil wiki code to preview or an object with body + mimetype " |
| 305 | "properties."); |
| 306 | return NULL; |
| 307 | } |
| 308 | zContent = cson_string_cstr(sContent); |
| 309 | blob_append( &contentOrig, zContent, (int)cson_string_length_bytes(sContent)); |
| 310 | zMime = wiki_filter_mimetypes(zMime); |
| 311 | if( 0==fossil_strcmp(zMime, "text/x-markdown") ){ |
| 312 | markdown_to_html(&contentOrig, 0, &contentHtml); |
| 313 | }else if( 0==fossil_strcmp(zMime, "text/plain") ){ |
| 314 | blob_append(&contentHtml, "<pre class='textPlain'>", -1); |
| @@ -315,11 +316,12 @@ | |
| 316 | blob_append(&contentHtml, "</pre>", -1); |
| 317 | }else{ |
| 318 | wiki_convert( &contentOrig, &contentHtml, 0 ); |
| 319 | } |
| 320 | blob_reset( &contentOrig ); |
| 321 | pay = cson_value_new_string( blob_str(&contentHtml), |
| 322 | (unsigned int)blob_size(&contentHtml)); |
| 323 | blob_reset( &contentHtml ); |
| 324 | return pay; |
| 325 | } |
| 326 | |
| 327 | |
| @@ -346,11 +348,12 @@ | |
| 348 | cson_value * nameV; /* wiki page name */ |
| 349 | char const * zPageName; /* cstr form of page name */ |
| 350 | cson_value * contentV; /* passed-in content */ |
| 351 | cson_value * emptyContent = NULL; /* placeholder for empty content. */ |
| 352 | cson_value * payV = NULL; /* payload/return value */ |
| 353 | cson_string const * jstr = NULL; /* temp for cson_value-to-cson_string |
| 354 | conversions. */ |
| 355 | char const * zMimeType = 0; |
| 356 | unsigned int contentLen = 0; |
| 357 | int rid; |
| 358 | if( (createMode && !g.perm.NewWiki) |
| 359 | || (!createMode && !g.perm.WrWiki)){ |
| 360 |
+11
-11
| --- src/login.c | ||
| +++ src/login.c | ||
| @@ -254,11 +254,11 @@ | ||
| 254 | 254 | *pzUsername = fossil_strdup(zLogin); |
| 255 | 255 | break; |
| 256 | 256 | } |
| 257 | 257 | } |
| 258 | 258 | db_finalize(&q); |
| 259 | - } | |
| 259 | + } | |
| 260 | 260 | free(zSha1Pw); |
| 261 | 261 | return uid; |
| 262 | 262 | } |
| 263 | 263 | |
| 264 | 264 | /* |
| @@ -775,11 +775,11 @@ | ||
| 775 | 775 | } |
| 776 | 776 | @ <table class="login_out"> |
| 777 | 777 | if( P("HTTPS")==0 ){ |
| 778 | 778 | @ <tr><td class="form_label">Warning:</td> |
| 779 | 779 | @ <td><span class='securityWarning'> |
| 780 | - @ Login information, including the password, | |
| 780 | + @ Login information, including the password, | |
| 781 | 781 | @ will be sent in the clear over an unencrypted connection. |
| 782 | 782 | if( !g.sslNotAvailable ){ |
| 783 | 783 | @ Consider logging in at |
| 784 | 784 | @ <a href='%s(g.zHttpsURL)'>%h(g.zHttpsURL)</a> instead. |
| 785 | 785 | } |
| @@ -824,11 +824,11 @@ | ||
| 824 | 824 | @ </table> |
| 825 | 825 | if( zAnonPw && !noAnon ){ |
| 826 | 826 | const char *zDecoded = captcha_decode(uSeed); |
| 827 | 827 | int bAutoCaptcha = db_get_boolean("auto-captcha", 0); |
| 828 | 828 | char *zCaptcha = captcha_render(zDecoded); |
| 829 | - | |
| 829 | + | |
| 830 | 830 | @ <p><input type="hidden" name="cs" value="%u(uSeed)"> |
| 831 | 831 | @ Visitors may enter <b>anonymous</b> as the user-ID with |
| 832 | 832 | @ the 8-character hexadecimal password shown below:</p> |
| 833 | 833 | @ <div class="captcha"><table class="captcha"><tr><td>\ |
| 834 | 834 | @ <pre class="captcha"> |
| @@ -1029,11 +1029,11 @@ | ||
| 1029 | 1029 | @ <p><span class="loginError"> |
| 1030 | 1030 | @ This password-reset URL is invalid, probably because it has expired. |
| 1031 | 1031 | @ Password-reset URLs have a short lifespan. |
| 1032 | 1032 | @ </span></p> |
| 1033 | 1033 | style_finish_page(); |
| 1034 | - sleep(1); /* Introduce a small delay on an invalid suffix as an | |
| 1034 | + sleep(1); /* Introduce a small delay on an invalid suffix as an | |
| 1035 | 1035 | ** extra defense against search attacks */ |
| 1036 | 1036 | return; |
| 1037 | 1037 | } |
| 1038 | 1038 | fossil_redirect_to_https_if_needed(1); |
| 1039 | 1039 | login_set_uid(uid, 0); |
| @@ -1163,11 +1163,11 @@ | ||
| 1163 | 1163 | if( rc==SQLITE_OK && sqlite3_step(pStmt)==SQLITE_ROW ){ |
| 1164 | 1164 | db_unprotect(PROTECT_USER); |
| 1165 | 1165 | db_multi_exec( |
| 1166 | 1166 | "UPDATE user SET cookie=%Q, cexpire=%.17g" |
| 1167 | 1167 | " WHERE login=%Q", |
| 1168 | - zHash, | |
| 1168 | + zHash, | |
| 1169 | 1169 | sqlite3_column_double(pStmt, 0), zLogin |
| 1170 | 1170 | ); |
| 1171 | 1171 | db_protect_pop(); |
| 1172 | 1172 | nXfer++; |
| 1173 | 1173 | } |
| @@ -1580,11 +1580,11 @@ | ||
| 1580 | 1580 | p->ApndWiki = p->Hyperlink = p->Clone = |
| 1581 | 1581 | p->NewTkt = p->Password = p->RdAddr = |
| 1582 | 1582 | p->TktFmt = p->Attach = p->ApndTkt = |
| 1583 | 1583 | p->ModWiki = p->ModTkt = |
| 1584 | 1584 | p->RdForum = p->WrForum = p->ModForum = |
| 1585 | - p->WrTForum = p->AdminForum = p->Chat = | |
| 1585 | + p->WrTForum = p->AdminForum = p->Chat = | |
| 1586 | 1586 | p->EmailAlert = p->Announce = p->Debug = 1; |
| 1587 | 1587 | /* Fall thru into Read/Write */ |
| 1588 | 1588 | case 'i': p->Read = p->Write = 1; break; |
| 1589 | 1589 | case 'o': p->Read = 1; break; |
| 1590 | 1590 | case 'z': p->Zip = 1; break; |
| @@ -1827,11 +1827,11 @@ | ||
| 1827 | 1827 | @ <input type="hidden" name="csrf" value="%s(g.zCsrfToken)"> |
| 1828 | 1828 | } |
| 1829 | 1829 | |
| 1830 | 1830 | /* |
| 1831 | 1831 | ** Check to see if the candidate username zUserID is already used. |
| 1832 | -** Return 1 if it is already in use. Return 0 if the name is | |
| 1832 | +** Return 1 if it is already in use. Return 0 if the name is | |
| 1833 | 1833 | ** available for a self-registeration. |
| 1834 | 1834 | */ |
| 1835 | 1835 | static int login_self_choosen_userid_already_exists(const char *zUserID){ |
| 1836 | 1836 | int rc = db_exists( |
| 1837 | 1837 | "SELECT 1 FROM user WHERE login=%Q " |
| @@ -1849,11 +1849,11 @@ | ||
| 1849 | 1849 | ** address is assigned to a particular user return the UID for that user. |
| 1850 | 1850 | ** If the email address is used, but not by a particular user, return -1. |
| 1851 | 1851 | */ |
| 1852 | 1852 | static int email_address_in_use(const char *zEMail){ |
| 1853 | 1853 | int uid; |
| 1854 | - uid = db_int(0, | |
| 1854 | + uid = db_int(0, | |
| 1855 | 1855 | "SELECT uid FROM user" |
| 1856 | 1856 | " WHERE info LIKE '%%<%q>%%'", zEMail); |
| 1857 | 1857 | if( uid>0 ){ |
| 1858 | 1858 | if( db_exists("SELECT 1 FROM user WHERE uid=%d AND (" |
| 1859 | 1859 | " cap GLOB '*[as]*' OR" |
| @@ -1878,11 +1878,11 @@ | ||
| 1878 | 1878 | } |
| 1879 | 1879 | |
| 1880 | 1880 | /* |
| 1881 | 1881 | ** COMMAND: test-email-used |
| 1882 | 1882 | ** Usage: fossil test-email-used EMAIL ... |
| 1883 | -** | |
| 1883 | +** | |
| 1884 | 1884 | ** Given a list of email addresses, show the UID and LOGIN associated |
| 1885 | 1885 | ** with each one. |
| 1886 | 1886 | */ |
| 1887 | 1887 | void test_email_used(void){ |
| 1888 | 1888 | int i; |
| @@ -1903,11 +1903,11 @@ | ||
| 1903 | 1903 | fossil_print("%s: UID %d (%s)\n", zEMail, uid, zLogin); |
| 1904 | 1904 | fossil_free(zLogin); |
| 1905 | 1905 | } |
| 1906 | 1906 | } |
| 1907 | 1907 | } |
| 1908 | - | |
| 1908 | + | |
| 1909 | 1909 | |
| 1910 | 1910 | /* |
| 1911 | 1911 | ** Check an email address and confirm that it is valid for self-registration. |
| 1912 | 1912 | ** The email address is known already to be well-formed. Return true |
| 1913 | 1913 | ** if the email address is on the allowed list. |
| @@ -1995,11 +1995,11 @@ | ||
| 1995 | 1995 | iErrLine = 1; |
| 1996 | 1996 | zErr = "User ID too short. Must be at least 6 characters."; |
| 1997 | 1997 | }else if( sqlite3_strglob("*[^-a-zA-Z0-9_.]*",zUserID)==0 ){ |
| 1998 | 1998 | iErrLine = 1; |
| 1999 | 1999 | zErr = "User ID may not contain spaces or special characters."; |
| 2000 | - }else if( sqlite3_strlike("anonymous%", zUserID, 0)==0 | |
| 2000 | + }else if( sqlite3_strlike("anonymous%", zUserID, 0)==0 | |
| 2001 | 2001 | || sqlite3_strlike("nobody%", zUserID, 0)==0 |
| 2002 | 2002 | || sqlite3_strlike("reader%", zUserID, 0)==0 |
| 2003 | 2003 | || sqlite3_strlike("developer%", zUserID, 0)==0 |
| 2004 | 2004 | ){ |
| 2005 | 2005 | iErrLine = 1; |
| 2006 | 2006 |
| --- src/login.c | |
| +++ src/login.c | |
| @@ -254,11 +254,11 @@ | |
| 254 | *pzUsername = fossil_strdup(zLogin); |
| 255 | break; |
| 256 | } |
| 257 | } |
| 258 | db_finalize(&q); |
| 259 | } |
| 260 | free(zSha1Pw); |
| 261 | return uid; |
| 262 | } |
| 263 | |
| 264 | /* |
| @@ -775,11 +775,11 @@ | |
| 775 | } |
| 776 | @ <table class="login_out"> |
| 777 | if( P("HTTPS")==0 ){ |
| 778 | @ <tr><td class="form_label">Warning:</td> |
| 779 | @ <td><span class='securityWarning'> |
| 780 | @ Login information, including the password, |
| 781 | @ will be sent in the clear over an unencrypted connection. |
| 782 | if( !g.sslNotAvailable ){ |
| 783 | @ Consider logging in at |
| 784 | @ <a href='%s(g.zHttpsURL)'>%h(g.zHttpsURL)</a> instead. |
| 785 | } |
| @@ -824,11 +824,11 @@ | |
| 824 | @ </table> |
| 825 | if( zAnonPw && !noAnon ){ |
| 826 | const char *zDecoded = captcha_decode(uSeed); |
| 827 | int bAutoCaptcha = db_get_boolean("auto-captcha", 0); |
| 828 | char *zCaptcha = captcha_render(zDecoded); |
| 829 | |
| 830 | @ <p><input type="hidden" name="cs" value="%u(uSeed)"> |
| 831 | @ Visitors may enter <b>anonymous</b> as the user-ID with |
| 832 | @ the 8-character hexadecimal password shown below:</p> |
| 833 | @ <div class="captcha"><table class="captcha"><tr><td>\ |
| 834 | @ <pre class="captcha"> |
| @@ -1029,11 +1029,11 @@ | |
| 1029 | @ <p><span class="loginError"> |
| 1030 | @ This password-reset URL is invalid, probably because it has expired. |
| 1031 | @ Password-reset URLs have a short lifespan. |
| 1032 | @ </span></p> |
| 1033 | style_finish_page(); |
| 1034 | sleep(1); /* Introduce a small delay on an invalid suffix as an |
| 1035 | ** extra defense against search attacks */ |
| 1036 | return; |
| 1037 | } |
| 1038 | fossil_redirect_to_https_if_needed(1); |
| 1039 | login_set_uid(uid, 0); |
| @@ -1163,11 +1163,11 @@ | |
| 1163 | if( rc==SQLITE_OK && sqlite3_step(pStmt)==SQLITE_ROW ){ |
| 1164 | db_unprotect(PROTECT_USER); |
| 1165 | db_multi_exec( |
| 1166 | "UPDATE user SET cookie=%Q, cexpire=%.17g" |
| 1167 | " WHERE login=%Q", |
| 1168 | zHash, |
| 1169 | sqlite3_column_double(pStmt, 0), zLogin |
| 1170 | ); |
| 1171 | db_protect_pop(); |
| 1172 | nXfer++; |
| 1173 | } |
| @@ -1580,11 +1580,11 @@ | |
| 1580 | p->ApndWiki = p->Hyperlink = p->Clone = |
| 1581 | p->NewTkt = p->Password = p->RdAddr = |
| 1582 | p->TktFmt = p->Attach = p->ApndTkt = |
| 1583 | p->ModWiki = p->ModTkt = |
| 1584 | p->RdForum = p->WrForum = p->ModForum = |
| 1585 | p->WrTForum = p->AdminForum = p->Chat = |
| 1586 | p->EmailAlert = p->Announce = p->Debug = 1; |
| 1587 | /* Fall thru into Read/Write */ |
| 1588 | case 'i': p->Read = p->Write = 1; break; |
| 1589 | case 'o': p->Read = 1; break; |
| 1590 | case 'z': p->Zip = 1; break; |
| @@ -1827,11 +1827,11 @@ | |
| 1827 | @ <input type="hidden" name="csrf" value="%s(g.zCsrfToken)"> |
| 1828 | } |
| 1829 | |
| 1830 | /* |
| 1831 | ** Check to see if the candidate username zUserID is already used. |
| 1832 | ** Return 1 if it is already in use. Return 0 if the name is |
| 1833 | ** available for a self-registeration. |
| 1834 | */ |
| 1835 | static int login_self_choosen_userid_already_exists(const char *zUserID){ |
| 1836 | int rc = db_exists( |
| 1837 | "SELECT 1 FROM user WHERE login=%Q " |
| @@ -1849,11 +1849,11 @@ | |
| 1849 | ** address is assigned to a particular user return the UID for that user. |
| 1850 | ** If the email address is used, but not by a particular user, return -1. |
| 1851 | */ |
| 1852 | static int email_address_in_use(const char *zEMail){ |
| 1853 | int uid; |
| 1854 | uid = db_int(0, |
| 1855 | "SELECT uid FROM user" |
| 1856 | " WHERE info LIKE '%%<%q>%%'", zEMail); |
| 1857 | if( uid>0 ){ |
| 1858 | if( db_exists("SELECT 1 FROM user WHERE uid=%d AND (" |
| 1859 | " cap GLOB '*[as]*' OR" |
| @@ -1878,11 +1878,11 @@ | |
| 1878 | } |
| 1879 | |
| 1880 | /* |
| 1881 | ** COMMAND: test-email-used |
| 1882 | ** Usage: fossil test-email-used EMAIL ... |
| 1883 | ** |
| 1884 | ** Given a list of email addresses, show the UID and LOGIN associated |
| 1885 | ** with each one. |
| 1886 | */ |
| 1887 | void test_email_used(void){ |
| 1888 | int i; |
| @@ -1903,11 +1903,11 @@ | |
| 1903 | fossil_print("%s: UID %d (%s)\n", zEMail, uid, zLogin); |
| 1904 | fossil_free(zLogin); |
| 1905 | } |
| 1906 | } |
| 1907 | } |
| 1908 | |
| 1909 | |
| 1910 | /* |
| 1911 | ** Check an email address and confirm that it is valid for self-registration. |
| 1912 | ** The email address is known already to be well-formed. Return true |
| 1913 | ** if the email address is on the allowed list. |
| @@ -1995,11 +1995,11 @@ | |
| 1995 | iErrLine = 1; |
| 1996 | zErr = "User ID too short. Must be at least 6 characters."; |
| 1997 | }else if( sqlite3_strglob("*[^-a-zA-Z0-9_.]*",zUserID)==0 ){ |
| 1998 | iErrLine = 1; |
| 1999 | zErr = "User ID may not contain spaces or special characters."; |
| 2000 | }else if( sqlite3_strlike("anonymous%", zUserID, 0)==0 |
| 2001 | || sqlite3_strlike("nobody%", zUserID, 0)==0 |
| 2002 | || sqlite3_strlike("reader%", zUserID, 0)==0 |
| 2003 | || sqlite3_strlike("developer%", zUserID, 0)==0 |
| 2004 | ){ |
| 2005 | iErrLine = 1; |
| 2006 |
| --- src/login.c | |
| +++ src/login.c | |
| @@ -254,11 +254,11 @@ | |
| 254 | *pzUsername = fossil_strdup(zLogin); |
| 255 | break; |
| 256 | } |
| 257 | } |
| 258 | db_finalize(&q); |
| 259 | } |
| 260 | free(zSha1Pw); |
| 261 | return uid; |
| 262 | } |
| 263 | |
| 264 | /* |
| @@ -775,11 +775,11 @@ | |
| 775 | } |
| 776 | @ <table class="login_out"> |
| 777 | if( P("HTTPS")==0 ){ |
| 778 | @ <tr><td class="form_label">Warning:</td> |
| 779 | @ <td><span class='securityWarning'> |
| 780 | @ Login information, including the password, |
| 781 | @ will be sent in the clear over an unencrypted connection. |
| 782 | if( !g.sslNotAvailable ){ |
| 783 | @ Consider logging in at |
| 784 | @ <a href='%s(g.zHttpsURL)'>%h(g.zHttpsURL)</a> instead. |
| 785 | } |
| @@ -824,11 +824,11 @@ | |
| 824 | @ </table> |
| 825 | if( zAnonPw && !noAnon ){ |
| 826 | const char *zDecoded = captcha_decode(uSeed); |
| 827 | int bAutoCaptcha = db_get_boolean("auto-captcha", 0); |
| 828 | char *zCaptcha = captcha_render(zDecoded); |
| 829 | |
| 830 | @ <p><input type="hidden" name="cs" value="%u(uSeed)"> |
| 831 | @ Visitors may enter <b>anonymous</b> as the user-ID with |
| 832 | @ the 8-character hexadecimal password shown below:</p> |
| 833 | @ <div class="captcha"><table class="captcha"><tr><td>\ |
| 834 | @ <pre class="captcha"> |
| @@ -1029,11 +1029,11 @@ | |
| 1029 | @ <p><span class="loginError"> |
| 1030 | @ This password-reset URL is invalid, probably because it has expired. |
| 1031 | @ Password-reset URLs have a short lifespan. |
| 1032 | @ </span></p> |
| 1033 | style_finish_page(); |
| 1034 | sleep(1); /* Introduce a small delay on an invalid suffix as an |
| 1035 | ** extra defense against search attacks */ |
| 1036 | return; |
| 1037 | } |
| 1038 | fossil_redirect_to_https_if_needed(1); |
| 1039 | login_set_uid(uid, 0); |
| @@ -1163,11 +1163,11 @@ | |
| 1163 | if( rc==SQLITE_OK && sqlite3_step(pStmt)==SQLITE_ROW ){ |
| 1164 | db_unprotect(PROTECT_USER); |
| 1165 | db_multi_exec( |
| 1166 | "UPDATE user SET cookie=%Q, cexpire=%.17g" |
| 1167 | " WHERE login=%Q", |
| 1168 | zHash, |
| 1169 | sqlite3_column_double(pStmt, 0), zLogin |
| 1170 | ); |
| 1171 | db_protect_pop(); |
| 1172 | nXfer++; |
| 1173 | } |
| @@ -1580,11 +1580,11 @@ | |
| 1580 | p->ApndWiki = p->Hyperlink = p->Clone = |
| 1581 | p->NewTkt = p->Password = p->RdAddr = |
| 1582 | p->TktFmt = p->Attach = p->ApndTkt = |
| 1583 | p->ModWiki = p->ModTkt = |
| 1584 | p->RdForum = p->WrForum = p->ModForum = |
| 1585 | p->WrTForum = p->AdminForum = p->Chat = |
| 1586 | p->EmailAlert = p->Announce = p->Debug = 1; |
| 1587 | /* Fall thru into Read/Write */ |
| 1588 | case 'i': p->Read = p->Write = 1; break; |
| 1589 | case 'o': p->Read = 1; break; |
| 1590 | case 'z': p->Zip = 1; break; |
| @@ -1827,11 +1827,11 @@ | |
| 1827 | @ <input type="hidden" name="csrf" value="%s(g.zCsrfToken)"> |
| 1828 | } |
| 1829 | |
| 1830 | /* |
| 1831 | ** Check to see if the candidate username zUserID is already used. |
| 1832 | ** Return 1 if it is already in use. Return 0 if the name is |
| 1833 | ** available for a self-registeration. |
| 1834 | */ |
| 1835 | static int login_self_choosen_userid_already_exists(const char *zUserID){ |
| 1836 | int rc = db_exists( |
| 1837 | "SELECT 1 FROM user WHERE login=%Q " |
| @@ -1849,11 +1849,11 @@ | |
| 1849 | ** address is assigned to a particular user return the UID for that user. |
| 1850 | ** If the email address is used, but not by a particular user, return -1. |
| 1851 | */ |
| 1852 | static int email_address_in_use(const char *zEMail){ |
| 1853 | int uid; |
| 1854 | uid = db_int(0, |
| 1855 | "SELECT uid FROM user" |
| 1856 | " WHERE info LIKE '%%<%q>%%'", zEMail); |
| 1857 | if( uid>0 ){ |
| 1858 | if( db_exists("SELECT 1 FROM user WHERE uid=%d AND (" |
| 1859 | " cap GLOB '*[as]*' OR" |
| @@ -1878,11 +1878,11 @@ | |
| 1878 | } |
| 1879 | |
| 1880 | /* |
| 1881 | ** COMMAND: test-email-used |
| 1882 | ** Usage: fossil test-email-used EMAIL ... |
| 1883 | ** |
| 1884 | ** Given a list of email addresses, show the UID and LOGIN associated |
| 1885 | ** with each one. |
| 1886 | */ |
| 1887 | void test_email_used(void){ |
| 1888 | int i; |
| @@ -1903,11 +1903,11 @@ | |
| 1903 | fossil_print("%s: UID %d (%s)\n", zEMail, uid, zLogin); |
| 1904 | fossil_free(zLogin); |
| 1905 | } |
| 1906 | } |
| 1907 | } |
| 1908 | |
| 1909 | |
| 1910 | /* |
| 1911 | ** Check an email address and confirm that it is valid for self-registration. |
| 1912 | ** The email address is known already to be well-formed. Return true |
| 1913 | ** if the email address is on the allowed list. |
| @@ -1995,11 +1995,11 @@ | |
| 1995 | iErrLine = 1; |
| 1996 | zErr = "User ID too short. Must be at least 6 characters."; |
| 1997 | }else if( sqlite3_strglob("*[^-a-zA-Z0-9_.]*",zUserID)==0 ){ |
| 1998 | iErrLine = 1; |
| 1999 | zErr = "User ID may not contain spaces or special characters."; |
| 2000 | }else if( sqlite3_strlike("anonymous%", zUserID, 0)==0 |
| 2001 | || sqlite3_strlike("nobody%", zUserID, 0)==0 |
| 2002 | || sqlite3_strlike("reader%", zUserID, 0)==0 |
| 2003 | || sqlite3_strlike("developer%", zUserID, 0)==0 |
| 2004 | ){ |
| 2005 | iErrLine = 1; |
| 2006 |
+1
-1
| --- src/lookslike.c | ||
| +++ src/lookslike.c | ||
| @@ -270,11 +270,11 @@ | ||
| 270 | 270 | int j, c, flags = LOOK_NONE; /* Assume UTF-16 text, prove otherwise */ |
| 271 | 271 | |
| 272 | 272 | if( n%sizeof(WCHAR_T) ){ |
| 273 | 273 | flags |= LOOK_ODD; /* Odd number of bytes -> binary (UTF-8?) */ |
| 274 | 274 | } |
| 275 | - if( n<sizeof(WCHAR_T) ) return flags; /* Zero or One byte -> binary (UTF-8?) */ | |
| 275 | + if( n<sizeof(WCHAR_T) ) return flags;/* Zero or One byte -> binary (UTF-8?) */ | |
| 276 | 276 | c = *z; |
| 277 | 277 | if( bReverse ){ |
| 278 | 278 | c = UTF16_SWAP(c); |
| 279 | 279 | } |
| 280 | 280 | if( c==0 ){ |
| 281 | 281 |
| --- src/lookslike.c | |
| +++ src/lookslike.c | |
| @@ -270,11 +270,11 @@ | |
| 270 | int j, c, flags = LOOK_NONE; /* Assume UTF-16 text, prove otherwise */ |
| 271 | |
| 272 | if( n%sizeof(WCHAR_T) ){ |
| 273 | flags |= LOOK_ODD; /* Odd number of bytes -> binary (UTF-8?) */ |
| 274 | } |
| 275 | if( n<sizeof(WCHAR_T) ) return flags; /* Zero or One byte -> binary (UTF-8?) */ |
| 276 | c = *z; |
| 277 | if( bReverse ){ |
| 278 | c = UTF16_SWAP(c); |
| 279 | } |
| 280 | if( c==0 ){ |
| 281 |
| --- src/lookslike.c | |
| +++ src/lookslike.c | |
| @@ -270,11 +270,11 @@ | |
| 270 | int j, c, flags = LOOK_NONE; /* Assume UTF-16 text, prove otherwise */ |
| 271 | |
| 272 | if( n%sizeof(WCHAR_T) ){ |
| 273 | flags |= LOOK_ODD; /* Odd number of bytes -> binary (UTF-8?) */ |
| 274 | } |
| 275 | if( n<sizeof(WCHAR_T) ) return flags;/* Zero or One byte -> binary (UTF-8?) */ |
| 276 | c = *z; |
| 277 | if( bReverse ){ |
| 278 | c = UTF16_SWAP(c); |
| 279 | } |
| 280 | if( c==0 ){ |
| 281 |
+7
-7
| --- src/main.c | ||
| +++ src/main.c | ||
| @@ -852,11 +852,11 @@ | ||
| 852 | 852 | zNewArgv[2] = g.argv[1]; |
| 853 | 853 | zNewArgv[3] = 0; |
| 854 | 854 | g.argc = 3; |
| 855 | 855 | g.argv = zNewArgv; |
| 856 | 856 | #endif |
| 857 | - } | |
| 857 | + } | |
| 858 | 858 | zCmdName = g.argv[1]; |
| 859 | 859 | } |
| 860 | 860 | #ifndef _WIN32 |
| 861 | 861 | /* There is a bug in stunnel4 in which it sometimes starts up client |
| 862 | 862 | ** processes without first opening file descriptor 2 (standard error). |
| @@ -1414,11 +1414,11 @@ | ||
| 1414 | 1414 | i -= 4; |
| 1415 | 1415 | } |
| 1416 | 1416 | }else{ |
| 1417 | 1417 | /* Remove trailing ":80" from the HOST */ |
| 1418 | 1418 | if( i>3 && z[i-1]=='0' && z[i-2]=='8' && z[i-3]==':' ) i -= 3; |
| 1419 | - } | |
| 1419 | + } | |
| 1420 | 1420 | if( i && z[i-1]=='.' ) i--; |
| 1421 | 1421 | z[i] = 0; |
| 1422 | 1422 | zCur = PD("SCRIPT_NAME","/"); |
| 1423 | 1423 | i = strlen(zCur); |
| 1424 | 1424 | while( i>0 && zCur[i-1]=='/' ) i--; |
| @@ -1614,11 +1614,11 @@ | ||
| 1614 | 1614 | return 1; |
| 1615 | 1615 | } |
| 1616 | 1616 | |
| 1617 | 1617 | /* |
| 1618 | 1618 | ** Redirect to the equivalent HTTPS request if the current connection is |
| 1619 | -** insecure and if the redirect-to-https flag greater than or equal to | |
| 1619 | +** insecure and if the redirect-to-https flag greater than or equal to | |
| 1620 | 1620 | ** iLevel. iLevel is 1 for /login pages and 2 for every other page. |
| 1621 | 1621 | */ |
| 1622 | 1622 | int fossil_redirect_to_https_if_needed(int iLevel){ |
| 1623 | 1623 | if( fossil_wants_https(iLevel) ){ |
| 1624 | 1624 | const char *zQS = P("QUERY_STRING"); |
| @@ -1969,11 +1969,11 @@ | ||
| 1969 | 1969 | cgi_replace_parameter("PATH_INFO", zPathInfo); |
| 1970 | 1970 | cgi_replace_parameter("SCRIPT_NAME", zNewScript); |
| 1971 | 1971 | etag_cancel(); |
| 1972 | 1972 | } |
| 1973 | 1973 | |
| 1974 | - /* If the content type is application/x-fossil or | |
| 1974 | + /* If the content type is application/x-fossil or | |
| 1975 | 1975 | ** application/x-fossil-debug, then a sync/push/pull/clone is |
| 1976 | 1976 | ** desired, so default the PATH_INFO to /xfer |
| 1977 | 1977 | */ |
| 1978 | 1978 | if( g.zContentType && |
| 1979 | 1979 | strncmp(g.zContentType, "application/x-fossil", 20)==0 ){ |
| @@ -2785,11 +2785,11 @@ | ||
| 2785 | 2785 | ** process exit |
| 2786 | 2786 | ** --nojail Drop root privilege but do not enter the chroot jail |
| 2787 | 2787 | ** --nossl Do not do http: to https: redirects, regardless of |
| 2788 | 2788 | ** the redirect-to-https setting. |
| 2789 | 2789 | ** --notfound URL Use URL as the "HTTP 404, object not found" page |
| 2790 | -** --out FILE Write the HTTP reply to FILE instead of to | |
| 2790 | +** --out FILE Write the HTTP reply to FILE instead of to | |
| 2791 | 2791 | ** standard output |
| 2792 | 2792 | ** --pkey FILE Read the private key used for TLS from FILE |
| 2793 | 2793 | ** --repolist If REPOSITORY is directory, URL "/" lists all repos |
| 2794 | 2794 | ** --scgi Interpret input as SCGI rather than HTTP |
| 2795 | 2795 | ** --skin LABEL Use override skin LABEL. Use an empty string ("") |
| @@ -3175,11 +3175,11 @@ | ||
| 3175 | 3175 | const char *zInitPage = 0; /* Start on this page. --page option */ |
| 3176 | 3176 | int findServerArg = 2; /* argv index for find_server_repository() */ |
| 3177 | 3177 | char *zRemote = 0; /* Remote host on which to run "fossil ui" */ |
| 3178 | 3178 | const char *zJsMode; /* The --jsmode parameter */ |
| 3179 | 3179 | const char *zFossilCmd =0; /* Name of "fossil" binary on remote system */ |
| 3180 | - | |
| 3180 | + | |
| 3181 | 3181 | |
| 3182 | 3182 | #if USE_SEE |
| 3183 | 3183 | db_setup_for_saved_encryption_key(); |
| 3184 | 3184 | #endif |
| 3185 | 3185 | |
| @@ -3347,11 +3347,11 @@ | ||
| 3347 | 3347 | Blob ssh; |
| 3348 | 3348 | char zLine[1000]; |
| 3349 | 3349 | blob_init(&ssh, 0, 0); |
| 3350 | 3350 | transport_ssh_command(&ssh); |
| 3351 | 3351 | db_close_config(); |
| 3352 | - blob_appendf(&ssh, | |
| 3352 | + blob_appendf(&ssh, | |
| 3353 | 3353 | " -t -L 127.0.0.1:%d:127.0.0.1:%d %!$", |
| 3354 | 3354 | iPort, iPort, zRemote |
| 3355 | 3355 | ); |
| 3356 | 3356 | if( zFossilCmd==0 ){ |
| 3357 | 3357 | blob_appendf(&ssh, " %$ fossil", "PATH=$HOME/bin:$PATH"); |
| 3358 | 3358 |
| --- src/main.c | |
| +++ src/main.c | |
| @@ -852,11 +852,11 @@ | |
| 852 | zNewArgv[2] = g.argv[1]; |
| 853 | zNewArgv[3] = 0; |
| 854 | g.argc = 3; |
| 855 | g.argv = zNewArgv; |
| 856 | #endif |
| 857 | } |
| 858 | zCmdName = g.argv[1]; |
| 859 | } |
| 860 | #ifndef _WIN32 |
| 861 | /* There is a bug in stunnel4 in which it sometimes starts up client |
| 862 | ** processes without first opening file descriptor 2 (standard error). |
| @@ -1414,11 +1414,11 @@ | |
| 1414 | i -= 4; |
| 1415 | } |
| 1416 | }else{ |
| 1417 | /* Remove trailing ":80" from the HOST */ |
| 1418 | if( i>3 && z[i-1]=='0' && z[i-2]=='8' && z[i-3]==':' ) i -= 3; |
| 1419 | } |
| 1420 | if( i && z[i-1]=='.' ) i--; |
| 1421 | z[i] = 0; |
| 1422 | zCur = PD("SCRIPT_NAME","/"); |
| 1423 | i = strlen(zCur); |
| 1424 | while( i>0 && zCur[i-1]=='/' ) i--; |
| @@ -1614,11 +1614,11 @@ | |
| 1614 | return 1; |
| 1615 | } |
| 1616 | |
| 1617 | /* |
| 1618 | ** Redirect to the equivalent HTTPS request if the current connection is |
| 1619 | ** insecure and if the redirect-to-https flag greater than or equal to |
| 1620 | ** iLevel. iLevel is 1 for /login pages and 2 for every other page. |
| 1621 | */ |
| 1622 | int fossil_redirect_to_https_if_needed(int iLevel){ |
| 1623 | if( fossil_wants_https(iLevel) ){ |
| 1624 | const char *zQS = P("QUERY_STRING"); |
| @@ -1969,11 +1969,11 @@ | |
| 1969 | cgi_replace_parameter("PATH_INFO", zPathInfo); |
| 1970 | cgi_replace_parameter("SCRIPT_NAME", zNewScript); |
| 1971 | etag_cancel(); |
| 1972 | } |
| 1973 | |
| 1974 | /* If the content type is application/x-fossil or |
| 1975 | ** application/x-fossil-debug, then a sync/push/pull/clone is |
| 1976 | ** desired, so default the PATH_INFO to /xfer |
| 1977 | */ |
| 1978 | if( g.zContentType && |
| 1979 | strncmp(g.zContentType, "application/x-fossil", 20)==0 ){ |
| @@ -2785,11 +2785,11 @@ | |
| 2785 | ** process exit |
| 2786 | ** --nojail Drop root privilege but do not enter the chroot jail |
| 2787 | ** --nossl Do not do http: to https: redirects, regardless of |
| 2788 | ** the redirect-to-https setting. |
| 2789 | ** --notfound URL Use URL as the "HTTP 404, object not found" page |
| 2790 | ** --out FILE Write the HTTP reply to FILE instead of to |
| 2791 | ** standard output |
| 2792 | ** --pkey FILE Read the private key used for TLS from FILE |
| 2793 | ** --repolist If REPOSITORY is directory, URL "/" lists all repos |
| 2794 | ** --scgi Interpret input as SCGI rather than HTTP |
| 2795 | ** --skin LABEL Use override skin LABEL. Use an empty string ("") |
| @@ -3175,11 +3175,11 @@ | |
| 3175 | const char *zInitPage = 0; /* Start on this page. --page option */ |
| 3176 | int findServerArg = 2; /* argv index for find_server_repository() */ |
| 3177 | char *zRemote = 0; /* Remote host on which to run "fossil ui" */ |
| 3178 | const char *zJsMode; /* The --jsmode parameter */ |
| 3179 | const char *zFossilCmd =0; /* Name of "fossil" binary on remote system */ |
| 3180 | |
| 3181 | |
| 3182 | #if USE_SEE |
| 3183 | db_setup_for_saved_encryption_key(); |
| 3184 | #endif |
| 3185 | |
| @@ -3347,11 +3347,11 @@ | |
| 3347 | Blob ssh; |
| 3348 | char zLine[1000]; |
| 3349 | blob_init(&ssh, 0, 0); |
| 3350 | transport_ssh_command(&ssh); |
| 3351 | db_close_config(); |
| 3352 | blob_appendf(&ssh, |
| 3353 | " -t -L 127.0.0.1:%d:127.0.0.1:%d %!$", |
| 3354 | iPort, iPort, zRemote |
| 3355 | ); |
| 3356 | if( zFossilCmd==0 ){ |
| 3357 | blob_appendf(&ssh, " %$ fossil", "PATH=$HOME/bin:$PATH"); |
| 3358 |
| --- src/main.c | |
| +++ src/main.c | |
| @@ -852,11 +852,11 @@ | |
| 852 | zNewArgv[2] = g.argv[1]; |
| 853 | zNewArgv[3] = 0; |
| 854 | g.argc = 3; |
| 855 | g.argv = zNewArgv; |
| 856 | #endif |
| 857 | } |
| 858 | zCmdName = g.argv[1]; |
| 859 | } |
| 860 | #ifndef _WIN32 |
| 861 | /* There is a bug in stunnel4 in which it sometimes starts up client |
| 862 | ** processes without first opening file descriptor 2 (standard error). |
| @@ -1414,11 +1414,11 @@ | |
| 1414 | i -= 4; |
| 1415 | } |
| 1416 | }else{ |
| 1417 | /* Remove trailing ":80" from the HOST */ |
| 1418 | if( i>3 && z[i-1]=='0' && z[i-2]=='8' && z[i-3]==':' ) i -= 3; |
| 1419 | } |
| 1420 | if( i && z[i-1]=='.' ) i--; |
| 1421 | z[i] = 0; |
| 1422 | zCur = PD("SCRIPT_NAME","/"); |
| 1423 | i = strlen(zCur); |
| 1424 | while( i>0 && zCur[i-1]=='/' ) i--; |
| @@ -1614,11 +1614,11 @@ | |
| 1614 | return 1; |
| 1615 | } |
| 1616 | |
| 1617 | /* |
| 1618 | ** Redirect to the equivalent HTTPS request if the current connection is |
| 1619 | ** insecure and if the redirect-to-https flag greater than or equal to |
| 1620 | ** iLevel. iLevel is 1 for /login pages and 2 for every other page. |
| 1621 | */ |
| 1622 | int fossil_redirect_to_https_if_needed(int iLevel){ |
| 1623 | if( fossil_wants_https(iLevel) ){ |
| 1624 | const char *zQS = P("QUERY_STRING"); |
| @@ -1969,11 +1969,11 @@ | |
| 1969 | cgi_replace_parameter("PATH_INFO", zPathInfo); |
| 1970 | cgi_replace_parameter("SCRIPT_NAME", zNewScript); |
| 1971 | etag_cancel(); |
| 1972 | } |
| 1973 | |
| 1974 | /* If the content type is application/x-fossil or |
| 1975 | ** application/x-fossil-debug, then a sync/push/pull/clone is |
| 1976 | ** desired, so default the PATH_INFO to /xfer |
| 1977 | */ |
| 1978 | if( g.zContentType && |
| 1979 | strncmp(g.zContentType, "application/x-fossil", 20)==0 ){ |
| @@ -2785,11 +2785,11 @@ | |
| 2785 | ** process exit |
| 2786 | ** --nojail Drop root privilege but do not enter the chroot jail |
| 2787 | ** --nossl Do not do http: to https: redirects, regardless of |
| 2788 | ** the redirect-to-https setting. |
| 2789 | ** --notfound URL Use URL as the "HTTP 404, object not found" page |
| 2790 | ** --out FILE Write the HTTP reply to FILE instead of to |
| 2791 | ** standard output |
| 2792 | ** --pkey FILE Read the private key used for TLS from FILE |
| 2793 | ** --repolist If REPOSITORY is directory, URL "/" lists all repos |
| 2794 | ** --scgi Interpret input as SCGI rather than HTTP |
| 2795 | ** --skin LABEL Use override skin LABEL. Use an empty string ("") |
| @@ -3175,11 +3175,11 @@ | |
| 3175 | const char *zInitPage = 0; /* Start on this page. --page option */ |
| 3176 | int findServerArg = 2; /* argv index for find_server_repository() */ |
| 3177 | char *zRemote = 0; /* Remote host on which to run "fossil ui" */ |
| 3178 | const char *zJsMode; /* The --jsmode parameter */ |
| 3179 | const char *zFossilCmd =0; /* Name of "fossil" binary on remote system */ |
| 3180 | |
| 3181 | |
| 3182 | #if USE_SEE |
| 3183 | db_setup_for_saved_encryption_key(); |
| 3184 | #endif |
| 3185 | |
| @@ -3347,11 +3347,11 @@ | |
| 3347 | Blob ssh; |
| 3348 | char zLine[1000]; |
| 3349 | blob_init(&ssh, 0, 0); |
| 3350 | transport_ssh_command(&ssh); |
| 3351 | db_close_config(); |
| 3352 | blob_appendf(&ssh, |
| 3353 | " -t -L 127.0.0.1:%d:127.0.0.1:%d %!$", |
| 3354 | iPort, iPort, zRemote |
| 3355 | ); |
| 3356 | if( zFossilCmd==0 ){ |
| 3357 | blob_appendf(&ssh, " %$ fossil", "PATH=$HOME/bin:$PATH"); |
| 3358 |
+3
-3
| --- src/manifest.c | ||
| +++ src/manifest.c | ||
| @@ -1226,11 +1226,11 @@ | ||
| 1226 | 1226 | */ |
| 1227 | 1227 | blob_init(©, 0, 0); |
| 1228 | 1228 | blob_init(&errmsg, 0, 0); |
| 1229 | 1229 | blob_append(©, zIn, nIn); |
| 1230 | 1230 | pManifest = manifest_parse(©, 0, &errmsg); |
| 1231 | - iRes = pManifest!=0; | |
| 1231 | + iRes = pManifest!=0; | |
| 1232 | 1232 | manifest_destroy(pManifest); |
| 1233 | 1233 | blob_reset(&errmsg); |
| 1234 | 1234 | return iRes; |
| 1235 | 1235 | } |
| 1236 | 1236 | |
| @@ -1338,11 +1338,11 @@ | ||
| 1338 | 1338 | }else if( !isWF && p!=0 ){ |
| 1339 | 1339 | fossil_print("%d ERROR: manifest_is_well_formed() reported false " |
| 1340 | 1340 | "but manifest_parse() found nothing wrong.\n", id); |
| 1341 | 1341 | nErr++; |
| 1342 | 1342 | } |
| 1343 | - }else{ | |
| 1343 | + }else{ | |
| 1344 | 1344 | p = manifest_get(id, CFTYPE_ANY, &err); |
| 1345 | 1345 | if( p==0 ){ |
| 1346 | 1346 | fossil_print("%d ERROR: %s\n", id, blob_str(&err)); |
| 1347 | 1347 | nErr++; |
| 1348 | 1348 | } |
| @@ -2113,11 +2113,11 @@ | ||
| 2113 | 2113 | void manifest_create_event_triggers(void){ |
| 2114 | 2114 | if( manifest_event_triggers_are_enabled ){ |
| 2115 | 2115 | return; /* Triggers already exists. No-op. */ |
| 2116 | 2116 | } |
| 2117 | 2117 | alert_create_trigger(); |
| 2118 | - manifest_event_triggers_are_enabled = 1; | |
| 2118 | + manifest_event_triggers_are_enabled = 1; | |
| 2119 | 2119 | } |
| 2120 | 2120 | |
| 2121 | 2121 | /* |
| 2122 | 2122 | ** Disable manifest event triggers. Drop them if they exist, but mark |
| 2123 | 2123 | ** them has having been created so that they won't be recreated. This |
| 2124 | 2124 |
| --- src/manifest.c | |
| +++ src/manifest.c | |
| @@ -1226,11 +1226,11 @@ | |
| 1226 | */ |
| 1227 | blob_init(©, 0, 0); |
| 1228 | blob_init(&errmsg, 0, 0); |
| 1229 | blob_append(©, zIn, nIn); |
| 1230 | pManifest = manifest_parse(©, 0, &errmsg); |
| 1231 | iRes = pManifest!=0; |
| 1232 | manifest_destroy(pManifest); |
| 1233 | blob_reset(&errmsg); |
| 1234 | return iRes; |
| 1235 | } |
| 1236 | |
| @@ -1338,11 +1338,11 @@ | |
| 1338 | }else if( !isWF && p!=0 ){ |
| 1339 | fossil_print("%d ERROR: manifest_is_well_formed() reported false " |
| 1340 | "but manifest_parse() found nothing wrong.\n", id); |
| 1341 | nErr++; |
| 1342 | } |
| 1343 | }else{ |
| 1344 | p = manifest_get(id, CFTYPE_ANY, &err); |
| 1345 | if( p==0 ){ |
| 1346 | fossil_print("%d ERROR: %s\n", id, blob_str(&err)); |
| 1347 | nErr++; |
| 1348 | } |
| @@ -2113,11 +2113,11 @@ | |
| 2113 | void manifest_create_event_triggers(void){ |
| 2114 | if( manifest_event_triggers_are_enabled ){ |
| 2115 | return; /* Triggers already exists. No-op. */ |
| 2116 | } |
| 2117 | alert_create_trigger(); |
| 2118 | manifest_event_triggers_are_enabled = 1; |
| 2119 | } |
| 2120 | |
| 2121 | /* |
| 2122 | ** Disable manifest event triggers. Drop them if they exist, but mark |
| 2123 | ** them has having been created so that they won't be recreated. This |
| 2124 |
| --- src/manifest.c | |
| +++ src/manifest.c | |
| @@ -1226,11 +1226,11 @@ | |
| 1226 | */ |
| 1227 | blob_init(©, 0, 0); |
| 1228 | blob_init(&errmsg, 0, 0); |
| 1229 | blob_append(©, zIn, nIn); |
| 1230 | pManifest = manifest_parse(©, 0, &errmsg); |
| 1231 | iRes = pManifest!=0; |
| 1232 | manifest_destroy(pManifest); |
| 1233 | blob_reset(&errmsg); |
| 1234 | return iRes; |
| 1235 | } |
| 1236 | |
| @@ -1338,11 +1338,11 @@ | |
| 1338 | }else if( !isWF && p!=0 ){ |
| 1339 | fossil_print("%d ERROR: manifest_is_well_formed() reported false " |
| 1340 | "but manifest_parse() found nothing wrong.\n", id); |
| 1341 | nErr++; |
| 1342 | } |
| 1343 | }else{ |
| 1344 | p = manifest_get(id, CFTYPE_ANY, &err); |
| 1345 | if( p==0 ){ |
| 1346 | fossil_print("%d ERROR: %s\n", id, blob_str(&err)); |
| 1347 | nErr++; |
| 1348 | } |
| @@ -2113,11 +2113,11 @@ | |
| 2113 | void manifest_create_event_triggers(void){ |
| 2114 | if( manifest_event_triggers_are_enabled ){ |
| 2115 | return; /* Triggers already exists. No-op. */ |
| 2116 | } |
| 2117 | alert_create_trigger(); |
| 2118 | manifest_event_triggers_are_enabled = 1; |
| 2119 | } |
| 2120 | |
| 2121 | /* |
| 2122 | ** Disable manifest event triggers. Drop them if they exist, but mark |
| 2123 | ** them has having been created so that they won't be recreated. This |
| 2124 |
+4
-3
| --- src/markdown.c | ||
| +++ src/markdown.c | ||
| @@ -64,11 +64,11 @@ | ||
| 64 | 64 | void *opaque); |
| 65 | 65 | void (*table_cell)(struct Blob *ob, struct Blob *text, int flags, |
| 66 | 66 | void *opaque); |
| 67 | 67 | void (*table_row)(struct Blob *ob, struct Blob *cells, int flags, |
| 68 | 68 | void *opaque); |
| 69 | - void (*footnote_item)(struct Blob *ob, const struct Blob *text, | |
| 69 | + void (*footnote_item)(struct Blob *ob, const struct Blob *text, | |
| 70 | 70 | int index, int nUsed, void *opaque); |
| 71 | 71 | |
| 72 | 72 | /* span level callbacks - NULL or return 0 prints the span verbatim */ |
| 73 | 73 | int (*autolink)(struct Blob *ob, struct Blob *link, |
| 74 | 74 | enum mkd_autolink type, void *opaque); |
| @@ -382,11 +382,12 @@ | ||
| 382 | 382 | /* release the given working buffer back to the cache */ |
| 383 | 383 | static void release_work_buffer(struct render *rndr, struct Blob *buf){ |
| 384 | 384 | if( !buf ) return; |
| 385 | 385 | rndr->iDepth--; |
| 386 | 386 | blob_reset(buf); |
| 387 | - if( rndr->nBlobCache < (int)(sizeof(rndr->aBlobCache)/sizeof(rndr->aBlobCache[0])) ){ | |
| 387 | + if( rndr->nBlobCache < | |
| 388 | + (int)(sizeof(rndr->aBlobCache)/sizeof(rndr->aBlobCache[0])) ){ | |
| 388 | 389 | rndr->aBlobCache[rndr->nBlobCache++] = buf; |
| 389 | 390 | }else{ |
| 390 | 391 | fossil_free(buf); |
| 391 | 392 | } |
| 392 | 393 | } |
| @@ -2370,11 +2371,11 @@ | ||
| 2370 | 2371 | beg += parse_list(ob, rndr, txt_data, end, 0); |
| 2371 | 2372 | }else if( prefix_oli(txt_data, end) ){ |
| 2372 | 2373 | beg += parse_list(ob, rndr, txt_data, end, MKD_LIST_ORDERED); |
| 2373 | 2374 | }else if( has_table && is_tableline(txt_data, end) ){ |
| 2374 | 2375 | beg += parse_table(ob, rndr, txt_data, end); |
| 2375 | - }else if( prefix_fencedcode(txt_data, end) | |
| 2376 | + }else if( prefix_fencedcode(txt_data, end) | |
| 2376 | 2377 | && (i = char_codespan(ob, rndr, txt_data, 0, end))!=0 |
| 2377 | 2378 | ){ |
| 2378 | 2379 | beg += i; |
| 2379 | 2380 | }else{ |
| 2380 | 2381 | beg += parse_paragraph(ob, rndr, txt_data, end); |
| 2381 | 2382 |
| --- src/markdown.c | |
| +++ src/markdown.c | |
| @@ -64,11 +64,11 @@ | |
| 64 | void *opaque); |
| 65 | void (*table_cell)(struct Blob *ob, struct Blob *text, int flags, |
| 66 | void *opaque); |
| 67 | void (*table_row)(struct Blob *ob, struct Blob *cells, int flags, |
| 68 | void *opaque); |
| 69 | void (*footnote_item)(struct Blob *ob, const struct Blob *text, |
| 70 | int index, int nUsed, void *opaque); |
| 71 | |
| 72 | /* span level callbacks - NULL or return 0 prints the span verbatim */ |
| 73 | int (*autolink)(struct Blob *ob, struct Blob *link, |
| 74 | enum mkd_autolink type, void *opaque); |
| @@ -382,11 +382,12 @@ | |
| 382 | /* release the given working buffer back to the cache */ |
| 383 | static void release_work_buffer(struct render *rndr, struct Blob *buf){ |
| 384 | if( !buf ) return; |
| 385 | rndr->iDepth--; |
| 386 | blob_reset(buf); |
| 387 | if( rndr->nBlobCache < (int)(sizeof(rndr->aBlobCache)/sizeof(rndr->aBlobCache[0])) ){ |
| 388 | rndr->aBlobCache[rndr->nBlobCache++] = buf; |
| 389 | }else{ |
| 390 | fossil_free(buf); |
| 391 | } |
| 392 | } |
| @@ -2370,11 +2371,11 @@ | |
| 2370 | beg += parse_list(ob, rndr, txt_data, end, 0); |
| 2371 | }else if( prefix_oli(txt_data, end) ){ |
| 2372 | beg += parse_list(ob, rndr, txt_data, end, MKD_LIST_ORDERED); |
| 2373 | }else if( has_table && is_tableline(txt_data, end) ){ |
| 2374 | beg += parse_table(ob, rndr, txt_data, end); |
| 2375 | }else if( prefix_fencedcode(txt_data, end) |
| 2376 | && (i = char_codespan(ob, rndr, txt_data, 0, end))!=0 |
| 2377 | ){ |
| 2378 | beg += i; |
| 2379 | }else{ |
| 2380 | beg += parse_paragraph(ob, rndr, txt_data, end); |
| 2381 |
| --- src/markdown.c | |
| +++ src/markdown.c | |
| @@ -64,11 +64,11 @@ | |
| 64 | void *opaque); |
| 65 | void (*table_cell)(struct Blob *ob, struct Blob *text, int flags, |
| 66 | void *opaque); |
| 67 | void (*table_row)(struct Blob *ob, struct Blob *cells, int flags, |
| 68 | void *opaque); |
| 69 | void (*footnote_item)(struct Blob *ob, const struct Blob *text, |
| 70 | int index, int nUsed, void *opaque); |
| 71 | |
| 72 | /* span level callbacks - NULL or return 0 prints the span verbatim */ |
| 73 | int (*autolink)(struct Blob *ob, struct Blob *link, |
| 74 | enum mkd_autolink type, void *opaque); |
| @@ -382,11 +382,12 @@ | |
| 382 | /* release the given working buffer back to the cache */ |
| 383 | static void release_work_buffer(struct render *rndr, struct Blob *buf){ |
| 384 | if( !buf ) return; |
| 385 | rndr->iDepth--; |
| 386 | blob_reset(buf); |
| 387 | if( rndr->nBlobCache < |
| 388 | (int)(sizeof(rndr->aBlobCache)/sizeof(rndr->aBlobCache[0])) ){ |
| 389 | rndr->aBlobCache[rndr->nBlobCache++] = buf; |
| 390 | }else{ |
| 391 | fossil_free(buf); |
| 392 | } |
| 393 | } |
| @@ -2370,11 +2371,11 @@ | |
| 2371 | beg += parse_list(ob, rndr, txt_data, end, 0); |
| 2372 | }else if( prefix_oli(txt_data, end) ){ |
| 2373 | beg += parse_list(ob, rndr, txt_data, end, MKD_LIST_ORDERED); |
| 2374 | }else if( has_table && is_tableline(txt_data, end) ){ |
| 2375 | beg += parse_table(ob, rndr, txt_data, end); |
| 2376 | }else if( prefix_fencedcode(txt_data, end) |
| 2377 | && (i = char_codespan(ob, rndr, txt_data, 0, end))!=0 |
| 2378 | ){ |
| 2379 | beg += i; |
| 2380 | }else{ |
| 2381 | beg += parse_paragraph(ob, rndr, txt_data, end); |
| 2382 |
+2
-2
| --- src/markdown_html.c | ||
| +++ src/markdown_html.c | ||
| @@ -780,12 +780,12 @@ | ||
| 780 | 780 | char *zTitle = title!=0 && blob_size(title)>0 ? blob_str(title) : 0; |
| 781 | 781 | char zClose[20]; |
| 782 | 782 | |
| 783 | 783 | if( zLink==0 || zLink[0]==0 ){ |
| 784 | 784 | zClose[0] = 0; |
| 785 | - }else{ | |
| 786 | - static const int flags = | |
| 785 | + }else{ | |
| 786 | + static const int flags = | |
| 787 | 787 | WIKI_NOBADLINKS | |
| 788 | 788 | WIKI_MARKDOWNLINKS |
| 789 | 789 | ; |
| 790 | 790 | wiki_resolve_hyperlink(ob, flags, zLink, zClose, sizeof(zClose), 0, zTitle); |
| 791 | 791 | } |
| 792 | 792 |
| --- src/markdown_html.c | |
| +++ src/markdown_html.c | |
| @@ -780,12 +780,12 @@ | |
| 780 | char *zTitle = title!=0 && blob_size(title)>0 ? blob_str(title) : 0; |
| 781 | char zClose[20]; |
| 782 | |
| 783 | if( zLink==0 || zLink[0]==0 ){ |
| 784 | zClose[0] = 0; |
| 785 | }else{ |
| 786 | static const int flags = |
| 787 | WIKI_NOBADLINKS | |
| 788 | WIKI_MARKDOWNLINKS |
| 789 | ; |
| 790 | wiki_resolve_hyperlink(ob, flags, zLink, zClose, sizeof(zClose), 0, zTitle); |
| 791 | } |
| 792 |
| --- src/markdown_html.c | |
| +++ src/markdown_html.c | |
| @@ -780,12 +780,12 @@ | |
| 780 | char *zTitle = title!=0 && blob_size(title)>0 ? blob_str(title) : 0; |
| 781 | char zClose[20]; |
| 782 | |
| 783 | if( zLink==0 || zLink[0]==0 ){ |
| 784 | zClose[0] = 0; |
| 785 | }else{ |
| 786 | static const int flags = |
| 787 | WIKI_NOBADLINKS | |
| 788 | WIKI_MARKDOWNLINKS |
| 789 | ; |
| 790 | wiki_resolve_hyperlink(ob, flags, zLink, zClose, sizeof(zClose), 0, zTitle); |
| 791 | } |
| 792 |
+2
-2
| --- src/merge.c | ||
| +++ src/merge.c | ||
| @@ -268,11 +268,11 @@ | ||
| 268 | 268 | if( g.argc!=2 ){ |
| 269 | 269 | fossil_fatal("unknown arguments to the %s command\n", g.argv[1]); |
| 270 | 270 | } |
| 271 | 271 | verify_all_options(); |
| 272 | 272 | db_must_be_within_tree(); |
| 273 | - debug_show_vfile(); | |
| 273 | + debug_show_vfile(); | |
| 274 | 274 | } |
| 275 | 275 | |
| 276 | 276 | |
| 277 | 277 | /* |
| 278 | 278 | ** COMMAND: merge |
| @@ -375,11 +375,11 @@ | ||
| 375 | 375 | ** |
| 376 | 376 | ** When included on the command-line, --debug causes lots of state |
| 377 | 377 | ** information to be displayed. This option is undocumented as it |
| 378 | 378 | ** might change or be eliminated in future releases. |
| 379 | 379 | ** |
| 380 | - ** The --show-vfile flag does a dump of the VFILE table for reference. | |
| 380 | + ** The --show-vfile flag does a dump of the VFILE table for reference. | |
| 381 | 381 | ** |
| 382 | 382 | ** Hints: |
| 383 | 383 | ** * Combine --debug and --verbose for still more output. |
| 384 | 384 | ** * The --dry-run option is also useful in combination with --debug. |
| 385 | 385 | */ |
| 386 | 386 |
| --- src/merge.c | |
| +++ src/merge.c | |
| @@ -268,11 +268,11 @@ | |
| 268 | if( g.argc!=2 ){ |
| 269 | fossil_fatal("unknown arguments to the %s command\n", g.argv[1]); |
| 270 | } |
| 271 | verify_all_options(); |
| 272 | db_must_be_within_tree(); |
| 273 | debug_show_vfile(); |
| 274 | } |
| 275 | |
| 276 | |
| 277 | /* |
| 278 | ** COMMAND: merge |
| @@ -375,11 +375,11 @@ | |
| 375 | ** |
| 376 | ** When included on the command-line, --debug causes lots of state |
| 377 | ** information to be displayed. This option is undocumented as it |
| 378 | ** might change or be eliminated in future releases. |
| 379 | ** |
| 380 | ** The --show-vfile flag does a dump of the VFILE table for reference. |
| 381 | ** |
| 382 | ** Hints: |
| 383 | ** * Combine --debug and --verbose for still more output. |
| 384 | ** * The --dry-run option is also useful in combination with --debug. |
| 385 | */ |
| 386 |
| --- src/merge.c | |
| +++ src/merge.c | |
| @@ -268,11 +268,11 @@ | |
| 268 | if( g.argc!=2 ){ |
| 269 | fossil_fatal("unknown arguments to the %s command\n", g.argv[1]); |
| 270 | } |
| 271 | verify_all_options(); |
| 272 | db_must_be_within_tree(); |
| 273 | debug_show_vfile(); |
| 274 | } |
| 275 | |
| 276 | |
| 277 | /* |
| 278 | ** COMMAND: merge |
| @@ -375,11 +375,11 @@ | |
| 375 | ** |
| 376 | ** When included on the command-line, --debug causes lots of state |
| 377 | ** information to be displayed. This option is undocumented as it |
| 378 | ** might change or be eliminated in future releases. |
| 379 | ** |
| 380 | ** The --show-vfile flag does a dump of the VFILE table for reference. |
| 381 | ** |
| 382 | ** Hints: |
| 383 | ** * Combine --debug and --verbose for still more output. |
| 384 | ** * The --dry-run option is also useful in combination with --debug. |
| 385 | */ |
| 386 |
+1
-1
| --- src/merge3.c | ||
| +++ src/merge3.c | ||
| @@ -211,11 +211,11 @@ | ||
| 211 | 211 | int useCrLf = 0; |
| 212 | 212 | int ln1, ln2, lnPivot; /* Line numbers for all files */ |
| 213 | 213 | DiffConfig DCfg; |
| 214 | 214 | |
| 215 | 215 | blob_zero(pOut); /* Merge results stored in pOut */ |
| 216 | - | |
| 216 | + | |
| 217 | 217 | /* If both pV1 and pV2 start with a UTF-8 byte-order-mark (BOM), |
| 218 | 218 | ** keep it in the output. This should be secure enough not to cause |
| 219 | 219 | ** unintended changes to the merged file and consistent with what |
| 220 | 220 | ** users are using in their source files. |
| 221 | 221 | */ |
| 222 | 222 |
| --- src/merge3.c | |
| +++ src/merge3.c | |
| @@ -211,11 +211,11 @@ | |
| 211 | int useCrLf = 0; |
| 212 | int ln1, ln2, lnPivot; /* Line numbers for all files */ |
| 213 | DiffConfig DCfg; |
| 214 | |
| 215 | blob_zero(pOut); /* Merge results stored in pOut */ |
| 216 | |
| 217 | /* If both pV1 and pV2 start with a UTF-8 byte-order-mark (BOM), |
| 218 | ** keep it in the output. This should be secure enough not to cause |
| 219 | ** unintended changes to the merged file and consistent with what |
| 220 | ** users are using in their source files. |
| 221 | */ |
| 222 |
| --- src/merge3.c | |
| +++ src/merge3.c | |
| @@ -211,11 +211,11 @@ | |
| 211 | int useCrLf = 0; |
| 212 | int ln1, ln2, lnPivot; /* Line numbers for all files */ |
| 213 | DiffConfig DCfg; |
| 214 | |
| 215 | blob_zero(pOut); /* Merge results stored in pOut */ |
| 216 | |
| 217 | /* If both pV1 and pV2 start with a UTF-8 byte-order-mark (BOM), |
| 218 | ** keep it in the output. This should be secure enough not to cause |
| 219 | ** unintended changes to the merged file and consistent with what |
| 220 | ** users are using in their source files. |
| 221 | */ |
| 222 |
+4
-4
| --- src/name.c | ||
| +++ src/name.c | ||
| @@ -513,22 +513,22 @@ | ||
| 513 | 513 | |
| 514 | 514 | /* start:BR -> The first check-in on branch named BR */ |
| 515 | 515 | if( strncmp(zTag, "start:", 6)==0 ){ |
| 516 | 516 | rid = symbolic_name_to_rid(zTag+6, zType); |
| 517 | 517 | return start_of_branch(rid, 1); |
| 518 | - } | |
| 519 | - | |
| 518 | + } | |
| 519 | + | |
| 520 | 520 | /* merge-in:BR -> Most recent merge-in for the branch named BR */ |
| 521 | 521 | if( strncmp(zTag, "merge-in:", 9)==0 ){ |
| 522 | 522 | rid = symbolic_name_to_rid(zTag+9, zType); |
| 523 | 523 | return start_of_branch(rid, 2); |
| 524 | 524 | } |
| 525 | 525 | |
| 526 | 526 | /* symbolic-name ":" date-time */ |
| 527 | 527 | nTag = strlen(zTag); |
| 528 | 528 | for(i=0; i<nTag-8 && zTag[i]!=':'; i++){} |
| 529 | - if( zTag[i]==':' | |
| 529 | + if( zTag[i]==':' | |
| 530 | 530 | && (fossil_isdate(&zTag[i+1]) || fossil_expand_datetime(&zTag[i+1],0)!=0) |
| 531 | 531 | ){ |
| 532 | 532 | char *zDate = mprintf("%s", &zTag[i+1]); |
| 533 | 533 | char *zTagBase = mprintf("%.*s", i, zTag); |
| 534 | 534 | char *zXDate; |
| @@ -1087,11 +1087,11 @@ | ||
| 1087 | 1087 | " WHERE mlink.fid=%d" |
| 1088 | 1088 | " AND filename.fnid=mlink.fnid" |
| 1089 | 1089 | " AND event.objid=mlink.mid" |
| 1090 | 1090 | " AND blob.rid=mlink.mid" |
| 1091 | 1091 | " ORDER BY event.mtime %s /*sort*/", |
| 1092 | - rid, | |
| 1092 | + rid, | |
| 1093 | 1093 | (flags & WHATIS_BRIEF) ? "LIMIT 1" : "DESC"); |
| 1094 | 1094 | while( db_step(&q)==SQLITE_ROW ){ |
| 1095 | 1095 | if( flags & WHATIS_BRIEF ){ |
| 1096 | 1096 | fossil_print("mtime: %s\n", db_column_text(&q,2)); |
| 1097 | 1097 | } |
| 1098 | 1098 |
| --- src/name.c | |
| +++ src/name.c | |
| @@ -513,22 +513,22 @@ | |
| 513 | |
| 514 | /* start:BR -> The first check-in on branch named BR */ |
| 515 | if( strncmp(zTag, "start:", 6)==0 ){ |
| 516 | rid = symbolic_name_to_rid(zTag+6, zType); |
| 517 | return start_of_branch(rid, 1); |
| 518 | } |
| 519 | |
| 520 | /* merge-in:BR -> Most recent merge-in for the branch named BR */ |
| 521 | if( strncmp(zTag, "merge-in:", 9)==0 ){ |
| 522 | rid = symbolic_name_to_rid(zTag+9, zType); |
| 523 | return start_of_branch(rid, 2); |
| 524 | } |
| 525 | |
| 526 | /* symbolic-name ":" date-time */ |
| 527 | nTag = strlen(zTag); |
| 528 | for(i=0; i<nTag-8 && zTag[i]!=':'; i++){} |
| 529 | if( zTag[i]==':' |
| 530 | && (fossil_isdate(&zTag[i+1]) || fossil_expand_datetime(&zTag[i+1],0)!=0) |
| 531 | ){ |
| 532 | char *zDate = mprintf("%s", &zTag[i+1]); |
| 533 | char *zTagBase = mprintf("%.*s", i, zTag); |
| 534 | char *zXDate; |
| @@ -1087,11 +1087,11 @@ | |
| 1087 | " WHERE mlink.fid=%d" |
| 1088 | " AND filename.fnid=mlink.fnid" |
| 1089 | " AND event.objid=mlink.mid" |
| 1090 | " AND blob.rid=mlink.mid" |
| 1091 | " ORDER BY event.mtime %s /*sort*/", |
| 1092 | rid, |
| 1093 | (flags & WHATIS_BRIEF) ? "LIMIT 1" : "DESC"); |
| 1094 | while( db_step(&q)==SQLITE_ROW ){ |
| 1095 | if( flags & WHATIS_BRIEF ){ |
| 1096 | fossil_print("mtime: %s\n", db_column_text(&q,2)); |
| 1097 | } |
| 1098 |
| --- src/name.c | |
| +++ src/name.c | |
| @@ -513,22 +513,22 @@ | |
| 513 | |
| 514 | /* start:BR -> The first check-in on branch named BR */ |
| 515 | if( strncmp(zTag, "start:", 6)==0 ){ |
| 516 | rid = symbolic_name_to_rid(zTag+6, zType); |
| 517 | return start_of_branch(rid, 1); |
| 518 | } |
| 519 | |
| 520 | /* merge-in:BR -> Most recent merge-in for the branch named BR */ |
| 521 | if( strncmp(zTag, "merge-in:", 9)==0 ){ |
| 522 | rid = symbolic_name_to_rid(zTag+9, zType); |
| 523 | return start_of_branch(rid, 2); |
| 524 | } |
| 525 | |
| 526 | /* symbolic-name ":" date-time */ |
| 527 | nTag = strlen(zTag); |
| 528 | for(i=0; i<nTag-8 && zTag[i]!=':'; i++){} |
| 529 | if( zTag[i]==':' |
| 530 | && (fossil_isdate(&zTag[i+1]) || fossil_expand_datetime(&zTag[i+1],0)!=0) |
| 531 | ){ |
| 532 | char *zDate = mprintf("%s", &zTag[i+1]); |
| 533 | char *zTagBase = mprintf("%.*s", i, zTag); |
| 534 | char *zXDate; |
| @@ -1087,11 +1087,11 @@ | |
| 1087 | " WHERE mlink.fid=%d" |
| 1088 | " AND filename.fnid=mlink.fnid" |
| 1089 | " AND event.objid=mlink.mid" |
| 1090 | " AND blob.rid=mlink.mid" |
| 1091 | " ORDER BY event.mtime %s /*sort*/", |
| 1092 | rid, |
| 1093 | (flags & WHATIS_BRIEF) ? "LIMIT 1" : "DESC"); |
| 1094 | while( db_step(&q)==SQLITE_ROW ){ |
| 1095 | if( flags & WHATIS_BRIEF ){ |
| 1096 | fossil_print("mtime: %s\n", db_column_text(&q,2)); |
| 1097 | } |
| 1098 |
+13
-13
| --- src/patch.c | ||
| +++ src/patch.c | ||
| @@ -71,11 +71,11 @@ | ||
| 71 | 71 | /* |
| 72 | 72 | ** mkdelta(X,Y) |
| 73 | 73 | ** |
| 74 | 74 | ** X is an numeric artifact id. Y is a filename. |
| 75 | 75 | ** |
| 76 | -** Compute a compressed delta that carries X into Y. Or return | |
| 76 | +** Compute a compressed delta that carries X into Y. Or return | |
| 77 | 77 | ** and zero-length blob if X is equal to Y. |
| 78 | 78 | */ |
| 79 | 79 | static void mkdeltaFunc( |
| 80 | 80 | sqlite3_context *context, |
| 81 | 81 | int argc, |
| @@ -162,11 +162,11 @@ | ||
| 162 | 162 | " pathname TEXT,\n" /* Filename */ |
| 163 | 163 | " origname TEXT,\n" /* Name before rename. NULL if not renamed */ |
| 164 | 164 | " hash TEXT,\n" /* Baseline hash. NULL for new files. */ |
| 165 | 165 | " isexe BOOL,\n" /* True if executable */ |
| 166 | 166 | " islink BOOL,\n" /* True if is a symbolic link */ |
| 167 | - " delta BLOB\n" /* compressed delta. NULL if deleted. | |
| 167 | + " delta BLOB\n" /* compressed delta. NULL if deleted. | |
| 168 | 168 | ** length 0 if unchanged */ |
| 169 | 169 | ");" |
| 170 | 170 | "CREATE TABLE patch.cfg(\n" |
| 171 | 171 | " key TEXT,\n" |
| 172 | 172 | " value ANY\n" |
| @@ -196,11 +196,11 @@ | ||
| 196 | 196 | if( z ){ |
| 197 | 197 | db_multi_exec( |
| 198 | 198 | "INSERT INTO patch.cfg(key,value)VALUES('hostname',%Q)", z); |
| 199 | 199 | fossil_free(z); |
| 200 | 200 | } |
| 201 | - | |
| 201 | + | |
| 202 | 202 | /* New files */ |
| 203 | 203 | db_multi_exec( |
| 204 | 204 | "INSERT INTO patch.chng(pathname,hash,isexe,islink,delta)" |
| 205 | 205 | " SELECT pathname, NULL, isexe, islink," |
| 206 | 206 | " compress(read_co_file(%Q||pathname))" |
| @@ -249,11 +249,11 @@ | ||
| 249 | 249 | #ifdef _WIN32 |
| 250 | 250 | fflush(out); |
| 251 | 251 | _setmode(_fileno(out), _O_BINARY); |
| 252 | 252 | #endif |
| 253 | 253 | fwrite(pData, sz, 1, out); |
| 254 | - sqlite3_free(pData); | |
| 254 | + sqlite3_free(pData); | |
| 255 | 255 | fflush(out); |
| 256 | 256 | } |
| 257 | 257 | } |
| 258 | 258 | |
| 259 | 259 | /* |
| @@ -301,11 +301,11 @@ | ||
| 301 | 301 | /* |
| 302 | 302 | ** Show a summary of the content of a patch on standard output |
| 303 | 303 | */ |
| 304 | 304 | void patch_view(unsigned mFlags){ |
| 305 | 305 | Stmt q; |
| 306 | - db_prepare(&q, | |
| 306 | + db_prepare(&q, | |
| 307 | 307 | "WITH nmap(nkey,nm) AS (VALUES" |
| 308 | 308 | "('baseline','BASELINE')," |
| 309 | 309 | "('project-name','PROJECT-NAME'))" |
| 310 | 310 | "SELECT nm, value FROM nmap, patch.cfg WHERE nkey=key;" |
| 311 | 311 | ); |
| @@ -312,11 +312,11 @@ | ||
| 312 | 312 | while( db_step(&q)==SQLITE_ROW ){ |
| 313 | 313 | fossil_print("%-12s %s\n", db_column_text(&q,0), db_column_text(&q,1)); |
| 314 | 314 | } |
| 315 | 315 | db_finalize(&q); |
| 316 | 316 | if( mFlags & PATCH_VERBOSE ){ |
| 317 | - db_prepare(&q, | |
| 317 | + db_prepare(&q, | |
| 318 | 318 | "WITH nmap(nkey,nm,isDate) AS (VALUES" |
| 319 | 319 | "('project-code','PROJECT-CODE',0)," |
| 320 | 320 | "('date','TIMESTAMP',1)," |
| 321 | 321 | "('user','USER',0)," |
| 322 | 322 | "('hostname','HOSTNAME',0)," |
| @@ -433,11 +433,11 @@ | ||
| 433 | 433 | blob_appendf(&cmd, " merge %s\n", db_column_text(&q,1)); |
| 434 | 434 | }else{ |
| 435 | 435 | blob_appendf(&cmd, " merge --%s %s\n", zType, db_column_text(&q,1)); |
| 436 | 436 | } |
| 437 | 437 | if( mFlags & PATCH_VERBOSE ){ |
| 438 | - fossil_print("%-10s %s\n", db_column_text(&q,2), | |
| 438 | + fossil_print("%-10s %s\n", db_column_text(&q,2), | |
| 439 | 439 | db_column_text(&q,0)); |
| 440 | 440 | } |
| 441 | 441 | } |
| 442 | 442 | db_finalize(&q); |
| 443 | 443 | if( mFlags & PATCH_DRYRUN ){ |
| @@ -561,11 +561,11 @@ | ||
| 561 | 561 | blob_appendf(&cmd, " add %$\n", zPathname); |
| 562 | 562 | if( mFlags & PATCH_VERBOSE ){ |
| 563 | 563 | fossil_print("%-10s %s\n", "NEW", zPathname); |
| 564 | 564 | } |
| 565 | 565 | } |
| 566 | - if( (mFlags & PATCH_DRYRUN)==0 ){ | |
| 566 | + if( (mFlags & PATCH_DRYRUN)==0 ){ | |
| 567 | 567 | if( isLink ){ |
| 568 | 568 | symlink_create(blob_str(&data), zPathname); |
| 569 | 569 | }else{ |
| 570 | 570 | blob_write_to_file(&data, zPathname); |
| 571 | 571 | } |
| @@ -697,11 +697,11 @@ | ||
| 697 | 697 | blob_init(&remote, 0, 0); |
| 698 | 698 | if( zFossilCmd==0 ){ |
| 699 | 699 | blob_append_escaped_arg(&cmd, "PATH=$HOME/bin:$PATH", 0); |
| 700 | 700 | zFossilCmd = "fossil"; |
| 701 | 701 | } |
| 702 | - blob_appendf(&remote, "%$ patch %s%s --dir64 %z -", | |
| 702 | + blob_appendf(&remote, "%$ patch %s%s --dir64 %z -", | |
| 703 | 703 | zFossilCmd, zRemoteCmd, zForce, encode64(zDir, -1)); |
| 704 | 704 | blob_append_escaped_arg(&cmd, blob_str(&remote), 0); |
| 705 | 705 | blob_reset(&remote); |
| 706 | 706 | } |
| 707 | 707 | fossil_print("%s\n", blob_str(&cmd)); |
| @@ -777,11 +777,11 @@ | ||
| 777 | 777 | ); |
| 778 | 778 | while( db_step(&q)==SQLITE_ROW ){ |
| 779 | 779 | int rid; |
| 780 | 780 | const char *zName; |
| 781 | 781 | Blob a, b; |
| 782 | - | |
| 782 | + | |
| 783 | 783 | if( db_column_type(&q,0)!=SQLITE_INTEGER |
| 784 | 784 | && db_column_type(&q,4)==SQLITE_TEXT |
| 785 | 785 | ){ |
| 786 | 786 | char *zUuid = fossil_strdup(db_column_text(&q,4)); |
| 787 | 787 | char *zName = fossil_strdup(db_column_text(&q,1)); |
| @@ -899,11 +899,11 @@ | ||
| 899 | 899 | ** |
| 900 | 900 | ** -f|--force Apply the patch even though there are unsaved |
| 901 | 901 | ** changes in the current check-out. Unsaved |
| 902 | 902 | ** changes will be reverted and then the patch is |
| 903 | 903 | ** applied. |
| 904 | -** --fossilcmd EXE Name of the "fossil" executable on the remote | |
| 904 | +** --fossilcmd EXE Name of the "fossil" executable on the remote | |
| 905 | 905 | ** -n|--dry-run Do nothing, but print what would have happened |
| 906 | 906 | ** -v|--verbose Extra output explaining what happens |
| 907 | 907 | ** |
| 908 | 908 | ** |
| 909 | 909 | ** > fossil patch pull REMOTE-CHECKOUT |
| @@ -976,11 +976,11 @@ | ||
| 976 | 976 | if( find_option("dry-run","n",0) ) flags |= PATCH_DRYRUN; |
| 977 | 977 | if( find_option("verbose","v",0) ) flags |= PATCH_VERBOSE; |
| 978 | 978 | if( find_option("force","f",0) ) flags |= PATCH_FORCE; |
| 979 | 979 | db_must_be_within_tree(); |
| 980 | 980 | verify_all_options(); |
| 981 | - pIn = patch_remote_command(flags & (~PATCH_FORCE), | |
| 981 | + pIn = patch_remote_command(flags & (~PATCH_FORCE), | |
| 982 | 982 | "pull", "create", zFossilCmd, "r"); |
| 983 | 983 | if( pIn ){ |
| 984 | 984 | patch_attach(0, pIn); |
| 985 | 985 | pclose(pIn); |
| 986 | 986 | patch_apply(flags); |
| @@ -1014,7 +1014,7 @@ | ||
| 1014 | 1014 | patch_attach(zIn, stdin); |
| 1015 | 1015 | patch_view(flags); |
| 1016 | 1016 | }else |
| 1017 | 1017 | { |
| 1018 | 1018 | goto patch_usage; |
| 1019 | - } | |
| 1019 | + } | |
| 1020 | 1020 | } |
| 1021 | 1021 |
| --- src/patch.c | |
| +++ src/patch.c | |
| @@ -71,11 +71,11 @@ | |
| 71 | /* |
| 72 | ** mkdelta(X,Y) |
| 73 | ** |
| 74 | ** X is an numeric artifact id. Y is a filename. |
| 75 | ** |
| 76 | ** Compute a compressed delta that carries X into Y. Or return |
| 77 | ** and zero-length blob if X is equal to Y. |
| 78 | */ |
| 79 | static void mkdeltaFunc( |
| 80 | sqlite3_context *context, |
| 81 | int argc, |
| @@ -162,11 +162,11 @@ | |
| 162 | " pathname TEXT,\n" /* Filename */ |
| 163 | " origname TEXT,\n" /* Name before rename. NULL if not renamed */ |
| 164 | " hash TEXT,\n" /* Baseline hash. NULL for new files. */ |
| 165 | " isexe BOOL,\n" /* True if executable */ |
| 166 | " islink BOOL,\n" /* True if is a symbolic link */ |
| 167 | " delta BLOB\n" /* compressed delta. NULL if deleted. |
| 168 | ** length 0 if unchanged */ |
| 169 | ");" |
| 170 | "CREATE TABLE patch.cfg(\n" |
| 171 | " key TEXT,\n" |
| 172 | " value ANY\n" |
| @@ -196,11 +196,11 @@ | |
| 196 | if( z ){ |
| 197 | db_multi_exec( |
| 198 | "INSERT INTO patch.cfg(key,value)VALUES('hostname',%Q)", z); |
| 199 | fossil_free(z); |
| 200 | } |
| 201 | |
| 202 | /* New files */ |
| 203 | db_multi_exec( |
| 204 | "INSERT INTO patch.chng(pathname,hash,isexe,islink,delta)" |
| 205 | " SELECT pathname, NULL, isexe, islink," |
| 206 | " compress(read_co_file(%Q||pathname))" |
| @@ -249,11 +249,11 @@ | |
| 249 | #ifdef _WIN32 |
| 250 | fflush(out); |
| 251 | _setmode(_fileno(out), _O_BINARY); |
| 252 | #endif |
| 253 | fwrite(pData, sz, 1, out); |
| 254 | sqlite3_free(pData); |
| 255 | fflush(out); |
| 256 | } |
| 257 | } |
| 258 | |
| 259 | /* |
| @@ -301,11 +301,11 @@ | |
| 301 | /* |
| 302 | ** Show a summary of the content of a patch on standard output |
| 303 | */ |
| 304 | void patch_view(unsigned mFlags){ |
| 305 | Stmt q; |
| 306 | db_prepare(&q, |
| 307 | "WITH nmap(nkey,nm) AS (VALUES" |
| 308 | "('baseline','BASELINE')," |
| 309 | "('project-name','PROJECT-NAME'))" |
| 310 | "SELECT nm, value FROM nmap, patch.cfg WHERE nkey=key;" |
| 311 | ); |
| @@ -312,11 +312,11 @@ | |
| 312 | while( db_step(&q)==SQLITE_ROW ){ |
| 313 | fossil_print("%-12s %s\n", db_column_text(&q,0), db_column_text(&q,1)); |
| 314 | } |
| 315 | db_finalize(&q); |
| 316 | if( mFlags & PATCH_VERBOSE ){ |
| 317 | db_prepare(&q, |
| 318 | "WITH nmap(nkey,nm,isDate) AS (VALUES" |
| 319 | "('project-code','PROJECT-CODE',0)," |
| 320 | "('date','TIMESTAMP',1)," |
| 321 | "('user','USER',0)," |
| 322 | "('hostname','HOSTNAME',0)," |
| @@ -433,11 +433,11 @@ | |
| 433 | blob_appendf(&cmd, " merge %s\n", db_column_text(&q,1)); |
| 434 | }else{ |
| 435 | blob_appendf(&cmd, " merge --%s %s\n", zType, db_column_text(&q,1)); |
| 436 | } |
| 437 | if( mFlags & PATCH_VERBOSE ){ |
| 438 | fossil_print("%-10s %s\n", db_column_text(&q,2), |
| 439 | db_column_text(&q,0)); |
| 440 | } |
| 441 | } |
| 442 | db_finalize(&q); |
| 443 | if( mFlags & PATCH_DRYRUN ){ |
| @@ -561,11 +561,11 @@ | |
| 561 | blob_appendf(&cmd, " add %$\n", zPathname); |
| 562 | if( mFlags & PATCH_VERBOSE ){ |
| 563 | fossil_print("%-10s %s\n", "NEW", zPathname); |
| 564 | } |
| 565 | } |
| 566 | if( (mFlags & PATCH_DRYRUN)==0 ){ |
| 567 | if( isLink ){ |
| 568 | symlink_create(blob_str(&data), zPathname); |
| 569 | }else{ |
| 570 | blob_write_to_file(&data, zPathname); |
| 571 | } |
| @@ -697,11 +697,11 @@ | |
| 697 | blob_init(&remote, 0, 0); |
| 698 | if( zFossilCmd==0 ){ |
| 699 | blob_append_escaped_arg(&cmd, "PATH=$HOME/bin:$PATH", 0); |
| 700 | zFossilCmd = "fossil"; |
| 701 | } |
| 702 | blob_appendf(&remote, "%$ patch %s%s --dir64 %z -", |
| 703 | zFossilCmd, zRemoteCmd, zForce, encode64(zDir, -1)); |
| 704 | blob_append_escaped_arg(&cmd, blob_str(&remote), 0); |
| 705 | blob_reset(&remote); |
| 706 | } |
| 707 | fossil_print("%s\n", blob_str(&cmd)); |
| @@ -777,11 +777,11 @@ | |
| 777 | ); |
| 778 | while( db_step(&q)==SQLITE_ROW ){ |
| 779 | int rid; |
| 780 | const char *zName; |
| 781 | Blob a, b; |
| 782 | |
| 783 | if( db_column_type(&q,0)!=SQLITE_INTEGER |
| 784 | && db_column_type(&q,4)==SQLITE_TEXT |
| 785 | ){ |
| 786 | char *zUuid = fossil_strdup(db_column_text(&q,4)); |
| 787 | char *zName = fossil_strdup(db_column_text(&q,1)); |
| @@ -899,11 +899,11 @@ | |
| 899 | ** |
| 900 | ** -f|--force Apply the patch even though there are unsaved |
| 901 | ** changes in the current check-out. Unsaved |
| 902 | ** changes will be reverted and then the patch is |
| 903 | ** applied. |
| 904 | ** --fossilcmd EXE Name of the "fossil" executable on the remote |
| 905 | ** -n|--dry-run Do nothing, but print what would have happened |
| 906 | ** -v|--verbose Extra output explaining what happens |
| 907 | ** |
| 908 | ** |
| 909 | ** > fossil patch pull REMOTE-CHECKOUT |
| @@ -976,11 +976,11 @@ | |
| 976 | if( find_option("dry-run","n",0) ) flags |= PATCH_DRYRUN; |
| 977 | if( find_option("verbose","v",0) ) flags |= PATCH_VERBOSE; |
| 978 | if( find_option("force","f",0) ) flags |= PATCH_FORCE; |
| 979 | db_must_be_within_tree(); |
| 980 | verify_all_options(); |
| 981 | pIn = patch_remote_command(flags & (~PATCH_FORCE), |
| 982 | "pull", "create", zFossilCmd, "r"); |
| 983 | if( pIn ){ |
| 984 | patch_attach(0, pIn); |
| 985 | pclose(pIn); |
| 986 | patch_apply(flags); |
| @@ -1014,7 +1014,7 @@ | |
| 1014 | patch_attach(zIn, stdin); |
| 1015 | patch_view(flags); |
| 1016 | }else |
| 1017 | { |
| 1018 | goto patch_usage; |
| 1019 | } |
| 1020 | } |
| 1021 |
| --- src/patch.c | |
| +++ src/patch.c | |
| @@ -71,11 +71,11 @@ | |
| 71 | /* |
| 72 | ** mkdelta(X,Y) |
| 73 | ** |
| 74 | ** X is an numeric artifact id. Y is a filename. |
| 75 | ** |
| 76 | ** Compute a compressed delta that carries X into Y. Or return |
| 77 | ** and zero-length blob if X is equal to Y. |
| 78 | */ |
| 79 | static void mkdeltaFunc( |
| 80 | sqlite3_context *context, |
| 81 | int argc, |
| @@ -162,11 +162,11 @@ | |
| 162 | " pathname TEXT,\n" /* Filename */ |
| 163 | " origname TEXT,\n" /* Name before rename. NULL if not renamed */ |
| 164 | " hash TEXT,\n" /* Baseline hash. NULL for new files. */ |
| 165 | " isexe BOOL,\n" /* True if executable */ |
| 166 | " islink BOOL,\n" /* True if is a symbolic link */ |
| 167 | " delta BLOB\n" /* compressed delta. NULL if deleted. |
| 168 | ** length 0 if unchanged */ |
| 169 | ");" |
| 170 | "CREATE TABLE patch.cfg(\n" |
| 171 | " key TEXT,\n" |
| 172 | " value ANY\n" |
| @@ -196,11 +196,11 @@ | |
| 196 | if( z ){ |
| 197 | db_multi_exec( |
| 198 | "INSERT INTO patch.cfg(key,value)VALUES('hostname',%Q)", z); |
| 199 | fossil_free(z); |
| 200 | } |
| 201 | |
| 202 | /* New files */ |
| 203 | db_multi_exec( |
| 204 | "INSERT INTO patch.chng(pathname,hash,isexe,islink,delta)" |
| 205 | " SELECT pathname, NULL, isexe, islink," |
| 206 | " compress(read_co_file(%Q||pathname))" |
| @@ -249,11 +249,11 @@ | |
| 249 | #ifdef _WIN32 |
| 250 | fflush(out); |
| 251 | _setmode(_fileno(out), _O_BINARY); |
| 252 | #endif |
| 253 | fwrite(pData, sz, 1, out); |
| 254 | sqlite3_free(pData); |
| 255 | fflush(out); |
| 256 | } |
| 257 | } |
| 258 | |
| 259 | /* |
| @@ -301,11 +301,11 @@ | |
| 301 | /* |
| 302 | ** Show a summary of the content of a patch on standard output |
| 303 | */ |
| 304 | void patch_view(unsigned mFlags){ |
| 305 | Stmt q; |
| 306 | db_prepare(&q, |
| 307 | "WITH nmap(nkey,nm) AS (VALUES" |
| 308 | "('baseline','BASELINE')," |
| 309 | "('project-name','PROJECT-NAME'))" |
| 310 | "SELECT nm, value FROM nmap, patch.cfg WHERE nkey=key;" |
| 311 | ); |
| @@ -312,11 +312,11 @@ | |
| 312 | while( db_step(&q)==SQLITE_ROW ){ |
| 313 | fossil_print("%-12s %s\n", db_column_text(&q,0), db_column_text(&q,1)); |
| 314 | } |
| 315 | db_finalize(&q); |
| 316 | if( mFlags & PATCH_VERBOSE ){ |
| 317 | db_prepare(&q, |
| 318 | "WITH nmap(nkey,nm,isDate) AS (VALUES" |
| 319 | "('project-code','PROJECT-CODE',0)," |
| 320 | "('date','TIMESTAMP',1)," |
| 321 | "('user','USER',0)," |
| 322 | "('hostname','HOSTNAME',0)," |
| @@ -433,11 +433,11 @@ | |
| 433 | blob_appendf(&cmd, " merge %s\n", db_column_text(&q,1)); |
| 434 | }else{ |
| 435 | blob_appendf(&cmd, " merge --%s %s\n", zType, db_column_text(&q,1)); |
| 436 | } |
| 437 | if( mFlags & PATCH_VERBOSE ){ |
| 438 | fossil_print("%-10s %s\n", db_column_text(&q,2), |
| 439 | db_column_text(&q,0)); |
| 440 | } |
| 441 | } |
| 442 | db_finalize(&q); |
| 443 | if( mFlags & PATCH_DRYRUN ){ |
| @@ -561,11 +561,11 @@ | |
| 561 | blob_appendf(&cmd, " add %$\n", zPathname); |
| 562 | if( mFlags & PATCH_VERBOSE ){ |
| 563 | fossil_print("%-10s %s\n", "NEW", zPathname); |
| 564 | } |
| 565 | } |
| 566 | if( (mFlags & PATCH_DRYRUN)==0 ){ |
| 567 | if( isLink ){ |
| 568 | symlink_create(blob_str(&data), zPathname); |
| 569 | }else{ |
| 570 | blob_write_to_file(&data, zPathname); |
| 571 | } |
| @@ -697,11 +697,11 @@ | |
| 697 | blob_init(&remote, 0, 0); |
| 698 | if( zFossilCmd==0 ){ |
| 699 | blob_append_escaped_arg(&cmd, "PATH=$HOME/bin:$PATH", 0); |
| 700 | zFossilCmd = "fossil"; |
| 701 | } |
| 702 | blob_appendf(&remote, "%$ patch %s%s --dir64 %z -", |
| 703 | zFossilCmd, zRemoteCmd, zForce, encode64(zDir, -1)); |
| 704 | blob_append_escaped_arg(&cmd, blob_str(&remote), 0); |
| 705 | blob_reset(&remote); |
| 706 | } |
| 707 | fossil_print("%s\n", blob_str(&cmd)); |
| @@ -777,11 +777,11 @@ | |
| 777 | ); |
| 778 | while( db_step(&q)==SQLITE_ROW ){ |
| 779 | int rid; |
| 780 | const char *zName; |
| 781 | Blob a, b; |
| 782 | |
| 783 | if( db_column_type(&q,0)!=SQLITE_INTEGER |
| 784 | && db_column_type(&q,4)==SQLITE_TEXT |
| 785 | ){ |
| 786 | char *zUuid = fossil_strdup(db_column_text(&q,4)); |
| 787 | char *zName = fossil_strdup(db_column_text(&q,1)); |
| @@ -899,11 +899,11 @@ | |
| 899 | ** |
| 900 | ** -f|--force Apply the patch even though there are unsaved |
| 901 | ** changes in the current check-out. Unsaved |
| 902 | ** changes will be reverted and then the patch is |
| 903 | ** applied. |
| 904 | ** --fossilcmd EXE Name of the "fossil" executable on the remote |
| 905 | ** -n|--dry-run Do nothing, but print what would have happened |
| 906 | ** -v|--verbose Extra output explaining what happens |
| 907 | ** |
| 908 | ** |
| 909 | ** > fossil patch pull REMOTE-CHECKOUT |
| @@ -976,11 +976,11 @@ | |
| 976 | if( find_option("dry-run","n",0) ) flags |= PATCH_DRYRUN; |
| 977 | if( find_option("verbose","v",0) ) flags |= PATCH_VERBOSE; |
| 978 | if( find_option("force","f",0) ) flags |= PATCH_FORCE; |
| 979 | db_must_be_within_tree(); |
| 980 | verify_all_options(); |
| 981 | pIn = patch_remote_command(flags & (~PATCH_FORCE), |
| 982 | "pull", "create", zFossilCmd, "r"); |
| 983 | if( pIn ){ |
| 984 | patch_attach(0, pIn); |
| 985 | pclose(pIn); |
| 986 | patch_apply(flags); |
| @@ -1014,7 +1014,7 @@ | |
| 1014 | patch_attach(zIn, stdin); |
| 1015 | patch_view(flags); |
| 1016 | }else |
| 1017 | { |
| 1018 | goto patch_usage; |
| 1019 | } |
| 1020 | } |
| 1021 |
+2
-2
| --- src/pikchrshow.c | ||
| +++ src/pikchrshow.c | ||
| @@ -135,11 +135,11 @@ | ||
| 135 | 135 | } |
| 136 | 136 | if(!(PIKCHR_PROCESS_TH1 & pikFlags) |
| 137 | 137 | /* If any TH1_xxx flags are set, set TH1 */ |
| 138 | 138 | && (PIKCHR_PROCESS_TH1_NOSVG & pikFlags || thFlags!=0)){ |
| 139 | 139 | pikFlags |= PIKCHR_PROCESS_TH1; |
| 140 | - } | |
| 140 | + } | |
| 141 | 141 | if(zNonce){ |
| 142 | 142 | blob_appendf(pOut, "%s\n", zNonce); |
| 143 | 143 | } |
| 144 | 144 | if(PIKCHR_PROCESS_TH1 & pikFlags){ |
| 145 | 145 | Blob out = empty_blob; |
| @@ -546,11 +546,11 @@ | ||
| 546 | 546 | ** CSS to hide the SVG and reveal the source by default. |
| 547 | 547 | ** |
| 548 | 548 | ** -src Store the input pikchr's source code in the output as |
| 549 | 549 | ** a separate element adjacent to the SVG one. Implied |
| 550 | 550 | ** by -div-source. |
| 551 | -** | |
| 551 | +** | |
| 552 | 552 | ** |
| 553 | 553 | ** -th Process the input using TH1 before passing it to pikchr |
| 554 | 554 | ** |
| 555 | 555 | ** -th-novar Disable $var and $<var> TH1 processing. Use this if the |
| 556 | 556 | ** pikchr script uses '$' for its own purposes and that |
| 557 | 557 |
| --- src/pikchrshow.c | |
| +++ src/pikchrshow.c | |
| @@ -135,11 +135,11 @@ | |
| 135 | } |
| 136 | if(!(PIKCHR_PROCESS_TH1 & pikFlags) |
| 137 | /* If any TH1_xxx flags are set, set TH1 */ |
| 138 | && (PIKCHR_PROCESS_TH1_NOSVG & pikFlags || thFlags!=0)){ |
| 139 | pikFlags |= PIKCHR_PROCESS_TH1; |
| 140 | } |
| 141 | if(zNonce){ |
| 142 | blob_appendf(pOut, "%s\n", zNonce); |
| 143 | } |
| 144 | if(PIKCHR_PROCESS_TH1 & pikFlags){ |
| 145 | Blob out = empty_blob; |
| @@ -546,11 +546,11 @@ | |
| 546 | ** CSS to hide the SVG and reveal the source by default. |
| 547 | ** |
| 548 | ** -src Store the input pikchr's source code in the output as |
| 549 | ** a separate element adjacent to the SVG one. Implied |
| 550 | ** by -div-source. |
| 551 | ** |
| 552 | ** |
| 553 | ** -th Process the input using TH1 before passing it to pikchr |
| 554 | ** |
| 555 | ** -th-novar Disable $var and $<var> TH1 processing. Use this if the |
| 556 | ** pikchr script uses '$' for its own purposes and that |
| 557 |
| --- src/pikchrshow.c | |
| +++ src/pikchrshow.c | |
| @@ -135,11 +135,11 @@ | |
| 135 | } |
| 136 | if(!(PIKCHR_PROCESS_TH1 & pikFlags) |
| 137 | /* If any TH1_xxx flags are set, set TH1 */ |
| 138 | && (PIKCHR_PROCESS_TH1_NOSVG & pikFlags || thFlags!=0)){ |
| 139 | pikFlags |= PIKCHR_PROCESS_TH1; |
| 140 | } |
| 141 | if(zNonce){ |
| 142 | blob_appendf(pOut, "%s\n", zNonce); |
| 143 | } |
| 144 | if(PIKCHR_PROCESS_TH1 & pikFlags){ |
| 145 | Blob out = empty_blob; |
| @@ -546,11 +546,11 @@ | |
| 546 | ** CSS to hide the SVG and reveal the source by default. |
| 547 | ** |
| 548 | ** -src Store the input pikchr's source code in the output as |
| 549 | ** a separate element adjacent to the SVG one. Implied |
| 550 | ** by -div-source. |
| 551 | ** |
| 552 | ** |
| 553 | ** -th Process the input using TH1 before passing it to pikchr |
| 554 | ** |
| 555 | ** -th-novar Disable $var and $<var> TH1 processing. Use this if the |
| 556 | ** pikchr script uses '$' for its own purposes and that |
| 557 |
+3
-2
| --- src/rebuild.c | ||
| +++ src/rebuild.c | ||
| @@ -661,11 +661,11 @@ | ||
| 661 | 661 | ** --force Force the rebuild to complete even if errors are seen |
| 662 | 662 | ** --ifneeded Only do the rebuild if it would change the schema version |
| 663 | 663 | ** --index Always add in the full-text search index |
| 664 | 664 | ** --noverify Skip the verification of changes to the BLOB table |
| 665 | 665 | ** --noindex Always omit the full-text search index |
| 666 | -** --pagesize N Set the database pagesize to N. (512..65536 and power of 2) | |
| 666 | +** --pagesize N Set the database pagesize to N (512..65536, power of 2) | |
| 667 | 667 | ** --quiet Only show output if there are errors |
| 668 | 668 | ** --stats Show artifact statistics after rebuilding |
| 669 | 669 | ** --vacuum Run VACUUM on the database after rebuilding |
| 670 | 670 | ** --wal Set Write-Ahead-Log journalling mode on the database |
| 671 | 671 | */ |
| @@ -1395,11 +1395,12 @@ | ||
| 1395 | 1395 | |
| 1396 | 1396 | db_end_transaction(0); |
| 1397 | 1397 | fossil_print("project-id: %s\n", db_get("project-code", 0)); |
| 1398 | 1398 | fossil_print("server-id: %s\n", db_get("server-code", 0)); |
| 1399 | 1399 | zPassword = db_text(0, "SELECT pw FROM user WHERE login=%Q", g.zLogin); |
| 1400 | - fossil_print("admin-user: %s (initial password is \"%s\")\n", g.zLogin, zPassword); | |
| 1400 | + fossil_print("admin-user: %s (initial password is \"%s\")\n", g.zLogin, | |
| 1401 | + zPassword); | |
| 1401 | 1402 | hash_user_password(g.zLogin); |
| 1402 | 1403 | } |
| 1403 | 1404 | |
| 1404 | 1405 | /* |
| 1405 | 1406 | ** COMMAND: deconstruct* |
| 1406 | 1407 |
| --- src/rebuild.c | |
| +++ src/rebuild.c | |
| @@ -661,11 +661,11 @@ | |
| 661 | ** --force Force the rebuild to complete even if errors are seen |
| 662 | ** --ifneeded Only do the rebuild if it would change the schema version |
| 663 | ** --index Always add in the full-text search index |
| 664 | ** --noverify Skip the verification of changes to the BLOB table |
| 665 | ** --noindex Always omit the full-text search index |
| 666 | ** --pagesize N Set the database pagesize to N. (512..65536 and power of 2) |
| 667 | ** --quiet Only show output if there are errors |
| 668 | ** --stats Show artifact statistics after rebuilding |
| 669 | ** --vacuum Run VACUUM on the database after rebuilding |
| 670 | ** --wal Set Write-Ahead-Log journalling mode on the database |
| 671 | */ |
| @@ -1395,11 +1395,12 @@ | |
| 1395 | |
| 1396 | db_end_transaction(0); |
| 1397 | fossil_print("project-id: %s\n", db_get("project-code", 0)); |
| 1398 | fossil_print("server-id: %s\n", db_get("server-code", 0)); |
| 1399 | zPassword = db_text(0, "SELECT pw FROM user WHERE login=%Q", g.zLogin); |
| 1400 | fossil_print("admin-user: %s (initial password is \"%s\")\n", g.zLogin, zPassword); |
| 1401 | hash_user_password(g.zLogin); |
| 1402 | } |
| 1403 | |
| 1404 | /* |
| 1405 | ** COMMAND: deconstruct* |
| 1406 |
| --- src/rebuild.c | |
| +++ src/rebuild.c | |
| @@ -661,11 +661,11 @@ | |
| 661 | ** --force Force the rebuild to complete even if errors are seen |
| 662 | ** --ifneeded Only do the rebuild if it would change the schema version |
| 663 | ** --index Always add in the full-text search index |
| 664 | ** --noverify Skip the verification of changes to the BLOB table |
| 665 | ** --noindex Always omit the full-text search index |
| 666 | ** --pagesize N Set the database pagesize to N (512..65536, power of 2) |
| 667 | ** --quiet Only show output if there are errors |
| 668 | ** --stats Show artifact statistics after rebuilding |
| 669 | ** --vacuum Run VACUUM on the database after rebuilding |
| 670 | ** --wal Set Write-Ahead-Log journalling mode on the database |
| 671 | */ |
| @@ -1395,11 +1395,12 @@ | |
| 1395 | |
| 1396 | db_end_transaction(0); |
| 1397 | fossil_print("project-id: %s\n", db_get("project-code", 0)); |
| 1398 | fossil_print("server-id: %s\n", db_get("server-code", 0)); |
| 1399 | zPassword = db_text(0, "SELECT pw FROM user WHERE login=%Q", g.zLogin); |
| 1400 | fossil_print("admin-user: %s (initial password is \"%s\")\n", g.zLogin, |
| 1401 | zPassword); |
| 1402 | hash_user_password(g.zLogin); |
| 1403 | } |
| 1404 | |
| 1405 | /* |
| 1406 | ** COMMAND: deconstruct* |
| 1407 |
+3
-2
| --- src/report.c | ||
| +++ src/report.c | ||
| @@ -1126,11 +1126,11 @@ | ||
| 1126 | 1126 | char *zMimetype; |
| 1127 | 1127 | int tabs; |
| 1128 | 1128 | Stmt q; |
| 1129 | 1129 | char *zErr1 = 0; |
| 1130 | 1130 | char *zErr2 = 0; |
| 1131 | - | |
| 1131 | + | |
| 1132 | 1132 | login_check_credentials(); |
| 1133 | 1133 | if( !g.perm.RdTkt ){ login_needed(g.anon.RdTkt); return; } |
| 1134 | 1134 | report_update_reportfmt_table(); |
| 1135 | 1135 | rn = report_number(); |
| 1136 | 1136 | tabs = P("tablist")!=0; |
| @@ -1368,11 +1368,12 @@ | ||
| 1368 | 1368 | char *zErr1 = 0; |
| 1369 | 1369 | char *zErr2 = 0; |
| 1370 | 1370 | int count = 0; |
| 1371 | 1371 | int rn; |
| 1372 | 1372 | |
| 1373 | - if( !zRep || !strcmp(zRep,zFullTicketRptRn) || !strcmp(zRep,zFullTicketRptTitle) ){ | |
| 1373 | + if( !zRep || !strcmp(zRep,zFullTicketRptRn) | |
| 1374 | + || !strcmp(zRep,zFullTicketRptTitle) ){ | |
| 1374 | 1375 | zSql = "SELECT * FROM ticket"; |
| 1375 | 1376 | }else{ |
| 1376 | 1377 | rn = atoi(zRep); |
| 1377 | 1378 | if( rn ){ |
| 1378 | 1379 | db_prepare(&q, |
| 1379 | 1380 |
| --- src/report.c | |
| +++ src/report.c | |
| @@ -1126,11 +1126,11 @@ | |
| 1126 | char *zMimetype; |
| 1127 | int tabs; |
| 1128 | Stmt q; |
| 1129 | char *zErr1 = 0; |
| 1130 | char *zErr2 = 0; |
| 1131 | |
| 1132 | login_check_credentials(); |
| 1133 | if( !g.perm.RdTkt ){ login_needed(g.anon.RdTkt); return; } |
| 1134 | report_update_reportfmt_table(); |
| 1135 | rn = report_number(); |
| 1136 | tabs = P("tablist")!=0; |
| @@ -1368,11 +1368,12 @@ | |
| 1368 | char *zErr1 = 0; |
| 1369 | char *zErr2 = 0; |
| 1370 | int count = 0; |
| 1371 | int rn; |
| 1372 | |
| 1373 | if( !zRep || !strcmp(zRep,zFullTicketRptRn) || !strcmp(zRep,zFullTicketRptTitle) ){ |
| 1374 | zSql = "SELECT * FROM ticket"; |
| 1375 | }else{ |
| 1376 | rn = atoi(zRep); |
| 1377 | if( rn ){ |
| 1378 | db_prepare(&q, |
| 1379 |
| --- src/report.c | |
| +++ src/report.c | |
| @@ -1126,11 +1126,11 @@ | |
| 1126 | char *zMimetype; |
| 1127 | int tabs; |
| 1128 | Stmt q; |
| 1129 | char *zErr1 = 0; |
| 1130 | char *zErr2 = 0; |
| 1131 | |
| 1132 | login_check_credentials(); |
| 1133 | if( !g.perm.RdTkt ){ login_needed(g.anon.RdTkt); return; } |
| 1134 | report_update_reportfmt_table(); |
| 1135 | rn = report_number(); |
| 1136 | tabs = P("tablist")!=0; |
| @@ -1368,11 +1368,12 @@ | |
| 1368 | char *zErr1 = 0; |
| 1369 | char *zErr2 = 0; |
| 1370 | int count = 0; |
| 1371 | int rn; |
| 1372 | |
| 1373 | if( !zRep || !strcmp(zRep,zFullTicketRptRn) |
| 1374 | || !strcmp(zRep,zFullTicketRptTitle) ){ |
| 1375 | zSql = "SELECT * FROM ticket"; |
| 1376 | }else{ |
| 1377 | rn = atoi(zRep); |
| 1378 | if( rn ){ |
| 1379 | db_prepare(&q, |
| 1380 |
+9
-7
| --- src/rss.c | ||
| +++ src/rss.c | ||
| @@ -143,12 +143,12 @@ | ||
| 143 | 143 | |
| 144 | 144 | cgi_set_content_type("application/rss+xml"); |
| 145 | 145 | |
| 146 | 146 | zProjectName = db_get("project-name", 0); |
| 147 | 147 | if( zProjectName==0 ){ |
| 148 | - zFreeProjectName = zProjectName = mprintf("Fossil source repository for: %s", | |
| 149 | - g.zBaseURL); | |
| 148 | + zFreeProjectName = zProjectName = | |
| 149 | + mprintf("Fossil source repository for: %s", g.zBaseURL); | |
| 150 | 150 | } |
| 151 | 151 | zProjectDescr = db_get("project-description", 0); |
| 152 | 152 | if( zProjectDescr==0 ){ |
| 153 | 153 | zProjectDescr = zProjectName; |
| 154 | 154 | } |
| @@ -258,11 +258,11 @@ | ||
| 258 | 258 | void cmd_timeline_rss(void){ |
| 259 | 259 | Stmt q; |
| 260 | 260 | int nLine=0; |
| 261 | 261 | char *zPubDate, *zProjectName, *zProjectDescr, *zFreeProjectName=0; |
| 262 | 262 | Blob bSQL; |
| 263 | - const char *zType = find_option("type","y",1); /* Type of events. All if NULL */ | |
| 263 | + const char *zType = find_option("type","y",1); /* Type of events;All if NULL*/ | |
| 264 | 264 | const char *zTicketUuid = find_option("tkt",NULL,1); |
| 265 | 265 | const char *zTag = find_option("tag",NULL,1); |
| 266 | 266 | const char *zFilename = find_option("name",NULL,1); |
| 267 | 267 | const char *zWiki = find_option("wiki",NULL,1); |
| 268 | 268 | const char *zLimit = find_option("limit", "n",1); |
| @@ -332,31 +332,33 @@ | ||
| 332 | 332 | " WHERE tagid=%d AND tagtype>0 AND rid=blob.rid))", nTagId); |
| 333 | 333 | } |
| 334 | 334 | |
| 335 | 335 | if( zFilename ){ |
| 336 | 336 | blob_append_sql(&bSQL, |
| 337 | - " AND (SELECT mlink.fnid FROM mlink WHERE event.objid=mlink.mid) IN (SELECT fnid FROM filename WHERE name=%Q %s)", | |
| 337 | + " AND (SELECT mlink.fnid FROM mlink WHERE event.objid=mlink.mid) " | |
| 338 | + " IN (SELECT fnid FROM filename WHERE name=%Q %s)", | |
| 338 | 339 | zFilename, filename_collation() |
| 339 | 340 | ); |
| 340 | 341 | } |
| 341 | 342 | |
| 342 | 343 | blob_append( &bSQL, " ORDER BY event.mtime DESC", -1 ); |
| 343 | 344 | |
| 344 | 345 | zProjectName = db_get("project-name", 0); |
| 345 | 346 | if( zProjectName==0 ){ |
| 346 | - zFreeProjectName = zProjectName = mprintf("Fossil source repository for: %s", | |
| 347 | - zBaseURL); | |
| 347 | + zFreeProjectName = zProjectName = | |
| 348 | + mprintf("Fossil source repository for: %s", zBaseURL); | |
| 348 | 349 | } |
| 349 | 350 | zProjectDescr = db_get("project-description", 0); |
| 350 | 351 | if( zProjectDescr==0 ){ |
| 351 | 352 | zProjectDescr = zProjectName; |
| 352 | 353 | } |
| 353 | 354 | |
| 354 | 355 | zPubDate = cgi_rfc822_datestamp(time(NULL)); |
| 355 | 356 | |
| 356 | 357 | fossil_print("<?xml version=\"1.0\"?>"); |
| 357 | - fossil_print("<rss xmlns:dc=\"http://purl.org/dc/elements/1.1/\" version=\"2.0\">"); | |
| 358 | + fossil_print("<rss xmlns:dc=\"http://purl.org/dc/elements/1.1/\" " | |
| 359 | + " version=\"2.0\">"); | |
| 358 | 360 | fossil_print("<channel>\n"); |
| 359 | 361 | fossil_print("<title>%h</title>\n", zProjectName); |
| 360 | 362 | fossil_print("<link>%s</link>\n", zBaseURL); |
| 361 | 363 | fossil_print("<description>%h</description>\n", zProjectDescr); |
| 362 | 364 | fossil_print("<pubDate>%s</pubDate>\n", zPubDate); |
| 363 | 365 |
| --- src/rss.c | |
| +++ src/rss.c | |
| @@ -143,12 +143,12 @@ | |
| 143 | |
| 144 | cgi_set_content_type("application/rss+xml"); |
| 145 | |
| 146 | zProjectName = db_get("project-name", 0); |
| 147 | if( zProjectName==0 ){ |
| 148 | zFreeProjectName = zProjectName = mprintf("Fossil source repository for: %s", |
| 149 | g.zBaseURL); |
| 150 | } |
| 151 | zProjectDescr = db_get("project-description", 0); |
| 152 | if( zProjectDescr==0 ){ |
| 153 | zProjectDescr = zProjectName; |
| 154 | } |
| @@ -258,11 +258,11 @@ | |
| 258 | void cmd_timeline_rss(void){ |
| 259 | Stmt q; |
| 260 | int nLine=0; |
| 261 | char *zPubDate, *zProjectName, *zProjectDescr, *zFreeProjectName=0; |
| 262 | Blob bSQL; |
| 263 | const char *zType = find_option("type","y",1); /* Type of events. All if NULL */ |
| 264 | const char *zTicketUuid = find_option("tkt",NULL,1); |
| 265 | const char *zTag = find_option("tag",NULL,1); |
| 266 | const char *zFilename = find_option("name",NULL,1); |
| 267 | const char *zWiki = find_option("wiki",NULL,1); |
| 268 | const char *zLimit = find_option("limit", "n",1); |
| @@ -332,31 +332,33 @@ | |
| 332 | " WHERE tagid=%d AND tagtype>0 AND rid=blob.rid))", nTagId); |
| 333 | } |
| 334 | |
| 335 | if( zFilename ){ |
| 336 | blob_append_sql(&bSQL, |
| 337 | " AND (SELECT mlink.fnid FROM mlink WHERE event.objid=mlink.mid) IN (SELECT fnid FROM filename WHERE name=%Q %s)", |
| 338 | zFilename, filename_collation() |
| 339 | ); |
| 340 | } |
| 341 | |
| 342 | blob_append( &bSQL, " ORDER BY event.mtime DESC", -1 ); |
| 343 | |
| 344 | zProjectName = db_get("project-name", 0); |
| 345 | if( zProjectName==0 ){ |
| 346 | zFreeProjectName = zProjectName = mprintf("Fossil source repository for: %s", |
| 347 | zBaseURL); |
| 348 | } |
| 349 | zProjectDescr = db_get("project-description", 0); |
| 350 | if( zProjectDescr==0 ){ |
| 351 | zProjectDescr = zProjectName; |
| 352 | } |
| 353 | |
| 354 | zPubDate = cgi_rfc822_datestamp(time(NULL)); |
| 355 | |
| 356 | fossil_print("<?xml version=\"1.0\"?>"); |
| 357 | fossil_print("<rss xmlns:dc=\"http://purl.org/dc/elements/1.1/\" version=\"2.0\">"); |
| 358 | fossil_print("<channel>\n"); |
| 359 | fossil_print("<title>%h</title>\n", zProjectName); |
| 360 | fossil_print("<link>%s</link>\n", zBaseURL); |
| 361 | fossil_print("<description>%h</description>\n", zProjectDescr); |
| 362 | fossil_print("<pubDate>%s</pubDate>\n", zPubDate); |
| 363 |
| --- src/rss.c | |
| +++ src/rss.c | |
| @@ -143,12 +143,12 @@ | |
| 143 | |
| 144 | cgi_set_content_type("application/rss+xml"); |
| 145 | |
| 146 | zProjectName = db_get("project-name", 0); |
| 147 | if( zProjectName==0 ){ |
| 148 | zFreeProjectName = zProjectName = |
| 149 | mprintf("Fossil source repository for: %s", g.zBaseURL); |
| 150 | } |
| 151 | zProjectDescr = db_get("project-description", 0); |
| 152 | if( zProjectDescr==0 ){ |
| 153 | zProjectDescr = zProjectName; |
| 154 | } |
| @@ -258,11 +258,11 @@ | |
| 258 | void cmd_timeline_rss(void){ |
| 259 | Stmt q; |
| 260 | int nLine=0; |
| 261 | char *zPubDate, *zProjectName, *zProjectDescr, *zFreeProjectName=0; |
| 262 | Blob bSQL; |
| 263 | const char *zType = find_option("type","y",1); /* Type of events;All if NULL*/ |
| 264 | const char *zTicketUuid = find_option("tkt",NULL,1); |
| 265 | const char *zTag = find_option("tag",NULL,1); |
| 266 | const char *zFilename = find_option("name",NULL,1); |
| 267 | const char *zWiki = find_option("wiki",NULL,1); |
| 268 | const char *zLimit = find_option("limit", "n",1); |
| @@ -332,31 +332,33 @@ | |
| 332 | " WHERE tagid=%d AND tagtype>0 AND rid=blob.rid))", nTagId); |
| 333 | } |
| 334 | |
| 335 | if( zFilename ){ |
| 336 | blob_append_sql(&bSQL, |
| 337 | " AND (SELECT mlink.fnid FROM mlink WHERE event.objid=mlink.mid) " |
| 338 | " IN (SELECT fnid FROM filename WHERE name=%Q %s)", |
| 339 | zFilename, filename_collation() |
| 340 | ); |
| 341 | } |
| 342 | |
| 343 | blob_append( &bSQL, " ORDER BY event.mtime DESC", -1 ); |
| 344 | |
| 345 | zProjectName = db_get("project-name", 0); |
| 346 | if( zProjectName==0 ){ |
| 347 | zFreeProjectName = zProjectName = |
| 348 | mprintf("Fossil source repository for: %s", zBaseURL); |
| 349 | } |
| 350 | zProjectDescr = db_get("project-description", 0); |
| 351 | if( zProjectDescr==0 ){ |
| 352 | zProjectDescr = zProjectName; |
| 353 | } |
| 354 | |
| 355 | zPubDate = cgi_rfc822_datestamp(time(NULL)); |
| 356 | |
| 357 | fossil_print("<?xml version=\"1.0\"?>"); |
| 358 | fossil_print("<rss xmlns:dc=\"http://purl.org/dc/elements/1.1/\" " |
| 359 | " version=\"2.0\">"); |
| 360 | fossil_print("<channel>\n"); |
| 361 | fossil_print("<title>%h</title>\n", zProjectName); |
| 362 | fossil_print("<link>%s</link>\n", zBaseURL); |
| 363 | fossil_print("<description>%h</description>\n", zProjectDescr); |
| 364 | fossil_print("<pubDate>%s</pubDate>\n", zPubDate); |
| 365 |
+2
-2
| --- src/search.c | ||
| +++ src/search.c | ||
| @@ -696,11 +696,11 @@ | ||
| 696 | 696 | }else{ |
| 697 | 697 | /* Legacy timeline search (the default) */ |
| 698 | 698 | (void)search_init(blob_str(&pattern),"*","*","...",SRCHFLG_STATIC); |
| 699 | 699 | blob_reset(&pattern); |
| 700 | 700 | search_sql_setup(g.db); |
| 701 | - | |
| 701 | + | |
| 702 | 702 | db_multi_exec( |
| 703 | 703 | "CREATE TEMP TABLE srch(rid,uuid,date,comment,x);" |
| 704 | 704 | "CREATE INDEX srch_idx1 ON srch(x);" |
| 705 | 705 | "INSERT INTO srch(rid,uuid,date,comment,x)" |
| 706 | 706 | " SELECT blob.rid, uuid, datetime(event.mtime,toLocal())," |
| @@ -2380,11 +2380,11 @@ | ||
| 2380 | 2380 | } |
| 2381 | 2381 | |
| 2382 | 2382 | |
| 2383 | 2383 | /* |
| 2384 | 2384 | ** Argument f should be a flag accepted by matchinfo() (a valid character |
| 2385 | -** in the string passed as the second argument). If it is not, -1 is | |
| 2385 | +** in the string passed as the second argument). If it is not, -1 is | |
| 2386 | 2386 | ** returned. Otherwise, if f is a valid matchinfo flag, the value returned |
| 2387 | 2387 | ** is the number of 32-bit integers added to the output array if the |
| 2388 | 2388 | ** table has nCol columns and the query nPhrase phrases. |
| 2389 | 2389 | */ |
| 2390 | 2390 | static int fts5MatchinfoFlagsize(int nCol, int nPhrase, char f){ |
| 2391 | 2391 |
| --- src/search.c | |
| +++ src/search.c | |
| @@ -696,11 +696,11 @@ | |
| 696 | }else{ |
| 697 | /* Legacy timeline search (the default) */ |
| 698 | (void)search_init(blob_str(&pattern),"*","*","...",SRCHFLG_STATIC); |
| 699 | blob_reset(&pattern); |
| 700 | search_sql_setup(g.db); |
| 701 | |
| 702 | db_multi_exec( |
| 703 | "CREATE TEMP TABLE srch(rid,uuid,date,comment,x);" |
| 704 | "CREATE INDEX srch_idx1 ON srch(x);" |
| 705 | "INSERT INTO srch(rid,uuid,date,comment,x)" |
| 706 | " SELECT blob.rid, uuid, datetime(event.mtime,toLocal())," |
| @@ -2380,11 +2380,11 @@ | |
| 2380 | } |
| 2381 | |
| 2382 | |
| 2383 | /* |
| 2384 | ** Argument f should be a flag accepted by matchinfo() (a valid character |
| 2385 | ** in the string passed as the second argument). If it is not, -1 is |
| 2386 | ** returned. Otherwise, if f is a valid matchinfo flag, the value returned |
| 2387 | ** is the number of 32-bit integers added to the output array if the |
| 2388 | ** table has nCol columns and the query nPhrase phrases. |
| 2389 | */ |
| 2390 | static int fts5MatchinfoFlagsize(int nCol, int nPhrase, char f){ |
| 2391 |
| --- src/search.c | |
| +++ src/search.c | |
| @@ -696,11 +696,11 @@ | |
| 696 | }else{ |
| 697 | /* Legacy timeline search (the default) */ |
| 698 | (void)search_init(blob_str(&pattern),"*","*","...",SRCHFLG_STATIC); |
| 699 | blob_reset(&pattern); |
| 700 | search_sql_setup(g.db); |
| 701 | |
| 702 | db_multi_exec( |
| 703 | "CREATE TEMP TABLE srch(rid,uuid,date,comment,x);" |
| 704 | "CREATE INDEX srch_idx1 ON srch(x);" |
| 705 | "INSERT INTO srch(rid,uuid,date,comment,x)" |
| 706 | " SELECT blob.rid, uuid, datetime(event.mtime,toLocal())," |
| @@ -2380,11 +2380,11 @@ | |
| 2380 | } |
| 2381 | |
| 2382 | |
| 2383 | /* |
| 2384 | ** Argument f should be a flag accepted by matchinfo() (a valid character |
| 2385 | ** in the string passed as the second argument). If it is not, -1 is |
| 2386 | ** returned. Otherwise, if f is a valid matchinfo flag, the value returned |
| 2387 | ** is the number of 32-bit integers added to the output array if the |
| 2388 | ** table has nCol columns and the query nPhrase phrases. |
| 2389 | */ |
| 2390 | static int fts5MatchinfoFlagsize(int nCol, int nPhrase, char f){ |
| 2391 |
+7
-7
| --- src/security_audit.c | ||
| +++ src/security_audit.c | ||
| @@ -336,11 +336,11 @@ | ||
| 336 | 336 | /* Anonymous users probably should not be allowed act as moderators |
| 337 | 337 | ** for wiki or tickets. |
| 338 | 338 | */ |
| 339 | 339 | if( hasAnyCap(zAnonCap, "lq5") ){ |
| 340 | 340 | @ <li><p><b>WARNING:</b> |
| 341 | - @ Anonymous users can act as moderators for wiki, tickets, or | |
| 341 | + @ Anonymous users can act as moderators for wiki, tickets, or | |
| 342 | 342 | @ forum posts. This defeats the whole purpose of moderation. |
| 343 | 343 | @ Fix this by removing the "Mod-Wiki", "Mod-Tkt", and "Mod-Forum" |
| 344 | 344 | @ privileges (<a href="%R/setup_ucap_list">capabilities</a> "fq5") |
| 345 | 345 | @ from users "anonymous" and "nobody" |
| 346 | 346 | @ on the <a href="setup_ulist">User Configuration</a> page. |
| @@ -353,11 +353,11 @@ | ||
| 353 | 353 | @ <li><p><b>WARNING:</b> |
| 354 | 354 | @ TH1 scripts might be configured to run on any sync, push, pull, or |
| 355 | 355 | @ clone operation. See the the <a href="%R/xfersetup">/xfersetup</a> |
| 356 | 356 | @ page for more information. These TH1 scripts are a potential |
| 357 | 357 | @ security concern and so should be carefully audited by a human. |
| 358 | - } | |
| 358 | + } | |
| 359 | 359 | |
| 360 | 360 | /* The strict-manifest-syntax setting should be on. */ |
| 361 | 361 | if( db_get_boolean("strict-manifest-syntax",1)==0 ){ |
| 362 | 362 | @ <li><p><b>WARNING:</b> |
| 363 | 363 | @ The "strict-manifest-syntax" flag is off. This is a security |
| @@ -582,11 +582,11 @@ | ||
| 582 | 582 | if( r<=0.0 ){ |
| 583 | 583 | @ <li><p> |
| 584 | 584 | @ Load average limiting is turned off. This can cause the server |
| 585 | 585 | @ to bog down if many requests for expensive services (such as |
| 586 | 586 | @ large diffs or tarballs) arrive at about the same time. |
| 587 | - @ To fix this, set the | |
| 587 | + @ To fix this, set the | |
| 588 | 588 | @ <a href='%R/setup_access#slal'>"Server Load Average Limit"</a> on the |
| 589 | 589 | @ <a href='%R/setup_access'>Access Control</a> page to the approximate |
| 590 | 590 | @ the number of available cores on your server, or maybe just a little |
| 591 | 591 | @ less. |
| 592 | 592 | }else if( r>=8.0 ){ |
| @@ -604,11 +604,11 @@ | ||
| 604 | 604 | @ To set up an error log, |
| 605 | 605 | if( fossil_strcmp(g.zCmdName, "cgi")==0 ){ |
| 606 | 606 | @ make an entry like "errorlog: <i>FILENAME</i>" in the |
| 607 | 607 | @ CGI script at %h(P("SCRIPT_FILENAME")). |
| 608 | 608 | }else{ |
| 609 | - @ add the "--errorlog <i>FILENAME</i>" option to the | |
| 609 | + @ add the "--errorlog <i>FILENAME</i>" option to the | |
| 610 | 610 | @ "%h(g.argv[0]) %h(g.zCmdName)" command that launched this server. |
| 611 | 611 | } |
| 612 | 612 | }else{ |
| 613 | 613 | FILE *pTest = fossil_fopen(g.zErrlog,"a"); |
| 614 | 614 | if( pTest==0 ){ |
| @@ -635,11 +635,11 @@ | ||
| 635 | 635 | @ %d(nCgi) CGIs and %d(nFile-nCgi) static content and data files. |
| 636 | 636 | } |
| 637 | 637 | |
| 638 | 638 | if( fileedit_glob()!=0 ){ |
| 639 | 639 | @ <li><p><a href='%R/fileedit'>Online File Editing</a> is enabled |
| 640 | - @ for this repository. Clear the | |
| 640 | + @ for this repository. Clear the | |
| 641 | 641 | @ <a href='%R/setup_settings'>"fileedit-glob" setting</a> to |
| 642 | 642 | @ disable online editing.</p> |
| 643 | 643 | } |
| 644 | 644 | |
| 645 | 645 | @ <li><p> User capability summary: |
| @@ -651,11 +651,11 @@ | ||
| 651 | 651 | @ <li><p> WARNING: No Content Security Policy (CSP) is specified in the |
| 652 | 652 | @ header. Though not required, a strong CSP is recommended. Fossil will |
| 653 | 653 | @ automatically insert an appropriate CSP if you let it generate the |
| 654 | 654 | @ HTML <tt><head></tt> element by omitting <tt><body></tt> |
| 655 | 655 | @ from the header configuration in your customized skin. |
| 656 | - @ | |
| 656 | + @ | |
| 657 | 657 | }else{ |
| 658 | 658 | int ii; |
| 659 | 659 | @ <li><p> Content Security Policy: |
| 660 | 660 | @ <ol type="a"> |
| 661 | 661 | for(ii=0; azCSP[ii]; ii++){ |
| @@ -787,11 +787,11 @@ | ||
| 787 | 787 | @ like this: |
| 788 | 788 | @ <blockquote><pre> |
| 789 | 789 | @ errorlog: <i>FILENAME</i> |
| 790 | 790 | @ </pre></blockquote> |
| 791 | 791 | @ <li><p> |
| 792 | - @ If the server is running using one of | |
| 792 | + @ If the server is running using one of | |
| 793 | 793 | @ the "fossil http" or "fossil server" commands then add |
| 794 | 794 | @ a command-line option "--errorlog <i>FILENAME</i>" to that |
| 795 | 795 | @ command. |
| 796 | 796 | @ </ol> |
| 797 | 797 | style_finish_page(); |
| 798 | 798 |
| --- src/security_audit.c | |
| +++ src/security_audit.c | |
| @@ -336,11 +336,11 @@ | |
| 336 | /* Anonymous users probably should not be allowed act as moderators |
| 337 | ** for wiki or tickets. |
| 338 | */ |
| 339 | if( hasAnyCap(zAnonCap, "lq5") ){ |
| 340 | @ <li><p><b>WARNING:</b> |
| 341 | @ Anonymous users can act as moderators for wiki, tickets, or |
| 342 | @ forum posts. This defeats the whole purpose of moderation. |
| 343 | @ Fix this by removing the "Mod-Wiki", "Mod-Tkt", and "Mod-Forum" |
| 344 | @ privileges (<a href="%R/setup_ucap_list">capabilities</a> "fq5") |
| 345 | @ from users "anonymous" and "nobody" |
| 346 | @ on the <a href="setup_ulist">User Configuration</a> page. |
| @@ -353,11 +353,11 @@ | |
| 353 | @ <li><p><b>WARNING:</b> |
| 354 | @ TH1 scripts might be configured to run on any sync, push, pull, or |
| 355 | @ clone operation. See the the <a href="%R/xfersetup">/xfersetup</a> |
| 356 | @ page for more information. These TH1 scripts are a potential |
| 357 | @ security concern and so should be carefully audited by a human. |
| 358 | } |
| 359 | |
| 360 | /* The strict-manifest-syntax setting should be on. */ |
| 361 | if( db_get_boolean("strict-manifest-syntax",1)==0 ){ |
| 362 | @ <li><p><b>WARNING:</b> |
| 363 | @ The "strict-manifest-syntax" flag is off. This is a security |
| @@ -582,11 +582,11 @@ | |
| 582 | if( r<=0.0 ){ |
| 583 | @ <li><p> |
| 584 | @ Load average limiting is turned off. This can cause the server |
| 585 | @ to bog down if many requests for expensive services (such as |
| 586 | @ large diffs or tarballs) arrive at about the same time. |
| 587 | @ To fix this, set the |
| 588 | @ <a href='%R/setup_access#slal'>"Server Load Average Limit"</a> on the |
| 589 | @ <a href='%R/setup_access'>Access Control</a> page to the approximate |
| 590 | @ the number of available cores on your server, or maybe just a little |
| 591 | @ less. |
| 592 | }else if( r>=8.0 ){ |
| @@ -604,11 +604,11 @@ | |
| 604 | @ To set up an error log, |
| 605 | if( fossil_strcmp(g.zCmdName, "cgi")==0 ){ |
| 606 | @ make an entry like "errorlog: <i>FILENAME</i>" in the |
| 607 | @ CGI script at %h(P("SCRIPT_FILENAME")). |
| 608 | }else{ |
| 609 | @ add the "--errorlog <i>FILENAME</i>" option to the |
| 610 | @ "%h(g.argv[0]) %h(g.zCmdName)" command that launched this server. |
| 611 | } |
| 612 | }else{ |
| 613 | FILE *pTest = fossil_fopen(g.zErrlog,"a"); |
| 614 | if( pTest==0 ){ |
| @@ -635,11 +635,11 @@ | |
| 635 | @ %d(nCgi) CGIs and %d(nFile-nCgi) static content and data files. |
| 636 | } |
| 637 | |
| 638 | if( fileedit_glob()!=0 ){ |
| 639 | @ <li><p><a href='%R/fileedit'>Online File Editing</a> is enabled |
| 640 | @ for this repository. Clear the |
| 641 | @ <a href='%R/setup_settings'>"fileedit-glob" setting</a> to |
| 642 | @ disable online editing.</p> |
| 643 | } |
| 644 | |
| 645 | @ <li><p> User capability summary: |
| @@ -651,11 +651,11 @@ | |
| 651 | @ <li><p> WARNING: No Content Security Policy (CSP) is specified in the |
| 652 | @ header. Though not required, a strong CSP is recommended. Fossil will |
| 653 | @ automatically insert an appropriate CSP if you let it generate the |
| 654 | @ HTML <tt><head></tt> element by omitting <tt><body></tt> |
| 655 | @ from the header configuration in your customized skin. |
| 656 | @ |
| 657 | }else{ |
| 658 | int ii; |
| 659 | @ <li><p> Content Security Policy: |
| 660 | @ <ol type="a"> |
| 661 | for(ii=0; azCSP[ii]; ii++){ |
| @@ -787,11 +787,11 @@ | |
| 787 | @ like this: |
| 788 | @ <blockquote><pre> |
| 789 | @ errorlog: <i>FILENAME</i> |
| 790 | @ </pre></blockquote> |
| 791 | @ <li><p> |
| 792 | @ If the server is running using one of |
| 793 | @ the "fossil http" or "fossil server" commands then add |
| 794 | @ a command-line option "--errorlog <i>FILENAME</i>" to that |
| 795 | @ command. |
| 796 | @ </ol> |
| 797 | style_finish_page(); |
| 798 |
| --- src/security_audit.c | |
| +++ src/security_audit.c | |
| @@ -336,11 +336,11 @@ | |
| 336 | /* Anonymous users probably should not be allowed act as moderators |
| 337 | ** for wiki or tickets. |
| 338 | */ |
| 339 | if( hasAnyCap(zAnonCap, "lq5") ){ |
| 340 | @ <li><p><b>WARNING:</b> |
| 341 | @ Anonymous users can act as moderators for wiki, tickets, or |
| 342 | @ forum posts. This defeats the whole purpose of moderation. |
| 343 | @ Fix this by removing the "Mod-Wiki", "Mod-Tkt", and "Mod-Forum" |
| 344 | @ privileges (<a href="%R/setup_ucap_list">capabilities</a> "fq5") |
| 345 | @ from users "anonymous" and "nobody" |
| 346 | @ on the <a href="setup_ulist">User Configuration</a> page. |
| @@ -353,11 +353,11 @@ | |
| 353 | @ <li><p><b>WARNING:</b> |
| 354 | @ TH1 scripts might be configured to run on any sync, push, pull, or |
| 355 | @ clone operation. See the the <a href="%R/xfersetup">/xfersetup</a> |
| 356 | @ page for more information. These TH1 scripts are a potential |
| 357 | @ security concern and so should be carefully audited by a human. |
| 358 | } |
| 359 | |
| 360 | /* The strict-manifest-syntax setting should be on. */ |
| 361 | if( db_get_boolean("strict-manifest-syntax",1)==0 ){ |
| 362 | @ <li><p><b>WARNING:</b> |
| 363 | @ The "strict-manifest-syntax" flag is off. This is a security |
| @@ -582,11 +582,11 @@ | |
| 582 | if( r<=0.0 ){ |
| 583 | @ <li><p> |
| 584 | @ Load average limiting is turned off. This can cause the server |
| 585 | @ to bog down if many requests for expensive services (such as |
| 586 | @ large diffs or tarballs) arrive at about the same time. |
| 587 | @ To fix this, set the |
| 588 | @ <a href='%R/setup_access#slal'>"Server Load Average Limit"</a> on the |
| 589 | @ <a href='%R/setup_access'>Access Control</a> page to the approximate |
| 590 | @ the number of available cores on your server, or maybe just a little |
| 591 | @ less. |
| 592 | }else if( r>=8.0 ){ |
| @@ -604,11 +604,11 @@ | |
| 604 | @ To set up an error log, |
| 605 | if( fossil_strcmp(g.zCmdName, "cgi")==0 ){ |
| 606 | @ make an entry like "errorlog: <i>FILENAME</i>" in the |
| 607 | @ CGI script at %h(P("SCRIPT_FILENAME")). |
| 608 | }else{ |
| 609 | @ add the "--errorlog <i>FILENAME</i>" option to the |
| 610 | @ "%h(g.argv[0]) %h(g.zCmdName)" command that launched this server. |
| 611 | } |
| 612 | }else{ |
| 613 | FILE *pTest = fossil_fopen(g.zErrlog,"a"); |
| 614 | if( pTest==0 ){ |
| @@ -635,11 +635,11 @@ | |
| 635 | @ %d(nCgi) CGIs and %d(nFile-nCgi) static content and data files. |
| 636 | } |
| 637 | |
| 638 | if( fileedit_glob()!=0 ){ |
| 639 | @ <li><p><a href='%R/fileedit'>Online File Editing</a> is enabled |
| 640 | @ for this repository. Clear the |
| 641 | @ <a href='%R/setup_settings'>"fileedit-glob" setting</a> to |
| 642 | @ disable online editing.</p> |
| 643 | } |
| 644 | |
| 645 | @ <li><p> User capability summary: |
| @@ -651,11 +651,11 @@ | |
| 651 | @ <li><p> WARNING: No Content Security Policy (CSP) is specified in the |
| 652 | @ header. Though not required, a strong CSP is recommended. Fossil will |
| 653 | @ automatically insert an appropriate CSP if you let it generate the |
| 654 | @ HTML <tt><head></tt> element by omitting <tt><body></tt> |
| 655 | @ from the header configuration in your customized skin. |
| 656 | @ |
| 657 | }else{ |
| 658 | int ii; |
| 659 | @ <li><p> Content Security Policy: |
| 660 | @ <ol type="a"> |
| 661 | for(ii=0; azCSP[ii]; ii++){ |
| @@ -787,11 +787,11 @@ | |
| 787 | @ like this: |
| 788 | @ <blockquote><pre> |
| 789 | @ errorlog: <i>FILENAME</i> |
| 790 | @ </pre></blockquote> |
| 791 | @ <li><p> |
| 792 | @ If the server is running using one of |
| 793 | @ the "fossil http" or "fossil server" commands then add |
| 794 | @ a command-line option "--errorlog <i>FILENAME</i>" to that |
| 795 | @ command. |
| 796 | @ </ol> |
| 797 | style_finish_page(); |
| 798 |
+3
-3
| --- src/setup.c | ||
| +++ src/setup.c | ||
| @@ -588,11 +588,11 @@ | ||
| 588 | 588 | @ <hr> |
| 589 | 589 | entry_attribute("Public pages", 30, "public-pages", |
| 590 | 590 | "pubpage", "", 0); |
| 591 | 591 | @ <p>A comma-separated list of glob patterns for pages that are accessible |
| 592 | 592 | @ without needing a login and using the privileges given by the |
| 593 | - @ "Default privileges" setting below. | |
| 593 | + @ "Default privileges" setting below. | |
| 594 | 594 | @ |
| 595 | 595 | @ <p>Example use case: Set this field to "/doc/trunk/www/*" and set |
| 596 | 596 | @ the "Default privileges" to include the "o" privilege |
| 597 | 597 | @ to give anonymous users read-only permission to the |
| 598 | 598 | @ latest version of the embedded documentation in the www/ folder without |
| @@ -1201,11 +1201,11 @@ | ||
| 1201 | 1201 | @ <p> |
| 1202 | 1202 | if(P("resetMenu")!=0){ |
| 1203 | 1203 | db_unset("mainmenu", 0); |
| 1204 | 1204 | cgi_delete_parameter("mmenu"); |
| 1205 | 1205 | } |
| 1206 | - textarea_attribute("Main Menu", 12, 80, | |
| 1206 | + textarea_attribute("Main Menu", 12, 80, | |
| 1207 | 1207 | "mainmenu", "mmenu", style_default_mainmenu(), 0); |
| 1208 | 1208 | @ </p> |
| 1209 | 1209 | @ <p><input type='checkbox' id='cbResetMenu' name='resetMenu' value='1'> |
| 1210 | 1210 | @ <label for='cbResetMenu'>Reset menu to default value</label> |
| 1211 | 1211 | @ </p> |
| @@ -1229,11 +1229,11 @@ | ||
| 1229 | 1229 | @ </ol> |
| 1230 | 1230 | @ |
| 1231 | 1231 | @ <p>The default value is blank, meaning no added entries. |
| 1232 | 1232 | @ (Property: sitemap-extra) |
| 1233 | 1233 | @ <p> |
| 1234 | - textarea_attribute("Custom Sitemap Entries", 8, 80, | |
| 1234 | + textarea_attribute("Custom Sitemap Entries", 8, 80, | |
| 1235 | 1235 | "sitemap-extra", "smextra", "", 0); |
| 1236 | 1236 | @ <hr> |
| 1237 | 1237 | @ <p><input type="submit" name="submit" value="Apply Changes"></p> |
| 1238 | 1238 | @ </div></form> |
| 1239 | 1239 | db_end_transaction(0); |
| 1240 | 1240 |
| --- src/setup.c | |
| +++ src/setup.c | |
| @@ -588,11 +588,11 @@ | |
| 588 | @ <hr> |
| 589 | entry_attribute("Public pages", 30, "public-pages", |
| 590 | "pubpage", "", 0); |
| 591 | @ <p>A comma-separated list of glob patterns for pages that are accessible |
| 592 | @ without needing a login and using the privileges given by the |
| 593 | @ "Default privileges" setting below. |
| 594 | @ |
| 595 | @ <p>Example use case: Set this field to "/doc/trunk/www/*" and set |
| 596 | @ the "Default privileges" to include the "o" privilege |
| 597 | @ to give anonymous users read-only permission to the |
| 598 | @ latest version of the embedded documentation in the www/ folder without |
| @@ -1201,11 +1201,11 @@ | |
| 1201 | @ <p> |
| 1202 | if(P("resetMenu")!=0){ |
| 1203 | db_unset("mainmenu", 0); |
| 1204 | cgi_delete_parameter("mmenu"); |
| 1205 | } |
| 1206 | textarea_attribute("Main Menu", 12, 80, |
| 1207 | "mainmenu", "mmenu", style_default_mainmenu(), 0); |
| 1208 | @ </p> |
| 1209 | @ <p><input type='checkbox' id='cbResetMenu' name='resetMenu' value='1'> |
| 1210 | @ <label for='cbResetMenu'>Reset menu to default value</label> |
| 1211 | @ </p> |
| @@ -1229,11 +1229,11 @@ | |
| 1229 | @ </ol> |
| 1230 | @ |
| 1231 | @ <p>The default value is blank, meaning no added entries. |
| 1232 | @ (Property: sitemap-extra) |
| 1233 | @ <p> |
| 1234 | textarea_attribute("Custom Sitemap Entries", 8, 80, |
| 1235 | "sitemap-extra", "smextra", "", 0); |
| 1236 | @ <hr> |
| 1237 | @ <p><input type="submit" name="submit" value="Apply Changes"></p> |
| 1238 | @ </div></form> |
| 1239 | db_end_transaction(0); |
| 1240 |
| --- src/setup.c | |
| +++ src/setup.c | |
| @@ -588,11 +588,11 @@ | |
| 588 | @ <hr> |
| 589 | entry_attribute("Public pages", 30, "public-pages", |
| 590 | "pubpage", "", 0); |
| 591 | @ <p>A comma-separated list of glob patterns for pages that are accessible |
| 592 | @ without needing a login and using the privileges given by the |
| 593 | @ "Default privileges" setting below. |
| 594 | @ |
| 595 | @ <p>Example use case: Set this field to "/doc/trunk/www/*" and set |
| 596 | @ the "Default privileges" to include the "o" privilege |
| 597 | @ to give anonymous users read-only permission to the |
| 598 | @ latest version of the embedded documentation in the www/ folder without |
| @@ -1201,11 +1201,11 @@ | |
| 1201 | @ <p> |
| 1202 | if(P("resetMenu")!=0){ |
| 1203 | db_unset("mainmenu", 0); |
| 1204 | cgi_delete_parameter("mmenu"); |
| 1205 | } |
| 1206 | textarea_attribute("Main Menu", 12, 80, |
| 1207 | "mainmenu", "mmenu", style_default_mainmenu(), 0); |
| 1208 | @ </p> |
| 1209 | @ <p><input type='checkbox' id='cbResetMenu' name='resetMenu' value='1'> |
| 1210 | @ <label for='cbResetMenu'>Reset menu to default value</label> |
| 1211 | @ </p> |
| @@ -1229,11 +1229,11 @@ | |
| 1229 | @ </ol> |
| 1230 | @ |
| 1231 | @ <p>The default value is blank, meaning no added entries. |
| 1232 | @ (Property: sitemap-extra) |
| 1233 | @ <p> |
| 1234 | textarea_attribute("Custom Sitemap Entries", 8, 80, |
| 1235 | "sitemap-extra", "smextra", "", 0); |
| 1236 | @ <hr> |
| 1237 | @ <p><input type="submit" name="submit" value="Apply Changes"></p> |
| 1238 | @ </div></form> |
| 1239 | db_end_transaction(0); |
| 1240 |
+1
-1
| --- src/setupuser.c | ||
| +++ src/setupuser.c | ||
| @@ -810,11 +810,11 @@ | ||
| 810 | 810 | @ are inherited by all logged-in users. |
| 811 | 811 | @ </p></li> |
| 812 | 812 | @ |
| 813 | 813 | @ <li><p> |
| 814 | 814 | @ The "<span class="ueditInheritDeveloper"><sub>D</sub></span>" |
| 815 | - @ subscript suffix indicates the privileges of | |
| 815 | + @ subscript suffix indicates the privileges of | |
| 816 | 816 | @ <span class="usertype">developer</span> that |
| 817 | 817 | @ are inherited by all users with the |
| 818 | 818 | @ <span class="capability">Developer</span> privilege. |
| 819 | 819 | @ </p></li> |
| 820 | 820 | @ |
| 821 | 821 |
| --- src/setupuser.c | |
| +++ src/setupuser.c | |
| @@ -810,11 +810,11 @@ | |
| 810 | @ are inherited by all logged-in users. |
| 811 | @ </p></li> |
| 812 | @ |
| 813 | @ <li><p> |
| 814 | @ The "<span class="ueditInheritDeveloper"><sub>D</sub></span>" |
| 815 | @ subscript suffix indicates the privileges of |
| 816 | @ <span class="usertype">developer</span> that |
| 817 | @ are inherited by all users with the |
| 818 | @ <span class="capability">Developer</span> privilege. |
| 819 | @ </p></li> |
| 820 | @ |
| 821 |
| --- src/setupuser.c | |
| +++ src/setupuser.c | |
| @@ -810,11 +810,11 @@ | |
| 810 | @ are inherited by all logged-in users. |
| 811 | @ </p></li> |
| 812 | @ |
| 813 | @ <li><p> |
| 814 | @ The "<span class="ueditInheritDeveloper"><sub>D</sub></span>" |
| 815 | @ subscript suffix indicates the privileges of |
| 816 | @ <span class="usertype">developer</span> that |
| 817 | @ are inherited by all users with the |
| 818 | @ <span class="capability">Developer</span> privilege. |
| 819 | @ </p></li> |
| 820 | @ |
| 821 |
+2
-1
| --- src/sha1.c | ||
| +++ src/sha1.c | ||
| @@ -32,11 +32,12 @@ | ||
| 32 | 32 | ** and makeheaders. |
| 33 | 33 | */ |
| 34 | 34 | #if FOSSIL_HARDENED_SHA1 |
| 35 | 35 | |
| 36 | 36 | #if INTERFACE |
| 37 | -typedef void(*collision_block_callback)(uint64_t, const uint32_t*, const uint32_t*, const uint32_t*, const uint32_t*); | |
| 37 | +typedef void(*collision_block_callback)(uint64_t, const uint32_t*, | |
| 38 | + const uint32_t*, const uint32_t*, const uint32_t*); | |
| 38 | 39 | struct SHA1_CTX { |
| 39 | 40 | uint64_t total; |
| 40 | 41 | uint32_t ihv[5]; |
| 41 | 42 | unsigned char buffer[64]; |
| 42 | 43 | int bigendian; |
| 43 | 44 |
| --- src/sha1.c | |
| +++ src/sha1.c | |
| @@ -32,11 +32,12 @@ | |
| 32 | ** and makeheaders. |
| 33 | */ |
| 34 | #if FOSSIL_HARDENED_SHA1 |
| 35 | |
| 36 | #if INTERFACE |
| 37 | typedef void(*collision_block_callback)(uint64_t, const uint32_t*, const uint32_t*, const uint32_t*, const uint32_t*); |
| 38 | struct SHA1_CTX { |
| 39 | uint64_t total; |
| 40 | uint32_t ihv[5]; |
| 41 | unsigned char buffer[64]; |
| 42 | int bigendian; |
| 43 |
| --- src/sha1.c | |
| +++ src/sha1.c | |
| @@ -32,11 +32,12 @@ | |
| 32 | ** and makeheaders. |
| 33 | */ |
| 34 | #if FOSSIL_HARDENED_SHA1 |
| 35 | |
| 36 | #if INTERFACE |
| 37 | typedef void(*collision_block_callback)(uint64_t, const uint32_t*, |
| 38 | const uint32_t*, const uint32_t*, const uint32_t*); |
| 39 | struct SHA1_CTX { |
| 40 | uint64_t total; |
| 41 | uint32_t ihv[5]; |
| 42 | unsigned char buffer[64]; |
| 43 | int bigendian; |
| 44 |
+2
-2
| --- src/sitemap.c | ||
| +++ src/sitemap.c | ||
| @@ -81,11 +81,11 @@ | ||
| 81 | 81 | srchFlags = search_restrict(SRCH_ALL); |
| 82 | 82 | if( !isPopup ){ |
| 83 | 83 | style_header("Site Map"); |
| 84 | 84 | style_adunit_config(ADUNIT_RIGHT_OK); |
| 85 | 85 | } |
| 86 | - | |
| 86 | + | |
| 87 | 87 | @ <ul id="sitemap" class="columns" style="column-width:20em"> |
| 88 | 88 | if( (e&1)==0 ){ |
| 89 | 89 | @ <li>%z(href("%R/home"))Home Page</a> |
| 90 | 90 | } |
| 91 | 91 | |
| @@ -152,11 +152,11 @@ | ||
| 152 | 152 | } |
| 153 | 153 | #endif |
| 154 | 154 | |
| 155 | 155 | if( inSublist ){ |
| 156 | 156 | @ </ul> |
| 157 | - inSublist = 0; | |
| 157 | + inSublist = 0; | |
| 158 | 158 | } |
| 159 | 159 | @ </li> |
| 160 | 160 | if( g.perm.Read ){ |
| 161 | 161 | const char *zEditGlob = db_get("fileedit-glob",""); |
| 162 | 162 | @ <li>%z(href("%R/tree"))File Browser</a> |
| 163 | 163 |
| --- src/sitemap.c | |
| +++ src/sitemap.c | |
| @@ -81,11 +81,11 @@ | |
| 81 | srchFlags = search_restrict(SRCH_ALL); |
| 82 | if( !isPopup ){ |
| 83 | style_header("Site Map"); |
| 84 | style_adunit_config(ADUNIT_RIGHT_OK); |
| 85 | } |
| 86 | |
| 87 | @ <ul id="sitemap" class="columns" style="column-width:20em"> |
| 88 | if( (e&1)==0 ){ |
| 89 | @ <li>%z(href("%R/home"))Home Page</a> |
| 90 | } |
| 91 | |
| @@ -152,11 +152,11 @@ | |
| 152 | } |
| 153 | #endif |
| 154 | |
| 155 | if( inSublist ){ |
| 156 | @ </ul> |
| 157 | inSublist = 0; |
| 158 | } |
| 159 | @ </li> |
| 160 | if( g.perm.Read ){ |
| 161 | const char *zEditGlob = db_get("fileedit-glob",""); |
| 162 | @ <li>%z(href("%R/tree"))File Browser</a> |
| 163 |
| --- src/sitemap.c | |
| +++ src/sitemap.c | |
| @@ -81,11 +81,11 @@ | |
| 81 | srchFlags = search_restrict(SRCH_ALL); |
| 82 | if( !isPopup ){ |
| 83 | style_header("Site Map"); |
| 84 | style_adunit_config(ADUNIT_RIGHT_OK); |
| 85 | } |
| 86 | |
| 87 | @ <ul id="sitemap" class="columns" style="column-width:20em"> |
| 88 | if( (e&1)==0 ){ |
| 89 | @ <li>%z(href("%R/home"))Home Page</a> |
| 90 | } |
| 91 | |
| @@ -152,11 +152,11 @@ | |
| 152 | } |
| 153 | #endif |
| 154 | |
| 155 | if( inSublist ){ |
| 156 | @ </ul> |
| 157 | inSublist = 0; |
| 158 | } |
| 159 | @ </li> |
| 160 | if( g.perm.Read ){ |
| 161 | const char *zEditGlob = db_get("fileedit-glob",""); |
| 162 | @ <li>%z(href("%R/tree"))File Browser</a> |
| 163 |
+2
-2
| --- src/skins.c | ||
| +++ src/skins.c | ||
| @@ -885,11 +885,11 @@ | ||
| 885 | 885 | DCfg.diffFlags |= DIFF_STRIP_EOLCR; |
| 886 | 886 | if( P("sbsdiff")!=0 ) DCfg.diffFlags |= DIFF_SIDEBYSIDE; |
| 887 | 887 | blob_init(&to, zContent, -1); |
| 888 | 888 | blob_init(&from, skin_file_content(zBasis, zFile), -1); |
| 889 | 889 | blob_zero(&out); |
| 890 | - DCfg.diffFlags |= DIFF_HTML | DIFF_NOTTOOBIG; | |
| 890 | + DCfg.diffFlags |= DIFF_HTML | DIFF_NOTTOOBIG; | |
| 891 | 891 | if( DCfg.diffFlags & DIFF_SIDEBYSIDE ){ |
| 892 | 892 | text_diff(&from, &to, &out, &DCfg); |
| 893 | 893 | @ %s(blob_str(&out)) |
| 894 | 894 | }else{ |
| 895 | 895 | DCfg.diffFlags |= DIFF_LINENO; |
| @@ -1206,11 +1206,11 @@ | ||
| 1206 | 1206 | if( sqlite3_strglob(zPattern, zBase)==0 ){ |
| 1207 | 1207 | nBase -= strlen(zPattern)-1; |
| 1208 | 1208 | zBase[nBase] = 0; |
| 1209 | 1209 | } |
| 1210 | 1210 | fossil_free(zPattern); |
| 1211 | - } | |
| 1211 | + } | |
| 1212 | 1212 | login_check_credentials(); |
| 1213 | 1213 | style_header("Skins"); |
| 1214 | 1214 | if( iDraftSkin || nSkinRank<=1 ){ |
| 1215 | 1215 | @ <p class="warning">Warning: |
| 1216 | 1216 | if( iDraftSkin>0 ){ |
| 1217 | 1217 |
| --- src/skins.c | |
| +++ src/skins.c | |
| @@ -885,11 +885,11 @@ | |
| 885 | DCfg.diffFlags |= DIFF_STRIP_EOLCR; |
| 886 | if( P("sbsdiff")!=0 ) DCfg.diffFlags |= DIFF_SIDEBYSIDE; |
| 887 | blob_init(&to, zContent, -1); |
| 888 | blob_init(&from, skin_file_content(zBasis, zFile), -1); |
| 889 | blob_zero(&out); |
| 890 | DCfg.diffFlags |= DIFF_HTML | DIFF_NOTTOOBIG; |
| 891 | if( DCfg.diffFlags & DIFF_SIDEBYSIDE ){ |
| 892 | text_diff(&from, &to, &out, &DCfg); |
| 893 | @ %s(blob_str(&out)) |
| 894 | }else{ |
| 895 | DCfg.diffFlags |= DIFF_LINENO; |
| @@ -1206,11 +1206,11 @@ | |
| 1206 | if( sqlite3_strglob(zPattern, zBase)==0 ){ |
| 1207 | nBase -= strlen(zPattern)-1; |
| 1208 | zBase[nBase] = 0; |
| 1209 | } |
| 1210 | fossil_free(zPattern); |
| 1211 | } |
| 1212 | login_check_credentials(); |
| 1213 | style_header("Skins"); |
| 1214 | if( iDraftSkin || nSkinRank<=1 ){ |
| 1215 | @ <p class="warning">Warning: |
| 1216 | if( iDraftSkin>0 ){ |
| 1217 |
| --- src/skins.c | |
| +++ src/skins.c | |
| @@ -885,11 +885,11 @@ | |
| 885 | DCfg.diffFlags |= DIFF_STRIP_EOLCR; |
| 886 | if( P("sbsdiff")!=0 ) DCfg.diffFlags |= DIFF_SIDEBYSIDE; |
| 887 | blob_init(&to, zContent, -1); |
| 888 | blob_init(&from, skin_file_content(zBasis, zFile), -1); |
| 889 | blob_zero(&out); |
| 890 | DCfg.diffFlags |= DIFF_HTML | DIFF_NOTTOOBIG; |
| 891 | if( DCfg.diffFlags & DIFF_SIDEBYSIDE ){ |
| 892 | text_diff(&from, &to, &out, &DCfg); |
| 893 | @ %s(blob_str(&out)) |
| 894 | }else{ |
| 895 | DCfg.diffFlags |= DIFF_LINENO; |
| @@ -1206,11 +1206,11 @@ | |
| 1206 | if( sqlite3_strglob(zPattern, zBase)==0 ){ |
| 1207 | nBase -= strlen(zPattern)-1; |
| 1208 | zBase[nBase] = 0; |
| 1209 | } |
| 1210 | fossil_free(zPattern); |
| 1211 | } |
| 1212 | login_check_credentials(); |
| 1213 | style_header("Skins"); |
| 1214 | if( iDraftSkin || nSkinRank<=1 ){ |
| 1215 | @ <p class="warning">Warning: |
| 1216 | if( iDraftSkin>0 ){ |
| 1217 |
+2
-2
| --- src/smtp.c | ||
| +++ src/smtp.c | ||
| @@ -19,12 +19,12 @@ | ||
| 19 | 19 | ** to RFC 5321. |
| 20 | 20 | */ |
| 21 | 21 | #include "config.h" |
| 22 | 22 | #include "smtp.h" |
| 23 | 23 | #include <assert.h> |
| 24 | -#if (HAVE_DN_EXPAND || HAVE___NS_NAME_UNCOMPRESS || HAVE_NS_NAME_UNCOMPRESS) && \ | |
| 25 | - (HAVE_NS_PARSERR || HAVE___NS_PARSERR) && !defined(FOSSIL_OMIT_DNS) | |
| 24 | +#if (HAVE_DN_EXPAND || HAVE___NS_NAME_UNCOMPRESS || HAVE_NS_NAME_UNCOMPRESS) \ | |
| 25 | + && (HAVE_NS_PARSERR || HAVE___NS_PARSERR) && !defined(FOSSIL_OMIT_DNS) | |
| 26 | 26 | # include <sys/types.h> |
| 27 | 27 | # include <netinet/in.h> |
| 28 | 28 | # if defined(HAVE_BIND_RESOLV_H) |
| 29 | 29 | # include <bind/resolv.h> |
| 30 | 30 | # include <bind/arpa/nameser_compat.h> |
| 31 | 31 |
| --- src/smtp.c | |
| +++ src/smtp.c | |
| @@ -19,12 +19,12 @@ | |
| 19 | ** to RFC 5321. |
| 20 | */ |
| 21 | #include "config.h" |
| 22 | #include "smtp.h" |
| 23 | #include <assert.h> |
| 24 | #if (HAVE_DN_EXPAND || HAVE___NS_NAME_UNCOMPRESS || HAVE_NS_NAME_UNCOMPRESS) && \ |
| 25 | (HAVE_NS_PARSERR || HAVE___NS_PARSERR) && !defined(FOSSIL_OMIT_DNS) |
| 26 | # include <sys/types.h> |
| 27 | # include <netinet/in.h> |
| 28 | # if defined(HAVE_BIND_RESOLV_H) |
| 29 | # include <bind/resolv.h> |
| 30 | # include <bind/arpa/nameser_compat.h> |
| 31 |
| --- src/smtp.c | |
| +++ src/smtp.c | |
| @@ -19,12 +19,12 @@ | |
| 19 | ** to RFC 5321. |
| 20 | */ |
| 21 | #include "config.h" |
| 22 | #include "smtp.h" |
| 23 | #include <assert.h> |
| 24 | #if (HAVE_DN_EXPAND || HAVE___NS_NAME_UNCOMPRESS || HAVE_NS_NAME_UNCOMPRESS) \ |
| 25 | && (HAVE_NS_PARSERR || HAVE___NS_PARSERR) && !defined(FOSSIL_OMIT_DNS) |
| 26 | # include <sys/types.h> |
| 27 | # include <netinet/in.h> |
| 28 | # if defined(HAVE_BIND_RESOLV_H) |
| 29 | # include <bind/resolv.h> |
| 30 | # include <bind/arpa/nameser_compat.h> |
| 31 |
+1
-1
| --- src/sqlcmd.c | ||
| +++ src/sqlcmd.c | ||
| @@ -384,11 +384,11 @@ | ||
| 384 | 384 | ** |
| 385 | 385 | ** SELECT * FROM files_of_checkin('trunk'); |
| 386 | 386 | ** |
| 387 | 387 | ** helptext A virtual table with one row for each command, |
| 388 | 388 | ** webpage, and setting together with the built-in |
| 389 | -** help text. | |
| 389 | +** help text. | |
| 390 | 390 | ** |
| 391 | 391 | ** now() Return the number of seconds since 1970. |
| 392 | 392 | ** |
| 393 | 393 | ** obscure(T) Obfuscate the text password T so that its |
| 394 | 394 | ** original value is not readily visible. Fossil |
| 395 | 395 |
| --- src/sqlcmd.c | |
| +++ src/sqlcmd.c | |
| @@ -384,11 +384,11 @@ | |
| 384 | ** |
| 385 | ** SELECT * FROM files_of_checkin('trunk'); |
| 386 | ** |
| 387 | ** helptext A virtual table with one row for each command, |
| 388 | ** webpage, and setting together with the built-in |
| 389 | ** help text. |
| 390 | ** |
| 391 | ** now() Return the number of seconds since 1970. |
| 392 | ** |
| 393 | ** obscure(T) Obfuscate the text password T so that its |
| 394 | ** original value is not readily visible. Fossil |
| 395 |
| --- src/sqlcmd.c | |
| +++ src/sqlcmd.c | |
| @@ -384,11 +384,11 @@ | |
| 384 | ** |
| 385 | ** SELECT * FROM files_of_checkin('trunk'); |
| 386 | ** |
| 387 | ** helptext A virtual table with one row for each command, |
| 388 | ** webpage, and setting together with the built-in |
| 389 | ** help text. |
| 390 | ** |
| 391 | ** now() Return the number of seconds since 1970. |
| 392 | ** |
| 393 | ** obscure(T) Obfuscate the text password T so that its |
| 394 | ** original value is not readily visible. Fossil |
| 395 |
+12
-12
| --- src/stat.c | ||
| +++ src/stat.c | ||
| @@ -557,11 +557,11 @@ | ||
| 557 | 557 | @ <td><nobr>%h(db_column_text(&q,1))</nobr></td></tr> |
| 558 | 558 | } |
| 559 | 559 | cnt++; |
| 560 | 560 | } |
| 561 | 561 | db_finalize(&q); |
| 562 | - | |
| 562 | + | |
| 563 | 563 | if( nOmitted ){ |
| 564 | 564 | @ <tr><td><a href="urllist?all"><i>Show %d(nOmitted) more...</i></a> |
| 565 | 565 | } |
| 566 | 566 | if( cnt ){ |
| 567 | 567 | @ </table> |
| @@ -715,11 +715,11 @@ | ||
| 715 | 715 | Blob sql; |
| 716 | 716 | const char *zArg = P("n"); |
| 717 | 717 | login_check_credentials(); |
| 718 | 718 | if( !g.perm.Admin ){ login_needed(0); return; } |
| 719 | 719 | |
| 720 | - if( zArg!=0 | |
| 720 | + if( zArg!=0 | |
| 721 | 721 | && db_table_exists("repository",zArg) |
| 722 | 722 | && cgi_csrf_safe(1) |
| 723 | 723 | ){ |
| 724 | 724 | if( P("analyze")!=0 ){ |
| 725 | 725 | db_multi_exec("ANALYZE \"%w\"", zArg); |
| @@ -934,11 +934,11 @@ | ||
| 934 | 934 | ** Gather statistics on artifact types, counts, and sizes. |
| 935 | 935 | ** |
| 936 | 936 | ** Only populate the artstat.atype field if the bWithTypes parameter is true. |
| 937 | 937 | */ |
| 938 | 938 | void gather_artifact_stats(int bWithTypes){ |
| 939 | - static const char zSql[] = | |
| 939 | + static const char zSql[] = | |
| 940 | 940 | @ CREATE TEMP TABLE artstat( |
| 941 | 941 | @ id INTEGER PRIMARY KEY, -- Corresponds to BLOB.RID |
| 942 | 942 | @ atype TEXT, -- 'data', 'manifest', 'tag', 'wiki', etc. |
| 943 | 943 | @ isDelta BOOLEAN, -- true if stored as a delta |
| 944 | 944 | @ szExp, -- expanded, uncompressed size |
| @@ -949,46 +949,46 @@ | ||
| 949 | 949 | @ delta.rid IS NOT NULL, |
| 950 | 950 | @ size, octet_length(content) |
| 951 | 951 | @ FROM blob LEFT JOIN delta ON blob.rid=delta.rid |
| 952 | 952 | @ WHERE content IS NOT NULL; |
| 953 | 953 | ; |
| 954 | - static const char zSql2[] = | |
| 954 | + static const char zSql2[] = | |
| 955 | 955 | @ UPDATE artstat SET atype='file' |
| 956 | 956 | @ WHERE +id IN (SELECT fid FROM mlink); |
| 957 | 957 | @ UPDATE artstat SET atype='manifest' |
| 958 | 958 | @ WHERE id IN (SELECT objid FROM event WHERE type='ci') AND atype IS NULL; |
| 959 | 959 | @ UPDATE artstat SET atype='forum' |
| 960 | 960 | @ WHERE id IN (SELECT objid FROM event WHERE type='f') AND atype IS NULL; |
| 961 | 961 | @ UPDATE artstat SET atype='cluster' |
| 962 | - @ WHERE atype IS NULL | |
| 962 | + @ WHERE atype IS NULL | |
| 963 | 963 | @ AND id IN (SELECT rid FROM tagxref |
| 964 | 964 | @ WHERE tagid=(SELECT tagid FROM tag |
| 965 | 965 | @ WHERE tagname='cluster')); |
| 966 | 966 | @ UPDATE artstat SET atype='ticket' |
| 967 | - @ WHERE atype IS NULL | |
| 967 | + @ WHERE atype IS NULL | |
| 968 | 968 | @ AND id IN (SELECT rid FROM tagxref |
| 969 | 969 | @ WHERE tagid IN (SELECT tagid FROM tag |
| 970 | 970 | @ WHERE tagname GLOB 'tkt-*')); |
| 971 | 971 | @ UPDATE artstat SET atype='wiki' |
| 972 | - @ WHERE atype IS NULL | |
| 972 | + @ WHERE atype IS NULL | |
| 973 | 973 | @ AND id IN (SELECT rid FROM tagxref |
| 974 | 974 | @ WHERE tagid IN (SELECT tagid FROM tag |
| 975 | 975 | @ WHERE tagname GLOB 'wiki-*')); |
| 976 | 976 | @ UPDATE artstat SET atype='technote' |
| 977 | - @ WHERE atype IS NULL | |
| 977 | + @ WHERE atype IS NULL | |
| 978 | 978 | @ AND id IN (SELECT rid FROM tagxref |
| 979 | 979 | @ WHERE tagid IN (SELECT tagid FROM tag |
| 980 | 980 | @ WHERE tagname GLOB 'event-*')); |
| 981 | 981 | @ UPDATE artstat SET atype='attachment' |
| 982 | - @ WHERE atype IS NULL | |
| 983 | - @ AND id IN (SELECT attachid FROM attachment UNION | |
| 982 | + @ WHERE atype IS NULL | |
| 983 | + @ AND id IN (SELECT attachid FROM attachment UNION | |
| 984 | 984 | @ SELECT blob.rid FROM attachment JOIN blob ON uuid=src); |
| 985 | 985 | @ UPDATE artstat SET atype='tag' |
| 986 | - @ WHERE atype IS NULL | |
| 986 | + @ WHERE atype IS NULL | |
| 987 | 987 | @ AND id IN (SELECT srcid FROM tagxref); |
| 988 | 988 | @ UPDATE artstat SET atype='tag' |
| 989 | - @ WHERE atype IS NULL | |
| 989 | + @ WHERE atype IS NULL | |
| 990 | 990 | @ AND id IN (SELECT objid FROM event WHERE type='g'); |
| 991 | 991 | @ UPDATE artstat SET atype='unused' WHERE atype IS NULL; |
| 992 | 992 | ; |
| 993 | 993 | db_multi_exec("%s", zSql/*safe-for-%s*/); |
| 994 | 994 | if( bWithTypes ){ |
| 995 | 995 |
| --- src/stat.c | |
| +++ src/stat.c | |
| @@ -557,11 +557,11 @@ | |
| 557 | @ <td><nobr>%h(db_column_text(&q,1))</nobr></td></tr> |
| 558 | } |
| 559 | cnt++; |
| 560 | } |
| 561 | db_finalize(&q); |
| 562 | |
| 563 | if( nOmitted ){ |
| 564 | @ <tr><td><a href="urllist?all"><i>Show %d(nOmitted) more...</i></a> |
| 565 | } |
| 566 | if( cnt ){ |
| 567 | @ </table> |
| @@ -715,11 +715,11 @@ | |
| 715 | Blob sql; |
| 716 | const char *zArg = P("n"); |
| 717 | login_check_credentials(); |
| 718 | if( !g.perm.Admin ){ login_needed(0); return; } |
| 719 | |
| 720 | if( zArg!=0 |
| 721 | && db_table_exists("repository",zArg) |
| 722 | && cgi_csrf_safe(1) |
| 723 | ){ |
| 724 | if( P("analyze")!=0 ){ |
| 725 | db_multi_exec("ANALYZE \"%w\"", zArg); |
| @@ -934,11 +934,11 @@ | |
| 934 | ** Gather statistics on artifact types, counts, and sizes. |
| 935 | ** |
| 936 | ** Only populate the artstat.atype field if the bWithTypes parameter is true. |
| 937 | */ |
| 938 | void gather_artifact_stats(int bWithTypes){ |
| 939 | static const char zSql[] = |
| 940 | @ CREATE TEMP TABLE artstat( |
| 941 | @ id INTEGER PRIMARY KEY, -- Corresponds to BLOB.RID |
| 942 | @ atype TEXT, -- 'data', 'manifest', 'tag', 'wiki', etc. |
| 943 | @ isDelta BOOLEAN, -- true if stored as a delta |
| 944 | @ szExp, -- expanded, uncompressed size |
| @@ -949,46 +949,46 @@ | |
| 949 | @ delta.rid IS NOT NULL, |
| 950 | @ size, octet_length(content) |
| 951 | @ FROM blob LEFT JOIN delta ON blob.rid=delta.rid |
| 952 | @ WHERE content IS NOT NULL; |
| 953 | ; |
| 954 | static const char zSql2[] = |
| 955 | @ UPDATE artstat SET atype='file' |
| 956 | @ WHERE +id IN (SELECT fid FROM mlink); |
| 957 | @ UPDATE artstat SET atype='manifest' |
| 958 | @ WHERE id IN (SELECT objid FROM event WHERE type='ci') AND atype IS NULL; |
| 959 | @ UPDATE artstat SET atype='forum' |
| 960 | @ WHERE id IN (SELECT objid FROM event WHERE type='f') AND atype IS NULL; |
| 961 | @ UPDATE artstat SET atype='cluster' |
| 962 | @ WHERE atype IS NULL |
| 963 | @ AND id IN (SELECT rid FROM tagxref |
| 964 | @ WHERE tagid=(SELECT tagid FROM tag |
| 965 | @ WHERE tagname='cluster')); |
| 966 | @ UPDATE artstat SET atype='ticket' |
| 967 | @ WHERE atype IS NULL |
| 968 | @ AND id IN (SELECT rid FROM tagxref |
| 969 | @ WHERE tagid IN (SELECT tagid FROM tag |
| 970 | @ WHERE tagname GLOB 'tkt-*')); |
| 971 | @ UPDATE artstat SET atype='wiki' |
| 972 | @ WHERE atype IS NULL |
| 973 | @ AND id IN (SELECT rid FROM tagxref |
| 974 | @ WHERE tagid IN (SELECT tagid FROM tag |
| 975 | @ WHERE tagname GLOB 'wiki-*')); |
| 976 | @ UPDATE artstat SET atype='technote' |
| 977 | @ WHERE atype IS NULL |
| 978 | @ AND id IN (SELECT rid FROM tagxref |
| 979 | @ WHERE tagid IN (SELECT tagid FROM tag |
| 980 | @ WHERE tagname GLOB 'event-*')); |
| 981 | @ UPDATE artstat SET atype='attachment' |
| 982 | @ WHERE atype IS NULL |
| 983 | @ AND id IN (SELECT attachid FROM attachment UNION |
| 984 | @ SELECT blob.rid FROM attachment JOIN blob ON uuid=src); |
| 985 | @ UPDATE artstat SET atype='tag' |
| 986 | @ WHERE atype IS NULL |
| 987 | @ AND id IN (SELECT srcid FROM tagxref); |
| 988 | @ UPDATE artstat SET atype='tag' |
| 989 | @ WHERE atype IS NULL |
| 990 | @ AND id IN (SELECT objid FROM event WHERE type='g'); |
| 991 | @ UPDATE artstat SET atype='unused' WHERE atype IS NULL; |
| 992 | ; |
| 993 | db_multi_exec("%s", zSql/*safe-for-%s*/); |
| 994 | if( bWithTypes ){ |
| 995 |
| --- src/stat.c | |
| +++ src/stat.c | |
| @@ -557,11 +557,11 @@ | |
| 557 | @ <td><nobr>%h(db_column_text(&q,1))</nobr></td></tr> |
| 558 | } |
| 559 | cnt++; |
| 560 | } |
| 561 | db_finalize(&q); |
| 562 | |
| 563 | if( nOmitted ){ |
| 564 | @ <tr><td><a href="urllist?all"><i>Show %d(nOmitted) more...</i></a> |
| 565 | } |
| 566 | if( cnt ){ |
| 567 | @ </table> |
| @@ -715,11 +715,11 @@ | |
| 715 | Blob sql; |
| 716 | const char *zArg = P("n"); |
| 717 | login_check_credentials(); |
| 718 | if( !g.perm.Admin ){ login_needed(0); return; } |
| 719 | |
| 720 | if( zArg!=0 |
| 721 | && db_table_exists("repository",zArg) |
| 722 | && cgi_csrf_safe(1) |
| 723 | ){ |
| 724 | if( P("analyze")!=0 ){ |
| 725 | db_multi_exec("ANALYZE \"%w\"", zArg); |
| @@ -934,11 +934,11 @@ | |
| 934 | ** Gather statistics on artifact types, counts, and sizes. |
| 935 | ** |
| 936 | ** Only populate the artstat.atype field if the bWithTypes parameter is true. |
| 937 | */ |
| 938 | void gather_artifact_stats(int bWithTypes){ |
| 939 | static const char zSql[] = |
| 940 | @ CREATE TEMP TABLE artstat( |
| 941 | @ id INTEGER PRIMARY KEY, -- Corresponds to BLOB.RID |
| 942 | @ atype TEXT, -- 'data', 'manifest', 'tag', 'wiki', etc. |
| 943 | @ isDelta BOOLEAN, -- true if stored as a delta |
| 944 | @ szExp, -- expanded, uncompressed size |
| @@ -949,46 +949,46 @@ | |
| 949 | @ delta.rid IS NOT NULL, |
| 950 | @ size, octet_length(content) |
| 951 | @ FROM blob LEFT JOIN delta ON blob.rid=delta.rid |
| 952 | @ WHERE content IS NOT NULL; |
| 953 | ; |
| 954 | static const char zSql2[] = |
| 955 | @ UPDATE artstat SET atype='file' |
| 956 | @ WHERE +id IN (SELECT fid FROM mlink); |
| 957 | @ UPDATE artstat SET atype='manifest' |
| 958 | @ WHERE id IN (SELECT objid FROM event WHERE type='ci') AND atype IS NULL; |
| 959 | @ UPDATE artstat SET atype='forum' |
| 960 | @ WHERE id IN (SELECT objid FROM event WHERE type='f') AND atype IS NULL; |
| 961 | @ UPDATE artstat SET atype='cluster' |
| 962 | @ WHERE atype IS NULL |
| 963 | @ AND id IN (SELECT rid FROM tagxref |
| 964 | @ WHERE tagid=(SELECT tagid FROM tag |
| 965 | @ WHERE tagname='cluster')); |
| 966 | @ UPDATE artstat SET atype='ticket' |
| 967 | @ WHERE atype IS NULL |
| 968 | @ AND id IN (SELECT rid FROM tagxref |
| 969 | @ WHERE tagid IN (SELECT tagid FROM tag |
| 970 | @ WHERE tagname GLOB 'tkt-*')); |
| 971 | @ UPDATE artstat SET atype='wiki' |
| 972 | @ WHERE atype IS NULL |
| 973 | @ AND id IN (SELECT rid FROM tagxref |
| 974 | @ WHERE tagid IN (SELECT tagid FROM tag |
| 975 | @ WHERE tagname GLOB 'wiki-*')); |
| 976 | @ UPDATE artstat SET atype='technote' |
| 977 | @ WHERE atype IS NULL |
| 978 | @ AND id IN (SELECT rid FROM tagxref |
| 979 | @ WHERE tagid IN (SELECT tagid FROM tag |
| 980 | @ WHERE tagname GLOB 'event-*')); |
| 981 | @ UPDATE artstat SET atype='attachment' |
| 982 | @ WHERE atype IS NULL |
| 983 | @ AND id IN (SELECT attachid FROM attachment UNION |
| 984 | @ SELECT blob.rid FROM attachment JOIN blob ON uuid=src); |
| 985 | @ UPDATE artstat SET atype='tag' |
| 986 | @ WHERE atype IS NULL |
| 987 | @ AND id IN (SELECT srcid FROM tagxref); |
| 988 | @ UPDATE artstat SET atype='tag' |
| 989 | @ WHERE atype IS NULL |
| 990 | @ AND id IN (SELECT objid FROM event WHERE type='g'); |
| 991 | @ UPDATE artstat SET atype='unused' WHERE atype IS NULL; |
| 992 | ; |
| 993 | db_multi_exec("%s", zSql/*safe-for-%s*/); |
| 994 | if( bWithTypes ){ |
| 995 |
+1
-1
| --- src/statrep.c | ||
| +++ src/statrep.c | ||
| @@ -130,11 +130,11 @@ | ||
| 130 | 130 | db_multi_exec( |
| 131 | 131 | "CREATE TEMP VIEW v_reports AS " |
| 132 | 132 | "SELECT * FROM event WHERE type='ci' AND %s" |
| 133 | 133 | " AND objid %s IN (SELECT cid FROM plink WHERE NOT isprim)", |
| 134 | 134 | zTimeSpan/*safe-for-%s*/, zNot/*safe-for-%s*/ |
| 135 | - ); | |
| 135 | + ); | |
| 136 | 136 | } |
| 137 | 137 | return statsReportType = rc; |
| 138 | 138 | } |
| 139 | 139 | |
| 140 | 140 | /* |
| 141 | 141 |
| --- src/statrep.c | |
| +++ src/statrep.c | |
| @@ -130,11 +130,11 @@ | |
| 130 | db_multi_exec( |
| 131 | "CREATE TEMP VIEW v_reports AS " |
| 132 | "SELECT * FROM event WHERE type='ci' AND %s" |
| 133 | " AND objid %s IN (SELECT cid FROM plink WHERE NOT isprim)", |
| 134 | zTimeSpan/*safe-for-%s*/, zNot/*safe-for-%s*/ |
| 135 | ); |
| 136 | } |
| 137 | return statsReportType = rc; |
| 138 | } |
| 139 | |
| 140 | /* |
| 141 |
| --- src/statrep.c | |
| +++ src/statrep.c | |
| @@ -130,11 +130,11 @@ | |
| 130 | db_multi_exec( |
| 131 | "CREATE TEMP VIEW v_reports AS " |
| 132 | "SELECT * FROM event WHERE type='ci' AND %s" |
| 133 | " AND objid %s IN (SELECT cid FROM plink WHERE NOT isprim)", |
| 134 | zTimeSpan/*safe-for-%s*/, zNot/*safe-for-%s*/ |
| 135 | ); |
| 136 | } |
| 137 | return statsReportType = rc; |
| 138 | } |
| 139 | |
| 140 | /* |
| 141 |
+13
-13
| --- src/style.c | ||
| +++ src/style.c | ||
| @@ -452,11 +452,11 @@ | ||
| 452 | 452 | blob_appendf(&url, "?id=%x", skin_id("css")); |
| 453 | 453 | if( P("once")!=0 && P("skin")!=0 ){ |
| 454 | 454 | blob_appendf(&url, "&skin=%s&once", skin_in_use()); |
| 455 | 455 | } |
| 456 | 456 | |
| 457 | - /* Generate the CSS URL variable */ | |
| 457 | + /* Generate the CSS URL variable */ | |
| 458 | 458 | Th_Store("stylesheet_url", blob_str(&url)); |
| 459 | 459 | blob_reset(&url); |
| 460 | 460 | } |
| 461 | 461 | |
| 462 | 462 | /* |
| @@ -472,11 +472,11 @@ | ||
| 472 | 472 | char *zUrl; /* The URL */ |
| 473 | 473 | |
| 474 | 474 | zResource = mprintf("%s-image", zImageName); |
| 475 | 475 | zUrl = mprintf("%R/%s?id=%x", zImageName, skin_id(zResource)); |
| 476 | 476 | free(zResource); |
| 477 | - zVarName = mprintf("%s_image_url", zImageName); | |
| 477 | + zVarName = mprintf("%s_image_url", zImageName); | |
| 478 | 478 | Th_Store(zVarName, zUrl); |
| 479 | 479 | free(zVarName); |
| 480 | 480 | free(zUrl); |
| 481 | 481 | } |
| 482 | 482 | |
| @@ -597,11 +597,11 @@ | ||
| 597 | 597 | ** |
| 598 | 598 | ** The string returned is obtained from fossil_malloc() and |
| 599 | 599 | ** should be released by the caller. |
| 600 | 600 | */ |
| 601 | 601 | char *style_csp(int toHeader){ |
| 602 | - static const char zBackupCSP[] = | |
| 602 | + static const char zBackupCSP[] = | |
| 603 | 603 | "default-src 'self' data:; " |
| 604 | 604 | "script-src 'self' 'nonce-$nonce'; " |
| 605 | 605 | "style-src 'self' 'unsafe-inline'; " |
| 606 | 606 | "img-src * data:"; |
| 607 | 607 | const char *zFormat; |
| @@ -633,11 +633,11 @@ | ||
| 633 | 633 | |
| 634 | 634 | /* |
| 635 | 635 | ** Disable content security policy for the current page. |
| 636 | 636 | ** WARNING: Do not do this lightly! |
| 637 | 637 | ** |
| 638 | -** This routine must be called before the CSP is sued by | |
| 638 | +** This routine must be called before the CSP is sued by | |
| 639 | 639 | ** style_header(). |
| 640 | 640 | */ |
| 641 | 641 | void style_disable_csp(void){ |
| 642 | 642 | disableCSP = 1; |
| 643 | 643 | } |
| @@ -645,11 +645,11 @@ | ||
| 645 | 645 | /* |
| 646 | 646 | ** Default HTML page header text through <body>. If the repository-specific |
| 647 | 647 | ** header template lacks a <body> tag, then all of the following is |
| 648 | 648 | ** prepended. |
| 649 | 649 | */ |
| 650 | -static const char zDfltHeader[] = | |
| 650 | +static const char zDfltHeader[] = | |
| 651 | 651 | @ <html> |
| 652 | 652 | @ <head> |
| 653 | 653 | @ <meta charset="UTF-8"> |
| 654 | 654 | @ <base href="$baseurl/$current_page"> |
| 655 | 655 | @ <meta http-equiv="Content-Security-Policy" content="$default_csp"> |
| @@ -670,11 +670,11 @@ | ||
| 670 | 670 | } |
| 671 | 671 | |
| 672 | 672 | /* |
| 673 | 673 | ** The default TCL list that defines the main menu. |
| 674 | 674 | */ |
| 675 | -static const char zDfltMainMenu[] = | |
| 675 | +static const char zDfltMainMenu[] = | |
| 676 | 676 | @ Home /home * {} |
| 677 | 677 | @ Timeline /timeline {o r j} {} |
| 678 | 678 | @ Files /dir?ci=tip oh desktoponly |
| 679 | 679 | @ Branches /brlist o wideonly |
| 680 | 680 | @ Tags /taglist o wideonly |
| @@ -795,12 +795,12 @@ | ||
| 795 | 795 | } |
| 796 | 796 | Th_MaybeStore("current_feature", feature_from_page_path(local_zCurrentPage) ); |
| 797 | 797 | if( g.ftntsIssues[0] || g.ftntsIssues[1] || |
| 798 | 798 | g.ftntsIssues[2] || g.ftntsIssues[3] ){ |
| 799 | 799 | char buf[80]; |
| 800 | - sqlite3_snprintf(sizeof(buf),buf,"%i %i %i %i",g.ftntsIssues[0],g.ftntsIssues[1], | |
| 801 | - g.ftntsIssues[2],g.ftntsIssues[3]); | |
| 800 | + sqlite3_snprintf(sizeof(buf), buf, "%i %i %i %i", g.ftntsIssues[0], | |
| 801 | + g.ftntsIssues[1], g.ftntsIssues[2], g.ftntsIssues[3]); | |
| 802 | 802 | Th_Store("footnotes_issues_counters", buf); |
| 803 | 803 | } |
| 804 | 804 | } |
| 805 | 805 | |
| 806 | 806 | /* |
| @@ -1285,11 +1285,11 @@ | ||
| 1285 | 1285 | ** * $home |
| 1286 | 1286 | ** * $logo |
| 1287 | 1287 | ** * $background |
| 1288 | 1288 | ** |
| 1289 | 1289 | ** The output from TH1 becomes the style sheet. Fossil always reports |
| 1290 | -** that the style sheet is cacheable. | |
| 1290 | +** that the style sheet is cacheable. | |
| 1291 | 1291 | */ |
| 1292 | 1292 | void page_style_css(void){ |
| 1293 | 1293 | Blob css = empty_blob; |
| 1294 | 1294 | int i; |
| 1295 | 1295 | const char * zDefaults; |
| @@ -1325,11 +1325,11 @@ | ||
| 1325 | 1325 | } |
| 1326 | 1326 | |
| 1327 | 1327 | /* |
| 1328 | 1328 | ** All possible capabilities |
| 1329 | 1329 | */ |
| 1330 | -static const char allCap[] = | |
| 1330 | +static const char allCap[] = | |
| 1331 | 1331 | "abcdefghijklmnopqrstuvwxyz0123456789ABCDEFGHIJKL"; |
| 1332 | 1332 | |
| 1333 | 1333 | /* |
| 1334 | 1334 | ** Compute the current login capabilities |
| 1335 | 1335 | */ |
| @@ -1479,11 +1479,11 @@ | ||
| 1479 | 1479 | default: { |
| 1480 | 1480 | @ CSRF safety = unsafe<br> |
| 1481 | 1481 | break; |
| 1482 | 1482 | } |
| 1483 | 1483 | } |
| 1484 | - | |
| 1484 | + | |
| 1485 | 1485 | @ fossil_exe_id() = %h(fossil_exe_id())<br> |
| 1486 | 1486 | if( g.perm.Admin ){ |
| 1487 | 1487 | int k; |
| 1488 | 1488 | for(k=0; g.argvOrig[k]; k++){ |
| 1489 | 1489 | Blob t; |
| @@ -1651,11 +1651,11 @@ | ||
| 1651 | 1651 | ** style_select_list_int("my-grapes", "my_grapes", "Grapes", |
| 1652 | 1652 | ** "Select the number of grapes", |
| 1653 | 1653 | ** atoi(PD("my_field","0")), |
| 1654 | 1654 | ** "", 1, "2", 2, "Three", 3, |
| 1655 | 1655 | ** NULL); |
| 1656 | -** | |
| 1656 | +** | |
| 1657 | 1657 | */ |
| 1658 | 1658 | void style_select_list_int(const char * zWrapperId, |
| 1659 | 1659 | const char *zFieldName, const char * zLabel, |
| 1660 | 1660 | const char * zToolTip, int selectedVal, |
| 1661 | 1661 | ... ){ |
| @@ -1775,11 +1775,11 @@ | ||
| 1775 | 1775 | } |
| 1776 | 1776 | } |
| 1777 | 1777 | CX("<script nonce='%s'>/* %s:%d */\n", style_nonce(), zOrigin, iLine); |
| 1778 | 1778 | } |
| 1779 | 1779 | |
| 1780 | -/* Generate the closing </script> tag | |
| 1780 | +/* Generate the closing </script> tag | |
| 1781 | 1781 | */ |
| 1782 | 1782 | void style_script_end(void){ |
| 1783 | 1783 | CX("</script>\n"); |
| 1784 | 1784 | } |
| 1785 | 1785 | |
| 1786 | 1786 |
| --- src/style.c | |
| +++ src/style.c | |
| @@ -452,11 +452,11 @@ | |
| 452 | blob_appendf(&url, "?id=%x", skin_id("css")); |
| 453 | if( P("once")!=0 && P("skin")!=0 ){ |
| 454 | blob_appendf(&url, "&skin=%s&once", skin_in_use()); |
| 455 | } |
| 456 | |
| 457 | /* Generate the CSS URL variable */ |
| 458 | Th_Store("stylesheet_url", blob_str(&url)); |
| 459 | blob_reset(&url); |
| 460 | } |
| 461 | |
| 462 | /* |
| @@ -472,11 +472,11 @@ | |
| 472 | char *zUrl; /* The URL */ |
| 473 | |
| 474 | zResource = mprintf("%s-image", zImageName); |
| 475 | zUrl = mprintf("%R/%s?id=%x", zImageName, skin_id(zResource)); |
| 476 | free(zResource); |
| 477 | zVarName = mprintf("%s_image_url", zImageName); |
| 478 | Th_Store(zVarName, zUrl); |
| 479 | free(zVarName); |
| 480 | free(zUrl); |
| 481 | } |
| 482 | |
| @@ -597,11 +597,11 @@ | |
| 597 | ** |
| 598 | ** The string returned is obtained from fossil_malloc() and |
| 599 | ** should be released by the caller. |
| 600 | */ |
| 601 | char *style_csp(int toHeader){ |
| 602 | static const char zBackupCSP[] = |
| 603 | "default-src 'self' data:; " |
| 604 | "script-src 'self' 'nonce-$nonce'; " |
| 605 | "style-src 'self' 'unsafe-inline'; " |
| 606 | "img-src * data:"; |
| 607 | const char *zFormat; |
| @@ -633,11 +633,11 @@ | |
| 633 | |
| 634 | /* |
| 635 | ** Disable content security policy for the current page. |
| 636 | ** WARNING: Do not do this lightly! |
| 637 | ** |
| 638 | ** This routine must be called before the CSP is sued by |
| 639 | ** style_header(). |
| 640 | */ |
| 641 | void style_disable_csp(void){ |
| 642 | disableCSP = 1; |
| 643 | } |
| @@ -645,11 +645,11 @@ | |
| 645 | /* |
| 646 | ** Default HTML page header text through <body>. If the repository-specific |
| 647 | ** header template lacks a <body> tag, then all of the following is |
| 648 | ** prepended. |
| 649 | */ |
| 650 | static const char zDfltHeader[] = |
| 651 | @ <html> |
| 652 | @ <head> |
| 653 | @ <meta charset="UTF-8"> |
| 654 | @ <base href="$baseurl/$current_page"> |
| 655 | @ <meta http-equiv="Content-Security-Policy" content="$default_csp"> |
| @@ -670,11 +670,11 @@ | |
| 670 | } |
| 671 | |
| 672 | /* |
| 673 | ** The default TCL list that defines the main menu. |
| 674 | */ |
| 675 | static const char zDfltMainMenu[] = |
| 676 | @ Home /home * {} |
| 677 | @ Timeline /timeline {o r j} {} |
| 678 | @ Files /dir?ci=tip oh desktoponly |
| 679 | @ Branches /brlist o wideonly |
| 680 | @ Tags /taglist o wideonly |
| @@ -795,12 +795,12 @@ | |
| 795 | } |
| 796 | Th_MaybeStore("current_feature", feature_from_page_path(local_zCurrentPage) ); |
| 797 | if( g.ftntsIssues[0] || g.ftntsIssues[1] || |
| 798 | g.ftntsIssues[2] || g.ftntsIssues[3] ){ |
| 799 | char buf[80]; |
| 800 | sqlite3_snprintf(sizeof(buf),buf,"%i %i %i %i",g.ftntsIssues[0],g.ftntsIssues[1], |
| 801 | g.ftntsIssues[2],g.ftntsIssues[3]); |
| 802 | Th_Store("footnotes_issues_counters", buf); |
| 803 | } |
| 804 | } |
| 805 | |
| 806 | /* |
| @@ -1285,11 +1285,11 @@ | |
| 1285 | ** * $home |
| 1286 | ** * $logo |
| 1287 | ** * $background |
| 1288 | ** |
| 1289 | ** The output from TH1 becomes the style sheet. Fossil always reports |
| 1290 | ** that the style sheet is cacheable. |
| 1291 | */ |
| 1292 | void page_style_css(void){ |
| 1293 | Blob css = empty_blob; |
| 1294 | int i; |
| 1295 | const char * zDefaults; |
| @@ -1325,11 +1325,11 @@ | |
| 1325 | } |
| 1326 | |
| 1327 | /* |
| 1328 | ** All possible capabilities |
| 1329 | */ |
| 1330 | static const char allCap[] = |
| 1331 | "abcdefghijklmnopqrstuvwxyz0123456789ABCDEFGHIJKL"; |
| 1332 | |
| 1333 | /* |
| 1334 | ** Compute the current login capabilities |
| 1335 | */ |
| @@ -1479,11 +1479,11 @@ | |
| 1479 | default: { |
| 1480 | @ CSRF safety = unsafe<br> |
| 1481 | break; |
| 1482 | } |
| 1483 | } |
| 1484 | |
| 1485 | @ fossil_exe_id() = %h(fossil_exe_id())<br> |
| 1486 | if( g.perm.Admin ){ |
| 1487 | int k; |
| 1488 | for(k=0; g.argvOrig[k]; k++){ |
| 1489 | Blob t; |
| @@ -1651,11 +1651,11 @@ | |
| 1651 | ** style_select_list_int("my-grapes", "my_grapes", "Grapes", |
| 1652 | ** "Select the number of grapes", |
| 1653 | ** atoi(PD("my_field","0")), |
| 1654 | ** "", 1, "2", 2, "Three", 3, |
| 1655 | ** NULL); |
| 1656 | ** |
| 1657 | */ |
| 1658 | void style_select_list_int(const char * zWrapperId, |
| 1659 | const char *zFieldName, const char * zLabel, |
| 1660 | const char * zToolTip, int selectedVal, |
| 1661 | ... ){ |
| @@ -1775,11 +1775,11 @@ | |
| 1775 | } |
| 1776 | } |
| 1777 | CX("<script nonce='%s'>/* %s:%d */\n", style_nonce(), zOrigin, iLine); |
| 1778 | } |
| 1779 | |
| 1780 | /* Generate the closing </script> tag |
| 1781 | */ |
| 1782 | void style_script_end(void){ |
| 1783 | CX("</script>\n"); |
| 1784 | } |
| 1785 | |
| 1786 |
| --- src/style.c | |
| +++ src/style.c | |
| @@ -452,11 +452,11 @@ | |
| 452 | blob_appendf(&url, "?id=%x", skin_id("css")); |
| 453 | if( P("once")!=0 && P("skin")!=0 ){ |
| 454 | blob_appendf(&url, "&skin=%s&once", skin_in_use()); |
| 455 | } |
| 456 | |
| 457 | /* Generate the CSS URL variable */ |
| 458 | Th_Store("stylesheet_url", blob_str(&url)); |
| 459 | blob_reset(&url); |
| 460 | } |
| 461 | |
| 462 | /* |
| @@ -472,11 +472,11 @@ | |
| 472 | char *zUrl; /* The URL */ |
| 473 | |
| 474 | zResource = mprintf("%s-image", zImageName); |
| 475 | zUrl = mprintf("%R/%s?id=%x", zImageName, skin_id(zResource)); |
| 476 | free(zResource); |
| 477 | zVarName = mprintf("%s_image_url", zImageName); |
| 478 | Th_Store(zVarName, zUrl); |
| 479 | free(zVarName); |
| 480 | free(zUrl); |
| 481 | } |
| 482 | |
| @@ -597,11 +597,11 @@ | |
| 597 | ** |
| 598 | ** The string returned is obtained from fossil_malloc() and |
| 599 | ** should be released by the caller. |
| 600 | */ |
| 601 | char *style_csp(int toHeader){ |
| 602 | static const char zBackupCSP[] = |
| 603 | "default-src 'self' data:; " |
| 604 | "script-src 'self' 'nonce-$nonce'; " |
| 605 | "style-src 'self' 'unsafe-inline'; " |
| 606 | "img-src * data:"; |
| 607 | const char *zFormat; |
| @@ -633,11 +633,11 @@ | |
| 633 | |
| 634 | /* |
| 635 | ** Disable content security policy for the current page. |
| 636 | ** WARNING: Do not do this lightly! |
| 637 | ** |
| 638 | ** This routine must be called before the CSP is sued by |
| 639 | ** style_header(). |
| 640 | */ |
| 641 | void style_disable_csp(void){ |
| 642 | disableCSP = 1; |
| 643 | } |
| @@ -645,11 +645,11 @@ | |
| 645 | /* |
| 646 | ** Default HTML page header text through <body>. If the repository-specific |
| 647 | ** header template lacks a <body> tag, then all of the following is |
| 648 | ** prepended. |
| 649 | */ |
| 650 | static const char zDfltHeader[] = |
| 651 | @ <html> |
| 652 | @ <head> |
| 653 | @ <meta charset="UTF-8"> |
| 654 | @ <base href="$baseurl/$current_page"> |
| 655 | @ <meta http-equiv="Content-Security-Policy" content="$default_csp"> |
| @@ -670,11 +670,11 @@ | |
| 670 | } |
| 671 | |
| 672 | /* |
| 673 | ** The default TCL list that defines the main menu. |
| 674 | */ |
| 675 | static const char zDfltMainMenu[] = |
| 676 | @ Home /home * {} |
| 677 | @ Timeline /timeline {o r j} {} |
| 678 | @ Files /dir?ci=tip oh desktoponly |
| 679 | @ Branches /brlist o wideonly |
| 680 | @ Tags /taglist o wideonly |
| @@ -795,12 +795,12 @@ | |
| 795 | } |
| 796 | Th_MaybeStore("current_feature", feature_from_page_path(local_zCurrentPage) ); |
| 797 | if( g.ftntsIssues[0] || g.ftntsIssues[1] || |
| 798 | g.ftntsIssues[2] || g.ftntsIssues[3] ){ |
| 799 | char buf[80]; |
| 800 | sqlite3_snprintf(sizeof(buf), buf, "%i %i %i %i", g.ftntsIssues[0], |
| 801 | g.ftntsIssues[1], g.ftntsIssues[2], g.ftntsIssues[3]); |
| 802 | Th_Store("footnotes_issues_counters", buf); |
| 803 | } |
| 804 | } |
| 805 | |
| 806 | /* |
| @@ -1285,11 +1285,11 @@ | |
| 1285 | ** * $home |
| 1286 | ** * $logo |
| 1287 | ** * $background |
| 1288 | ** |
| 1289 | ** The output from TH1 becomes the style sheet. Fossil always reports |
| 1290 | ** that the style sheet is cacheable. |
| 1291 | */ |
| 1292 | void page_style_css(void){ |
| 1293 | Blob css = empty_blob; |
| 1294 | int i; |
| 1295 | const char * zDefaults; |
| @@ -1325,11 +1325,11 @@ | |
| 1325 | } |
| 1326 | |
| 1327 | /* |
| 1328 | ** All possible capabilities |
| 1329 | */ |
| 1330 | static const char allCap[] = |
| 1331 | "abcdefghijklmnopqrstuvwxyz0123456789ABCDEFGHIJKL"; |
| 1332 | |
| 1333 | /* |
| 1334 | ** Compute the current login capabilities |
| 1335 | */ |
| @@ -1479,11 +1479,11 @@ | |
| 1479 | default: { |
| 1480 | @ CSRF safety = unsafe<br> |
| 1481 | break; |
| 1482 | } |
| 1483 | } |
| 1484 | |
| 1485 | @ fossil_exe_id() = %h(fossil_exe_id())<br> |
| 1486 | if( g.perm.Admin ){ |
| 1487 | int k; |
| 1488 | for(k=0; g.argvOrig[k]; k++){ |
| 1489 | Blob t; |
| @@ -1651,11 +1651,11 @@ | |
| 1651 | ** style_select_list_int("my-grapes", "my_grapes", "Grapes", |
| 1652 | ** "Select the number of grapes", |
| 1653 | ** atoi(PD("my_field","0")), |
| 1654 | ** "", 1, "2", 2, "Three", 3, |
| 1655 | ** NULL); |
| 1656 | ** |
| 1657 | */ |
| 1658 | void style_select_list_int(const char * zWrapperId, |
| 1659 | const char *zFieldName, const char * zLabel, |
| 1660 | const char * zToolTip, int selectedVal, |
| 1661 | ... ){ |
| @@ -1775,11 +1775,11 @@ | |
| 1775 | } |
| 1776 | } |
| 1777 | CX("<script nonce='%s'>/* %s:%d */\n", style_nonce(), zOrigin, iLine); |
| 1778 | } |
| 1779 | |
| 1780 | /* Generate the closing </script> tag |
| 1781 | */ |
| 1782 | void style_script_end(void){ |
| 1783 | CX("</script>\n"); |
| 1784 | } |
| 1785 | |
| 1786 |
+3
-3
| --- src/sync.c | ||
| +++ src/sync.c | ||
| @@ -128,11 +128,11 @@ | ||
| 128 | 128 | return 0; |
| 129 | 129 | } |
| 130 | 130 | zAutosync = db_get_for_subsystem("autosync", zSubsys); |
| 131 | 131 | if( zAutosync==0 ) zAutosync = "on"; /* defend against misconfig */ |
| 132 | 132 | if( is_false(zAutosync) ) return 0; |
| 133 | - if( db_get_boolean("dont-push",0) | |
| 133 | + if( db_get_boolean("dont-push",0) | |
| 134 | 134 | || sqlite3_strglob("*pull*", zAutosync)==0 |
| 135 | 135 | ){ |
| 136 | 136 | flags &= ~SYNC_CKIN_LOCK; |
| 137 | 137 | if( flags & SYNC_PUSH ) return 0; |
| 138 | 138 | } |
| @@ -533,11 +533,11 @@ | ||
| 533 | 533 | ** |
| 534 | 534 | ** Show all remote repository URLs. |
| 535 | 535 | ** |
| 536 | 536 | ** > fossil remote off |
| 537 | 537 | ** |
| 538 | -** Forget the default URL. This disables autosync. | |
| 538 | +** Forget the default URL. This disables autosync. | |
| 539 | 539 | ** |
| 540 | 540 | ** This is a convenient way to enter "airplane mode". To enter |
| 541 | 541 | ** airplane mode, first save the current default URL, then turn the |
| 542 | 542 | ** default off. Perhaps like this: |
| 543 | 543 | ** |
| @@ -595,11 +595,11 @@ | ||
| 595 | 595 | ** |
| 596 | 596 | ** The last-sync-url might be duplicated into one of the sync-url:NAME |
| 597 | 597 | ** entries. Thus, when doing a "fossil sync --all" or an autosync with |
| 598 | 598 | ** autosync=all, each sync-url:NAME entry is checked to see if it is the |
| 599 | 599 | ** same as last-sync-url and if it is then that entry is skipped. |
| 600 | - */ | |
| 600 | + */ | |
| 601 | 601 | |
| 602 | 602 | if( g.argc==2 ){ |
| 603 | 603 | /* "fossil remote" with no arguments: Show the last sync URL. */ |
| 604 | 604 | zUrl = db_get("last-sync-url", 0); |
| 605 | 605 | if( zUrl==0 ){ |
| 606 | 606 |
| --- src/sync.c | |
| +++ src/sync.c | |
| @@ -128,11 +128,11 @@ | |
| 128 | return 0; |
| 129 | } |
| 130 | zAutosync = db_get_for_subsystem("autosync", zSubsys); |
| 131 | if( zAutosync==0 ) zAutosync = "on"; /* defend against misconfig */ |
| 132 | if( is_false(zAutosync) ) return 0; |
| 133 | if( db_get_boolean("dont-push",0) |
| 134 | || sqlite3_strglob("*pull*", zAutosync)==0 |
| 135 | ){ |
| 136 | flags &= ~SYNC_CKIN_LOCK; |
| 137 | if( flags & SYNC_PUSH ) return 0; |
| 138 | } |
| @@ -533,11 +533,11 @@ | |
| 533 | ** |
| 534 | ** Show all remote repository URLs. |
| 535 | ** |
| 536 | ** > fossil remote off |
| 537 | ** |
| 538 | ** Forget the default URL. This disables autosync. |
| 539 | ** |
| 540 | ** This is a convenient way to enter "airplane mode". To enter |
| 541 | ** airplane mode, first save the current default URL, then turn the |
| 542 | ** default off. Perhaps like this: |
| 543 | ** |
| @@ -595,11 +595,11 @@ | |
| 595 | ** |
| 596 | ** The last-sync-url might be duplicated into one of the sync-url:NAME |
| 597 | ** entries. Thus, when doing a "fossil sync --all" or an autosync with |
| 598 | ** autosync=all, each sync-url:NAME entry is checked to see if it is the |
| 599 | ** same as last-sync-url and if it is then that entry is skipped. |
| 600 | */ |
| 601 | |
| 602 | if( g.argc==2 ){ |
| 603 | /* "fossil remote" with no arguments: Show the last sync URL. */ |
| 604 | zUrl = db_get("last-sync-url", 0); |
| 605 | if( zUrl==0 ){ |
| 606 |
| --- src/sync.c | |
| +++ src/sync.c | |
| @@ -128,11 +128,11 @@ | |
| 128 | return 0; |
| 129 | } |
| 130 | zAutosync = db_get_for_subsystem("autosync", zSubsys); |
| 131 | if( zAutosync==0 ) zAutosync = "on"; /* defend against misconfig */ |
| 132 | if( is_false(zAutosync) ) return 0; |
| 133 | if( db_get_boolean("dont-push",0) |
| 134 | || sqlite3_strglob("*pull*", zAutosync)==0 |
| 135 | ){ |
| 136 | flags &= ~SYNC_CKIN_LOCK; |
| 137 | if( flags & SYNC_PUSH ) return 0; |
| 138 | } |
| @@ -533,11 +533,11 @@ | |
| 533 | ** |
| 534 | ** Show all remote repository URLs. |
| 535 | ** |
| 536 | ** > fossil remote off |
| 537 | ** |
| 538 | ** Forget the default URL. This disables autosync. |
| 539 | ** |
| 540 | ** This is a convenient way to enter "airplane mode". To enter |
| 541 | ** airplane mode, first save the current default URL, then turn the |
| 542 | ** default off. Perhaps like this: |
| 543 | ** |
| @@ -595,11 +595,11 @@ | |
| 595 | ** |
| 596 | ** The last-sync-url might be duplicated into one of the sync-url:NAME |
| 597 | ** entries. Thus, when doing a "fossil sync --all" or an autosync with |
| 598 | ** autosync=all, each sync-url:NAME entry is checked to see if it is the |
| 599 | ** same as last-sync-url and if it is then that entry is skipped. |
| 600 | */ |
| 601 | |
| 602 | if( g.argc==2 ){ |
| 603 | /* "fossil remote" with no arguments: Show the last sync URL. */ |
| 604 | zUrl = db_get("last-sync-url", 0); |
| 605 | if( zUrl==0 ){ |
| 606 |
+2
-2
| --- src/tag.c | ||
| +++ src/tag.c | ||
| @@ -640,13 +640,13 @@ | ||
| 640 | 640 | |
| 641 | 641 | if( zTagType!=0 ){ |
| 642 | 642 | int l = strlen(zTagType); |
| 643 | 643 | if( strncmp(zTagType,"cancel",l)==0 ){ |
| 644 | 644 | nTagType = 0; |
| 645 | - }else if( strncmp(zTagType,"singleton",l)==0 ){ | |
| 645 | + }else if( strncmp(zTagType,"singleton",l)==0 ){ | |
| 646 | 646 | nTagType = 1; |
| 647 | - }else if( strncmp(zTagType,"propagated",l)==0 ){ | |
| 647 | + }else if( strncmp(zTagType,"propagated",l)==0 ){ | |
| 648 | 648 | nTagType = 2; |
| 649 | 649 | }else{ |
| 650 | 650 | fossil_fatal("unrecognized tag type"); |
| 651 | 651 | } |
| 652 | 652 | } |
| 653 | 653 |
| --- src/tag.c | |
| +++ src/tag.c | |
| @@ -640,13 +640,13 @@ | |
| 640 | |
| 641 | if( zTagType!=0 ){ |
| 642 | int l = strlen(zTagType); |
| 643 | if( strncmp(zTagType,"cancel",l)==0 ){ |
| 644 | nTagType = 0; |
| 645 | }else if( strncmp(zTagType,"singleton",l)==0 ){ |
| 646 | nTagType = 1; |
| 647 | }else if( strncmp(zTagType,"propagated",l)==0 ){ |
| 648 | nTagType = 2; |
| 649 | }else{ |
| 650 | fossil_fatal("unrecognized tag type"); |
| 651 | } |
| 652 | } |
| 653 |
| --- src/tag.c | |
| +++ src/tag.c | |
| @@ -640,13 +640,13 @@ | |
| 640 | |
| 641 | if( zTagType!=0 ){ |
| 642 | int l = strlen(zTagType); |
| 643 | if( strncmp(zTagType,"cancel",l)==0 ){ |
| 644 | nTagType = 0; |
| 645 | }else if( strncmp(zTagType,"singleton",l)==0 ){ |
| 646 | nTagType = 1; |
| 647 | }else if( strncmp(zTagType,"propagated",l)==0 ){ |
| 648 | nTagType = 2; |
| 649 | }else{ |
| 650 | fossil_fatal("unrecognized tag type"); |
| 651 | } |
| 652 | } |
| 653 |
+2
-1
| --- src/tar.c | ||
| +++ src/tar.c | ||
| @@ -244,11 +244,12 @@ | ||
| 244 | 244 | /* adding the length extended the length field? */ |
| 245 | 245 | if(blen > next10){ |
| 246 | 246 | blen++; |
| 247 | 247 | } |
| 248 | 248 | /* build the string */ |
| 249 | - blob_appendf(&tball.pax, "%d %s=%*.*s\n", blen, zField, nValue, nValue, zValue); | |
| 249 | + blob_appendf(&tball.pax, "%d %s=%*.*s\n", | |
| 250 | + blen, zField, nValue, nValue, zValue); | |
| 250 | 251 | /* this _must_ be right */ |
| 251 | 252 | if((int)blob_size(&tball.pax) != blen){ |
| 252 | 253 | fossil_panic("internal error: PAX tar header has bad length"); |
| 253 | 254 | } |
| 254 | 255 | } |
| 255 | 256 |
| --- src/tar.c | |
| +++ src/tar.c | |
| @@ -244,11 +244,12 @@ | |
| 244 | /* adding the length extended the length field? */ |
| 245 | if(blen > next10){ |
| 246 | blen++; |
| 247 | } |
| 248 | /* build the string */ |
| 249 | blob_appendf(&tball.pax, "%d %s=%*.*s\n", blen, zField, nValue, nValue, zValue); |
| 250 | /* this _must_ be right */ |
| 251 | if((int)blob_size(&tball.pax) != blen){ |
| 252 | fossil_panic("internal error: PAX tar header has bad length"); |
| 253 | } |
| 254 | } |
| 255 |
| --- src/tar.c | |
| +++ src/tar.c | |
| @@ -244,11 +244,12 @@ | |
| 244 | /* adding the length extended the length field? */ |
| 245 | if(blen > next10){ |
| 246 | blen++; |
| 247 | } |
| 248 | /* build the string */ |
| 249 | blob_appendf(&tball.pax, "%d %s=%*.*s\n", |
| 250 | blen, zField, nValue, nValue, zValue); |
| 251 | /* this _must_ be right */ |
| 252 | if((int)blob_size(&tball.pax) != blen){ |
| 253 | fossil_panic("internal error: PAX tar header has bad length"); |
| 254 | } |
| 255 | } |
| 256 |
+2
-1
| --- src/th_main.c | ||
| +++ src/th_main.c | ||
| @@ -31,11 +31,12 @@ | ||
| 31 | 31 | #define TH_INIT_NEED_CONFIG ((u32)0x00000001) /* Open configuration first? */ |
| 32 | 32 | #define TH_INIT_FORCE_TCL ((u32)0x00000002) /* Force Tcl to be enabled? */ |
| 33 | 33 | #define TH_INIT_FORCE_RESET ((u32)0x00000004) /* Force TH1 commands re-added? */ |
| 34 | 34 | #define TH_INIT_FORCE_SETUP ((u32)0x00000008) /* Force eval of setup script? */ |
| 35 | 35 | #define TH_INIT_NO_REPO ((u32)0x00000010) /* Skip opening repository. */ |
| 36 | -#define TH_INIT_NO_ENCODE ((u32)0x00000020) /* Do not html-encode sendText() output. */ | |
| 36 | +#define TH_INIT_NO_ENCODE ((u32)0x00000020) /* Do not html-encode sendText()*/ | |
| 37 | + /* output. */ | |
| 37 | 38 | #define TH_INIT_MASK ((u32)0x0000003F) /* All possible init flags. */ |
| 38 | 39 | |
| 39 | 40 | /* |
| 40 | 41 | ** Useful and/or "well-known" combinations of flag values. |
| 41 | 42 | */ |
| 42 | 43 |
| --- src/th_main.c | |
| +++ src/th_main.c | |
| @@ -31,11 +31,12 @@ | |
| 31 | #define TH_INIT_NEED_CONFIG ((u32)0x00000001) /* Open configuration first? */ |
| 32 | #define TH_INIT_FORCE_TCL ((u32)0x00000002) /* Force Tcl to be enabled? */ |
| 33 | #define TH_INIT_FORCE_RESET ((u32)0x00000004) /* Force TH1 commands re-added? */ |
| 34 | #define TH_INIT_FORCE_SETUP ((u32)0x00000008) /* Force eval of setup script? */ |
| 35 | #define TH_INIT_NO_REPO ((u32)0x00000010) /* Skip opening repository. */ |
| 36 | #define TH_INIT_NO_ENCODE ((u32)0x00000020) /* Do not html-encode sendText() output. */ |
| 37 | #define TH_INIT_MASK ((u32)0x0000003F) /* All possible init flags. */ |
| 38 | |
| 39 | /* |
| 40 | ** Useful and/or "well-known" combinations of flag values. |
| 41 | */ |
| 42 |
| --- src/th_main.c | |
| +++ src/th_main.c | |
| @@ -31,11 +31,12 @@ | |
| 31 | #define TH_INIT_NEED_CONFIG ((u32)0x00000001) /* Open configuration first? */ |
| 32 | #define TH_INIT_FORCE_TCL ((u32)0x00000002) /* Force Tcl to be enabled? */ |
| 33 | #define TH_INIT_FORCE_RESET ((u32)0x00000004) /* Force TH1 commands re-added? */ |
| 34 | #define TH_INIT_FORCE_SETUP ((u32)0x00000008) /* Force eval of setup script? */ |
| 35 | #define TH_INIT_NO_REPO ((u32)0x00000010) /* Skip opening repository. */ |
| 36 | #define TH_INIT_NO_ENCODE ((u32)0x00000020) /* Do not html-encode sendText()*/ |
| 37 | /* output. */ |
| 38 | #define TH_INIT_MASK ((u32)0x0000003F) /* All possible init flags. */ |
| 39 | |
| 40 | /* |
| 41 | ** Useful and/or "well-known" combinations of flag values. |
| 42 | */ |
| 43 |
+6
-3
| --- src/th_tcl.c | ||
| +++ src/th_tcl.c | ||
| @@ -1164,18 +1164,20 @@ | ||
| 1164 | 1164 | return TH_ERROR; |
| 1165 | 1165 | } |
| 1166 | 1166 | tclContext->interp = tclInterp; |
| 1167 | 1167 | if( Tcl_Init(tclInterp)!=TCL_OK ){ |
| 1168 | 1168 | Th_ErrorMessage(interp, |
| 1169 | - "Tcl initialization error:", Tcl_GetString(Tcl_GetObjResult(tclInterp)), -1); | |
| 1169 | + "Tcl initialization error:", | |
| 1170 | + Tcl_GetString(Tcl_GetObjResult(tclInterp)), -1); | |
| 1170 | 1171 | Tcl_DeleteInterp(tclInterp); |
| 1171 | 1172 | tclContext->interp = tclInterp = 0; |
| 1172 | 1173 | return TH_ERROR; |
| 1173 | 1174 | } |
| 1174 | 1175 | if( setTclArguments(tclInterp, argc, argv)!=TCL_OK ){ |
| 1175 | 1176 | Th_ErrorMessage(interp, |
| 1176 | - "Tcl error setting arguments:", Tcl_GetString(Tcl_GetObjResult(tclInterp)), -1); | |
| 1177 | + "Tcl error setting arguments:", | |
| 1178 | + Tcl_GetString(Tcl_GetObjResult(tclInterp)), -1); | |
| 1177 | 1179 | Tcl_DeleteInterp(tclInterp); |
| 1178 | 1180 | tclContext->interp = tclInterp = 0; |
| 1179 | 1181 | return TH_ERROR; |
| 1180 | 1182 | } |
| 1181 | 1183 | /* |
| @@ -1194,11 +1196,12 @@ | ||
| 1194 | 1196 | Tcl_CreateObjCommand(tclInterp, "th1Expr", Th1ExprObjCmd, interp, NULL); |
| 1195 | 1197 | /* If necessary, evaluate the custom Tcl setup script. */ |
| 1196 | 1198 | setup = tclContext->setup; |
| 1197 | 1199 | if( setup && Tcl_EvalEx(tclInterp, setup, -1, 0)!=TCL_OK ){ |
| 1198 | 1200 | Th_ErrorMessage(interp, |
| 1199 | - "Tcl setup script error:", Tcl_GetString(Tcl_GetObjResult(tclInterp)), -1); | |
| 1201 | + "Tcl setup script error:", | |
| 1202 | + Tcl_GetString(Tcl_GetObjResult(tclInterp)), -1); | |
| 1200 | 1203 | Tcl_DeleteInterp(tclInterp); |
| 1201 | 1204 | tclContext->interp = tclInterp = 0; |
| 1202 | 1205 | return TH_ERROR; |
| 1203 | 1206 | } |
| 1204 | 1207 | return TH_OK; |
| 1205 | 1208 |
| --- src/th_tcl.c | |
| +++ src/th_tcl.c | |
| @@ -1164,18 +1164,20 @@ | |
| 1164 | return TH_ERROR; |
| 1165 | } |
| 1166 | tclContext->interp = tclInterp; |
| 1167 | if( Tcl_Init(tclInterp)!=TCL_OK ){ |
| 1168 | Th_ErrorMessage(interp, |
| 1169 | "Tcl initialization error:", Tcl_GetString(Tcl_GetObjResult(tclInterp)), -1); |
| 1170 | Tcl_DeleteInterp(tclInterp); |
| 1171 | tclContext->interp = tclInterp = 0; |
| 1172 | return TH_ERROR; |
| 1173 | } |
| 1174 | if( setTclArguments(tclInterp, argc, argv)!=TCL_OK ){ |
| 1175 | Th_ErrorMessage(interp, |
| 1176 | "Tcl error setting arguments:", Tcl_GetString(Tcl_GetObjResult(tclInterp)), -1); |
| 1177 | Tcl_DeleteInterp(tclInterp); |
| 1178 | tclContext->interp = tclInterp = 0; |
| 1179 | return TH_ERROR; |
| 1180 | } |
| 1181 | /* |
| @@ -1194,11 +1196,12 @@ | |
| 1194 | Tcl_CreateObjCommand(tclInterp, "th1Expr", Th1ExprObjCmd, interp, NULL); |
| 1195 | /* If necessary, evaluate the custom Tcl setup script. */ |
| 1196 | setup = tclContext->setup; |
| 1197 | if( setup && Tcl_EvalEx(tclInterp, setup, -1, 0)!=TCL_OK ){ |
| 1198 | Th_ErrorMessage(interp, |
| 1199 | "Tcl setup script error:", Tcl_GetString(Tcl_GetObjResult(tclInterp)), -1); |
| 1200 | Tcl_DeleteInterp(tclInterp); |
| 1201 | tclContext->interp = tclInterp = 0; |
| 1202 | return TH_ERROR; |
| 1203 | } |
| 1204 | return TH_OK; |
| 1205 |
| --- src/th_tcl.c | |
| +++ src/th_tcl.c | |
| @@ -1164,18 +1164,20 @@ | |
| 1164 | return TH_ERROR; |
| 1165 | } |
| 1166 | tclContext->interp = tclInterp; |
| 1167 | if( Tcl_Init(tclInterp)!=TCL_OK ){ |
| 1168 | Th_ErrorMessage(interp, |
| 1169 | "Tcl initialization error:", |
| 1170 | Tcl_GetString(Tcl_GetObjResult(tclInterp)), -1); |
| 1171 | Tcl_DeleteInterp(tclInterp); |
| 1172 | tclContext->interp = tclInterp = 0; |
| 1173 | return TH_ERROR; |
| 1174 | } |
| 1175 | if( setTclArguments(tclInterp, argc, argv)!=TCL_OK ){ |
| 1176 | Th_ErrorMessage(interp, |
| 1177 | "Tcl error setting arguments:", |
| 1178 | Tcl_GetString(Tcl_GetObjResult(tclInterp)), -1); |
| 1179 | Tcl_DeleteInterp(tclInterp); |
| 1180 | tclContext->interp = tclInterp = 0; |
| 1181 | return TH_ERROR; |
| 1182 | } |
| 1183 | /* |
| @@ -1194,11 +1196,12 @@ | |
| 1196 | Tcl_CreateObjCommand(tclInterp, "th1Expr", Th1ExprObjCmd, interp, NULL); |
| 1197 | /* If necessary, evaluate the custom Tcl setup script. */ |
| 1198 | setup = tclContext->setup; |
| 1199 | if( setup && Tcl_EvalEx(tclInterp, setup, -1, 0)!=TCL_OK ){ |
| 1200 | Th_ErrorMessage(interp, |
| 1201 | "Tcl setup script error:", |
| 1202 | Tcl_GetString(Tcl_GetObjResult(tclInterp)), -1); |
| 1203 | Tcl_DeleteInterp(tclInterp); |
| 1204 | tclContext->interp = tclInterp = 0; |
| 1205 | return TH_ERROR; |
| 1206 | } |
| 1207 | return TH_OK; |
| 1208 |
+20
-16
| --- src/timeline.c | ||
| +++ src/timeline.c | ||
| @@ -41,11 +41,11 @@ | ||
| 41 | 41 | "%h %c" |
| 42 | 42 | #define TIMELINE_FMT_MEDIUM \ |
| 43 | 43 | "Commit: %h%nDate: %d%nAuthor: %a%nComment: %c" |
| 44 | 44 | #define TIMELINE_FMT_FULL \ |
| 45 | 45 | "Commit: %H%nDate: %d%nAuthor: %a%nComment: %c%n"\ |
| 46 | - "Branch: %b%nTags: %t%nPhase: %p" | |
| 46 | + "Branch: %b%nTags: %t%nPhase: %p" | |
| 47 | 47 | /* |
| 48 | 48 | ** Add an appropriate tag to the output if "rid" is unpublished (private) |
| 49 | 49 | */ |
| 50 | 50 | #define UNPUB_TAG "<em>(unpublished)</em>" |
| 51 | 51 | void tag_private_status(int rid){ |
| @@ -153,11 +153,11 @@ | ||
| 153 | 153 | db_reset(&q); |
| 154 | 154 | return res; |
| 155 | 155 | } |
| 156 | 156 | |
| 157 | 157 | /* |
| 158 | -** Return the text of the unformatted | |
| 158 | +** Return the text of the unformatted | |
| 159 | 159 | ** forum post given by the RID in the argument. |
| 160 | 160 | */ |
| 161 | 161 | static void forum_post_content_function( |
| 162 | 162 | sqlite3_context *context, |
| 163 | 163 | int argc, |
| @@ -366,11 +366,11 @@ | ||
| 366 | 366 | zExtraClass = " tktTlClosed"; |
| 367 | 367 | }else{ |
| 368 | 368 | zExtraClass = " tktTlOpen"; |
| 369 | 369 | } |
| 370 | 370 | fossil_free(zTktid); |
| 371 | - } | |
| 371 | + } | |
| 372 | 372 | } |
| 373 | 373 | if( zType[0]=='e' && tagid ){ |
| 374 | 374 | if( bTimestampLinksToInfo ){ |
| 375 | 375 | char *zId; |
| 376 | 376 | zId = db_text(0, "SELECT substr(tagname, 7) FROM tag WHERE tagid=%d", |
| @@ -676,11 +676,11 @@ | ||
| 676 | 676 | } |
| 677 | 677 | |
| 678 | 678 | if( tmFlags & TIMELINE_SHOWRID ){ |
| 679 | 679 | int srcId = delta_source_rid(rid); |
| 680 | 680 | if( srcId ){ |
| 681 | - cgi_printf(" id: %z%d←%d</a>", | |
| 681 | + cgi_printf(" id: %z%d←%d</a>", | |
| 682 | 682 | href("%R/deltachain/%d",rid), rid, srcId); |
| 683 | 683 | }else{ |
| 684 | 684 | cgi_printf(" id: %z%d</a>", |
| 685 | 685 | href("%R/deltachain/%d",rid), rid); |
| 686 | 686 | } |
| @@ -2222,11 +2222,11 @@ | ||
| 2222 | 2222 | blob_appendf(&desc, " of %z%h</a>", |
| 2223 | 2223 | href("%R/info?name=%h", zCiName), zCiName); |
| 2224 | 2224 | if( ridBackTo ){ |
| 2225 | 2225 | if( np==0 ){ |
| 2226 | 2226 | blob_reset(&desc); |
| 2227 | - blob_appendf(&desc, | |
| 2227 | + blob_appendf(&desc, | |
| 2228 | 2228 | "Check-in %z%h</a> only (%z%h</a> is not an ancestor)", |
| 2229 | 2229 | href("%R/info?name=%h",zCiName), zCiName, |
| 2230 | 2230 | href("%R/info?name=%h",zBackTo), zBackTo); |
| 2231 | 2231 | }else{ |
| 2232 | 2232 | blob_appendf(&desc, " back to %z%h</a>", |
| @@ -2237,11 +2237,11 @@ | ||
| 2237 | 2237 | } |
| 2238 | 2238 | } |
| 2239 | 2239 | }else if( ridFwdTo ){ |
| 2240 | 2240 | if( nd==0 ){ |
| 2241 | 2241 | blob_reset(&desc); |
| 2242 | - blob_appendf(&desc, | |
| 2242 | + blob_appendf(&desc, | |
| 2243 | 2243 | "Check-in %z%h</a> only (%z%h</a> is not an descendant)", |
| 2244 | 2244 | href("%R/info?name=%h",zCiName), zCiName, |
| 2245 | 2245 | href("%R/info?name=%h",zFwdTo), zFwdTo); |
| 2246 | 2246 | }else{ |
| 2247 | 2247 | blob_appendf(&desc, " up to %z%h</a>", |
| @@ -3017,24 +3017,27 @@ | ||
| 3017 | 3017 | ** 8. event-type: 'ci', 'w', 't', 'f', and so forth. |
| 3018 | 3018 | ** 9. comment |
| 3019 | 3019 | ** 10. user |
| 3020 | 3020 | ** 11. tags |
| 3021 | 3021 | */ |
| 3022 | -void print_timeline(Stmt *q, int nLimit, int width, const char *zFormat, int verboseFlag){ | |
| 3022 | +void print_timeline(Stmt *q, int nLimit, int width, const char *zFormat, | |
| 3023 | + int verboseFlag){ | |
| 3023 | 3024 | int nAbsLimit = (nLimit >= 0) ? nLimit : -nLimit; |
| 3024 | 3025 | int nLine = 0; |
| 3025 | 3026 | int nEntry = 0; |
| 3026 | 3027 | char zPrevDate[20]; |
| 3027 | 3028 | const char *zCurrentUuid = 0; |
| 3028 | 3029 | int fchngQueryInit = 0; /* True if fchngQuery is initialized */ |
| 3029 | 3030 | Stmt fchngQuery; /* Query for file changes on check-ins */ |
| 3030 | 3031 | int rc; |
| 3031 | 3032 | /* True: separate entries with a newline after file listing */ |
| 3032 | - int bVerboseNL = (zFormat && (fossil_strcmp(zFormat, TIMELINE_FMT_ONELINE)!=0)); | |
| 3033 | + int bVerboseNL = (zFormat && | |
| 3034 | + (fossil_strcmp(zFormat, TIMELINE_FMT_ONELINE)!=0)); | |
| 3033 | 3035 | /* True: separate entries with a newline even with no file listing */ |
| 3034 | - int bNoVerboseNL = (zFormat && (fossil_strcmp(zFormat, TIMELINE_FMT_MEDIUM)==0 || | |
| 3035 | - fossil_strcmp(zFormat, TIMELINE_FMT_FULL)==0)); | |
| 3036 | + int bNoVerboseNL = (zFormat && | |
| 3037 | + (fossil_strcmp(zFormat, TIMELINE_FMT_MEDIUM)==0 || | |
| 3038 | + fossil_strcmp(zFormat, TIMELINE_FMT_FULL)==0)); | |
| 3036 | 3039 | |
| 3037 | 3040 | zPrevDate[0] = 0; |
| 3038 | 3041 | if( g.localOpen ){ |
| 3039 | 3042 | int rid = db_lget_int("checkout", 0); |
| 3040 | 3043 | zCurrentUuid = db_text(0, "SELECT uuid FROM blob WHERE rid=%d", rid); |
| @@ -3122,12 +3125,13 @@ | ||
| 3122 | 3125 | char *zEntry; |
| 3123 | 3126 | int nEntryLine = 0; |
| 3124 | 3127 | if( nChild==0 ){ |
| 3125 | 3128 | sqlite3_snprintf(sizeof(zPrefix)-n, &zPrefix[n], "*LEAF* "); |
| 3126 | 3129 | } |
| 3127 | - zEntry = timeline_entry_subst(zFormat, &nEntryLine, zId, zDate, zUserShort, | |
| 3128 | - zComShort, zBranch, zTags, zPrefix); | |
| 3130 | + zEntry = timeline_entry_subst(zFormat, &nEntryLine, zId, zDate, | |
| 3131 | + zUserShort, zComShort, zBranch, zTags, | |
| 3132 | + zPrefix); | |
| 3129 | 3133 | nLine += nEntryLine; |
| 3130 | 3134 | fossil_print("%s\n", zEntry); |
| 3131 | 3135 | fossil_free(zEntry); |
| 3132 | 3136 | } |
| 3133 | 3137 | else{ |
| @@ -3167,11 +3171,11 @@ | ||
| 3167 | 3171 | db_reset(&fchngQuery); |
| 3168 | 3172 | if( bVerboseNL ) fossil_print("\n"); |
| 3169 | 3173 | }else{ |
| 3170 | 3174 | if( bNoVerboseNL ) fossil_print("\n"); |
| 3171 | 3175 | } |
| 3172 | - | |
| 3176 | + | |
| 3173 | 3177 | nEntry++; /* record another complete entry */ |
| 3174 | 3178 | } |
| 3175 | 3179 | if( rc==SQLITE_DONE ){ |
| 3176 | 3180 | /* Did the underlying query actually have all entries? */ |
| 3177 | 3181 | if( nAbsLimit==0 ){ |
| @@ -3211,11 +3215,11 @@ | ||
| 3211 | 3215 | @ , coalesce(euser,user,'?') AS user0 |
| 3212 | 3216 | @ , (SELECT case when length(x)>0 then x else '' end |
| 3213 | 3217 | @ FROM (SELECT group_concat(substr(tagname,5), ', ') AS x |
| 3214 | 3218 | @ FROM tag, tagxref |
| 3215 | 3219 | @ WHERE tagname GLOB 'sym-*' AND tag.tagid=tagxref.tagid |
| 3216 | - @ AND tagxref.rid=blob.rid AND tagxref.tagtype>0)) AS tags | |
| 3220 | + @ AND tagxref.rid=blob.rid AND tagxref.tagtype>0)) AS tags | |
| 3217 | 3221 | @ FROM tag CROSS JOIN event CROSS JOIN blob |
| 3218 | 3222 | @ LEFT JOIN tagxref ON tagxref.tagid=tag.tagid |
| 3219 | 3223 | @ AND tagxref.tagtype>0 |
| 3220 | 3224 | @ AND tagxref.rid=blob.rid |
| 3221 | 3225 | @ WHERE blob.rid=event.objid |
| @@ -3272,19 +3276,19 @@ | ||
| 3272 | 3276 | ** |
| 3273 | 3277 | ** Options: |
| 3274 | 3278 | ** -b|--branch BRANCH Show only items on the branch named BRANCH |
| 3275 | 3279 | ** -c|--current-branch Show only items on the current branch |
| 3276 | 3280 | ** -F|--format Entry format. Values "oneline", "medium", and "full" |
| 3277 | -** get mapped to the full options below. Otherwise a | |
| 3281 | +** get mapped to the full options below. Otherwise a | |
| 3278 | 3282 | ** string which can contain these placeholders: |
| 3279 | 3283 | ** %n newline |
| 3280 | 3284 | ** %% a raw % |
| 3281 | 3285 | ** %H commit hash |
| 3282 | 3286 | ** %h abbreviated commit hash |
| 3283 | 3287 | ** %a author name |
| 3284 | 3288 | ** %d date |
| 3285 | -** %c comment (NL, TAB replaced by space, LF deleted) | |
| 3289 | +** %c comment (NL, TAB replaced by space, LF erased) | |
| 3286 | 3290 | ** %b branch |
| 3287 | 3291 | ** %t tags |
| 3288 | 3292 | ** %p phase: zero or more of *CURRENT*, *MERGE*, |
| 3289 | 3293 | ** *FORK*, *UNPUBLISHED*, *LEAF*, *BRANCH* |
| 3290 | 3294 | ** --oneline Show only short hash and comment for each entry |
| 3291 | 3295 |
| --- src/timeline.c | |
| +++ src/timeline.c | |
| @@ -41,11 +41,11 @@ | |
| 41 | "%h %c" |
| 42 | #define TIMELINE_FMT_MEDIUM \ |
| 43 | "Commit: %h%nDate: %d%nAuthor: %a%nComment: %c" |
| 44 | #define TIMELINE_FMT_FULL \ |
| 45 | "Commit: %H%nDate: %d%nAuthor: %a%nComment: %c%n"\ |
| 46 | "Branch: %b%nTags: %t%nPhase: %p" |
| 47 | /* |
| 48 | ** Add an appropriate tag to the output if "rid" is unpublished (private) |
| 49 | */ |
| 50 | #define UNPUB_TAG "<em>(unpublished)</em>" |
| 51 | void tag_private_status(int rid){ |
| @@ -153,11 +153,11 @@ | |
| 153 | db_reset(&q); |
| 154 | return res; |
| 155 | } |
| 156 | |
| 157 | /* |
| 158 | ** Return the text of the unformatted |
| 159 | ** forum post given by the RID in the argument. |
| 160 | */ |
| 161 | static void forum_post_content_function( |
| 162 | sqlite3_context *context, |
| 163 | int argc, |
| @@ -366,11 +366,11 @@ | |
| 366 | zExtraClass = " tktTlClosed"; |
| 367 | }else{ |
| 368 | zExtraClass = " tktTlOpen"; |
| 369 | } |
| 370 | fossil_free(zTktid); |
| 371 | } |
| 372 | } |
| 373 | if( zType[0]=='e' && tagid ){ |
| 374 | if( bTimestampLinksToInfo ){ |
| 375 | char *zId; |
| 376 | zId = db_text(0, "SELECT substr(tagname, 7) FROM tag WHERE tagid=%d", |
| @@ -676,11 +676,11 @@ | |
| 676 | } |
| 677 | |
| 678 | if( tmFlags & TIMELINE_SHOWRID ){ |
| 679 | int srcId = delta_source_rid(rid); |
| 680 | if( srcId ){ |
| 681 | cgi_printf(" id: %z%d←%d</a>", |
| 682 | href("%R/deltachain/%d",rid), rid, srcId); |
| 683 | }else{ |
| 684 | cgi_printf(" id: %z%d</a>", |
| 685 | href("%R/deltachain/%d",rid), rid); |
| 686 | } |
| @@ -2222,11 +2222,11 @@ | |
| 2222 | blob_appendf(&desc, " of %z%h</a>", |
| 2223 | href("%R/info?name=%h", zCiName), zCiName); |
| 2224 | if( ridBackTo ){ |
| 2225 | if( np==0 ){ |
| 2226 | blob_reset(&desc); |
| 2227 | blob_appendf(&desc, |
| 2228 | "Check-in %z%h</a> only (%z%h</a> is not an ancestor)", |
| 2229 | href("%R/info?name=%h",zCiName), zCiName, |
| 2230 | href("%R/info?name=%h",zBackTo), zBackTo); |
| 2231 | }else{ |
| 2232 | blob_appendf(&desc, " back to %z%h</a>", |
| @@ -2237,11 +2237,11 @@ | |
| 2237 | } |
| 2238 | } |
| 2239 | }else if( ridFwdTo ){ |
| 2240 | if( nd==0 ){ |
| 2241 | blob_reset(&desc); |
| 2242 | blob_appendf(&desc, |
| 2243 | "Check-in %z%h</a> only (%z%h</a> is not an descendant)", |
| 2244 | href("%R/info?name=%h",zCiName), zCiName, |
| 2245 | href("%R/info?name=%h",zFwdTo), zFwdTo); |
| 2246 | }else{ |
| 2247 | blob_appendf(&desc, " up to %z%h</a>", |
| @@ -3017,24 +3017,27 @@ | |
| 3017 | ** 8. event-type: 'ci', 'w', 't', 'f', and so forth. |
| 3018 | ** 9. comment |
| 3019 | ** 10. user |
| 3020 | ** 11. tags |
| 3021 | */ |
| 3022 | void print_timeline(Stmt *q, int nLimit, int width, const char *zFormat, int verboseFlag){ |
| 3023 | int nAbsLimit = (nLimit >= 0) ? nLimit : -nLimit; |
| 3024 | int nLine = 0; |
| 3025 | int nEntry = 0; |
| 3026 | char zPrevDate[20]; |
| 3027 | const char *zCurrentUuid = 0; |
| 3028 | int fchngQueryInit = 0; /* True if fchngQuery is initialized */ |
| 3029 | Stmt fchngQuery; /* Query for file changes on check-ins */ |
| 3030 | int rc; |
| 3031 | /* True: separate entries with a newline after file listing */ |
| 3032 | int bVerboseNL = (zFormat && (fossil_strcmp(zFormat, TIMELINE_FMT_ONELINE)!=0)); |
| 3033 | /* True: separate entries with a newline even with no file listing */ |
| 3034 | int bNoVerboseNL = (zFormat && (fossil_strcmp(zFormat, TIMELINE_FMT_MEDIUM)==0 || |
| 3035 | fossil_strcmp(zFormat, TIMELINE_FMT_FULL)==0)); |
| 3036 | |
| 3037 | zPrevDate[0] = 0; |
| 3038 | if( g.localOpen ){ |
| 3039 | int rid = db_lget_int("checkout", 0); |
| 3040 | zCurrentUuid = db_text(0, "SELECT uuid FROM blob WHERE rid=%d", rid); |
| @@ -3122,12 +3125,13 @@ | |
| 3122 | char *zEntry; |
| 3123 | int nEntryLine = 0; |
| 3124 | if( nChild==0 ){ |
| 3125 | sqlite3_snprintf(sizeof(zPrefix)-n, &zPrefix[n], "*LEAF* "); |
| 3126 | } |
| 3127 | zEntry = timeline_entry_subst(zFormat, &nEntryLine, zId, zDate, zUserShort, |
| 3128 | zComShort, zBranch, zTags, zPrefix); |
| 3129 | nLine += nEntryLine; |
| 3130 | fossil_print("%s\n", zEntry); |
| 3131 | fossil_free(zEntry); |
| 3132 | } |
| 3133 | else{ |
| @@ -3167,11 +3171,11 @@ | |
| 3167 | db_reset(&fchngQuery); |
| 3168 | if( bVerboseNL ) fossil_print("\n"); |
| 3169 | }else{ |
| 3170 | if( bNoVerboseNL ) fossil_print("\n"); |
| 3171 | } |
| 3172 | |
| 3173 | nEntry++; /* record another complete entry */ |
| 3174 | } |
| 3175 | if( rc==SQLITE_DONE ){ |
| 3176 | /* Did the underlying query actually have all entries? */ |
| 3177 | if( nAbsLimit==0 ){ |
| @@ -3211,11 +3215,11 @@ | |
| 3211 | @ , coalesce(euser,user,'?') AS user0 |
| 3212 | @ , (SELECT case when length(x)>0 then x else '' end |
| 3213 | @ FROM (SELECT group_concat(substr(tagname,5), ', ') AS x |
| 3214 | @ FROM tag, tagxref |
| 3215 | @ WHERE tagname GLOB 'sym-*' AND tag.tagid=tagxref.tagid |
| 3216 | @ AND tagxref.rid=blob.rid AND tagxref.tagtype>0)) AS tags |
| 3217 | @ FROM tag CROSS JOIN event CROSS JOIN blob |
| 3218 | @ LEFT JOIN tagxref ON tagxref.tagid=tag.tagid |
| 3219 | @ AND tagxref.tagtype>0 |
| 3220 | @ AND tagxref.rid=blob.rid |
| 3221 | @ WHERE blob.rid=event.objid |
| @@ -3272,19 +3276,19 @@ | |
| 3272 | ** |
| 3273 | ** Options: |
| 3274 | ** -b|--branch BRANCH Show only items on the branch named BRANCH |
| 3275 | ** -c|--current-branch Show only items on the current branch |
| 3276 | ** -F|--format Entry format. Values "oneline", "medium", and "full" |
| 3277 | ** get mapped to the full options below. Otherwise a |
| 3278 | ** string which can contain these placeholders: |
| 3279 | ** %n newline |
| 3280 | ** %% a raw % |
| 3281 | ** %H commit hash |
| 3282 | ** %h abbreviated commit hash |
| 3283 | ** %a author name |
| 3284 | ** %d date |
| 3285 | ** %c comment (NL, TAB replaced by space, LF deleted) |
| 3286 | ** %b branch |
| 3287 | ** %t tags |
| 3288 | ** %p phase: zero or more of *CURRENT*, *MERGE*, |
| 3289 | ** *FORK*, *UNPUBLISHED*, *LEAF*, *BRANCH* |
| 3290 | ** --oneline Show only short hash and comment for each entry |
| 3291 |
| --- src/timeline.c | |
| +++ src/timeline.c | |
| @@ -41,11 +41,11 @@ | |
| 41 | "%h %c" |
| 42 | #define TIMELINE_FMT_MEDIUM \ |
| 43 | "Commit: %h%nDate: %d%nAuthor: %a%nComment: %c" |
| 44 | #define TIMELINE_FMT_FULL \ |
| 45 | "Commit: %H%nDate: %d%nAuthor: %a%nComment: %c%n"\ |
| 46 | "Branch: %b%nTags: %t%nPhase: %p" |
| 47 | /* |
| 48 | ** Add an appropriate tag to the output if "rid" is unpublished (private) |
| 49 | */ |
| 50 | #define UNPUB_TAG "<em>(unpublished)</em>" |
| 51 | void tag_private_status(int rid){ |
| @@ -153,11 +153,11 @@ | |
| 153 | db_reset(&q); |
| 154 | return res; |
| 155 | } |
| 156 | |
| 157 | /* |
| 158 | ** Return the text of the unformatted |
| 159 | ** forum post given by the RID in the argument. |
| 160 | */ |
| 161 | static void forum_post_content_function( |
| 162 | sqlite3_context *context, |
| 163 | int argc, |
| @@ -366,11 +366,11 @@ | |
| 366 | zExtraClass = " tktTlClosed"; |
| 367 | }else{ |
| 368 | zExtraClass = " tktTlOpen"; |
| 369 | } |
| 370 | fossil_free(zTktid); |
| 371 | } |
| 372 | } |
| 373 | if( zType[0]=='e' && tagid ){ |
| 374 | if( bTimestampLinksToInfo ){ |
| 375 | char *zId; |
| 376 | zId = db_text(0, "SELECT substr(tagname, 7) FROM tag WHERE tagid=%d", |
| @@ -676,11 +676,11 @@ | |
| 676 | } |
| 677 | |
| 678 | if( tmFlags & TIMELINE_SHOWRID ){ |
| 679 | int srcId = delta_source_rid(rid); |
| 680 | if( srcId ){ |
| 681 | cgi_printf(" id: %z%d←%d</a>", |
| 682 | href("%R/deltachain/%d",rid), rid, srcId); |
| 683 | }else{ |
| 684 | cgi_printf(" id: %z%d</a>", |
| 685 | href("%R/deltachain/%d",rid), rid); |
| 686 | } |
| @@ -2222,11 +2222,11 @@ | |
| 2222 | blob_appendf(&desc, " of %z%h</a>", |
| 2223 | href("%R/info?name=%h", zCiName), zCiName); |
| 2224 | if( ridBackTo ){ |
| 2225 | if( np==0 ){ |
| 2226 | blob_reset(&desc); |
| 2227 | blob_appendf(&desc, |
| 2228 | "Check-in %z%h</a> only (%z%h</a> is not an ancestor)", |
| 2229 | href("%R/info?name=%h",zCiName), zCiName, |
| 2230 | href("%R/info?name=%h",zBackTo), zBackTo); |
| 2231 | }else{ |
| 2232 | blob_appendf(&desc, " back to %z%h</a>", |
| @@ -2237,11 +2237,11 @@ | |
| 2237 | } |
| 2238 | } |
| 2239 | }else if( ridFwdTo ){ |
| 2240 | if( nd==0 ){ |
| 2241 | blob_reset(&desc); |
| 2242 | blob_appendf(&desc, |
| 2243 | "Check-in %z%h</a> only (%z%h</a> is not an descendant)", |
| 2244 | href("%R/info?name=%h",zCiName), zCiName, |
| 2245 | href("%R/info?name=%h",zFwdTo), zFwdTo); |
| 2246 | }else{ |
| 2247 | blob_appendf(&desc, " up to %z%h</a>", |
| @@ -3017,24 +3017,27 @@ | |
| 3017 | ** 8. event-type: 'ci', 'w', 't', 'f', and so forth. |
| 3018 | ** 9. comment |
| 3019 | ** 10. user |
| 3020 | ** 11. tags |
| 3021 | */ |
| 3022 | void print_timeline(Stmt *q, int nLimit, int width, const char *zFormat, |
| 3023 | int verboseFlag){ |
| 3024 | int nAbsLimit = (nLimit >= 0) ? nLimit : -nLimit; |
| 3025 | int nLine = 0; |
| 3026 | int nEntry = 0; |
| 3027 | char zPrevDate[20]; |
| 3028 | const char *zCurrentUuid = 0; |
| 3029 | int fchngQueryInit = 0; /* True if fchngQuery is initialized */ |
| 3030 | Stmt fchngQuery; /* Query for file changes on check-ins */ |
| 3031 | int rc; |
| 3032 | /* True: separate entries with a newline after file listing */ |
| 3033 | int bVerboseNL = (zFormat && |
| 3034 | (fossil_strcmp(zFormat, TIMELINE_FMT_ONELINE)!=0)); |
| 3035 | /* True: separate entries with a newline even with no file listing */ |
| 3036 | int bNoVerboseNL = (zFormat && |
| 3037 | (fossil_strcmp(zFormat, TIMELINE_FMT_MEDIUM)==0 || |
| 3038 | fossil_strcmp(zFormat, TIMELINE_FMT_FULL)==0)); |
| 3039 | |
| 3040 | zPrevDate[0] = 0; |
| 3041 | if( g.localOpen ){ |
| 3042 | int rid = db_lget_int("checkout", 0); |
| 3043 | zCurrentUuid = db_text(0, "SELECT uuid FROM blob WHERE rid=%d", rid); |
| @@ -3122,12 +3125,13 @@ | |
| 3125 | char *zEntry; |
| 3126 | int nEntryLine = 0; |
| 3127 | if( nChild==0 ){ |
| 3128 | sqlite3_snprintf(sizeof(zPrefix)-n, &zPrefix[n], "*LEAF* "); |
| 3129 | } |
| 3130 | zEntry = timeline_entry_subst(zFormat, &nEntryLine, zId, zDate, |
| 3131 | zUserShort, zComShort, zBranch, zTags, |
| 3132 | zPrefix); |
| 3133 | nLine += nEntryLine; |
| 3134 | fossil_print("%s\n", zEntry); |
| 3135 | fossil_free(zEntry); |
| 3136 | } |
| 3137 | else{ |
| @@ -3167,11 +3171,11 @@ | |
| 3171 | db_reset(&fchngQuery); |
| 3172 | if( bVerboseNL ) fossil_print("\n"); |
| 3173 | }else{ |
| 3174 | if( bNoVerboseNL ) fossil_print("\n"); |
| 3175 | } |
| 3176 | |
| 3177 | nEntry++; /* record another complete entry */ |
| 3178 | } |
| 3179 | if( rc==SQLITE_DONE ){ |
| 3180 | /* Did the underlying query actually have all entries? */ |
| 3181 | if( nAbsLimit==0 ){ |
| @@ -3211,11 +3215,11 @@ | |
| 3215 | @ , coalesce(euser,user,'?') AS user0 |
| 3216 | @ , (SELECT case when length(x)>0 then x else '' end |
| 3217 | @ FROM (SELECT group_concat(substr(tagname,5), ', ') AS x |
| 3218 | @ FROM tag, tagxref |
| 3219 | @ WHERE tagname GLOB 'sym-*' AND tag.tagid=tagxref.tagid |
| 3220 | @ AND tagxref.rid=blob.rid AND tagxref.tagtype>0)) AS tags |
| 3221 | @ FROM tag CROSS JOIN event CROSS JOIN blob |
| 3222 | @ LEFT JOIN tagxref ON tagxref.tagid=tag.tagid |
| 3223 | @ AND tagxref.tagtype>0 |
| 3224 | @ AND tagxref.rid=blob.rid |
| 3225 | @ WHERE blob.rid=event.objid |
| @@ -3272,19 +3276,19 @@ | |
| 3276 | ** |
| 3277 | ** Options: |
| 3278 | ** -b|--branch BRANCH Show only items on the branch named BRANCH |
| 3279 | ** -c|--current-branch Show only items on the current branch |
| 3280 | ** -F|--format Entry format. Values "oneline", "medium", and "full" |
| 3281 | ** get mapped to the full options below. Otherwise a |
| 3282 | ** string which can contain these placeholders: |
| 3283 | ** %n newline |
| 3284 | ** %% a raw % |
| 3285 | ** %H commit hash |
| 3286 | ** %h abbreviated commit hash |
| 3287 | ** %a author name |
| 3288 | ** %d date |
| 3289 | ** %c comment (NL, TAB replaced by space, LF erased) |
| 3290 | ** %b branch |
| 3291 | ** %t tags |
| 3292 | ** %p phase: zero or more of *CURRENT*, *MERGE*, |
| 3293 | ** *FORK*, *UNPUBLISHED*, *LEAF*, *BRANCH* |
| 3294 | ** --oneline Show only short hash and comment for each entry |
| 3295 |
+2
-2
| --- src/tkt.c | ||
| +++ src/tkt.c | ||
| @@ -557,11 +557,11 @@ | ||
| 557 | 557 | if( sqlite3_stricmp(z2,"main")!=0 |
| 558 | 558 | && sqlite3_stricmp(z2,"repository")!=0 |
| 559 | 559 | ){ |
| 560 | 560 | goto ticket_schema_error; |
| 561 | 561 | } |
| 562 | - if( sqlite3_strnicmp(z0,"ticket",6)!=0 | |
| 562 | + if( sqlite3_strnicmp(z0,"ticket",6)!=0 | |
| 563 | 563 | && sqlite3_strnicmp(z0,"fx_",3)!=0 |
| 564 | 564 | ){ |
| 565 | 565 | goto ticket_schema_error; |
| 566 | 566 | } |
| 567 | 567 | break; |
| @@ -1213,11 +1213,11 @@ | ||
| 1213 | 1213 | /* |
| 1214 | 1214 | ** WEBPAGE: tkttimeline |
| 1215 | 1215 | ** URL: /tkttimeline/TICKETUUID |
| 1216 | 1216 | ** |
| 1217 | 1217 | ** Show the change history for a single ticket in timeline format. |
| 1218 | -** | |
| 1218 | +** | |
| 1219 | 1219 | ** Query parameters: |
| 1220 | 1220 | ** |
| 1221 | 1221 | ** y=ci Show only check-ins associated with the ticket |
| 1222 | 1222 | */ |
| 1223 | 1223 | void tkttimeline_page(void){ |
| 1224 | 1224 |
| --- src/tkt.c | |
| +++ src/tkt.c | |
| @@ -557,11 +557,11 @@ | |
| 557 | if( sqlite3_stricmp(z2,"main")!=0 |
| 558 | && sqlite3_stricmp(z2,"repository")!=0 |
| 559 | ){ |
| 560 | goto ticket_schema_error; |
| 561 | } |
| 562 | if( sqlite3_strnicmp(z0,"ticket",6)!=0 |
| 563 | && sqlite3_strnicmp(z0,"fx_",3)!=0 |
| 564 | ){ |
| 565 | goto ticket_schema_error; |
| 566 | } |
| 567 | break; |
| @@ -1213,11 +1213,11 @@ | |
| 1213 | /* |
| 1214 | ** WEBPAGE: tkttimeline |
| 1215 | ** URL: /tkttimeline/TICKETUUID |
| 1216 | ** |
| 1217 | ** Show the change history for a single ticket in timeline format. |
| 1218 | ** |
| 1219 | ** Query parameters: |
| 1220 | ** |
| 1221 | ** y=ci Show only check-ins associated with the ticket |
| 1222 | */ |
| 1223 | void tkttimeline_page(void){ |
| 1224 |
| --- src/tkt.c | |
| +++ src/tkt.c | |
| @@ -557,11 +557,11 @@ | |
| 557 | if( sqlite3_stricmp(z2,"main")!=0 |
| 558 | && sqlite3_stricmp(z2,"repository")!=0 |
| 559 | ){ |
| 560 | goto ticket_schema_error; |
| 561 | } |
| 562 | if( sqlite3_strnicmp(z0,"ticket",6)!=0 |
| 563 | && sqlite3_strnicmp(z0,"fx_",3)!=0 |
| 564 | ){ |
| 565 | goto ticket_schema_error; |
| 566 | } |
| 567 | break; |
| @@ -1213,11 +1213,11 @@ | |
| 1213 | /* |
| 1214 | ** WEBPAGE: tkttimeline |
| 1215 | ** URL: /tkttimeline/TICKETUUID |
| 1216 | ** |
| 1217 | ** Show the change history for a single ticket in timeline format. |
| 1218 | ** |
| 1219 | ** Query parameters: |
| 1220 | ** |
| 1221 | ** y=ci Show only check-ins associated with the ticket |
| 1222 | */ |
| 1223 | void tkttimeline_page(void){ |
| 1224 |
+2
-1
| --- src/unicode.c | ||
| +++ src/unicode.c | ||
| @@ -240,11 +240,12 @@ | ||
| 240 | 240 | iHi = iTest-1; |
| 241 | 241 | } |
| 242 | 242 | } |
| 243 | 243 | assert( key>=aDia[iRes] ); |
| 244 | 244 | if( bComplex==0 && (aChar[iRes] & 0x80) ) return c; |
| 245 | - return (c > (aDia[iRes]>>3) + (aDia[iRes]&0x07)) ? c : ((int)aChar[iRes] & 0x7F); | |
| 245 | + return (c > (aDia[iRes]>>3) + (aDia[iRes]&0x07)) ? c : | |
| 246 | + ((int)aChar[iRes] & 0x7F); | |
| 246 | 247 | } |
| 247 | 248 | |
| 248 | 249 | |
| 249 | 250 | /* |
| 250 | 251 | ** Return true if the argument interpreted as a unicode codepoint |
| 251 | 252 |
| --- src/unicode.c | |
| +++ src/unicode.c | |
| @@ -240,11 +240,12 @@ | |
| 240 | iHi = iTest-1; |
| 241 | } |
| 242 | } |
| 243 | assert( key>=aDia[iRes] ); |
| 244 | if( bComplex==0 && (aChar[iRes] & 0x80) ) return c; |
| 245 | return (c > (aDia[iRes]>>3) + (aDia[iRes]&0x07)) ? c : ((int)aChar[iRes] & 0x7F); |
| 246 | } |
| 247 | |
| 248 | |
| 249 | /* |
| 250 | ** Return true if the argument interpreted as a unicode codepoint |
| 251 |
| --- src/unicode.c | |
| +++ src/unicode.c | |
| @@ -240,11 +240,12 @@ | |
| 240 | iHi = iTest-1; |
| 241 | } |
| 242 | } |
| 243 | assert( key>=aDia[iRes] ); |
| 244 | if( bComplex==0 && (aChar[iRes] & 0x80) ) return c; |
| 245 | return (c > (aDia[iRes]>>3) + (aDia[iRes]&0x07)) ? c : |
| 246 | ((int)aChar[iRes] & 0x7F); |
| 247 | } |
| 248 | |
| 249 | |
| 250 | /* |
| 251 | ** Return true if the argument interpreted as a unicode codepoint |
| 252 |
+1
-1
| --- src/update.c | ||
| +++ src/update.c | ||
| @@ -567,11 +567,11 @@ | ||
| 567 | 567 | fossil_print("%.79c\n",'-'); |
| 568 | 568 | if( nUpdate==0 ){ |
| 569 | 569 | show_common_info(tid, "checkout:", 1, 0); |
| 570 | 570 | fossil_print("%-13s None. Already up-to-date\n", "changes:"); |
| 571 | 571 | }else{ |
| 572 | - fossil_print("%-13s %.40s %s\n", "updated-from:", rid_to_uuid(vid), | |
| 572 | + fossil_print("%-13s %.40s %s\n", "updated-from:", rid_to_uuid(vid), | |
| 573 | 573 | db_text("", "SELECT datetime(mtime) || ' UTC' FROM event " |
| 574 | 574 | " WHERE objid=%d", vid)); |
| 575 | 575 | show_common_info(tid, "updated-to:", 1, 0); |
| 576 | 576 | fossil_print("%-13s %d file%s modified.\n", "changes:", |
| 577 | 577 | nUpdate, nUpdate>1 ? "s" : ""); |
| 578 | 578 |
| --- src/update.c | |
| +++ src/update.c | |
| @@ -567,11 +567,11 @@ | |
| 567 | fossil_print("%.79c\n",'-'); |
| 568 | if( nUpdate==0 ){ |
| 569 | show_common_info(tid, "checkout:", 1, 0); |
| 570 | fossil_print("%-13s None. Already up-to-date\n", "changes:"); |
| 571 | }else{ |
| 572 | fossil_print("%-13s %.40s %s\n", "updated-from:", rid_to_uuid(vid), |
| 573 | db_text("", "SELECT datetime(mtime) || ' UTC' FROM event " |
| 574 | " WHERE objid=%d", vid)); |
| 575 | show_common_info(tid, "updated-to:", 1, 0); |
| 576 | fossil_print("%-13s %d file%s modified.\n", "changes:", |
| 577 | nUpdate, nUpdate>1 ? "s" : ""); |
| 578 |
| --- src/update.c | |
| +++ src/update.c | |
| @@ -567,11 +567,11 @@ | |
| 567 | fossil_print("%.79c\n",'-'); |
| 568 | if( nUpdate==0 ){ |
| 569 | show_common_info(tid, "checkout:", 1, 0); |
| 570 | fossil_print("%-13s None. Already up-to-date\n", "changes:"); |
| 571 | }else{ |
| 572 | fossil_print("%-13s %.40s %s\n", "updated-from:", rid_to_uuid(vid), |
| 573 | db_text("", "SELECT datetime(mtime) || ' UTC' FROM event " |
| 574 | " WHERE objid=%d", vid)); |
| 575 | show_common_info(tid, "updated-to:", 1, 0); |
| 576 | fossil_print("%-13s %d file%s modified.\n", "changes:", |
| 577 | nUpdate, nUpdate>1 ? "s" : ""); |
| 578 |
+3
-3
| --- src/url.c | ||
| +++ src/url.c | ||
| @@ -89,11 +89,11 @@ | ||
| 89 | 89 | ** passwd Password. |
| 90 | 90 | ** hostname HOST:PORT or just HOST if port is the default. |
| 91 | 91 | ** canonical The URL in canonical form, omitting the password |
| 92 | 92 | ** |
| 93 | 93 | ** If URL_USECONFIG is set and zUrl is NULL or "default", then parse the |
| 94 | -** URL stored in last-sync-url and last-sync-pw of the CONFIG table. Or if | |
| 94 | +** URL stored in last-sync-url and last-sync-pw of the CONFIG table. Or if | |
| 95 | 95 | ** URL_USE_PARENT is also set, then use parent-project-url and |
| 96 | 96 | ** parent-project-pw from the CONFIG table instead of last-sync-url |
| 97 | 97 | ** and last-sync-pw. |
| 98 | 98 | ** |
| 99 | 99 | ** If URL_USE_CONFIG is set and zUrl is a symbolic name, then look up |
| @@ -317,11 +317,11 @@ | ||
| 317 | 317 | pUrlData->protocol = "file"; |
| 318 | 318 | pUrlData->path = mprintf(""); |
| 319 | 319 | pUrlData->name = mprintf("%b", &cfile); |
| 320 | 320 | pUrlData->canonical = mprintf("file://%T", pUrlData->name); |
| 321 | 321 | blob_reset(&cfile); |
| 322 | - }else if( pUrlData->user!=0 && pUrlData->passwd==0 | |
| 322 | + }else if( pUrlData->user!=0 && pUrlData->passwd==0 | |
| 323 | 323 | && (urlFlags & URL_PROMPT_PW)!=0 ){ |
| 324 | 324 | url_prompt_for_password_local(pUrlData); |
| 325 | 325 | }else if( pUrlData->user!=0 && ( urlFlags & URL_ASK_REMEMBER_PW ) ){ |
| 326 | 326 | if( isatty(fileno(stdin)) && ( urlFlags & URL_REMEMBER_PW )==0 ){ |
| 327 | 327 | if( save_password_prompt(pUrlData->passwd) ){ |
| @@ -791,11 +791,11 @@ | ||
| 791 | 791 | ** |
| 792 | 792 | ** * If the URL has a path, use the tail of the path, with any suffix |
| 793 | 793 | ** elided. |
| 794 | 794 | ** |
| 795 | 795 | ** * If the URL is just a domain name, without a path, then use the |
| 796 | -** first element of the domain name, except skip over "www." if | |
| 796 | +** first element of the domain name, except skip over "www." if | |
| 797 | 797 | ** present and if there is a ".com" or ".org" or similar suffix. |
| 798 | 798 | ** |
| 799 | 799 | ** The string returned is obtained from fossil_malloc(). NULL might be |
| 800 | 800 | ** returned if there is an error. |
| 801 | 801 | */ |
| 802 | 802 |
| --- src/url.c | |
| +++ src/url.c | |
| @@ -89,11 +89,11 @@ | |
| 89 | ** passwd Password. |
| 90 | ** hostname HOST:PORT or just HOST if port is the default. |
| 91 | ** canonical The URL in canonical form, omitting the password |
| 92 | ** |
| 93 | ** If URL_USECONFIG is set and zUrl is NULL or "default", then parse the |
| 94 | ** URL stored in last-sync-url and last-sync-pw of the CONFIG table. Or if |
| 95 | ** URL_USE_PARENT is also set, then use parent-project-url and |
| 96 | ** parent-project-pw from the CONFIG table instead of last-sync-url |
| 97 | ** and last-sync-pw. |
| 98 | ** |
| 99 | ** If URL_USE_CONFIG is set and zUrl is a symbolic name, then look up |
| @@ -317,11 +317,11 @@ | |
| 317 | pUrlData->protocol = "file"; |
| 318 | pUrlData->path = mprintf(""); |
| 319 | pUrlData->name = mprintf("%b", &cfile); |
| 320 | pUrlData->canonical = mprintf("file://%T", pUrlData->name); |
| 321 | blob_reset(&cfile); |
| 322 | }else if( pUrlData->user!=0 && pUrlData->passwd==0 |
| 323 | && (urlFlags & URL_PROMPT_PW)!=0 ){ |
| 324 | url_prompt_for_password_local(pUrlData); |
| 325 | }else if( pUrlData->user!=0 && ( urlFlags & URL_ASK_REMEMBER_PW ) ){ |
| 326 | if( isatty(fileno(stdin)) && ( urlFlags & URL_REMEMBER_PW )==0 ){ |
| 327 | if( save_password_prompt(pUrlData->passwd) ){ |
| @@ -791,11 +791,11 @@ | |
| 791 | ** |
| 792 | ** * If the URL has a path, use the tail of the path, with any suffix |
| 793 | ** elided. |
| 794 | ** |
| 795 | ** * If the URL is just a domain name, without a path, then use the |
| 796 | ** first element of the domain name, except skip over "www." if |
| 797 | ** present and if there is a ".com" or ".org" or similar suffix. |
| 798 | ** |
| 799 | ** The string returned is obtained from fossil_malloc(). NULL might be |
| 800 | ** returned if there is an error. |
| 801 | */ |
| 802 |
| --- src/url.c | |
| +++ src/url.c | |
| @@ -89,11 +89,11 @@ | |
| 89 | ** passwd Password. |
| 90 | ** hostname HOST:PORT or just HOST if port is the default. |
| 91 | ** canonical The URL in canonical form, omitting the password |
| 92 | ** |
| 93 | ** If URL_USECONFIG is set and zUrl is NULL or "default", then parse the |
| 94 | ** URL stored in last-sync-url and last-sync-pw of the CONFIG table. Or if |
| 95 | ** URL_USE_PARENT is also set, then use parent-project-url and |
| 96 | ** parent-project-pw from the CONFIG table instead of last-sync-url |
| 97 | ** and last-sync-pw. |
| 98 | ** |
| 99 | ** If URL_USE_CONFIG is set and zUrl is a symbolic name, then look up |
| @@ -317,11 +317,11 @@ | |
| 317 | pUrlData->protocol = "file"; |
| 318 | pUrlData->path = mprintf(""); |
| 319 | pUrlData->name = mprintf("%b", &cfile); |
| 320 | pUrlData->canonical = mprintf("file://%T", pUrlData->name); |
| 321 | blob_reset(&cfile); |
| 322 | }else if( pUrlData->user!=0 && pUrlData->passwd==0 |
| 323 | && (urlFlags & URL_PROMPT_PW)!=0 ){ |
| 324 | url_prompt_for_password_local(pUrlData); |
| 325 | }else if( pUrlData->user!=0 && ( urlFlags & URL_ASK_REMEMBER_PW ) ){ |
| 326 | if( isatty(fileno(stdin)) && ( urlFlags & URL_REMEMBER_PW )==0 ){ |
| 327 | if( save_password_prompt(pUrlData->passwd) ){ |
| @@ -791,11 +791,11 @@ | |
| 791 | ** |
| 792 | ** * If the URL has a path, use the tail of the path, with any suffix |
| 793 | ** elided. |
| 794 | ** |
| 795 | ** * If the URL is just a domain name, without a path, then use the |
| 796 | ** first element of the domain name, except skip over "www." if |
| 797 | ** present and if there is a ".com" or ".org" or similar suffix. |
| 798 | ** |
| 799 | ** The string returned is obtained from fossil_malloc(). NULL might be |
| 800 | ** returned if there is an error. |
| 801 | */ |
| 802 |
+2
-1
| --- src/user.c | ||
| +++ src/user.c | ||
| @@ -399,11 +399,12 @@ | ||
| 399 | 399 | db_lset("default-user", g.argv[3]); |
| 400 | 400 | }else{ |
| 401 | 401 | db_set("default-user", g.argv[3], 0); |
| 402 | 402 | } |
| 403 | 403 | } |
| 404 | - }else if(( n>=2 && strncmp(g.argv[2],"list",n)==0 ) || ( n>=2 && strncmp(g.argv[2],"ls",n)==0 )){ | |
| 404 | + }else if(( n>=2 && strncmp(g.argv[2],"list",n)==0 ) || | |
| 405 | + ( n>=2 && strncmp(g.argv[2],"ls",n)==0 )){ | |
| 405 | 406 | Stmt q; |
| 406 | 407 | db_prepare(&q, "SELECT login, info FROM user ORDER BY login"); |
| 407 | 408 | while( db_step(&q)==SQLITE_ROW ){ |
| 408 | 409 | fossil_print("%-12s %s\n", db_column_text(&q, 0), db_column_text(&q, 1)); |
| 409 | 410 | } |
| 410 | 411 |
| --- src/user.c | |
| +++ src/user.c | |
| @@ -399,11 +399,12 @@ | |
| 399 | db_lset("default-user", g.argv[3]); |
| 400 | }else{ |
| 401 | db_set("default-user", g.argv[3], 0); |
| 402 | } |
| 403 | } |
| 404 | }else if(( n>=2 && strncmp(g.argv[2],"list",n)==0 ) || ( n>=2 && strncmp(g.argv[2],"ls",n)==0 )){ |
| 405 | Stmt q; |
| 406 | db_prepare(&q, "SELECT login, info FROM user ORDER BY login"); |
| 407 | while( db_step(&q)==SQLITE_ROW ){ |
| 408 | fossil_print("%-12s %s\n", db_column_text(&q, 0), db_column_text(&q, 1)); |
| 409 | } |
| 410 |
| --- src/user.c | |
| +++ src/user.c | |
| @@ -399,11 +399,12 @@ | |
| 399 | db_lset("default-user", g.argv[3]); |
| 400 | }else{ |
| 401 | db_set("default-user", g.argv[3], 0); |
| 402 | } |
| 403 | } |
| 404 | }else if(( n>=2 && strncmp(g.argv[2],"list",n)==0 ) || |
| 405 | ( n>=2 && strncmp(g.argv[2],"ls",n)==0 )){ |
| 406 | Stmt q; |
| 407 | db_prepare(&q, "SELECT login, info FROM user ORDER BY login"); |
| 408 | while( db_step(&q)==SQLITE_ROW ){ |
| 409 | fossil_print("%-12s %s\n", db_column_text(&q, 0), db_column_text(&q, 1)); |
| 410 | } |
| 411 |
+5
-4
| --- src/vfile.c | ||
| +++ src/vfile.c | ||
| @@ -410,11 +410,12 @@ | ||
| 410 | 410 | }; |
| 411 | 411 | int i, j, n; |
| 412 | 412 | |
| 413 | 413 | if( sqlite3_strglob("ci-comment-????????????.txt", zName)==0 ) return 1; |
| 414 | 414 | for(; zName[0]!=0; zName++){ |
| 415 | - if( zName[0]=='/' && sqlite3_strglob("/ci-comment-????????????.txt", zName)==0 ){ | |
| 415 | + if( zName[0]=='/' | |
| 416 | + && sqlite3_strglob("/ci-comment-????????????.txt", zName)==0 ){ | |
| 416 | 417 | return 1; |
| 417 | 418 | } |
| 418 | 419 | if( zName[0]!='-' ) continue; |
| 419 | 420 | for(i=0; i<count(azTemp); i++){ |
| 420 | 421 | n = (int)strlen(azTemp[i]); |
| @@ -754,11 +755,11 @@ | ||
| 754 | 755 | } |
| 755 | 756 | fseek(in, 0L, SEEK_END); |
| 756 | 757 | sqlite3_snprintf(sizeof(zBuf), zBuf, " %ld\n", ftell(in)); |
| 757 | 758 | fseek(in, 0L, SEEK_SET); |
| 758 | 759 | md5sum_step_text(zBuf, -1); |
| 759 | - /*printf("%s %s %s",md5sum_current_state(),zName,zBuf); fflush(stdout);*/ | |
| 760 | + /*printf("%s %s %s",md5sum_current_state(),zName,zBuf);fflush(stdout);*/ | |
| 760 | 761 | for(;;){ |
| 761 | 762 | int n; |
| 762 | 763 | n = fread(zBuf, 1, sizeof(zBuf), in); |
| 763 | 764 | if( n<=0 ) break; |
| 764 | 765 | md5sum_step_text(zBuf, n); |
| @@ -1041,17 +1042,17 @@ | ||
| 1041 | 1042 | db_multi_exec( |
| 1042 | 1043 | "INSERT OR IGNORE INTO idMap(oldrid, newrid)" |
| 1043 | 1044 | " SELECT vfile.mrid, blob.rid FROM vfile, blob" |
| 1044 | 1045 | " WHERE blob.uuid=vfile.mhash;" |
| 1045 | 1046 | ); |
| 1046 | - | |
| 1047 | + | |
| 1047 | 1048 | if( dryRun ){ |
| 1048 | 1049 | Stmt q; |
| 1049 | 1050 | db_prepare(&q, "SELECT oldrid, newrid, blob.uuid" |
| 1050 | 1051 | " FROM idMap, blob WHERE blob.rid=idMap.newrid"); |
| 1051 | 1052 | while( db_step(&q)==SQLITE_ROW ){ |
| 1052 | - fossil_print("%8d -> %8d %.25s\n", | |
| 1053 | + fossil_print("%8d -> %8d %.25s\n", | |
| 1053 | 1054 | db_column_int(&q,0), |
| 1054 | 1055 | db_column_int(&q,1), |
| 1055 | 1056 | db_column_text(&q,2)); |
| 1056 | 1057 | } |
| 1057 | 1058 | db_finalize(&q); |
| 1058 | 1059 |
| --- src/vfile.c | |
| +++ src/vfile.c | |
| @@ -410,11 +410,12 @@ | |
| 410 | }; |
| 411 | int i, j, n; |
| 412 | |
| 413 | if( sqlite3_strglob("ci-comment-????????????.txt", zName)==0 ) return 1; |
| 414 | for(; zName[0]!=0; zName++){ |
| 415 | if( zName[0]=='/' && sqlite3_strglob("/ci-comment-????????????.txt", zName)==0 ){ |
| 416 | return 1; |
| 417 | } |
| 418 | if( zName[0]!='-' ) continue; |
| 419 | for(i=0; i<count(azTemp); i++){ |
| 420 | n = (int)strlen(azTemp[i]); |
| @@ -754,11 +755,11 @@ | |
| 754 | } |
| 755 | fseek(in, 0L, SEEK_END); |
| 756 | sqlite3_snprintf(sizeof(zBuf), zBuf, " %ld\n", ftell(in)); |
| 757 | fseek(in, 0L, SEEK_SET); |
| 758 | md5sum_step_text(zBuf, -1); |
| 759 | /*printf("%s %s %s",md5sum_current_state(),zName,zBuf); fflush(stdout);*/ |
| 760 | for(;;){ |
| 761 | int n; |
| 762 | n = fread(zBuf, 1, sizeof(zBuf), in); |
| 763 | if( n<=0 ) break; |
| 764 | md5sum_step_text(zBuf, n); |
| @@ -1041,17 +1042,17 @@ | |
| 1041 | db_multi_exec( |
| 1042 | "INSERT OR IGNORE INTO idMap(oldrid, newrid)" |
| 1043 | " SELECT vfile.mrid, blob.rid FROM vfile, blob" |
| 1044 | " WHERE blob.uuid=vfile.mhash;" |
| 1045 | ); |
| 1046 | |
| 1047 | if( dryRun ){ |
| 1048 | Stmt q; |
| 1049 | db_prepare(&q, "SELECT oldrid, newrid, blob.uuid" |
| 1050 | " FROM idMap, blob WHERE blob.rid=idMap.newrid"); |
| 1051 | while( db_step(&q)==SQLITE_ROW ){ |
| 1052 | fossil_print("%8d -> %8d %.25s\n", |
| 1053 | db_column_int(&q,0), |
| 1054 | db_column_int(&q,1), |
| 1055 | db_column_text(&q,2)); |
| 1056 | } |
| 1057 | db_finalize(&q); |
| 1058 |
| --- src/vfile.c | |
| +++ src/vfile.c | |
| @@ -410,11 +410,12 @@ | |
| 410 | }; |
| 411 | int i, j, n; |
| 412 | |
| 413 | if( sqlite3_strglob("ci-comment-????????????.txt", zName)==0 ) return 1; |
| 414 | for(; zName[0]!=0; zName++){ |
| 415 | if( zName[0]=='/' |
| 416 | && sqlite3_strglob("/ci-comment-????????????.txt", zName)==0 ){ |
| 417 | return 1; |
| 418 | } |
| 419 | if( zName[0]!='-' ) continue; |
| 420 | for(i=0; i<count(azTemp); i++){ |
| 421 | n = (int)strlen(azTemp[i]); |
| @@ -754,11 +755,11 @@ | |
| 755 | } |
| 756 | fseek(in, 0L, SEEK_END); |
| 757 | sqlite3_snprintf(sizeof(zBuf), zBuf, " %ld\n", ftell(in)); |
| 758 | fseek(in, 0L, SEEK_SET); |
| 759 | md5sum_step_text(zBuf, -1); |
| 760 | /*printf("%s %s %s",md5sum_current_state(),zName,zBuf);fflush(stdout);*/ |
| 761 | for(;;){ |
| 762 | int n; |
| 763 | n = fread(zBuf, 1, sizeof(zBuf), in); |
| 764 | if( n<=0 ) break; |
| 765 | md5sum_step_text(zBuf, n); |
| @@ -1041,17 +1042,17 @@ | |
| 1042 | db_multi_exec( |
| 1043 | "INSERT OR IGNORE INTO idMap(oldrid, newrid)" |
| 1044 | " SELECT vfile.mrid, blob.rid FROM vfile, blob" |
| 1045 | " WHERE blob.uuid=vfile.mhash;" |
| 1046 | ); |
| 1047 | |
| 1048 | if( dryRun ){ |
| 1049 | Stmt q; |
| 1050 | db_prepare(&q, "SELECT oldrid, newrid, blob.uuid" |
| 1051 | " FROM idMap, blob WHERE blob.rid=idMap.newrid"); |
| 1052 | while( db_step(&q)==SQLITE_ROW ){ |
| 1053 | fossil_print("%8d -> %8d %.25s\n", |
| 1054 | db_column_int(&q,0), |
| 1055 | db_column_int(&q,1), |
| 1056 | db_column_text(&q,2)); |
| 1057 | } |
| 1058 | db_finalize(&q); |
| 1059 |
+12
-11
| --- src/wiki.c | ||
| +++ src/wiki.c | ||
| @@ -85,11 +85,11 @@ | ||
| 85 | 85 | return db_int(0, "SELECT tagid FROM tag WHERE tagname='wiki-%q/%q'", |
| 86 | 86 | zPrefix, zPageName); |
| 87 | 87 | } |
| 88 | 88 | |
| 89 | 89 | /* |
| 90 | -** Return the RID of the next or previous version of a wiki page. | |
| 90 | +** Return the RID of the next or previous version of a wiki page. | |
| 91 | 91 | ** Return 0 if rid is the last/first version. |
| 92 | 92 | */ |
| 93 | 93 | int wiki_next(int tagid, double mtime){ |
| 94 | 94 | return db_int(0, |
| 95 | 95 | "SELECT srcid FROM tagxref" |
| @@ -413,11 +413,11 @@ | ||
| 413 | 413 | */ |
| 414 | 414 | int wiki_page_type(const char *zPageName){ |
| 415 | 415 | if( db_get_boolean("wiki-about",1)==0 ){ |
| 416 | 416 | return WIKITYPE_NORMAL; |
| 417 | 417 | }else |
| 418 | - if( sqlite3_strglob("checkin/*", zPageName)==0 | |
| 418 | + if( sqlite3_strglob("checkin/*", zPageName)==0 | |
| 419 | 419 | && db_exists("SELECT 1 FROM blob WHERE uuid=%Q",zPageName+8) |
| 420 | 420 | ){ |
| 421 | 421 | return WIKITYPE_CHECKIN; |
| 422 | 422 | }else |
| 423 | 423 | if( sqlite3_strglob("branch/*", zPageName)==0 ){ |
| @@ -447,11 +447,11 @@ | ||
| 447 | 447 | ** Add an appropriate style_header() for either the /wiki or /wikiedit page |
| 448 | 448 | ** for zPageName. zExtra is an empty string for /wiki but has the text |
| 449 | 449 | ** "Edit: " for /wikiedit. |
| 450 | 450 | ** |
| 451 | 451 | ** If the page is /wiki and the page is one of the special times (check-in, |
| 452 | -** branch, or tag) and the "p" query parameter is omitted, then do a | |
| 452 | +** branch, or tag) and the "p" query parameter is omitted, then do a | |
| 453 | 453 | ** redirect to the display of the check-in, branch, or tag rather than |
| 454 | 454 | ** continuing to the plain wiki display. |
| 455 | 455 | */ |
| 456 | 456 | static int wiki_page_header( |
| 457 | 457 | int eType, /* Page type. Might be WIKITYPE_UNKNOWN */ |
| @@ -469,11 +469,12 @@ | ||
| 469 | 469 | zPageName += 8; |
| 470 | 470 | if( zExtra[0]==0 && !P("p") ){ |
| 471 | 471 | cgi_redirectf("%R/info/%s",zPageName); |
| 472 | 472 | }else{ |
| 473 | 473 | style_header("Notes About Check-in %S", zPageName); |
| 474 | - style_submenu_element("Check-in Timeline","%R/timeline?f=%s", zPageName); | |
| 474 | + style_submenu_element("Check-in Timeline","%R/timeline?f=%s", | |
| 475 | + zPageName); | |
| 475 | 476 | style_submenu_element("Check-in Info","%R/info/%s", zPageName); |
| 476 | 477 | } |
| 477 | 478 | break; |
| 478 | 479 | } |
| 479 | 480 | case WIKITYPE_BRANCH: { |
| @@ -743,11 +744,11 @@ | ||
| 743 | 744 | ** a sandbox page, but it is reported as writable here (with rid 0). |
| 744 | 745 | */ |
| 745 | 746 | static int wiki_ajax_can_write(const char *zPageName, int * pRid){ |
| 746 | 747 | int rid = 0; |
| 747 | 748 | const char * zErr = 0; |
| 748 | - | |
| 749 | + | |
| 749 | 750 | if(pRid) *pRid = 0; |
| 750 | 751 | if(!zPageName || !*zPageName |
| 751 | 752 | || !wiki_name_is_wellformed((unsigned const char *)zPageName)){ |
| 752 | 753 | zErr = "Invalid page name."; |
| 753 | 754 | }else if(is_sandbox(zPageName)){ |
| @@ -766,11 +767,11 @@ | ||
| 766 | 767 | }else{ |
| 767 | 768 | zErr = "Cannot happen! Please report this as a bug."; |
| 768 | 769 | } |
| 769 | 770 | } |
| 770 | 771 | ajax_route_error(403, "%s", zErr); |
| 771 | - return 0; | |
| 772 | + return 0; | |
| 772 | 773 | } |
| 773 | 774 | |
| 774 | 775 | |
| 775 | 776 | /* |
| 776 | 777 | ** Emits an array of attachment info records for the given wiki page |
| @@ -1012,11 +1013,11 @@ | ||
| 1012 | 1013 | ** ajax_route_error(). On success, an object in the form documented |
| 1013 | 1014 | ** for wiki_ajax_emit_page_object(). |
| 1014 | 1015 | */ |
| 1015 | 1016 | static void wiki_ajax_route_fetch(void){ |
| 1016 | 1017 | const char * zPageName = P("page"); |
| 1017 | - | |
| 1018 | + | |
| 1018 | 1019 | if( zPageName==0 || zPageName[0]==0 ){ |
| 1019 | 1020 | ajax_route_error(400,"Missing page name."); |
| 1020 | 1021 | return; |
| 1021 | 1022 | } |
| 1022 | 1023 | cgi_set_content_type("application/json"); |
| @@ -1203,11 +1204,11 @@ | ||
| 1203 | 1204 | /* |
| 1204 | 1205 | ** WEBPAGE: wikiajax hidden |
| 1205 | 1206 | ** |
| 1206 | 1207 | ** An internal dispatcher for wiki AJAX operations. Not for direct |
| 1207 | 1208 | ** client use. All routes defined by this interface are app-internal, |
| 1208 | -** subject to change | |
| 1209 | +** subject to change | |
| 1209 | 1210 | */ |
| 1210 | 1211 | void wiki_ajax_page(void){ |
| 1211 | 1212 | const char * zName = P("name"); |
| 1212 | 1213 | AjaxRoute routeName = {0,0,0,0}; |
| 1213 | 1214 | const AjaxRoute * pRoute = 0; |
| @@ -1343,11 +1344,11 @@ | ||
| 1343 | 1344 | "class='hidden'" |
| 1344 | 1345 | ">"); |
| 1345 | 1346 | CX("<div>Loading wiki pages list...</div>"); |
| 1346 | 1347 | CX("</div>"/*#wikiedit-tab-pages*/); |
| 1347 | 1348 | } |
| 1348 | - | |
| 1349 | + | |
| 1349 | 1350 | /******* Content tab *******/ |
| 1350 | 1351 | { |
| 1351 | 1352 | CX("<div id='wikiedit-tab-content' " |
| 1352 | 1353 | "data-tab-parent='wikiedit-tabs' " |
| 1353 | 1354 | "data-tab-label='Editor' " |
| @@ -1905,11 +1906,11 @@ | ||
| 1905 | 1906 | ** wmtime time most recent version was created |
| 1906 | 1907 | ** wcnt Number of versions of this wiki page |
| 1907 | 1908 | ** |
| 1908 | 1909 | ** The wrid value is zero for deleted wiki pages. |
| 1909 | 1910 | */ |
| 1910 | -static const char listAllWikiPages[] = | |
| 1911 | +static const char listAllWikiPages[] = | |
| 1911 | 1912 | @ SELECT |
| 1912 | 1913 | @ substr(tag.tagname, 6) AS wname, |
| 1913 | 1914 | @ lower(substr(tag.tagname, 6)) AS sortname, |
| 1914 | 1915 | @ tagxref.value+0 AS wrid, |
| 1915 | 1916 | @ max(tagxref.mtime) AS wmtime, |
| @@ -2482,11 +2483,11 @@ | ||
| 2482 | 2483 | const char *zName = db_column_text(&q, 0); |
| 2483 | 2484 | const int wrid = db_column_int(&q, 2); |
| 2484 | 2485 | if(!showAll && !wrid){ |
| 2485 | 2486 | continue; |
| 2486 | 2487 | } |
| 2487 | - if( !showCkBr && | |
| 2488 | + if( !showCkBr && | |
| 2488 | 2489 | (sqlite3_strglob("checkin/*", zName)==0 || |
| 2489 | 2490 | sqlite3_strglob("branch/*", zName)==0) ){ |
| 2490 | 2491 | continue; |
| 2491 | 2492 | } |
| 2492 | 2493 | if( showIds ){ |
| 2493 | 2494 |
| --- src/wiki.c | |
| +++ src/wiki.c | |
| @@ -85,11 +85,11 @@ | |
| 85 | return db_int(0, "SELECT tagid FROM tag WHERE tagname='wiki-%q/%q'", |
| 86 | zPrefix, zPageName); |
| 87 | } |
| 88 | |
| 89 | /* |
| 90 | ** Return the RID of the next or previous version of a wiki page. |
| 91 | ** Return 0 if rid is the last/first version. |
| 92 | */ |
| 93 | int wiki_next(int tagid, double mtime){ |
| 94 | return db_int(0, |
| 95 | "SELECT srcid FROM tagxref" |
| @@ -413,11 +413,11 @@ | |
| 413 | */ |
| 414 | int wiki_page_type(const char *zPageName){ |
| 415 | if( db_get_boolean("wiki-about",1)==0 ){ |
| 416 | return WIKITYPE_NORMAL; |
| 417 | }else |
| 418 | if( sqlite3_strglob("checkin/*", zPageName)==0 |
| 419 | && db_exists("SELECT 1 FROM blob WHERE uuid=%Q",zPageName+8) |
| 420 | ){ |
| 421 | return WIKITYPE_CHECKIN; |
| 422 | }else |
| 423 | if( sqlite3_strglob("branch/*", zPageName)==0 ){ |
| @@ -447,11 +447,11 @@ | |
| 447 | ** Add an appropriate style_header() for either the /wiki or /wikiedit page |
| 448 | ** for zPageName. zExtra is an empty string for /wiki but has the text |
| 449 | ** "Edit: " for /wikiedit. |
| 450 | ** |
| 451 | ** If the page is /wiki and the page is one of the special times (check-in, |
| 452 | ** branch, or tag) and the "p" query parameter is omitted, then do a |
| 453 | ** redirect to the display of the check-in, branch, or tag rather than |
| 454 | ** continuing to the plain wiki display. |
| 455 | */ |
| 456 | static int wiki_page_header( |
| 457 | int eType, /* Page type. Might be WIKITYPE_UNKNOWN */ |
| @@ -469,11 +469,12 @@ | |
| 469 | zPageName += 8; |
| 470 | if( zExtra[0]==0 && !P("p") ){ |
| 471 | cgi_redirectf("%R/info/%s",zPageName); |
| 472 | }else{ |
| 473 | style_header("Notes About Check-in %S", zPageName); |
| 474 | style_submenu_element("Check-in Timeline","%R/timeline?f=%s", zPageName); |
| 475 | style_submenu_element("Check-in Info","%R/info/%s", zPageName); |
| 476 | } |
| 477 | break; |
| 478 | } |
| 479 | case WIKITYPE_BRANCH: { |
| @@ -743,11 +744,11 @@ | |
| 743 | ** a sandbox page, but it is reported as writable here (with rid 0). |
| 744 | */ |
| 745 | static int wiki_ajax_can_write(const char *zPageName, int * pRid){ |
| 746 | int rid = 0; |
| 747 | const char * zErr = 0; |
| 748 | |
| 749 | if(pRid) *pRid = 0; |
| 750 | if(!zPageName || !*zPageName |
| 751 | || !wiki_name_is_wellformed((unsigned const char *)zPageName)){ |
| 752 | zErr = "Invalid page name."; |
| 753 | }else if(is_sandbox(zPageName)){ |
| @@ -766,11 +767,11 @@ | |
| 766 | }else{ |
| 767 | zErr = "Cannot happen! Please report this as a bug."; |
| 768 | } |
| 769 | } |
| 770 | ajax_route_error(403, "%s", zErr); |
| 771 | return 0; |
| 772 | } |
| 773 | |
| 774 | |
| 775 | /* |
| 776 | ** Emits an array of attachment info records for the given wiki page |
| @@ -1012,11 +1013,11 @@ | |
| 1012 | ** ajax_route_error(). On success, an object in the form documented |
| 1013 | ** for wiki_ajax_emit_page_object(). |
| 1014 | */ |
| 1015 | static void wiki_ajax_route_fetch(void){ |
| 1016 | const char * zPageName = P("page"); |
| 1017 | |
| 1018 | if( zPageName==0 || zPageName[0]==0 ){ |
| 1019 | ajax_route_error(400,"Missing page name."); |
| 1020 | return; |
| 1021 | } |
| 1022 | cgi_set_content_type("application/json"); |
| @@ -1203,11 +1204,11 @@ | |
| 1203 | /* |
| 1204 | ** WEBPAGE: wikiajax hidden |
| 1205 | ** |
| 1206 | ** An internal dispatcher for wiki AJAX operations. Not for direct |
| 1207 | ** client use. All routes defined by this interface are app-internal, |
| 1208 | ** subject to change |
| 1209 | */ |
| 1210 | void wiki_ajax_page(void){ |
| 1211 | const char * zName = P("name"); |
| 1212 | AjaxRoute routeName = {0,0,0,0}; |
| 1213 | const AjaxRoute * pRoute = 0; |
| @@ -1343,11 +1344,11 @@ | |
| 1343 | "class='hidden'" |
| 1344 | ">"); |
| 1345 | CX("<div>Loading wiki pages list...</div>"); |
| 1346 | CX("</div>"/*#wikiedit-tab-pages*/); |
| 1347 | } |
| 1348 | |
| 1349 | /******* Content tab *******/ |
| 1350 | { |
| 1351 | CX("<div id='wikiedit-tab-content' " |
| 1352 | "data-tab-parent='wikiedit-tabs' " |
| 1353 | "data-tab-label='Editor' " |
| @@ -1905,11 +1906,11 @@ | |
| 1905 | ** wmtime time most recent version was created |
| 1906 | ** wcnt Number of versions of this wiki page |
| 1907 | ** |
| 1908 | ** The wrid value is zero for deleted wiki pages. |
| 1909 | */ |
| 1910 | static const char listAllWikiPages[] = |
| 1911 | @ SELECT |
| 1912 | @ substr(tag.tagname, 6) AS wname, |
| 1913 | @ lower(substr(tag.tagname, 6)) AS sortname, |
| 1914 | @ tagxref.value+0 AS wrid, |
| 1915 | @ max(tagxref.mtime) AS wmtime, |
| @@ -2482,11 +2483,11 @@ | |
| 2482 | const char *zName = db_column_text(&q, 0); |
| 2483 | const int wrid = db_column_int(&q, 2); |
| 2484 | if(!showAll && !wrid){ |
| 2485 | continue; |
| 2486 | } |
| 2487 | if( !showCkBr && |
| 2488 | (sqlite3_strglob("checkin/*", zName)==0 || |
| 2489 | sqlite3_strglob("branch/*", zName)==0) ){ |
| 2490 | continue; |
| 2491 | } |
| 2492 | if( showIds ){ |
| 2493 |
| --- src/wiki.c | |
| +++ src/wiki.c | |
| @@ -85,11 +85,11 @@ | |
| 85 | return db_int(0, "SELECT tagid FROM tag WHERE tagname='wiki-%q/%q'", |
| 86 | zPrefix, zPageName); |
| 87 | } |
| 88 | |
| 89 | /* |
| 90 | ** Return the RID of the next or previous version of a wiki page. |
| 91 | ** Return 0 if rid is the last/first version. |
| 92 | */ |
| 93 | int wiki_next(int tagid, double mtime){ |
| 94 | return db_int(0, |
| 95 | "SELECT srcid FROM tagxref" |
| @@ -413,11 +413,11 @@ | |
| 413 | */ |
| 414 | int wiki_page_type(const char *zPageName){ |
| 415 | if( db_get_boolean("wiki-about",1)==0 ){ |
| 416 | return WIKITYPE_NORMAL; |
| 417 | }else |
| 418 | if( sqlite3_strglob("checkin/*", zPageName)==0 |
| 419 | && db_exists("SELECT 1 FROM blob WHERE uuid=%Q",zPageName+8) |
| 420 | ){ |
| 421 | return WIKITYPE_CHECKIN; |
| 422 | }else |
| 423 | if( sqlite3_strglob("branch/*", zPageName)==0 ){ |
| @@ -447,11 +447,11 @@ | |
| 447 | ** Add an appropriate style_header() for either the /wiki or /wikiedit page |
| 448 | ** for zPageName. zExtra is an empty string for /wiki but has the text |
| 449 | ** "Edit: " for /wikiedit. |
| 450 | ** |
| 451 | ** If the page is /wiki and the page is one of the special times (check-in, |
| 452 | ** branch, or tag) and the "p" query parameter is omitted, then do a |
| 453 | ** redirect to the display of the check-in, branch, or tag rather than |
| 454 | ** continuing to the plain wiki display. |
| 455 | */ |
| 456 | static int wiki_page_header( |
| 457 | int eType, /* Page type. Might be WIKITYPE_UNKNOWN */ |
| @@ -469,11 +469,12 @@ | |
| 469 | zPageName += 8; |
| 470 | if( zExtra[0]==0 && !P("p") ){ |
| 471 | cgi_redirectf("%R/info/%s",zPageName); |
| 472 | }else{ |
| 473 | style_header("Notes About Check-in %S", zPageName); |
| 474 | style_submenu_element("Check-in Timeline","%R/timeline?f=%s", |
| 475 | zPageName); |
| 476 | style_submenu_element("Check-in Info","%R/info/%s", zPageName); |
| 477 | } |
| 478 | break; |
| 479 | } |
| 480 | case WIKITYPE_BRANCH: { |
| @@ -743,11 +744,11 @@ | |
| 744 | ** a sandbox page, but it is reported as writable here (with rid 0). |
| 745 | */ |
| 746 | static int wiki_ajax_can_write(const char *zPageName, int * pRid){ |
| 747 | int rid = 0; |
| 748 | const char * zErr = 0; |
| 749 | |
| 750 | if(pRid) *pRid = 0; |
| 751 | if(!zPageName || !*zPageName |
| 752 | || !wiki_name_is_wellformed((unsigned const char *)zPageName)){ |
| 753 | zErr = "Invalid page name."; |
| 754 | }else if(is_sandbox(zPageName)){ |
| @@ -766,11 +767,11 @@ | |
| 767 | }else{ |
| 768 | zErr = "Cannot happen! Please report this as a bug."; |
| 769 | } |
| 770 | } |
| 771 | ajax_route_error(403, "%s", zErr); |
| 772 | return 0; |
| 773 | } |
| 774 | |
| 775 | |
| 776 | /* |
| 777 | ** Emits an array of attachment info records for the given wiki page |
| @@ -1012,11 +1013,11 @@ | |
| 1013 | ** ajax_route_error(). On success, an object in the form documented |
| 1014 | ** for wiki_ajax_emit_page_object(). |
| 1015 | */ |
| 1016 | static void wiki_ajax_route_fetch(void){ |
| 1017 | const char * zPageName = P("page"); |
| 1018 | |
| 1019 | if( zPageName==0 || zPageName[0]==0 ){ |
| 1020 | ajax_route_error(400,"Missing page name."); |
| 1021 | return; |
| 1022 | } |
| 1023 | cgi_set_content_type("application/json"); |
| @@ -1203,11 +1204,11 @@ | |
| 1204 | /* |
| 1205 | ** WEBPAGE: wikiajax hidden |
| 1206 | ** |
| 1207 | ** An internal dispatcher for wiki AJAX operations. Not for direct |
| 1208 | ** client use. All routes defined by this interface are app-internal, |
| 1209 | ** subject to change |
| 1210 | */ |
| 1211 | void wiki_ajax_page(void){ |
| 1212 | const char * zName = P("name"); |
| 1213 | AjaxRoute routeName = {0,0,0,0}; |
| 1214 | const AjaxRoute * pRoute = 0; |
| @@ -1343,11 +1344,11 @@ | |
| 1344 | "class='hidden'" |
| 1345 | ">"); |
| 1346 | CX("<div>Loading wiki pages list...</div>"); |
| 1347 | CX("</div>"/*#wikiedit-tab-pages*/); |
| 1348 | } |
| 1349 | |
| 1350 | /******* Content tab *******/ |
| 1351 | { |
| 1352 | CX("<div id='wikiedit-tab-content' " |
| 1353 | "data-tab-parent='wikiedit-tabs' " |
| 1354 | "data-tab-label='Editor' " |
| @@ -1905,11 +1906,11 @@ | |
| 1906 | ** wmtime time most recent version was created |
| 1907 | ** wcnt Number of versions of this wiki page |
| 1908 | ** |
| 1909 | ** The wrid value is zero for deleted wiki pages. |
| 1910 | */ |
| 1911 | static const char listAllWikiPages[] = |
| 1912 | @ SELECT |
| 1913 | @ substr(tag.tagname, 6) AS wname, |
| 1914 | @ lower(substr(tag.tagname, 6)) AS sortname, |
| 1915 | @ tagxref.value+0 AS wrid, |
| 1916 | @ max(tagxref.mtime) AS wmtime, |
| @@ -2482,11 +2483,11 @@ | |
| 2483 | const char *zName = db_column_text(&q, 0); |
| 2484 | const int wrid = db_column_int(&q, 2); |
| 2485 | if(!showAll && !wrid){ |
| 2486 | continue; |
| 2487 | } |
| 2488 | if( !showCkBr && |
| 2489 | (sqlite3_strglob("checkin/*", zName)==0 || |
| 2490 | sqlite3_strglob("branch/*", zName)==0) ){ |
| 2491 | continue; |
| 2492 | } |
| 2493 | if( showIds ){ |
| 2494 |
+1
-1
| --- src/wikiformat.c | ||
| +++ src/wikiformat.c | ||
| @@ -2219,11 +2219,11 @@ | ||
| 2219 | 2219 | iMatchCnt = 2; |
| 2220 | 2220 | }else if( iMatchCnt==2 ){ |
| 2221 | 2221 | if( (zStart[0]=='"' || zStart[0]=='\'') && zStart[n-1]==zStart[0] ){ |
| 2222 | 2222 | zStart++; |
| 2223 | 2223 | n -= 2; |
| 2224 | - } | |
| 2224 | + } | |
| 2225 | 2225 | *pLen = n; |
| 2226 | 2226 | return zStart; |
| 2227 | 2227 | }else{ |
| 2228 | 2228 | iMatchCnt = 0; |
| 2229 | 2229 | } |
| 2230 | 2230 |
| --- src/wikiformat.c | |
| +++ src/wikiformat.c | |
| @@ -2219,11 +2219,11 @@ | |
| 2219 | iMatchCnt = 2; |
| 2220 | }else if( iMatchCnt==2 ){ |
| 2221 | if( (zStart[0]=='"' || zStart[0]=='\'') && zStart[n-1]==zStart[0] ){ |
| 2222 | zStart++; |
| 2223 | n -= 2; |
| 2224 | } |
| 2225 | *pLen = n; |
| 2226 | return zStart; |
| 2227 | }else{ |
| 2228 | iMatchCnt = 0; |
| 2229 | } |
| 2230 |
| --- src/wikiformat.c | |
| +++ src/wikiformat.c | |
| @@ -2219,11 +2219,11 @@ | |
| 2219 | iMatchCnt = 2; |
| 2220 | }else if( iMatchCnt==2 ){ |
| 2221 | if( (zStart[0]=='"' || zStart[0]=='\'') && zStart[n-1]==zStart[0] ){ |
| 2222 | zStart++; |
| 2223 | n -= 2; |
| 2224 | } |
| 2225 | *pLen = n; |
| 2226 | return zStart; |
| 2227 | }else{ |
| 2228 | iMatchCnt = 0; |
| 2229 | } |
| 2230 |
+7
-7
| --- src/winhttp.c | ||
| +++ src/winhttp.c | ||
| @@ -668,11 +668,11 @@ | ||
| 668 | 668 | /* Use a subdirectory for temp files (can then be excluded from virus scan) */ |
| 669 | 669 | zTempSubDirPath = mprintf("%s%s\\",fossil_path_to_utf8(zTmpPath),zTempSubDir); |
| 670 | 670 | if ( !file_mkdir(zTempSubDirPath, ExtFILE, 0) || |
| 671 | 671 | file_isdir(zTempSubDirPath, ExtFILE)==1 ){ |
| 672 | 672 | wcscpy(zTmpPath, fossil_utf8_to_path(zTempSubDirPath, 1)); |
| 673 | - } | |
| 673 | + } | |
| 674 | 674 | if( g.fHttpTrace ){ |
| 675 | 675 | zTempPrefix = mprintf("httptrace"); |
| 676 | 676 | }else{ |
| 677 | 677 | zTempPrefix = mprintf("%sfossil_server_P%d", |
| 678 | 678 | fossil_unicode_to_utf8(zTmpPath), iPort); |
| @@ -1372,16 +1372,16 @@ | ||
| 1372 | 1372 | SERVICE_ALL_ACCESS); |
| 1373 | 1373 | if( !hSvc ) winhttp_fatal("start", zSvcName, win32_get_last_errmsg()); |
| 1374 | 1374 | QueryServiceStatus(hSvc, &sstat); |
| 1375 | 1375 | if( sstat.dwCurrentState!=SERVICE_RUNNING ){ |
| 1376 | 1376 | fossil_print("Starting service '%s'", zSvcName); |
| 1377 | - if( sstat.dwCurrentState!=SERVICE_START_PENDING ){ | |
| 1378 | - if( !StartServiceW(hSvc, 0, NULL) ){ | |
| 1379 | - winhttp_fatal("start", zSvcName, win32_get_last_errmsg()); | |
| 1380 | - } | |
| 1381 | - QueryServiceStatus(hSvc, &sstat); | |
| 1382 | - } | |
| 1377 | + if( sstat.dwCurrentState!=SERVICE_START_PENDING ){ | |
| 1378 | + if( !StartServiceW(hSvc, 0, NULL) ){ | |
| 1379 | + winhttp_fatal("start", zSvcName, win32_get_last_errmsg()); | |
| 1380 | + } | |
| 1381 | + QueryServiceStatus(hSvc, &sstat); | |
| 1382 | + } | |
| 1383 | 1383 | while( sstat.dwCurrentState==SERVICE_START_PENDING || |
| 1384 | 1384 | sstat.dwCurrentState==SERVICE_STOPPED ){ |
| 1385 | 1385 | Sleep(100); |
| 1386 | 1386 | fossil_print("."); |
| 1387 | 1387 | QueryServiceStatus(hSvc, &sstat); |
| 1388 | 1388 |
| --- src/winhttp.c | |
| +++ src/winhttp.c | |
| @@ -668,11 +668,11 @@ | |
| 668 | /* Use a subdirectory for temp files (can then be excluded from virus scan) */ |
| 669 | zTempSubDirPath = mprintf("%s%s\\",fossil_path_to_utf8(zTmpPath),zTempSubDir); |
| 670 | if ( !file_mkdir(zTempSubDirPath, ExtFILE, 0) || |
| 671 | file_isdir(zTempSubDirPath, ExtFILE)==1 ){ |
| 672 | wcscpy(zTmpPath, fossil_utf8_to_path(zTempSubDirPath, 1)); |
| 673 | } |
| 674 | if( g.fHttpTrace ){ |
| 675 | zTempPrefix = mprintf("httptrace"); |
| 676 | }else{ |
| 677 | zTempPrefix = mprintf("%sfossil_server_P%d", |
| 678 | fossil_unicode_to_utf8(zTmpPath), iPort); |
| @@ -1372,16 +1372,16 @@ | |
| 1372 | SERVICE_ALL_ACCESS); |
| 1373 | if( !hSvc ) winhttp_fatal("start", zSvcName, win32_get_last_errmsg()); |
| 1374 | QueryServiceStatus(hSvc, &sstat); |
| 1375 | if( sstat.dwCurrentState!=SERVICE_RUNNING ){ |
| 1376 | fossil_print("Starting service '%s'", zSvcName); |
| 1377 | if( sstat.dwCurrentState!=SERVICE_START_PENDING ){ |
| 1378 | if( !StartServiceW(hSvc, 0, NULL) ){ |
| 1379 | winhttp_fatal("start", zSvcName, win32_get_last_errmsg()); |
| 1380 | } |
| 1381 | QueryServiceStatus(hSvc, &sstat); |
| 1382 | } |
| 1383 | while( sstat.dwCurrentState==SERVICE_START_PENDING || |
| 1384 | sstat.dwCurrentState==SERVICE_STOPPED ){ |
| 1385 | Sleep(100); |
| 1386 | fossil_print("."); |
| 1387 | QueryServiceStatus(hSvc, &sstat); |
| 1388 |
| --- src/winhttp.c | |
| +++ src/winhttp.c | |
| @@ -668,11 +668,11 @@ | |
| 668 | /* Use a subdirectory for temp files (can then be excluded from virus scan) */ |
| 669 | zTempSubDirPath = mprintf("%s%s\\",fossil_path_to_utf8(zTmpPath),zTempSubDir); |
| 670 | if ( !file_mkdir(zTempSubDirPath, ExtFILE, 0) || |
| 671 | file_isdir(zTempSubDirPath, ExtFILE)==1 ){ |
| 672 | wcscpy(zTmpPath, fossil_utf8_to_path(zTempSubDirPath, 1)); |
| 673 | } |
| 674 | if( g.fHttpTrace ){ |
| 675 | zTempPrefix = mprintf("httptrace"); |
| 676 | }else{ |
| 677 | zTempPrefix = mprintf("%sfossil_server_P%d", |
| 678 | fossil_unicode_to_utf8(zTmpPath), iPort); |
| @@ -1372,16 +1372,16 @@ | |
| 1372 | SERVICE_ALL_ACCESS); |
| 1373 | if( !hSvc ) winhttp_fatal("start", zSvcName, win32_get_last_errmsg()); |
| 1374 | QueryServiceStatus(hSvc, &sstat); |
| 1375 | if( sstat.dwCurrentState!=SERVICE_RUNNING ){ |
| 1376 | fossil_print("Starting service '%s'", zSvcName); |
| 1377 | if( sstat.dwCurrentState!=SERVICE_START_PENDING ){ |
| 1378 | if( !StartServiceW(hSvc, 0, NULL) ){ |
| 1379 | winhttp_fatal("start", zSvcName, win32_get_last_errmsg()); |
| 1380 | } |
| 1381 | QueryServiceStatus(hSvc, &sstat); |
| 1382 | } |
| 1383 | while( sstat.dwCurrentState==SERVICE_START_PENDING || |
| 1384 | sstat.dwCurrentState==SERVICE_STOPPED ){ |
| 1385 | Sleep(100); |
| 1386 | fossil_print("."); |
| 1387 | QueryServiceStatus(hSvc, &sstat); |
| 1388 |
+4
-4
| --- src/xfer.c | ||
| +++ src/xfer.c | ||
| @@ -355,11 +355,11 @@ | ||
| 355 | 355 | nullContent = 1; |
| 356 | 356 | } |
| 357 | 357 | |
| 358 | 358 | /* The isWriter flag must be true in order to land the new file */ |
| 359 | 359 | if( !isWriter ){ |
| 360 | - blob_appendf(&pXfer->err, "Write permissions for unversioned files missing"); | |
| 360 | + blob_appendf(&pXfer->err,"Write permissions for unversioned files missing"); | |
| 361 | 361 | goto end_accept_unversioned_file; |
| 362 | 362 | } |
| 363 | 363 | |
| 364 | 364 | /* Make sure we have a valid g.rcvid marker */ |
| 365 | 365 | content_rcvid_init(0); |
| @@ -1834,11 +1834,11 @@ | ||
| 1834 | 1834 | memset(&x, 0, sizeof(x)); |
| 1835 | 1835 | url_parse_local(zUrl, URL_OMIT_USER, &x); |
| 1836 | 1836 | if( x.name!=0 && sqlite3_strlike("%localhost%", x.name, 0)!=0 ){ |
| 1837 | 1837 | @ pragma link %F(x.canonical) %F(zArg) %lld(iMtime) |
| 1838 | 1838 | } |
| 1839 | - url_unparse(&x); | |
| 1839 | + url_unparse(&x); | |
| 1840 | 1840 | } |
| 1841 | 1841 | db_finalize(&q); |
| 1842 | 1842 | } |
| 1843 | 1843 | |
| 1844 | 1844 | /* Send the server timestamp last, in case prior processing happened |
| @@ -1859,11 +1859,11 @@ | ||
| 1859 | 1859 | ** |
| 1860 | 1860 | ** Pass the sync-protocol input file XFERFILE into the server-side sync |
| 1861 | 1861 | ** protocol handler. Generate a reply on standard output. |
| 1862 | 1862 | ** |
| 1863 | 1863 | ** This command was original created to help debug the server side of |
| 1864 | -** sync messages. The XFERFILE is the uncompressed content of an | |
| 1864 | +** sync messages. The XFERFILE is the uncompressed content of an | |
| 1865 | 1865 | ** "xfer" HTTP request from client to server. This command interprets |
| 1866 | 1866 | ** that message and generates the content of an HTTP reply (without any |
| 1867 | 1867 | ** encoding and without the HTTP reply headers) and writes that reply |
| 1868 | 1868 | ** on standard output. |
| 1869 | 1869 | ** |
| @@ -2528,11 +2528,11 @@ | ||
| 2528 | 2528 | "Warning: uv-pull-only \n" |
| 2529 | 2529 | " Unable to push unversioned content because you lack\n" |
| 2530 | 2530 | " sufficient permission on the server\n" |
| 2531 | 2531 | ); |
| 2532 | 2532 | uvPullOnly = 2; |
| 2533 | - } | |
| 2533 | + } | |
| 2534 | 2534 | if( iStatus<=3 || uvPullOnly ){ |
| 2535 | 2535 | db_multi_exec("DELETE FROM uv_tosend WHERE name=%Q", zName); |
| 2536 | 2536 | }else if( iStatus==4 ){ |
| 2537 | 2537 | db_multi_exec("UPDATE uv_tosend SET mtimeOnly=1 WHERE name=%Q",zName); |
| 2538 | 2538 | }else if( iStatus==5 ){ |
| 2539 | 2539 |
| --- src/xfer.c | |
| +++ src/xfer.c | |
| @@ -355,11 +355,11 @@ | |
| 355 | nullContent = 1; |
| 356 | } |
| 357 | |
| 358 | /* The isWriter flag must be true in order to land the new file */ |
| 359 | if( !isWriter ){ |
| 360 | blob_appendf(&pXfer->err, "Write permissions for unversioned files missing"); |
| 361 | goto end_accept_unversioned_file; |
| 362 | } |
| 363 | |
| 364 | /* Make sure we have a valid g.rcvid marker */ |
| 365 | content_rcvid_init(0); |
| @@ -1834,11 +1834,11 @@ | |
| 1834 | memset(&x, 0, sizeof(x)); |
| 1835 | url_parse_local(zUrl, URL_OMIT_USER, &x); |
| 1836 | if( x.name!=0 && sqlite3_strlike("%localhost%", x.name, 0)!=0 ){ |
| 1837 | @ pragma link %F(x.canonical) %F(zArg) %lld(iMtime) |
| 1838 | } |
| 1839 | url_unparse(&x); |
| 1840 | } |
| 1841 | db_finalize(&q); |
| 1842 | } |
| 1843 | |
| 1844 | /* Send the server timestamp last, in case prior processing happened |
| @@ -1859,11 +1859,11 @@ | |
| 1859 | ** |
| 1860 | ** Pass the sync-protocol input file XFERFILE into the server-side sync |
| 1861 | ** protocol handler. Generate a reply on standard output. |
| 1862 | ** |
| 1863 | ** This command was original created to help debug the server side of |
| 1864 | ** sync messages. The XFERFILE is the uncompressed content of an |
| 1865 | ** "xfer" HTTP request from client to server. This command interprets |
| 1866 | ** that message and generates the content of an HTTP reply (without any |
| 1867 | ** encoding and without the HTTP reply headers) and writes that reply |
| 1868 | ** on standard output. |
| 1869 | ** |
| @@ -2528,11 +2528,11 @@ | |
| 2528 | "Warning: uv-pull-only \n" |
| 2529 | " Unable to push unversioned content because you lack\n" |
| 2530 | " sufficient permission on the server\n" |
| 2531 | ); |
| 2532 | uvPullOnly = 2; |
| 2533 | } |
| 2534 | if( iStatus<=3 || uvPullOnly ){ |
| 2535 | db_multi_exec("DELETE FROM uv_tosend WHERE name=%Q", zName); |
| 2536 | }else if( iStatus==4 ){ |
| 2537 | db_multi_exec("UPDATE uv_tosend SET mtimeOnly=1 WHERE name=%Q",zName); |
| 2538 | }else if( iStatus==5 ){ |
| 2539 |
| --- src/xfer.c | |
| +++ src/xfer.c | |
| @@ -355,11 +355,11 @@ | |
| 355 | nullContent = 1; |
| 356 | } |
| 357 | |
| 358 | /* The isWriter flag must be true in order to land the new file */ |
| 359 | if( !isWriter ){ |
| 360 | blob_appendf(&pXfer->err,"Write permissions for unversioned files missing"); |
| 361 | goto end_accept_unversioned_file; |
| 362 | } |
| 363 | |
| 364 | /* Make sure we have a valid g.rcvid marker */ |
| 365 | content_rcvid_init(0); |
| @@ -1834,11 +1834,11 @@ | |
| 1834 | memset(&x, 0, sizeof(x)); |
| 1835 | url_parse_local(zUrl, URL_OMIT_USER, &x); |
| 1836 | if( x.name!=0 && sqlite3_strlike("%localhost%", x.name, 0)!=0 ){ |
| 1837 | @ pragma link %F(x.canonical) %F(zArg) %lld(iMtime) |
| 1838 | } |
| 1839 | url_unparse(&x); |
| 1840 | } |
| 1841 | db_finalize(&q); |
| 1842 | } |
| 1843 | |
| 1844 | /* Send the server timestamp last, in case prior processing happened |
| @@ -1859,11 +1859,11 @@ | |
| 1859 | ** |
| 1860 | ** Pass the sync-protocol input file XFERFILE into the server-side sync |
| 1861 | ** protocol handler. Generate a reply on standard output. |
| 1862 | ** |
| 1863 | ** This command was original created to help debug the server side of |
| 1864 | ** sync messages. The XFERFILE is the uncompressed content of an |
| 1865 | ** "xfer" HTTP request from client to server. This command interprets |
| 1866 | ** that message and generates the content of an HTTP reply (without any |
| 1867 | ** encoding and without the HTTP reply headers) and writes that reply |
| 1868 | ** on standard output. |
| 1869 | ** |
| @@ -2528,11 +2528,11 @@ | |
| 2528 | "Warning: uv-pull-only \n" |
| 2529 | " Unable to push unversioned content because you lack\n" |
| 2530 | " sufficient permission on the server\n" |
| 2531 | ); |
| 2532 | uvPullOnly = 2; |
| 2533 | } |
| 2534 | if( iStatus<=3 || uvPullOnly ){ |
| 2535 | db_multi_exec("DELETE FROM uv_tosend WHERE name=%Q", zName); |
| 2536 | }else if( iStatus==4 ){ |
| 2537 | db_multi_exec("UPDATE uv_tosend SET mtimeOnly=1 WHERE name=%Q",zName); |
| 2538 | }else if( iStatus==5 ){ |
| 2539 |
+17
-17
| --- src/zip.c | ||
| +++ src/zip.c | ||
| @@ -138,11 +138,11 @@ | ||
| 138 | 138 | static int archiveDeviceCharacteristics(sqlite3_file *pFile){ |
| 139 | 139 | return 0; |
| 140 | 140 | } |
| 141 | 141 | |
| 142 | 142 | static int archiveOpen( |
| 143 | - sqlite3_vfs *pVfs, const char *zName, | |
| 143 | + sqlite3_vfs *pVfs, const char *zName, | |
| 144 | 144 | sqlite3_file *pFile, int flags, int *pOutFlags |
| 145 | 145 | ){ |
| 146 | 146 | static struct sqlite3_io_methods methods = { |
| 147 | 147 | 1, /* iVersion */ |
| 148 | 148 | archiveClose, |
| @@ -247,12 +247,12 @@ | ||
| 247 | 247 | ** pFile is the file to be appended. zName is the name |
| 248 | 248 | ** that the file should be saved as. |
| 249 | 249 | */ |
| 250 | 250 | static void zip_add_file_to_zip( |
| 251 | 251 | Archive *p, |
| 252 | - const char *zName, | |
| 253 | - const Blob *pFile, | |
| 252 | + const char *zName, | |
| 253 | + const Blob *pFile, | |
| 254 | 254 | int mPerm |
| 255 | 255 | ){ |
| 256 | 256 | z_stream stream; |
| 257 | 257 | int nameLen; |
| 258 | 258 | int toOut = 0; |
| @@ -374,12 +374,12 @@ | ||
| 374 | 374 | nEntry++; |
| 375 | 375 | } |
| 376 | 376 | |
| 377 | 377 | static void zip_add_file_to_sqlar( |
| 378 | 378 | Archive *p, |
| 379 | - const char *zName, | |
| 380 | - const Blob *pFile, | |
| 379 | + const char *zName, | |
| 380 | + const Blob *pFile, | |
| 381 | 381 | int mPerm |
| 382 | 382 | ){ |
| 383 | 383 | int nName = (int)strlen(zName); |
| 384 | 384 | |
| 385 | 385 | if( p->db==0 ){ |
| @@ -396,16 +396,16 @@ | ||
| 396 | 396 | p->vfs.xRandomness = archiveRandomness; |
| 397 | 397 | p->vfs.xSleep = archiveSleep; |
| 398 | 398 | p->vfs.xCurrentTime = archiveCurrentTime; |
| 399 | 399 | p->vfs.xGetLastError = archiveGetLastError; |
| 400 | 400 | sqlite3_vfs_register(&p->vfs, 0); |
| 401 | - sqlite3_open_v2("file:xyz.db", &p->db, | |
| 401 | + sqlite3_open_v2("file:xyz.db", &p->db, | |
| 402 | 402 | SQLITE_OPEN_CREATE|SQLITE_OPEN_READWRITE, p->vfs.zName |
| 403 | 403 | ); |
| 404 | 404 | assert( p->db ); |
| 405 | 405 | blob_zero(&p->tmp); |
| 406 | - sqlite3_exec(p->db, | |
| 406 | + sqlite3_exec(p->db, | |
| 407 | 407 | "PRAGMA page_size=512;" |
| 408 | 408 | "PRAGMA journal_mode = off;" |
| 409 | 409 | "PRAGMA cache_spill = off;" |
| 410 | 410 | "BEGIN;" |
| 411 | 411 | "CREATE TABLE sqlar(" |
| @@ -414,12 +414,12 @@ | ||
| 414 | 414 | "mtime INT, -- last modification time\n" |
| 415 | 415 | "sz INT, -- original file size\n" |
| 416 | 416 | "data BLOB -- compressed content\n" |
| 417 | 417 | ");", 0, 0, 0 |
| 418 | 418 | ); |
| 419 | - sqlite3_prepare(p->db, | |
| 420 | - "INSERT INTO sqlar VALUES(?, ?, ?, ?, ?)", -1, | |
| 419 | + sqlite3_prepare(p->db, | |
| 420 | + "INSERT INTO sqlar VALUES(?, ?, ?, ?, ?)", -1, | |
| 421 | 421 | &p->pInsert, 0 |
| 422 | 422 | ); |
| 423 | 423 | assert( p->pInsert ); |
| 424 | 424 | |
| 425 | 425 | sqlite3_bind_int64(p->pInsert, 3, unixTime); |
| @@ -437,11 +437,11 @@ | ||
| 437 | 437 | }else{ |
| 438 | 438 | sqlite3_bind_text(p->pInsert, 1, zName, nName, SQLITE_STATIC); |
| 439 | 439 | if( mPerm==PERM_LNK ){ |
| 440 | 440 | sqlite3_bind_int(p->pInsert, 2, 0120755); |
| 441 | 441 | sqlite3_bind_int(p->pInsert, 4, -1); |
| 442 | - sqlite3_bind_text(p->pInsert, 5, | |
| 442 | + sqlite3_bind_text(p->pInsert, 5, | |
| 443 | 443 | blob_buffer(pFile), blob_size(pFile), SQLITE_STATIC |
| 444 | 444 | ); |
| 445 | 445 | }else{ |
| 446 | 446 | unsigned int nIn = blob_size(pFile); |
| 447 | 447 | unsigned long int nOut = nIn; |
| @@ -450,15 +450,15 @@ | ||
| 450 | 450 | zip_blob_minsize(&p->tmp, nIn); |
| 451 | 451 | compress( (unsigned char*) |
| 452 | 452 | blob_buffer(&p->tmp), &nOut, (unsigned char*)blob_buffer(pFile), nIn |
| 453 | 453 | ); |
| 454 | 454 | if( nOut>=(unsigned long)nIn ){ |
| 455 | - sqlite3_bind_blob(p->pInsert, 5, | |
| 455 | + sqlite3_bind_blob(p->pInsert, 5, | |
| 456 | 456 | blob_buffer(pFile), blob_size(pFile), SQLITE_STATIC |
| 457 | 457 | ); |
| 458 | 458 | }else{ |
| 459 | - sqlite3_bind_blob(p->pInsert, 5, | |
| 459 | + sqlite3_bind_blob(p->pInsert, 5, | |
| 460 | 460 | blob_buffer(&p->tmp), nOut, SQLITE_STATIC |
| 461 | 461 | ); |
| 462 | 462 | } |
| 463 | 463 | } |
| 464 | 464 | } |
| @@ -467,12 +467,12 @@ | ||
| 467 | 467 | sqlite3_reset(p->pInsert); |
| 468 | 468 | } |
| 469 | 469 | |
| 470 | 470 | static void zip_add_file( |
| 471 | 471 | Archive *p, |
| 472 | - const char *zName, | |
| 473 | - const Blob *pFile, | |
| 472 | + const char *zName, | |
| 473 | + const Blob *pFile, | |
| 474 | 474 | int mPerm |
| 475 | 475 | ){ |
| 476 | 476 | if( p->eType==ARCHIVE_ZIP ){ |
| 477 | 477 | zip_add_file_to_zip(p, zName, pFile, mPerm); |
| 478 | 478 | }else{ |
| @@ -786,11 +786,11 @@ | ||
| 786 | 786 | " WHERE event.objid=%d" |
| 787 | 787 | " AND blob.rid=%d", |
| 788 | 788 | db_get("project-name", "unnamed"), rid, rid |
| 789 | 789 | ); |
| 790 | 790 | } |
| 791 | - zip_of_checkin(eType, rid, zOut ? &zip : 0, | |
| 791 | + zip_of_checkin(eType, rid, zOut ? &zip : 0, | |
| 792 | 792 | zName, pInclude, pExclude, listFlag); |
| 793 | 793 | glob_free(pInclude); |
| 794 | 794 | glob_free(pExclude); |
| 795 | 795 | if( zOut ){ |
| 796 | 796 | blob_write_to_file(&zip, zOut); |
| @@ -947,18 +947,18 @@ | ||
| 947 | 947 | zExclude = P("ex"); |
| 948 | 948 | if( zExclude ) pExclude = glob_create(zExclude); |
| 949 | 949 | if( zInclude==0 && zExclude==0 ){ |
| 950 | 950 | etag_check_for_invariant_name(z); |
| 951 | 951 | } |
| 952 | - if( eType==ARCHIVE_ZIP | |
| 952 | + if( eType==ARCHIVE_ZIP | |
| 953 | 953 | && nName>4 |
| 954 | 954 | && fossil_strcmp(&zName[nName-4], ".zip")==0 |
| 955 | 955 | ){ |
| 956 | 956 | /* Special case: Remove the ".zip" suffix. */ |
| 957 | 957 | nName -= 4; |
| 958 | 958 | zName[nName] = 0; |
| 959 | - }else if( eType==ARCHIVE_SQLAR | |
| 959 | + }else if( eType==ARCHIVE_SQLAR | |
| 960 | 960 | && nName>6 |
| 961 | 961 | && fossil_strcmp(&zName[nName-6], ".sqlar")==0 |
| 962 | 962 | ){ |
| 963 | 963 | /* Special case: Remove the ".sqlar" suffix. */ |
| 964 | 964 | nName -= 6; |
| 965 | 965 |
| --- src/zip.c | |
| +++ src/zip.c | |
| @@ -138,11 +138,11 @@ | |
| 138 | static int archiveDeviceCharacteristics(sqlite3_file *pFile){ |
| 139 | return 0; |
| 140 | } |
| 141 | |
| 142 | static int archiveOpen( |
| 143 | sqlite3_vfs *pVfs, const char *zName, |
| 144 | sqlite3_file *pFile, int flags, int *pOutFlags |
| 145 | ){ |
| 146 | static struct sqlite3_io_methods methods = { |
| 147 | 1, /* iVersion */ |
| 148 | archiveClose, |
| @@ -247,12 +247,12 @@ | |
| 247 | ** pFile is the file to be appended. zName is the name |
| 248 | ** that the file should be saved as. |
| 249 | */ |
| 250 | static void zip_add_file_to_zip( |
| 251 | Archive *p, |
| 252 | const char *zName, |
| 253 | const Blob *pFile, |
| 254 | int mPerm |
| 255 | ){ |
| 256 | z_stream stream; |
| 257 | int nameLen; |
| 258 | int toOut = 0; |
| @@ -374,12 +374,12 @@ | |
| 374 | nEntry++; |
| 375 | } |
| 376 | |
| 377 | static void zip_add_file_to_sqlar( |
| 378 | Archive *p, |
| 379 | const char *zName, |
| 380 | const Blob *pFile, |
| 381 | int mPerm |
| 382 | ){ |
| 383 | int nName = (int)strlen(zName); |
| 384 | |
| 385 | if( p->db==0 ){ |
| @@ -396,16 +396,16 @@ | |
| 396 | p->vfs.xRandomness = archiveRandomness; |
| 397 | p->vfs.xSleep = archiveSleep; |
| 398 | p->vfs.xCurrentTime = archiveCurrentTime; |
| 399 | p->vfs.xGetLastError = archiveGetLastError; |
| 400 | sqlite3_vfs_register(&p->vfs, 0); |
| 401 | sqlite3_open_v2("file:xyz.db", &p->db, |
| 402 | SQLITE_OPEN_CREATE|SQLITE_OPEN_READWRITE, p->vfs.zName |
| 403 | ); |
| 404 | assert( p->db ); |
| 405 | blob_zero(&p->tmp); |
| 406 | sqlite3_exec(p->db, |
| 407 | "PRAGMA page_size=512;" |
| 408 | "PRAGMA journal_mode = off;" |
| 409 | "PRAGMA cache_spill = off;" |
| 410 | "BEGIN;" |
| 411 | "CREATE TABLE sqlar(" |
| @@ -414,12 +414,12 @@ | |
| 414 | "mtime INT, -- last modification time\n" |
| 415 | "sz INT, -- original file size\n" |
| 416 | "data BLOB -- compressed content\n" |
| 417 | ");", 0, 0, 0 |
| 418 | ); |
| 419 | sqlite3_prepare(p->db, |
| 420 | "INSERT INTO sqlar VALUES(?, ?, ?, ?, ?)", -1, |
| 421 | &p->pInsert, 0 |
| 422 | ); |
| 423 | assert( p->pInsert ); |
| 424 | |
| 425 | sqlite3_bind_int64(p->pInsert, 3, unixTime); |
| @@ -437,11 +437,11 @@ | |
| 437 | }else{ |
| 438 | sqlite3_bind_text(p->pInsert, 1, zName, nName, SQLITE_STATIC); |
| 439 | if( mPerm==PERM_LNK ){ |
| 440 | sqlite3_bind_int(p->pInsert, 2, 0120755); |
| 441 | sqlite3_bind_int(p->pInsert, 4, -1); |
| 442 | sqlite3_bind_text(p->pInsert, 5, |
| 443 | blob_buffer(pFile), blob_size(pFile), SQLITE_STATIC |
| 444 | ); |
| 445 | }else{ |
| 446 | unsigned int nIn = blob_size(pFile); |
| 447 | unsigned long int nOut = nIn; |
| @@ -450,15 +450,15 @@ | |
| 450 | zip_blob_minsize(&p->tmp, nIn); |
| 451 | compress( (unsigned char*) |
| 452 | blob_buffer(&p->tmp), &nOut, (unsigned char*)blob_buffer(pFile), nIn |
| 453 | ); |
| 454 | if( nOut>=(unsigned long)nIn ){ |
| 455 | sqlite3_bind_blob(p->pInsert, 5, |
| 456 | blob_buffer(pFile), blob_size(pFile), SQLITE_STATIC |
| 457 | ); |
| 458 | }else{ |
| 459 | sqlite3_bind_blob(p->pInsert, 5, |
| 460 | blob_buffer(&p->tmp), nOut, SQLITE_STATIC |
| 461 | ); |
| 462 | } |
| 463 | } |
| 464 | } |
| @@ -467,12 +467,12 @@ | |
| 467 | sqlite3_reset(p->pInsert); |
| 468 | } |
| 469 | |
| 470 | static void zip_add_file( |
| 471 | Archive *p, |
| 472 | const char *zName, |
| 473 | const Blob *pFile, |
| 474 | int mPerm |
| 475 | ){ |
| 476 | if( p->eType==ARCHIVE_ZIP ){ |
| 477 | zip_add_file_to_zip(p, zName, pFile, mPerm); |
| 478 | }else{ |
| @@ -786,11 +786,11 @@ | |
| 786 | " WHERE event.objid=%d" |
| 787 | " AND blob.rid=%d", |
| 788 | db_get("project-name", "unnamed"), rid, rid |
| 789 | ); |
| 790 | } |
| 791 | zip_of_checkin(eType, rid, zOut ? &zip : 0, |
| 792 | zName, pInclude, pExclude, listFlag); |
| 793 | glob_free(pInclude); |
| 794 | glob_free(pExclude); |
| 795 | if( zOut ){ |
| 796 | blob_write_to_file(&zip, zOut); |
| @@ -947,18 +947,18 @@ | |
| 947 | zExclude = P("ex"); |
| 948 | if( zExclude ) pExclude = glob_create(zExclude); |
| 949 | if( zInclude==0 && zExclude==0 ){ |
| 950 | etag_check_for_invariant_name(z); |
| 951 | } |
| 952 | if( eType==ARCHIVE_ZIP |
| 953 | && nName>4 |
| 954 | && fossil_strcmp(&zName[nName-4], ".zip")==0 |
| 955 | ){ |
| 956 | /* Special case: Remove the ".zip" suffix. */ |
| 957 | nName -= 4; |
| 958 | zName[nName] = 0; |
| 959 | }else if( eType==ARCHIVE_SQLAR |
| 960 | && nName>6 |
| 961 | && fossil_strcmp(&zName[nName-6], ".sqlar")==0 |
| 962 | ){ |
| 963 | /* Special case: Remove the ".sqlar" suffix. */ |
| 964 | nName -= 6; |
| 965 |
| --- src/zip.c | |
| +++ src/zip.c | |
| @@ -138,11 +138,11 @@ | |
| 138 | static int archiveDeviceCharacteristics(sqlite3_file *pFile){ |
| 139 | return 0; |
| 140 | } |
| 141 | |
| 142 | static int archiveOpen( |
| 143 | sqlite3_vfs *pVfs, const char *zName, |
| 144 | sqlite3_file *pFile, int flags, int *pOutFlags |
| 145 | ){ |
| 146 | static struct sqlite3_io_methods methods = { |
| 147 | 1, /* iVersion */ |
| 148 | archiveClose, |
| @@ -247,12 +247,12 @@ | |
| 247 | ** pFile is the file to be appended. zName is the name |
| 248 | ** that the file should be saved as. |
| 249 | */ |
| 250 | static void zip_add_file_to_zip( |
| 251 | Archive *p, |
| 252 | const char *zName, |
| 253 | const Blob *pFile, |
| 254 | int mPerm |
| 255 | ){ |
| 256 | z_stream stream; |
| 257 | int nameLen; |
| 258 | int toOut = 0; |
| @@ -374,12 +374,12 @@ | |
| 374 | nEntry++; |
| 375 | } |
| 376 | |
| 377 | static void zip_add_file_to_sqlar( |
| 378 | Archive *p, |
| 379 | const char *zName, |
| 380 | const Blob *pFile, |
| 381 | int mPerm |
| 382 | ){ |
| 383 | int nName = (int)strlen(zName); |
| 384 | |
| 385 | if( p->db==0 ){ |
| @@ -396,16 +396,16 @@ | |
| 396 | p->vfs.xRandomness = archiveRandomness; |
| 397 | p->vfs.xSleep = archiveSleep; |
| 398 | p->vfs.xCurrentTime = archiveCurrentTime; |
| 399 | p->vfs.xGetLastError = archiveGetLastError; |
| 400 | sqlite3_vfs_register(&p->vfs, 0); |
| 401 | sqlite3_open_v2("file:xyz.db", &p->db, |
| 402 | SQLITE_OPEN_CREATE|SQLITE_OPEN_READWRITE, p->vfs.zName |
| 403 | ); |
| 404 | assert( p->db ); |
| 405 | blob_zero(&p->tmp); |
| 406 | sqlite3_exec(p->db, |
| 407 | "PRAGMA page_size=512;" |
| 408 | "PRAGMA journal_mode = off;" |
| 409 | "PRAGMA cache_spill = off;" |
| 410 | "BEGIN;" |
| 411 | "CREATE TABLE sqlar(" |
| @@ -414,12 +414,12 @@ | |
| 414 | "mtime INT, -- last modification time\n" |
| 415 | "sz INT, -- original file size\n" |
| 416 | "data BLOB -- compressed content\n" |
| 417 | ");", 0, 0, 0 |
| 418 | ); |
| 419 | sqlite3_prepare(p->db, |
| 420 | "INSERT INTO sqlar VALUES(?, ?, ?, ?, ?)", -1, |
| 421 | &p->pInsert, 0 |
| 422 | ); |
| 423 | assert( p->pInsert ); |
| 424 | |
| 425 | sqlite3_bind_int64(p->pInsert, 3, unixTime); |
| @@ -437,11 +437,11 @@ | |
| 437 | }else{ |
| 438 | sqlite3_bind_text(p->pInsert, 1, zName, nName, SQLITE_STATIC); |
| 439 | if( mPerm==PERM_LNK ){ |
| 440 | sqlite3_bind_int(p->pInsert, 2, 0120755); |
| 441 | sqlite3_bind_int(p->pInsert, 4, -1); |
| 442 | sqlite3_bind_text(p->pInsert, 5, |
| 443 | blob_buffer(pFile), blob_size(pFile), SQLITE_STATIC |
| 444 | ); |
| 445 | }else{ |
| 446 | unsigned int nIn = blob_size(pFile); |
| 447 | unsigned long int nOut = nIn; |
| @@ -450,15 +450,15 @@ | |
| 450 | zip_blob_minsize(&p->tmp, nIn); |
| 451 | compress( (unsigned char*) |
| 452 | blob_buffer(&p->tmp), &nOut, (unsigned char*)blob_buffer(pFile), nIn |
| 453 | ); |
| 454 | if( nOut>=(unsigned long)nIn ){ |
| 455 | sqlite3_bind_blob(p->pInsert, 5, |
| 456 | blob_buffer(pFile), blob_size(pFile), SQLITE_STATIC |
| 457 | ); |
| 458 | }else{ |
| 459 | sqlite3_bind_blob(p->pInsert, 5, |
| 460 | blob_buffer(&p->tmp), nOut, SQLITE_STATIC |
| 461 | ); |
| 462 | } |
| 463 | } |
| 464 | } |
| @@ -467,12 +467,12 @@ | |
| 467 | sqlite3_reset(p->pInsert); |
| 468 | } |
| 469 | |
| 470 | static void zip_add_file( |
| 471 | Archive *p, |
| 472 | const char *zName, |
| 473 | const Blob *pFile, |
| 474 | int mPerm |
| 475 | ){ |
| 476 | if( p->eType==ARCHIVE_ZIP ){ |
| 477 | zip_add_file_to_zip(p, zName, pFile, mPerm); |
| 478 | }else{ |
| @@ -786,11 +786,11 @@ | |
| 786 | " WHERE event.objid=%d" |
| 787 | " AND blob.rid=%d", |
| 788 | db_get("project-name", "unnamed"), rid, rid |
| 789 | ); |
| 790 | } |
| 791 | zip_of_checkin(eType, rid, zOut ? &zip : 0, |
| 792 | zName, pInclude, pExclude, listFlag); |
| 793 | glob_free(pInclude); |
| 794 | glob_free(pExclude); |
| 795 | if( zOut ){ |
| 796 | blob_write_to_file(&zip, zOut); |
| @@ -947,18 +947,18 @@ | |
| 947 | zExclude = P("ex"); |
| 948 | if( zExclude ) pExclude = glob_create(zExclude); |
| 949 | if( zInclude==0 && zExclude==0 ){ |
| 950 | etag_check_for_invariant_name(z); |
| 951 | } |
| 952 | if( eType==ARCHIVE_ZIP |
| 953 | && nName>4 |
| 954 | && fossil_strcmp(&zName[nName-4], ".zip")==0 |
| 955 | ){ |
| 956 | /* Special case: Remove the ".zip" suffix. */ |
| 957 | nName -= 4; |
| 958 | zName[nName] = 0; |
| 959 | }else if( eType==ARCHIVE_SQLAR |
| 960 | && nName>6 |
| 961 | && fossil_strcmp(&zName[nName-6], ".sqlar")==0 |
| 962 | ){ |
| 963 | /* Special case: Remove the ".sqlar" suffix. */ |
| 964 | nName -= 6; |
| 965 |
+1
-1
| --- tools/codecheck1.c | ||
| +++ tools/codecheck1.c | ||
| @@ -604,11 +604,11 @@ | ||
| 604 | 604 | if( never_safe(zExpr) ){ |
| 605 | 605 | printf("%s:%d: Argument %d to %.*s() is not safe for" |
| 606 | 606 | " a query parameter\n", |
| 607 | 607 | zFilename, lnFCall, i+fmtArg, szFName, zFCall); |
| 608 | 608 | nErr++; |
| 609 | - | |
| 609 | + | |
| 610 | 610 | }else if( (fmtFlags & FMT_SQL)!=0 && !is_sql_safe(zExpr) ){ |
| 611 | 611 | printf("%s:%d: Argument %d to %.*s() not safe for SQL\n", |
| 612 | 612 | zFilename, lnFCall, i+fmtArg, szFName, zFCall); |
| 613 | 613 | nErr++; |
| 614 | 614 | } |
| 615 | 615 |
| --- tools/codecheck1.c | |
| +++ tools/codecheck1.c | |
| @@ -604,11 +604,11 @@ | |
| 604 | if( never_safe(zExpr) ){ |
| 605 | printf("%s:%d: Argument %d to %.*s() is not safe for" |
| 606 | " a query parameter\n", |
| 607 | zFilename, lnFCall, i+fmtArg, szFName, zFCall); |
| 608 | nErr++; |
| 609 | |
| 610 | }else if( (fmtFlags & FMT_SQL)!=0 && !is_sql_safe(zExpr) ){ |
| 611 | printf("%s:%d: Argument %d to %.*s() not safe for SQL\n", |
| 612 | zFilename, lnFCall, i+fmtArg, szFName, zFCall); |
| 613 | nErr++; |
| 614 | } |
| 615 |
| --- tools/codecheck1.c | |
| +++ tools/codecheck1.c | |
| @@ -604,11 +604,11 @@ | |
| 604 | if( never_safe(zExpr) ){ |
| 605 | printf("%s:%d: Argument %d to %.*s() is not safe for" |
| 606 | " a query parameter\n", |
| 607 | zFilename, lnFCall, i+fmtArg, szFName, zFCall); |
| 608 | nErr++; |
| 609 | |
| 610 | }else if( (fmtFlags & FMT_SQL)!=0 && !is_sql_safe(zExpr) ){ |
| 611 | printf("%s:%d: Argument %d to %.*s() not safe for SQL\n", |
| 612 | zFilename, lnFCall, i+fmtArg, szFName, zFCall); |
| 613 | nErr++; |
| 614 | } |
| 615 |
+4
-2
| --- tools/makeheaders.c | ||
| +++ tools/makeheaders.c | ||
| @@ -38,11 +38,12 @@ | ||
| 38 | 38 | #include <memory.h> |
| 39 | 39 | #include <sys/stat.h> |
| 40 | 40 | #include <assert.h> |
| 41 | 41 | #include <string.h> |
| 42 | 42 | |
| 43 | -#if defined( __MINGW32__) || defined(__DMC__) || defined(_MSC_VER) || defined(__POCC__) | |
| 43 | +#if defined( __MINGW32__) || defined(__DMC__) || \ | |
| 44 | + defined(_MSC_VER) || defined(__POCC__) | |
| 44 | 45 | # ifndef WIN32 |
| 45 | 46 | # define WIN32 |
| 46 | 47 | # endif |
| 47 | 48 | #else |
| 48 | 49 | # include <unistd.h> |
| @@ -2226,11 +2227,12 @@ | ||
| 2226 | 2227 | PushIfMacro(0,0,0,pToken->nLine,PS_Interface); |
| 2227 | 2228 | }else if( nArg==16 && strncmp(zArg,"EXPORT_INTERFACE",16)==0 ){ |
| 2228 | 2229 | PushIfMacro(0,0,0,pToken->nLine,PS_Export); |
| 2229 | 2230 | }else if( nArg==15 && strncmp(zArg,"LOCAL_INTERFACE",15)==0 ){ |
| 2230 | 2231 | PushIfMacro(0,0,0,pToken->nLine,PS_Local); |
| 2231 | - }else if( nArg==15 && strncmp(zArg,"MAKEHEADERS_STOPLOCAL_INTERFACE",15)==0 ){ | |
| 2232 | + }else if( nArg==15 && | |
| 2233 | + strncmp(zArg,"MAKEHEADERS_STOPLOCAL_INTERFACE",15)==0 ){ | |
| 2232 | 2234 | PushIfMacro(0,0,0,pToken->nLine,PS_Local); |
| 2233 | 2235 | }else{ |
| 2234 | 2236 | PushIfMacro(0,zArg,nArg,pToken->nLine,0); |
| 2235 | 2237 | } |
| 2236 | 2238 | }else if( nCmd==5 && strncmp(zCmd,"ifdef",5)==0 ){ |
| 2237 | 2239 |
| --- tools/makeheaders.c | |
| +++ tools/makeheaders.c | |
| @@ -38,11 +38,12 @@ | |
| 38 | #include <memory.h> |
| 39 | #include <sys/stat.h> |
| 40 | #include <assert.h> |
| 41 | #include <string.h> |
| 42 | |
| 43 | #if defined( __MINGW32__) || defined(__DMC__) || defined(_MSC_VER) || defined(__POCC__) |
| 44 | # ifndef WIN32 |
| 45 | # define WIN32 |
| 46 | # endif |
| 47 | #else |
| 48 | # include <unistd.h> |
| @@ -2226,11 +2227,12 @@ | |
| 2226 | PushIfMacro(0,0,0,pToken->nLine,PS_Interface); |
| 2227 | }else if( nArg==16 && strncmp(zArg,"EXPORT_INTERFACE",16)==0 ){ |
| 2228 | PushIfMacro(0,0,0,pToken->nLine,PS_Export); |
| 2229 | }else if( nArg==15 && strncmp(zArg,"LOCAL_INTERFACE",15)==0 ){ |
| 2230 | PushIfMacro(0,0,0,pToken->nLine,PS_Local); |
| 2231 | }else if( nArg==15 && strncmp(zArg,"MAKEHEADERS_STOPLOCAL_INTERFACE",15)==0 ){ |
| 2232 | PushIfMacro(0,0,0,pToken->nLine,PS_Local); |
| 2233 | }else{ |
| 2234 | PushIfMacro(0,zArg,nArg,pToken->nLine,0); |
| 2235 | } |
| 2236 | }else if( nCmd==5 && strncmp(zCmd,"ifdef",5)==0 ){ |
| 2237 |
| --- tools/makeheaders.c | |
| +++ tools/makeheaders.c | |
| @@ -38,11 +38,12 @@ | |
| 38 | #include <memory.h> |
| 39 | #include <sys/stat.h> |
| 40 | #include <assert.h> |
| 41 | #include <string.h> |
| 42 | |
| 43 | #if defined( __MINGW32__) || defined(__DMC__) || \ |
| 44 | defined(_MSC_VER) || defined(__POCC__) |
| 45 | # ifndef WIN32 |
| 46 | # define WIN32 |
| 47 | # endif |
| 48 | #else |
| 49 | # include <unistd.h> |
| @@ -2226,11 +2227,12 @@ | |
| 2227 | PushIfMacro(0,0,0,pToken->nLine,PS_Interface); |
| 2228 | }else if( nArg==16 && strncmp(zArg,"EXPORT_INTERFACE",16)==0 ){ |
| 2229 | PushIfMacro(0,0,0,pToken->nLine,PS_Export); |
| 2230 | }else if( nArg==15 && strncmp(zArg,"LOCAL_INTERFACE",15)==0 ){ |
| 2231 | PushIfMacro(0,0,0,pToken->nLine,PS_Local); |
| 2232 | }else if( nArg==15 && |
| 2233 | strncmp(zArg,"MAKEHEADERS_STOPLOCAL_INTERFACE",15)==0 ){ |
| 2234 | PushIfMacro(0,0,0,pToken->nLine,PS_Local); |
| 2235 | }else{ |
| 2236 | PushIfMacro(0,zArg,nArg,pToken->nLine,0); |
| 2237 | } |
| 2238 | }else if( nCmd==5 && strncmp(zCmd,"ifdef",5)==0 ){ |
| 2239 |
+1
-1
| --- tools/mkindex.c | ||
| +++ tools/mkindex.c | ||
| @@ -38,11 +38,11 @@ | ||
| 38 | 38 | ** |
| 39 | 39 | ** Commands are 1st-tier by default. If the command name begins with |
| 40 | 40 | ** "test-" or if the command name has a "test" argument, then it becomes |
| 41 | 41 | ** a test command. If the command name has a "2nd-tier" argument or ends |
| 42 | 42 | ** with a "*" character, it is second tier. If the command name has an "alias" |
| 43 | -** argument or ends with a "#" character, it is an alias: another name | |
| 43 | +** argument or ends with a "#" character, it is an alias: another name | |
| 44 | 44 | ** (a one-to-one replacement) for a command. Examples: |
| 45 | 45 | ** |
| 46 | 46 | ** COMMAND: abcde* |
| 47 | 47 | ** COMMAND: fghij 2nd-tier |
| 48 | 48 | ** COMMAND: mnopq# |
| 49 | 49 |
| --- tools/mkindex.c | |
| +++ tools/mkindex.c | |
| @@ -38,11 +38,11 @@ | |
| 38 | ** |
| 39 | ** Commands are 1st-tier by default. If the command name begins with |
| 40 | ** "test-" or if the command name has a "test" argument, then it becomes |
| 41 | ** a test command. If the command name has a "2nd-tier" argument or ends |
| 42 | ** with a "*" character, it is second tier. If the command name has an "alias" |
| 43 | ** argument or ends with a "#" character, it is an alias: another name |
| 44 | ** (a one-to-one replacement) for a command. Examples: |
| 45 | ** |
| 46 | ** COMMAND: abcde* |
| 47 | ** COMMAND: fghij 2nd-tier |
| 48 | ** COMMAND: mnopq# |
| 49 |
| --- tools/mkindex.c | |
| +++ tools/mkindex.c | |
| @@ -38,11 +38,11 @@ | |
| 38 | ** |
| 39 | ** Commands are 1st-tier by default. If the command name begins with |
| 40 | ** "test-" or if the command name has a "test" argument, then it becomes |
| 41 | ** a test command. If the command name has a "2nd-tier" argument or ends |
| 42 | ** with a "*" character, it is second tier. If the command name has an "alias" |
| 43 | ** argument or ends with a "#" character, it is an alias: another name |
| 44 | ** (a one-to-one replacement) for a command. Examples: |
| 45 | ** |
| 46 | ** COMMAND: abcde* |
| 47 | ** COMMAND: fghij 2nd-tier |
| 48 | ** COMMAND: mnopq# |
| 49 |
+2
-2
| --- tools/skintxt2config.c | ||
| +++ tools/skintxt2config.c | ||
| @@ -1,6 +1,6 @@ | ||
| 1 | -/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ | |
| 1 | +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ | |
| 2 | 2 | /* vim: set ts=2 et sw=2 tw=80: */ |
| 3 | 3 | /* |
| 4 | 4 | ** Copyright (c) 2021 Stephan Beal (https://wanderinghorse.net/home/stephan/) |
| 5 | 5 | ** |
| 6 | 6 | ** This program is free software; you can redistribute it and/or |
| @@ -102,11 +102,11 @@ | ||
| 102 | 102 | if(rc){ |
| 103 | 103 | free(zMem); |
| 104 | 104 | }else{ |
| 105 | 105 | *zContent = zMem; |
| 106 | 106 | *nContent = fpos; |
| 107 | - } | |
| 107 | + } | |
| 108 | 108 | return rc; |
| 109 | 109 | } |
| 110 | 110 | |
| 111 | 111 | /* |
| 112 | 112 | ** Expects zFilename to be one of the conventional skin filename |
| 113 | 113 |
| --- tools/skintxt2config.c | |
| +++ tools/skintxt2config.c | |
| @@ -1,6 +1,6 @@ | |
| 1 | /* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ |
| 2 | /* vim: set ts=2 et sw=2 tw=80: */ |
| 3 | /* |
| 4 | ** Copyright (c) 2021 Stephan Beal (https://wanderinghorse.net/home/stephan/) |
| 5 | ** |
| 6 | ** This program is free software; you can redistribute it and/or |
| @@ -102,11 +102,11 @@ | |
| 102 | if(rc){ |
| 103 | free(zMem); |
| 104 | }else{ |
| 105 | *zContent = zMem; |
| 106 | *nContent = fpos; |
| 107 | } |
| 108 | return rc; |
| 109 | } |
| 110 | |
| 111 | /* |
| 112 | ** Expects zFilename to be one of the conventional skin filename |
| 113 |
| --- tools/skintxt2config.c | |
| +++ tools/skintxt2config.c | |
| @@ -1,6 +1,6 @@ | |
| 1 | /* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ |
| 2 | /* vim: set ts=2 et sw=2 tw=80: */ |
| 3 | /* |
| 4 | ** Copyright (c) 2021 Stephan Beal (https://wanderinghorse.net/home/stephan/) |
| 5 | ** |
| 6 | ** This program is free software; you can redistribute it and/or |
| @@ -102,11 +102,11 @@ | |
| 102 | if(rc){ |
| 103 | free(zMem); |
| 104 | }else{ |
| 105 | *zContent = zMem; |
| 106 | *nContent = fpos; |
| 107 | } |
| 108 | return rc; |
| 109 | } |
| 110 | |
| 111 | /* |
| 112 | ** Expects zFilename to be one of the conventional skin filename |
| 113 |
+4
-2
| --- tools/sqlcompattest.c | ||
| +++ tools/sqlcompattest.c | ||
| @@ -53,11 +53,12 @@ | ||
| 53 | 53 | |
| 54 | 54 | #define QUOTE(VAL) #VAL |
| 55 | 55 | #define STR(MACRO_VAL) QUOTE(MACRO_VAL) |
| 56 | 56 | |
| 57 | 57 | char zMinimumVersionNumber[8]="nn.nn.nn"; |
| 58 | - strncpy((char *)&zMinimumVersionNumber,STR(MINIMUM_SQLITE_VERSION),sizeof(zMinimumVersionNumber)); | |
| 58 | + strncpy((char *)&zMinimumVersionNumber,STR(MINIMUM_SQLITE_VERSION), | |
| 59 | + sizeof(zMinimumVersionNumber)); | |
| 59 | 60 | |
| 60 | 61 | long major, minor, release, version; |
| 61 | 62 | sscanf(zMinimumVersionNumber, "%li.%li.%li", &major, &minor, &release); |
| 62 | 63 | version=(major*1000000)+(minor*1000)+release; |
| 63 | 64 | |
| @@ -67,11 +68,12 @@ | ||
| 67 | 68 | "ENABLE_DBSTAT_VTAB", /* Required by /repo-tabsize page */ |
| 68 | 69 | }; |
| 69 | 70 | |
| 70 | 71 | /* Check minimum SQLite version number */ |
| 71 | 72 | if( sqlite3_libversion_number()<version ){ |
| 72 | - printf("found system SQLite version %s but need %s or later, consider removing --disable-internal-sqlite\n", | |
| 73 | + printf("found system SQLite version %s but need %s or later, " | |
| 74 | + "consider removing --disable-internal-sqlite\n", | |
| 73 | 75 | sqlite3_libversion(),STR(MINIMUM_SQLITE_VERSION)); |
| 74 | 76 | return 1; |
| 75 | 77 | } |
| 76 | 78 | |
| 77 | 79 | for(i=0; i<sizeof(zRequiredOpts)/sizeof(zRequiredOpts[0]); i++){ |
| 78 | 80 |
| --- tools/sqlcompattest.c | |
| +++ tools/sqlcompattest.c | |
| @@ -53,11 +53,12 @@ | |
| 53 | |
| 54 | #define QUOTE(VAL) #VAL |
| 55 | #define STR(MACRO_VAL) QUOTE(MACRO_VAL) |
| 56 | |
| 57 | char zMinimumVersionNumber[8]="nn.nn.nn"; |
| 58 | strncpy((char *)&zMinimumVersionNumber,STR(MINIMUM_SQLITE_VERSION),sizeof(zMinimumVersionNumber)); |
| 59 | |
| 60 | long major, minor, release, version; |
| 61 | sscanf(zMinimumVersionNumber, "%li.%li.%li", &major, &minor, &release); |
| 62 | version=(major*1000000)+(minor*1000)+release; |
| 63 | |
| @@ -67,11 +68,12 @@ | |
| 67 | "ENABLE_DBSTAT_VTAB", /* Required by /repo-tabsize page */ |
| 68 | }; |
| 69 | |
| 70 | /* Check minimum SQLite version number */ |
| 71 | if( sqlite3_libversion_number()<version ){ |
| 72 | printf("found system SQLite version %s but need %s or later, consider removing --disable-internal-sqlite\n", |
| 73 | sqlite3_libversion(),STR(MINIMUM_SQLITE_VERSION)); |
| 74 | return 1; |
| 75 | } |
| 76 | |
| 77 | for(i=0; i<sizeof(zRequiredOpts)/sizeof(zRequiredOpts[0]); i++){ |
| 78 |
| --- tools/sqlcompattest.c | |
| +++ tools/sqlcompattest.c | |
| @@ -53,11 +53,12 @@ | |
| 53 | |
| 54 | #define QUOTE(VAL) #VAL |
| 55 | #define STR(MACRO_VAL) QUOTE(MACRO_VAL) |
| 56 | |
| 57 | char zMinimumVersionNumber[8]="nn.nn.nn"; |
| 58 | strncpy((char *)&zMinimumVersionNumber,STR(MINIMUM_SQLITE_VERSION), |
| 59 | sizeof(zMinimumVersionNumber)); |
| 60 | |
| 61 | long major, minor, release, version; |
| 62 | sscanf(zMinimumVersionNumber, "%li.%li.%li", &major, &minor, &release); |
| 63 | version=(major*1000000)+(minor*1000)+release; |
| 64 | |
| @@ -67,11 +68,12 @@ | |
| 68 | "ENABLE_DBSTAT_VTAB", /* Required by /repo-tabsize page */ |
| 69 | }; |
| 70 | |
| 71 | /* Check minimum SQLite version number */ |
| 72 | if( sqlite3_libversion_number()<version ){ |
| 73 | printf("found system SQLite version %s but need %s or later, " |
| 74 | "consider removing --disable-internal-sqlite\n", |
| 75 | sqlite3_libversion(),STR(MINIMUM_SQLITE_VERSION)); |
| 76 | return 1; |
| 77 | } |
| 78 | |
| 79 | for(i=0; i<sizeof(zRequiredOpts)/sizeof(zRequiredOpts[0]); i++){ |
| 80 |