Fossil SCM

Merge trunk.. including use of the urlData object the global "g" variable which fix byte alignment problem..

mgagnon 2014-03-31 18:57 UTC fix-cat-dash-R merge
Commit 7cb29889cae39d970ce740115fb71bd2454762d6
+2 -2
--- src/add.c
+++ src/add.c
@@ -25,11 +25,11 @@
2525
#include "cygsup.h"
2626
2727
/*
2828
** This routine returns the names of files in a working checkout that
2929
** are created by Fossil itself, and hence should not be added, deleted,
30
-** or merge, and should be omitted from "clean" and "extra" lists.
30
+** or merge, and should be omitted from "clean" and "extras" lists.
3131
**
3232
** Return the N-th name. The first name has N==0. When all names have
3333
** been used, return 0.
3434
*/
3535
const char *fossil_reserved_name(int N, int omitRepo){
@@ -461,11 +461,11 @@
461461
**
462462
** Do all necessary "add" and "rm" commands to synchronize the repository
463463
** with the content of the working checkout:
464464
**
465465
** * All files in the checkout but not in the repository (that is,
466
-** all files displayed using the "extra" command) are added as
466
+** all files displayed using the "extras" command) are added as
467467
** if by the "add" command.
468468
**
469469
** * All files in the repository but missing from the checkout (that is,
470470
** all files that show as MISSING with the "status" command) are
471471
** removed as if by the "rm" command.
472472
--- src/add.c
+++ src/add.c
@@ -25,11 +25,11 @@
25 #include "cygsup.h"
26
27 /*
28 ** This routine returns the names of files in a working checkout that
29 ** are created by Fossil itself, and hence should not be added, deleted,
30 ** or merge, and should be omitted from "clean" and "extra" lists.
31 **
32 ** Return the N-th name. The first name has N==0. When all names have
33 ** been used, return 0.
34 */
35 const char *fossil_reserved_name(int N, int omitRepo){
@@ -461,11 +461,11 @@
461 **
462 ** Do all necessary "add" and "rm" commands to synchronize the repository
463 ** with the content of the working checkout:
464 **
465 ** * All files in the checkout but not in the repository (that is,
466 ** all files displayed using the "extra" command) are added as
467 ** if by the "add" command.
468 **
469 ** * All files in the repository but missing from the checkout (that is,
470 ** all files that show as MISSING with the "status" command) are
471 ** removed as if by the "rm" command.
472
--- src/add.c
+++ src/add.c
@@ -25,11 +25,11 @@
25 #include "cygsup.h"
26
27 /*
28 ** This routine returns the names of files in a working checkout that
29 ** are created by Fossil itself, and hence should not be added, deleted,
30 ** or merge, and should be omitted from "clean" and "extras" lists.
31 **
32 ** Return the N-th name. The first name has N==0. When all names have
33 ** been used, return 0.
34 */
35 const char *fossil_reserved_name(int N, int omitRepo){
@@ -461,11 +461,11 @@
461 **
462 ** Do all necessary "add" and "rm" commands to synchronize the repository
463 ** with the content of the working checkout:
464 **
465 ** * All files in the checkout but not in the repository (that is,
466 ** all files displayed using the "extras" command) are added as
467 ** if by the "add" command.
468 **
469 ** * All files in the repository but missing from the checkout (that is,
470 ** all files that show as MISSING with the "status" command) are
471 ** removed as if by the "rm" command.
472
+12 -7
--- src/allrepo.c
+++ src/allrepo.c
@@ -76,11 +76,11 @@
7676
7777
7878
/*
7979
** COMMAND: all
8080
**
81
-** Usage: %fossil all (changes|clean|extra|ignore|list|ls|pull|push|rebuild|sync)
81
+** Usage: %fossil all (changes|clean|extras|ignore|list|ls|pull|push|rebuild|sync)
8282
**
8383
** The ~/.fossil file records the location of all repositories for a
8484
** user. This command performs certain operations on all repositories
8585
** that can be useful before or after a period of disconnected operation.
8686
**
@@ -99,16 +99,16 @@
9999
** and the --whatif option to carefully review the files to
100100
** be deleted beforehand is highly recommended. The command
101101
** line options supported by the clean command itself, if any
102102
** are present, are passed along verbatim.
103103
**
104
-** extra Shows extra files from all local checkouts. The command
104
+** extras Shows "extra" files from all local checkouts. The command
105105
** line options supported by the extra command itself, if any
106106
** are present, are passed along verbatim.
107107
**
108108
** ignore Arguments are repositories that should be ignored by
109
-** subsequent clean, extra, list, pull, push, rebuild, and
109
+** subsequent clean, extras, list, pull, push, rebuild, and
110110
** sync operations. The -c|--ckout option causes the listed
111111
** local checkouts to be ignored instead.
112112
**
113113
** list | ls Display the location of all repositories. The -c|--ckout
114114
** option causes all local checkouts to be listed instead.
@@ -136,10 +136,11 @@
136136
** when one of the following commands are run against the repository:
137137
** clone, info, pull, push, or sync. Even previously ignored repositories
138138
** are added back to the list of repositories by these commands.
139139
**
140140
** Options:
141
+** --showfile Show the repository or checkout being operated upon.
141142
** --dontstop Continue with other repositories even after an error.
142143
** --dry-run If given, display instead of run actions.
143144
*/
144145
void all_cmd(void){
145146
int n;
@@ -150,10 +151,11 @@
150151
char *zQFilename;
151152
Blob extra;
152153
int useCheckouts = 0;
153154
int quiet = 0;
154155
int dryRunFlag = 0;
156
+ int showFile = find_option("showfile",0,0)!=0;
155157
int stopOnError = find_option("dontstop",0,0)==0;
156158
int rc;
157159
int nToDel = 0;
158160
159161
dryRunFlag = find_option("dry-run","n",0)!=0;
@@ -160,11 +162,11 @@
160162
if( !dryRunFlag ){
161163
dryRunFlag = find_option("test",0,0)!=0; /* deprecated */
162164
}
163165
164166
if( g.argc<3 ){
165
- usage("changes|clean|extra|ignore|list|ls|pull|push|rebuild|sync");
167
+ usage("changes|clean|extras|ignore|list|ls|pull|push|rebuild|sync");
166168
}
167169
n = strlen(g.argv[2]);
168170
db_open_config(1);
169171
blob_zero(&extra);
170172
zCmd = g.argv[2];
@@ -185,12 +187,12 @@
185187
collect_argument_value(&extra, "keep");
186188
collect_argument(&extra, "temp",0);
187189
collect_argument(&extra, "verbose","v");
188190
collect_argument(&extra, "whatif",0);
189191
useCheckouts = 1;
190
- }else if( strncmp(zCmd, "extra", n)==0 ){
191
- zCmd = "extra --chdir";
192
+ }else if( strncmp(zCmd, "extras", n)==0 ){
193
+ zCmd = "extras --chdir";
192194
collect_argument(&extra, "abs-paths",0);
193195
collect_argument_value(&extra, "case-sensitive");
194196
collect_argument(&extra, "dotfiles",0);
195197
collect_argument_value(&extra, "ignore");
196198
collect_argument(&extra, "rel-paths",0);
@@ -254,11 +256,11 @@
254256
}
255257
db_end_transaction(0);
256258
return;
257259
}else{
258260
fossil_fatal("\"all\" subcommand should be one of: "
259
- "changes clean extra ignore list ls push pull rebuild sync");
261
+ "changes clean extras ignore list ls push pull rebuild sync");
260262
}
261263
verify_all_options();
262264
zFossil = quoteFilename(g.nameOfExe);
263265
if( useCheckouts ){
264266
db_prepare(&q,
@@ -287,10 +289,13 @@
287289
continue;
288290
}
289291
if( zCmd[0]=='l' ){
290292
fossil_print("%s\n", zFilename);
291293
continue;
294
+ }else if( showFile ){
295
+ fossil_print("%s: %s\n", useCheckouts ? "checkout" : "repository",
296
+ zFilename);
292297
}
293298
zQFilename = quoteFilename(zFilename);
294299
zSyscmd = mprintf("%s %s %s%s",
295300
zFossil, zCmd, zQFilename, blob_str(&extra));
296301
if( !quiet || dryRunFlag ){
297302
--- src/allrepo.c
+++ src/allrepo.c
@@ -76,11 +76,11 @@
76
77
78 /*
79 ** COMMAND: all
80 **
81 ** Usage: %fossil all (changes|clean|extra|ignore|list|ls|pull|push|rebuild|sync)
82 **
83 ** The ~/.fossil file records the location of all repositories for a
84 ** user. This command performs certain operations on all repositories
85 ** that can be useful before or after a period of disconnected operation.
86 **
@@ -99,16 +99,16 @@
99 ** and the --whatif option to carefully review the files to
100 ** be deleted beforehand is highly recommended. The command
101 ** line options supported by the clean command itself, if any
102 ** are present, are passed along verbatim.
103 **
104 ** extra Shows extra files from all local checkouts. The command
105 ** line options supported by the extra command itself, if any
106 ** are present, are passed along verbatim.
107 **
108 ** ignore Arguments are repositories that should be ignored by
109 ** subsequent clean, extra, list, pull, push, rebuild, and
110 ** sync operations. The -c|--ckout option causes the listed
111 ** local checkouts to be ignored instead.
112 **
113 ** list | ls Display the location of all repositories. The -c|--ckout
114 ** option causes all local checkouts to be listed instead.
@@ -136,10 +136,11 @@
136 ** when one of the following commands are run against the repository:
137 ** clone, info, pull, push, or sync. Even previously ignored repositories
138 ** are added back to the list of repositories by these commands.
139 **
140 ** Options:
 
141 ** --dontstop Continue with other repositories even after an error.
142 ** --dry-run If given, display instead of run actions.
143 */
144 void all_cmd(void){
145 int n;
@@ -150,10 +151,11 @@
150 char *zQFilename;
151 Blob extra;
152 int useCheckouts = 0;
153 int quiet = 0;
154 int dryRunFlag = 0;
 
155 int stopOnError = find_option("dontstop",0,0)==0;
156 int rc;
157 int nToDel = 0;
158
159 dryRunFlag = find_option("dry-run","n",0)!=0;
@@ -160,11 +162,11 @@
160 if( !dryRunFlag ){
161 dryRunFlag = find_option("test",0,0)!=0; /* deprecated */
162 }
163
164 if( g.argc<3 ){
165 usage("changes|clean|extra|ignore|list|ls|pull|push|rebuild|sync");
166 }
167 n = strlen(g.argv[2]);
168 db_open_config(1);
169 blob_zero(&extra);
170 zCmd = g.argv[2];
@@ -185,12 +187,12 @@
185 collect_argument_value(&extra, "keep");
186 collect_argument(&extra, "temp",0);
187 collect_argument(&extra, "verbose","v");
188 collect_argument(&extra, "whatif",0);
189 useCheckouts = 1;
190 }else if( strncmp(zCmd, "extra", n)==0 ){
191 zCmd = "extra --chdir";
192 collect_argument(&extra, "abs-paths",0);
193 collect_argument_value(&extra, "case-sensitive");
194 collect_argument(&extra, "dotfiles",0);
195 collect_argument_value(&extra, "ignore");
196 collect_argument(&extra, "rel-paths",0);
@@ -254,11 +256,11 @@
254 }
255 db_end_transaction(0);
256 return;
257 }else{
258 fossil_fatal("\"all\" subcommand should be one of: "
259 "changes clean extra ignore list ls push pull rebuild sync");
260 }
261 verify_all_options();
262 zFossil = quoteFilename(g.nameOfExe);
263 if( useCheckouts ){
264 db_prepare(&q,
@@ -287,10 +289,13 @@
287 continue;
288 }
289 if( zCmd[0]=='l' ){
290 fossil_print("%s\n", zFilename);
291 continue;
 
 
 
292 }
293 zQFilename = quoteFilename(zFilename);
294 zSyscmd = mprintf("%s %s %s%s",
295 zFossil, zCmd, zQFilename, blob_str(&extra));
296 if( !quiet || dryRunFlag ){
297
--- src/allrepo.c
+++ src/allrepo.c
@@ -76,11 +76,11 @@
76
77
78 /*
79 ** COMMAND: all
80 **
81 ** Usage: %fossil all (changes|clean|extras|ignore|list|ls|pull|push|rebuild|sync)
82 **
83 ** The ~/.fossil file records the location of all repositories for a
84 ** user. This command performs certain operations on all repositories
85 ** that can be useful before or after a period of disconnected operation.
86 **
@@ -99,16 +99,16 @@
99 ** and the --whatif option to carefully review the files to
100 ** be deleted beforehand is highly recommended. The command
101 ** line options supported by the clean command itself, if any
102 ** are present, are passed along verbatim.
103 **
104 ** extras Shows "extra" files from all local checkouts. The command
105 ** line options supported by the extra command itself, if any
106 ** are present, are passed along verbatim.
107 **
108 ** ignore Arguments are repositories that should be ignored by
109 ** subsequent clean, extras, list, pull, push, rebuild, and
110 ** sync operations. The -c|--ckout option causes the listed
111 ** local checkouts to be ignored instead.
112 **
113 ** list | ls Display the location of all repositories. The -c|--ckout
114 ** option causes all local checkouts to be listed instead.
@@ -136,10 +136,11 @@
136 ** when one of the following commands are run against the repository:
137 ** clone, info, pull, push, or sync. Even previously ignored repositories
138 ** are added back to the list of repositories by these commands.
139 **
140 ** Options:
141 ** --showfile Show the repository or checkout being operated upon.
142 ** --dontstop Continue with other repositories even after an error.
143 ** --dry-run If given, display instead of run actions.
144 */
145 void all_cmd(void){
146 int n;
@@ -150,10 +151,11 @@
151 char *zQFilename;
152 Blob extra;
153 int useCheckouts = 0;
154 int quiet = 0;
155 int dryRunFlag = 0;
156 int showFile = find_option("showfile",0,0)!=0;
157 int stopOnError = find_option("dontstop",0,0)==0;
158 int rc;
159 int nToDel = 0;
160
161 dryRunFlag = find_option("dry-run","n",0)!=0;
@@ -160,11 +162,11 @@
162 if( !dryRunFlag ){
163 dryRunFlag = find_option("test",0,0)!=0; /* deprecated */
164 }
165
166 if( g.argc<3 ){
167 usage("changes|clean|extras|ignore|list|ls|pull|push|rebuild|sync");
168 }
169 n = strlen(g.argv[2]);
170 db_open_config(1);
171 blob_zero(&extra);
172 zCmd = g.argv[2];
@@ -185,12 +187,12 @@
187 collect_argument_value(&extra, "keep");
188 collect_argument(&extra, "temp",0);
189 collect_argument(&extra, "verbose","v");
190 collect_argument(&extra, "whatif",0);
191 useCheckouts = 1;
192 }else if( strncmp(zCmd, "extras", n)==0 ){
193 zCmd = "extras --chdir";
194 collect_argument(&extra, "abs-paths",0);
195 collect_argument_value(&extra, "case-sensitive");
196 collect_argument(&extra, "dotfiles",0);
197 collect_argument_value(&extra, "ignore");
198 collect_argument(&extra, "rel-paths",0);
@@ -254,11 +256,11 @@
256 }
257 db_end_transaction(0);
258 return;
259 }else{
260 fossil_fatal("\"all\" subcommand should be one of: "
261 "changes clean extras ignore list ls push pull rebuild sync");
262 }
263 verify_all_options();
264 zFossil = quoteFilename(g.nameOfExe);
265 if( useCheckouts ){
266 db_prepare(&q,
@@ -287,10 +289,13 @@
289 continue;
290 }
291 if( zCmd[0]=='l' ){
292 fossil_print("%s\n", zFilename);
293 continue;
294 }else if( showFile ){
295 fossil_print("%s: %s\n", useCheckouts ? "checkout" : "repository",
296 zFilename);
297 }
298 zQFilename = quoteFilename(zFilename);
299 zSyscmd = mprintf("%s %s %s%s",
300 zFossil, zCmd, zQFilename, blob_str(&extra));
301 if( !quiet || dryRunFlag ){
302
+4 -4
--- src/attach.c
+++ src/attach.c
@@ -258,11 +258,11 @@
258258
zTkt = db_text(0, "SELECT substr(tagname,5) FROM tag"
259259
" WHERE tagname GLOB 'tkt-%q*'", zTkt);
260260
if( zTkt==0 ) fossil_redirect_home();
261261
}
262262
zTarget = zTkt;
263
- zTargetType = mprintf("Ticket <a href=\"%s/tktview/%S\">%S</a>",
263
+ zTargetType = mprintf("Ticket <a href=\"%s/tktview/%s\">%S</a>",
264264
g.zTop, zTkt, zTkt);
265265
}
266266
if( zFrom==0 ) zFrom = mprintf("%s/home", g.zTop);
267267
if( P("cancel") ){
268268
cgi_redirect(zFrom);
@@ -463,11 +463,11 @@
463463
if( strcmp(zModAction,"approve")==0 ){
464464
moderation_approve(rid);
465465
}
466466
}
467467
style_header("Attachment Details");
468
- style_submenu_element("Raw", "Raw", "%R/artifact/%S", zUuid);
468
+ style_submenu_element("Raw", "Raw", "%R/artifact/%s", zUuid);
469469
470470
@ <div class="section">Overview</div>
471471
@ <p><table class="label-value">
472472
@ <tr><th>Artifact&nbsp;ID:</th>
473473
@ <td>%z(href("%R/artifact/%s",zUuid))%s(zUuid)</a>
@@ -531,12 +531,12 @@
531531
@ <pre>
532532
@ %h(z)
533533
@ </pre>
534534
}
535535
}else if( strncmp(zMime, "image/", 6)==0 ){
536
- @ <img src="%R/raw/%S(zSrc)?m=%s(zMime)"></img>
537
- style_submenu_element("Image", "Image", "%R/raw/%S?m=%s", zSrc, zMime);
536
+ @ <img src="%R/raw/%s(zSrc)?m=%s(zMime)"></img>
537
+ style_submenu_element("Image", "Image", "%R/raw/%s?m=%s", zSrc, zMime);
538538
}else{
539539
int sz = db_int(0, "SELECT size FROM blob WHERE rid=%d", ridSrc);
540540
@ <i>(file is %d(sz) bytes of binary data)</i>
541541
}
542542
@ </blockquote>
543543
--- src/attach.c
+++ src/attach.c
@@ -258,11 +258,11 @@
258 zTkt = db_text(0, "SELECT substr(tagname,5) FROM tag"
259 " WHERE tagname GLOB 'tkt-%q*'", zTkt);
260 if( zTkt==0 ) fossil_redirect_home();
261 }
262 zTarget = zTkt;
263 zTargetType = mprintf("Ticket <a href=\"%s/tktview/%S\">%S</a>",
264 g.zTop, zTkt, zTkt);
265 }
266 if( zFrom==0 ) zFrom = mprintf("%s/home", g.zTop);
267 if( P("cancel") ){
268 cgi_redirect(zFrom);
@@ -463,11 +463,11 @@
463 if( strcmp(zModAction,"approve")==0 ){
464 moderation_approve(rid);
465 }
466 }
467 style_header("Attachment Details");
468 style_submenu_element("Raw", "Raw", "%R/artifact/%S", zUuid);
469
470 @ <div class="section">Overview</div>
471 @ <p><table class="label-value">
472 @ <tr><th>Artifact&nbsp;ID:</th>
473 @ <td>%z(href("%R/artifact/%s",zUuid))%s(zUuid)</a>
@@ -531,12 +531,12 @@
531 @ <pre>
532 @ %h(z)
533 @ </pre>
534 }
535 }else if( strncmp(zMime, "image/", 6)==0 ){
536 @ <img src="%R/raw/%S(zSrc)?m=%s(zMime)"></img>
537 style_submenu_element("Image", "Image", "%R/raw/%S?m=%s", zSrc, zMime);
538 }else{
539 int sz = db_int(0, "SELECT size FROM blob WHERE rid=%d", ridSrc);
540 @ <i>(file is %d(sz) bytes of binary data)</i>
541 }
542 @ </blockquote>
543
--- src/attach.c
+++ src/attach.c
@@ -258,11 +258,11 @@
258 zTkt = db_text(0, "SELECT substr(tagname,5) FROM tag"
259 " WHERE tagname GLOB 'tkt-%q*'", zTkt);
260 if( zTkt==0 ) fossil_redirect_home();
261 }
262 zTarget = zTkt;
263 zTargetType = mprintf("Ticket <a href=\"%s/tktview/%s\">%S</a>",
264 g.zTop, zTkt, zTkt);
265 }
266 if( zFrom==0 ) zFrom = mprintf("%s/home", g.zTop);
267 if( P("cancel") ){
268 cgi_redirect(zFrom);
@@ -463,11 +463,11 @@
463 if( strcmp(zModAction,"approve")==0 ){
464 moderation_approve(rid);
465 }
466 }
467 style_header("Attachment Details");
468 style_submenu_element("Raw", "Raw", "%R/artifact/%s", zUuid);
469
470 @ <div class="section">Overview</div>
471 @ <p><table class="label-value">
472 @ <tr><th>Artifact&nbsp;ID:</th>
473 @ <td>%z(href("%R/artifact/%s",zUuid))%s(zUuid)</a>
@@ -531,12 +531,12 @@
531 @ <pre>
532 @ %h(z)
533 @ </pre>
534 }
535 }else if( strncmp(zMime, "image/", 6)==0 ){
536 @ <img src="%R/raw/%s(zSrc)?m=%s(zMime)"></img>
537 style_submenu_element("Image", "Image", "%R/raw/%s?m=%s", zSrc, zMime);
538 }else{
539 int sz = db_int(0, "SELECT size FROM blob WHERE rid=%d", ridSrc);
540 @ <i>(file is %d(sz) bytes of binary data)</i>
541 }
542 @ </blockquote>
543
+6 -6
--- src/checkin.c
+++ src/checkin.c
@@ -179,11 +179,11 @@
179179
** --sha1sum Verify file status using SHA1 hashing rather
180180
** than relying on file mtimes.
181181
** --header Identify the repository if there are changes
182182
** -v|--verbose Say "(none)" if there are no changes
183183
**
184
-** See also: extra, ls, status
184
+** See also: extras, ls, status
185185
*/
186186
void changes_cmd(void){
187187
Blob report;
188188
int vid;
189189
int useSha1sum = find_option("sha1sum", 0, 0)!=0;
@@ -223,11 +223,11 @@
223223
** --rel-paths Display pathnames relative to the current working
224224
** directory.
225225
** --sha1sum Verify file status using SHA1 hashing rather
226226
** than relying on file mtimes.
227227
**
228
-** See also: changes, extra, ls
228
+** See also: changes, extras, ls
229229
*/
230230
void status_cmd(void){
231231
int vid;
232232
db_must_be_within_tree();
233233
/* 012345678901234 */
@@ -255,11 +255,11 @@
255255
**
256256
** Options:
257257
** --age Show when each file was committed
258258
** -v|--verbose Provide extra information about each file.
259259
**
260
-** See also: changes, extra, status
260
+** See also: changes, extras, status
261261
*/
262262
void ls_cmd(void){
263263
int vid;
264264
Stmt q;
265265
int verboseFlag;
@@ -439,11 +439,11 @@
439439
** --rel-paths Display pathnames relative to the current working
440440
** directory.
441441
**
442442
** See also: changes, clean, status
443443
*/
444
-void extra_cmd(void){
444
+void extras_cmd(void){
445445
Stmt q;
446446
const char *zIgnoreFlag = find_option("ignore",0,1);
447447
unsigned scanFlags = find_option("dotfiles",0,0)!=0 ? SCAN_ALL : 0;
448448
int cwdRelative = 0;
449449
Glob *pIgnore;
@@ -536,11 +536,11 @@
536536
** list of glob patterns.
537537
** -n|--dry-run If given, display instead of run actions.
538538
** --temp Remove only Fossil-generated temporary files.
539539
** -v|--verbose Show all files as they are removed.
540540
**
541
-** See also: addremove, extra, status
541
+** See also: addremove, extras, status
542542
*/
543543
void clean_cmd(void){
544544
int allFileFlag, allDirFlag, dryRunFlag, verboseFlag;
545545
int emptyDirsFlag, dirsOnlyFlag;
546546
unsigned scanFlags = 0;
@@ -1408,11 +1408,11 @@
14081408
** --private do not sync changes and their descendants
14091409
** --sha1sum verify file status using SHA1 hashing rather
14101410
** than relying on file mtimes
14111411
** --tag TAG-NAME assign given tag TAG-NAME to the checkin
14121412
**
1413
-** See also: branch, changes, checkout, extra, sync
1413
+** See also: branch, changes, checkout, extras, sync
14141414
*/
14151415
void commit_cmd(void){
14161416
int hasChanges; /* True if unsaved changes exist */
14171417
int vid; /* blob-id of parent version */
14181418
int nrid; /* blob-id of a modified file */
14191419
--- src/checkin.c
+++ src/checkin.c
@@ -179,11 +179,11 @@
179 ** --sha1sum Verify file status using SHA1 hashing rather
180 ** than relying on file mtimes.
181 ** --header Identify the repository if there are changes
182 ** -v|--verbose Say "(none)" if there are no changes
183 **
184 ** See also: extra, ls, status
185 */
186 void changes_cmd(void){
187 Blob report;
188 int vid;
189 int useSha1sum = find_option("sha1sum", 0, 0)!=0;
@@ -223,11 +223,11 @@
223 ** --rel-paths Display pathnames relative to the current working
224 ** directory.
225 ** --sha1sum Verify file status using SHA1 hashing rather
226 ** than relying on file mtimes.
227 **
228 ** See also: changes, extra, ls
229 */
230 void status_cmd(void){
231 int vid;
232 db_must_be_within_tree();
233 /* 012345678901234 */
@@ -255,11 +255,11 @@
255 **
256 ** Options:
257 ** --age Show when each file was committed
258 ** -v|--verbose Provide extra information about each file.
259 **
260 ** See also: changes, extra, status
261 */
262 void ls_cmd(void){
263 int vid;
264 Stmt q;
265 int verboseFlag;
@@ -439,11 +439,11 @@
439 ** --rel-paths Display pathnames relative to the current working
440 ** directory.
441 **
442 ** See also: changes, clean, status
443 */
444 void extra_cmd(void){
445 Stmt q;
446 const char *zIgnoreFlag = find_option("ignore",0,1);
447 unsigned scanFlags = find_option("dotfiles",0,0)!=0 ? SCAN_ALL : 0;
448 int cwdRelative = 0;
449 Glob *pIgnore;
@@ -536,11 +536,11 @@
536 ** list of glob patterns.
537 ** -n|--dry-run If given, display instead of run actions.
538 ** --temp Remove only Fossil-generated temporary files.
539 ** -v|--verbose Show all files as they are removed.
540 **
541 ** See also: addremove, extra, status
542 */
543 void clean_cmd(void){
544 int allFileFlag, allDirFlag, dryRunFlag, verboseFlag;
545 int emptyDirsFlag, dirsOnlyFlag;
546 unsigned scanFlags = 0;
@@ -1408,11 +1408,11 @@
1408 ** --private do not sync changes and their descendants
1409 ** --sha1sum verify file status using SHA1 hashing rather
1410 ** than relying on file mtimes
1411 ** --tag TAG-NAME assign given tag TAG-NAME to the checkin
1412 **
1413 ** See also: branch, changes, checkout, extra, sync
1414 */
1415 void commit_cmd(void){
1416 int hasChanges; /* True if unsaved changes exist */
1417 int vid; /* blob-id of parent version */
1418 int nrid; /* blob-id of a modified file */
1419
--- src/checkin.c
+++ src/checkin.c
@@ -179,11 +179,11 @@
179 ** --sha1sum Verify file status using SHA1 hashing rather
180 ** than relying on file mtimes.
181 ** --header Identify the repository if there are changes
182 ** -v|--verbose Say "(none)" if there are no changes
183 **
184 ** See also: extras, ls, status
185 */
186 void changes_cmd(void){
187 Blob report;
188 int vid;
189 int useSha1sum = find_option("sha1sum", 0, 0)!=0;
@@ -223,11 +223,11 @@
223 ** --rel-paths Display pathnames relative to the current working
224 ** directory.
225 ** --sha1sum Verify file status using SHA1 hashing rather
226 ** than relying on file mtimes.
227 **
228 ** See also: changes, extras, ls
229 */
230 void status_cmd(void){
231 int vid;
232 db_must_be_within_tree();
233 /* 012345678901234 */
@@ -255,11 +255,11 @@
255 **
256 ** Options:
257 ** --age Show when each file was committed
258 ** -v|--verbose Provide extra information about each file.
259 **
260 ** See also: changes, extras, status
261 */
262 void ls_cmd(void){
263 int vid;
264 Stmt q;
265 int verboseFlag;
@@ -439,11 +439,11 @@
439 ** --rel-paths Display pathnames relative to the current working
440 ** directory.
441 **
442 ** See also: changes, clean, status
443 */
444 void extras_cmd(void){
445 Stmt q;
446 const char *zIgnoreFlag = find_option("ignore",0,1);
447 unsigned scanFlags = find_option("dotfiles",0,0)!=0 ? SCAN_ALL : 0;
448 int cwdRelative = 0;
449 Glob *pIgnore;
@@ -536,11 +536,11 @@
536 ** list of glob patterns.
537 ** -n|--dry-run If given, display instead of run actions.
538 ** --temp Remove only Fossil-generated temporary files.
539 ** -v|--verbose Show all files as they are removed.
540 **
541 ** See also: addremove, extras, status
542 */
543 void clean_cmd(void){
544 int allFileFlag, allDirFlag, dryRunFlag, verboseFlag;
545 int emptyDirsFlag, dirsOnlyFlag;
546 unsigned scanFlags = 0;
@@ -1408,11 +1408,11 @@
1408 ** --private do not sync changes and their descendants
1409 ** --sha1sum verify file status using SHA1 hashing rather
1410 ** than relying on file mtimes
1411 ** --tag TAG-NAME assign given tag TAG-NAME to the checkin
1412 **
1413 ** See also: branch, changes, checkout, extras, sync
1414 */
1415 void commit_cmd(void){
1416 int hasChanges; /* True if unsaved changes exist */
1417 int vid; /* blob-id of parent version */
1418 int nrid; /* blob-id of a modified file */
1419
+6 -6
--- src/clone.c
+++ src/clone.c
@@ -136,13 +136,13 @@
136136
if( file_size(g.argv[3])>0 ){
137137
fossil_fatal("file already exists: %s", g.argv[3]);
138138
}
139139
140140
url_parse(g.argv[2], urlFlags);
141
- if( zDefaultUser==0 && g.urlUser!=0 ) zDefaultUser = g.urlUser;
142
- if( g.urlIsFile ){
143
- file_copy(g.urlName, g.argv[3]);
141
+ if( zDefaultUser==0 && g.url.user!=0 ) zDefaultUser = g.url.user;
142
+ if( g.url.isFile ){
143
+ file_copy(g.url.name, g.argv[3]);
144144
db_close(1);
145145
db_open_repository(g.argv[3]);
146146
db_record_repository_filename(g.argv[3]);
147147
url_remember();
148148
if( !bPrivate ) delete_private_content();
@@ -211,11 +211,11 @@
211211
void remember_or_get_http_auth(
212212
const char *zHttpAuth, /* Credentials in the form "user:password" */
213213
int fRemember, /* True to remember credentials for later reuse */
214214
const char *zUrl /* URL for which these credentials apply */
215215
){
216
- char *zKey = mprintf("http-auth:%s", g.urlCanonical);
216
+ char *zKey = mprintf("http-auth:%s", g.url.canonical);
217217
if( zHttpAuth && zHttpAuth[0] ){
218218
g.zHttpAuth = mprintf("%s", zHttpAuth);
219219
}
220220
if( fRemember ){
221221
if( g.zHttpAuth && g.zHttpAuth[0] ){
@@ -233,20 +233,20 @@
233233
234234
/*
235235
** Get the HTTP Authorization preference from db.
236236
*/
237237
char *get_httpauth(void){
238
- char *zKey = mprintf("http-auth:%s", g.urlCanonical);
238
+ char *zKey = mprintf("http-auth:%s", g.url.canonical);
239239
return unobscure(db_get(zKey, 0));
240240
free(zKey);
241241
}
242242
243243
/*
244244
** Set the HTTP Authorization preference in db.
245245
*/
246246
void set_httpauth(const char *zHttpAuth){
247
- char *zKey = mprintf("http-auth:%s", g.urlCanonical);
247
+ char *zKey = mprintf("http-auth:%s", g.url.canonical);
248248
db_set(zKey, obscure(zHttpAuth), 0);
249249
free(zKey);
250250
}
251251
252252
/*
253253
--- src/clone.c
+++ src/clone.c
@@ -136,13 +136,13 @@
136 if( file_size(g.argv[3])>0 ){
137 fossil_fatal("file already exists: %s", g.argv[3]);
138 }
139
140 url_parse(g.argv[2], urlFlags);
141 if( zDefaultUser==0 && g.urlUser!=0 ) zDefaultUser = g.urlUser;
142 if( g.urlIsFile ){
143 file_copy(g.urlName, g.argv[3]);
144 db_close(1);
145 db_open_repository(g.argv[3]);
146 db_record_repository_filename(g.argv[3]);
147 url_remember();
148 if( !bPrivate ) delete_private_content();
@@ -211,11 +211,11 @@
211 void remember_or_get_http_auth(
212 const char *zHttpAuth, /* Credentials in the form "user:password" */
213 int fRemember, /* True to remember credentials for later reuse */
214 const char *zUrl /* URL for which these credentials apply */
215 ){
216 char *zKey = mprintf("http-auth:%s", g.urlCanonical);
217 if( zHttpAuth && zHttpAuth[0] ){
218 g.zHttpAuth = mprintf("%s", zHttpAuth);
219 }
220 if( fRemember ){
221 if( g.zHttpAuth && g.zHttpAuth[0] ){
@@ -233,20 +233,20 @@
233
234 /*
235 ** Get the HTTP Authorization preference from db.
236 */
237 char *get_httpauth(void){
238 char *zKey = mprintf("http-auth:%s", g.urlCanonical);
239 return unobscure(db_get(zKey, 0));
240 free(zKey);
241 }
242
243 /*
244 ** Set the HTTP Authorization preference in db.
245 */
246 void set_httpauth(const char *zHttpAuth){
247 char *zKey = mprintf("http-auth:%s", g.urlCanonical);
248 db_set(zKey, obscure(zHttpAuth), 0);
249 free(zKey);
250 }
251
252 /*
253
--- src/clone.c
+++ src/clone.c
@@ -136,13 +136,13 @@
136 if( file_size(g.argv[3])>0 ){
137 fossil_fatal("file already exists: %s", g.argv[3]);
138 }
139
140 url_parse(g.argv[2], urlFlags);
141 if( zDefaultUser==0 && g.url.user!=0 ) zDefaultUser = g.url.user;
142 if( g.url.isFile ){
143 file_copy(g.url.name, g.argv[3]);
144 db_close(1);
145 db_open_repository(g.argv[3]);
146 db_record_repository_filename(g.argv[3]);
147 url_remember();
148 if( !bPrivate ) delete_private_content();
@@ -211,11 +211,11 @@
211 void remember_or_get_http_auth(
212 const char *zHttpAuth, /* Credentials in the form "user:password" */
213 int fRemember, /* True to remember credentials for later reuse */
214 const char *zUrl /* URL for which these credentials apply */
215 ){
216 char *zKey = mprintf("http-auth:%s", g.url.canonical);
217 if( zHttpAuth && zHttpAuth[0] ){
218 g.zHttpAuth = mprintf("%s", zHttpAuth);
219 }
220 if( fRemember ){
221 if( g.zHttpAuth && g.zHttpAuth[0] ){
@@ -233,20 +233,20 @@
233
234 /*
235 ** Get the HTTP Authorization preference from db.
236 */
237 char *get_httpauth(void){
238 char *zKey = mprintf("http-auth:%s", g.url.canonical);
239 return unobscure(db_get(zKey, 0));
240 free(zKey);
241 }
242
243 /*
244 ** Set the HTTP Authorization preference in db.
245 */
246 void set_httpauth(const char *zHttpAuth){
247 char *zKey = mprintf("http-auth:%s", g.url.canonical);
248 db_set(zKey, obscure(zHttpAuth), 0);
249 free(zKey);
250 }
251
252 /*
253
+1 -1
--- src/configure.c
+++ src/configure.c
@@ -924,11 +924,11 @@
924924
mask = configure_name_to_mask(g.argv[3], 1);
925925
if( g.argc==5 ){
926926
zServer = g.argv[4];
927927
}
928928
url_parse(zServer, URL_PROMPT_PW);
929
- if( g.urlProtocol==0 ) fossil_fatal("no server URL specified");
929
+ if( g.url.protocol==0 ) fossil_fatal("no server URL specified");
930930
user_select();
931931
url_enable_proxy("via proxy: ");
932932
if( legacyFlag ) mask |= CONFIGSET_OLDFORMAT;
933933
if( overwriteFlag ) mask |= CONFIGSET_OVERWRITE;
934934
if( strncmp(zMethod, "push", n)==0 ){
935935
--- src/configure.c
+++ src/configure.c
@@ -924,11 +924,11 @@
924 mask = configure_name_to_mask(g.argv[3], 1);
925 if( g.argc==5 ){
926 zServer = g.argv[4];
927 }
928 url_parse(zServer, URL_PROMPT_PW);
929 if( g.urlProtocol==0 ) fossil_fatal("no server URL specified");
930 user_select();
931 url_enable_proxy("via proxy: ");
932 if( legacyFlag ) mask |= CONFIGSET_OLDFORMAT;
933 if( overwriteFlag ) mask |= CONFIGSET_OVERWRITE;
934 if( strncmp(zMethod, "push", n)==0 ){
935
--- src/configure.c
+++ src/configure.c
@@ -924,11 +924,11 @@
924 mask = configure_name_to_mask(g.argv[3], 1);
925 if( g.argc==5 ){
926 zServer = g.argv[4];
927 }
928 url_parse(zServer, URL_PROMPT_PW);
929 if( g.url.protocol==0 ) fossil_fatal("no server URL specified");
930 user_select();
931 url_enable_proxy("via proxy: ");
932 if( legacyFlag ) mask |= CONFIGSET_OLDFORMAT;
933 if( overwriteFlag ) mask |= CONFIGSET_OVERWRITE;
934 if( strncmp(zMethod, "push", n)==0 ){
935
+1 -1
--- src/delta.c
+++ src/delta.c
@@ -467,11 +467,11 @@
467467
zDelta += lenOut-base;
468468
}
469469
/* Output the final checksum record. */
470470
putInt(checksum(zOut, lenOut), &zDelta);
471471
*(zDelta++) = ';';
472
- free(collide);
472
+ fossil_free(collide);
473473
return zDelta - zOrigDelta;
474474
}
475475
476476
/*
477477
** Return the size (in bytes) of the output from applying
478478
--- src/delta.c
+++ src/delta.c
@@ -467,11 +467,11 @@
467 zDelta += lenOut-base;
468 }
469 /* Output the final checksum record. */
470 putInt(checksum(zOut, lenOut), &zDelta);
471 *(zDelta++) = ';';
472 free(collide);
473 return zDelta - zOrigDelta;
474 }
475
476 /*
477 ** Return the size (in bytes) of the output from applying
478
--- src/delta.c
+++ src/delta.c
@@ -467,11 +467,11 @@
467 zDelta += lenOut-base;
468 }
469 /* Output the final checksum record. */
470 putInt(checksum(zOut, lenOut), &zDelta);
471 *(zDelta++) = ';';
472 fossil_free(collide);
473 return zDelta - zOrigDelta;
474 }
475
476 /*
477 ** Return the size (in bytes) of the output from applying
478
+1 -1
--- src/diff.c
+++ src/diff.c
@@ -225,11 +225,11 @@
225225
while( a<pA->n && b<pB->n ){
226226
if( pA->z[a++] != pB->z[b++] ) return 0;
227227
while( a<pA->n && fossil_isspace(pA->z[a])) ++a;
228228
while( b<pB->n && fossil_isspace(pB->z[b])) ++b;
229229
}
230
- return pA->n-a == b<pB->n-b;
230
+ return pA->n-a == pB->n-b;
231231
}
232232
return 0;
233233
}
234234
235235
/*
236236
--- src/diff.c
+++ src/diff.c
@@ -225,11 +225,11 @@
225 while( a<pA->n && b<pB->n ){
226 if( pA->z[a++] != pB->z[b++] ) return 0;
227 while( a<pA->n && fossil_isspace(pA->z[a])) ++a;
228 while( b<pB->n && fossil_isspace(pB->z[b])) ++b;
229 }
230 return pA->n-a == b<pB->n-b;
231 }
232 return 0;
233 }
234
235 /*
236
--- src/diff.c
+++ src/diff.c
@@ -225,11 +225,11 @@
225 while( a<pA->n && b<pB->n ){
226 if( pA->z[a++] != pB->z[b++] ) return 0;
227 while( a<pA->n && fossil_isspace(pA->z[a])) ++a;
228 while( b<pB->n && fossil_isspace(pB->z[b])) ++b;
229 }
230 return pA->n-a == pB->n-b;
231 }
232 return 0;
233 }
234
235 /*
236
+6 -10
--- src/finfo.c
+++ src/finfo.c
@@ -386,11 +386,11 @@
386386
}
387387
blob_reset(&sql);
388388
blob_zero(&title);
389389
if( baseCheckin ){
390390
char *zUuid = db_text(0, "SELECT uuid FROM blob WHERE rid=%d", baseCheckin);
391
- char *zLink = href("%R/info/%S", zUuid);
391
+ char *zLink = href("%R/info/%s", zUuid);
392392
blob_appendf(&title, "Ancestors of file ");
393393
hyperlinked_path(zFilename, &title, zUuid, "tree", "");
394394
blob_appendf(&title, " from check-in %z%.10s</a>", zLink, zUuid);
395395
fossil_free(zUuid);
396396
}else{
@@ -416,12 +416,10 @@
416416
const char *zBr = db_column_text(&q, 9);
417417
int fmid = db_column_int(&q, 10);
418418
int pfnid = db_column_int(&q, 11);
419419
int gidx;
420420
char zTime[10];
421
- char zShort[20];
422
- char zShortCkin[20];
423421
if( zBr==0 ) zBr = "trunk";
424422
if( uBg ){
425423
zBgClr = hash_color(zUser);
426424
}else if( brBg || zBgClr==0 || zBgClr[0]==0 ){
427425
zBgClr = strcmp(zBr,"trunk")==0 ? "" : hash_color(zBr);
@@ -442,12 +440,10 @@
442440
if( zBgClr && zBgClr[0] ){
443441
@ <td class="timelineTableCell" style="background-color: %h(zBgClr);">
444442
}else{
445443
@ <td class="timelineTableCell">
446444
}
447
- sqlite3_snprintf(sizeof(zShort), zShort, "%.10s", zUuid);
448
- sqlite3_snprintf(sizeof(zShortCkin), zShortCkin, "%.10s", zCkin);
449445
if( zUuid ){
450446
if( fpid==0 ){
451447
@ <b>Added</b>
452448
}else if( pfnid ){
453449
char *zPrevName = db_text(0, "SELECT name FROM filename WHERE fnid=%d",
@@ -470,23 +466,23 @@
470466
fossil_free(zNewName);
471467
}else{
472468
@ <b>Deleted</b> by check-in
473469
}
474470
}
475
- hyperlink_to_uuid(zShortCkin);
471
+ hyperlink_to_uuid(zCkin);
476472
@ %w(zCom) (user:
477473
hyperlink_to_user(zUser, zDate, "");
478474
@ branch: %h(zBr))
479475
if( g.perm.Hyperlink && zUuid ){
480476
const char *z = zFilename;
481
- @ %z(href("%R/annotate?checkin=%S&filename=%h",zCkin,z))
477
+ @ %z(href("%R/annotate?filename=%h&checkin=%s",z,zCkin))
482478
@ [annotate]</a>
483
- @ %z(href("%R/blame?checkin=%S&filename=%h",zCkin,z))
479
+ @ %z(href("%R/blame?filename=%h&checkin=%s",z,zCkin))
484480
@ [blame]</a>
485
- @ %z(href("%R/timeline?n=200&uf=%S",zUuid))[checkins&nbsp;using]</a>
481
+ @ %z(href("%R/timeline?n=200&uf=%s",zUuid))[checkins&nbsp;using]</a>
486482
if( fpid ){
487
- @ %z(href("%R/fdiff?v1=%S&v2=%S&sbs=1",zPUuid,zUuid))[diff]</a>
483
+ @ %z(href("%R/fdiff?sbs=1&v1=%s&v2=%s",zPUuid,zUuid))[diff]</a>
488484
}
489485
}
490486
if( fDebug & FINFO_DEBUG_MLINK ){
491487
int srcid = db_int(0, "SELECT srcid FROM delta WHERE rid=%d", frid);
492488
int sz = db_int(0, "SELECT length(content) FROM blob WHERE rid=%d", frid);
493489
--- src/finfo.c
+++ src/finfo.c
@@ -386,11 +386,11 @@
386 }
387 blob_reset(&sql);
388 blob_zero(&title);
389 if( baseCheckin ){
390 char *zUuid = db_text(0, "SELECT uuid FROM blob WHERE rid=%d", baseCheckin);
391 char *zLink = href("%R/info/%S", zUuid);
392 blob_appendf(&title, "Ancestors of file ");
393 hyperlinked_path(zFilename, &title, zUuid, "tree", "");
394 blob_appendf(&title, " from check-in %z%.10s</a>", zLink, zUuid);
395 fossil_free(zUuid);
396 }else{
@@ -416,12 +416,10 @@
416 const char *zBr = db_column_text(&q, 9);
417 int fmid = db_column_int(&q, 10);
418 int pfnid = db_column_int(&q, 11);
419 int gidx;
420 char zTime[10];
421 char zShort[20];
422 char zShortCkin[20];
423 if( zBr==0 ) zBr = "trunk";
424 if( uBg ){
425 zBgClr = hash_color(zUser);
426 }else if( brBg || zBgClr==0 || zBgClr[0]==0 ){
427 zBgClr = strcmp(zBr,"trunk")==0 ? "" : hash_color(zBr);
@@ -442,12 +440,10 @@
442 if( zBgClr && zBgClr[0] ){
443 @ <td class="timelineTableCell" style="background-color: %h(zBgClr);">
444 }else{
445 @ <td class="timelineTableCell">
446 }
447 sqlite3_snprintf(sizeof(zShort), zShort, "%.10s", zUuid);
448 sqlite3_snprintf(sizeof(zShortCkin), zShortCkin, "%.10s", zCkin);
449 if( zUuid ){
450 if( fpid==0 ){
451 @ <b>Added</b>
452 }else if( pfnid ){
453 char *zPrevName = db_text(0, "SELECT name FROM filename WHERE fnid=%d",
@@ -470,23 +466,23 @@
470 fossil_free(zNewName);
471 }else{
472 @ <b>Deleted</b> by check-in
473 }
474 }
475 hyperlink_to_uuid(zShortCkin);
476 @ %w(zCom) (user:
477 hyperlink_to_user(zUser, zDate, "");
478 @ branch: %h(zBr))
479 if( g.perm.Hyperlink && zUuid ){
480 const char *z = zFilename;
481 @ %z(href("%R/annotate?checkin=%S&filename=%h",zCkin,z))
482 @ [annotate]</a>
483 @ %z(href("%R/blame?checkin=%S&filename=%h",zCkin,z))
484 @ [blame]</a>
485 @ %z(href("%R/timeline?n=200&uf=%S",zUuid))[checkins&nbsp;using]</a>
486 if( fpid ){
487 @ %z(href("%R/fdiff?v1=%S&v2=%S&sbs=1",zPUuid,zUuid))[diff]</a>
488 }
489 }
490 if( fDebug & FINFO_DEBUG_MLINK ){
491 int srcid = db_int(0, "SELECT srcid FROM delta WHERE rid=%d", frid);
492 int sz = db_int(0, "SELECT length(content) FROM blob WHERE rid=%d", frid);
493
--- src/finfo.c
+++ src/finfo.c
@@ -386,11 +386,11 @@
386 }
387 blob_reset(&sql);
388 blob_zero(&title);
389 if( baseCheckin ){
390 char *zUuid = db_text(0, "SELECT uuid FROM blob WHERE rid=%d", baseCheckin);
391 char *zLink = href("%R/info/%s", zUuid);
392 blob_appendf(&title, "Ancestors of file ");
393 hyperlinked_path(zFilename, &title, zUuid, "tree", "");
394 blob_appendf(&title, " from check-in %z%.10s</a>", zLink, zUuid);
395 fossil_free(zUuid);
396 }else{
@@ -416,12 +416,10 @@
416 const char *zBr = db_column_text(&q, 9);
417 int fmid = db_column_int(&q, 10);
418 int pfnid = db_column_int(&q, 11);
419 int gidx;
420 char zTime[10];
 
 
421 if( zBr==0 ) zBr = "trunk";
422 if( uBg ){
423 zBgClr = hash_color(zUser);
424 }else if( brBg || zBgClr==0 || zBgClr[0]==0 ){
425 zBgClr = strcmp(zBr,"trunk")==0 ? "" : hash_color(zBr);
@@ -442,12 +440,10 @@
440 if( zBgClr && zBgClr[0] ){
441 @ <td class="timelineTableCell" style="background-color: %h(zBgClr);">
442 }else{
443 @ <td class="timelineTableCell">
444 }
 
 
445 if( zUuid ){
446 if( fpid==0 ){
447 @ <b>Added</b>
448 }else if( pfnid ){
449 char *zPrevName = db_text(0, "SELECT name FROM filename WHERE fnid=%d",
@@ -470,23 +466,23 @@
466 fossil_free(zNewName);
467 }else{
468 @ <b>Deleted</b> by check-in
469 }
470 }
471 hyperlink_to_uuid(zCkin);
472 @ %w(zCom) (user:
473 hyperlink_to_user(zUser, zDate, "");
474 @ branch: %h(zBr))
475 if( g.perm.Hyperlink && zUuid ){
476 const char *z = zFilename;
477 @ %z(href("%R/annotate?filename=%h&checkin=%s",z,zCkin))
478 @ [annotate]</a>
479 @ %z(href("%R/blame?filename=%h&checkin=%s",z,zCkin))
480 @ [blame]</a>
481 @ %z(href("%R/timeline?n=200&uf=%s",zUuid))[checkins&nbsp;using]</a>
482 if( fpid ){
483 @ %z(href("%R/fdiff?sbs=1&v1=%s&v2=%s",zPUuid,zUuid))[diff]</a>
484 }
485 }
486 if( fDebug & FINFO_DEBUG_MLINK ){
487 int srcid = db_int(0, "SELECT srcid FROM delta WHERE rid=%d", frid);
488 int sz = db_int(0, "SELECT length(content) FROM blob WHERE rid=%d", frid);
489
+6 -10
--- src/finfo.c
+++ src/finfo.c
@@ -386,11 +386,11 @@
386386
}
387387
blob_reset(&sql);
388388
blob_zero(&title);
389389
if( baseCheckin ){
390390
char *zUuid = db_text(0, "SELECT uuid FROM blob WHERE rid=%d", baseCheckin);
391
- char *zLink = href("%R/info/%S", zUuid);
391
+ char *zLink = href("%R/info/%s", zUuid);
392392
blob_appendf(&title, "Ancestors of file ");
393393
hyperlinked_path(zFilename, &title, zUuid, "tree", "");
394394
blob_appendf(&title, " from check-in %z%.10s</a>", zLink, zUuid);
395395
fossil_free(zUuid);
396396
}else{
@@ -416,12 +416,10 @@
416416
const char *zBr = db_column_text(&q, 9);
417417
int fmid = db_column_int(&q, 10);
418418
int pfnid = db_column_int(&q, 11);
419419
int gidx;
420420
char zTime[10];
421
- char zShort[20];
422
- char zShortCkin[20];
423421
if( zBr==0 ) zBr = "trunk";
424422
if( uBg ){
425423
zBgClr = hash_color(zUser);
426424
}else if( brBg || zBgClr==0 || zBgClr[0]==0 ){
427425
zBgClr = strcmp(zBr,"trunk")==0 ? "" : hash_color(zBr);
@@ -442,12 +440,10 @@
442440
if( zBgClr && zBgClr[0] ){
443441
@ <td class="timelineTableCell" style="background-color: %h(zBgClr);">
444442
}else{
445443
@ <td class="timelineTableCell">
446444
}
447
- sqlite3_snprintf(sizeof(zShort), zShort, "%.10s", zUuid);
448
- sqlite3_snprintf(sizeof(zShortCkin), zShortCkin, "%.10s", zCkin);
449445
if( zUuid ){
450446
if( fpid==0 ){
451447
@ <b>Added</b>
452448
}else if( pfnid ){
453449
char *zPrevName = db_text(0, "SELECT name FROM filename WHERE fnid=%d",
@@ -470,23 +466,23 @@
470466
fossil_free(zNewName);
471467
}else{
472468
@ <b>Deleted</b> by check-in
473469
}
474470
}
475
- hyperlink_to_uuid(zShortCkin);
471
+ hyperlink_to_uuid(zCkin);
476472
@ %w(zCom) (user:
477473
hyperlink_to_user(zUser, zDate, "");
478474
@ branch: %h(zBr))
479475
if( g.perm.Hyperlink && zUuid ){
480476
const char *z = zFilename;
481
- @ %z(href("%R/annotate?checkin=%S&filename=%h",zCkin,z))
477
+ @ %z(href("%R/annotate?filename=%h&checkin=%s",z,zCkin))
482478
@ [annotate]</a>
483
- @ %z(href("%R/blame?checkin=%S&filename=%h",zCkin,z))
479
+ @ %z(href("%R/blame?filename=%h&checkin=%s",z,zCkin))
484480
@ [blame]</a>
485
- @ %z(href("%R/timeline?n=200&uf=%S",zUuid))[checkins&nbsp;using]</a>
481
+ @ %z(href("%R/timeline?n=200&uf=%s",zUuid))[checkins&nbsp;using]</a>
486482
if( fpid ){
487
- @ %z(href("%R/fdiff?v1=%S&v2=%S&sbs=1",zPUuid,zUuid))[diff]</a>
483
+ @ %z(href("%R/fdiff?sbs=1&v1=%s&v2=%s",zPUuid,zUuid))[diff]</a>
488484
}
489485
}
490486
if( fDebug & FINFO_DEBUG_MLINK ){
491487
int srcid = db_int(0, "SELECT srcid FROM delta WHERE rid=%d", frid);
492488
int sz = db_int(0, "SELECT length(content) FROM blob WHERE rid=%d", frid);
493489
--- src/finfo.c
+++ src/finfo.c
@@ -386,11 +386,11 @@
386 }
387 blob_reset(&sql);
388 blob_zero(&title);
389 if( baseCheckin ){
390 char *zUuid = db_text(0, "SELECT uuid FROM blob WHERE rid=%d", baseCheckin);
391 char *zLink = href("%R/info/%S", zUuid);
392 blob_appendf(&title, "Ancestors of file ");
393 hyperlinked_path(zFilename, &title, zUuid, "tree", "");
394 blob_appendf(&title, " from check-in %z%.10s</a>", zLink, zUuid);
395 fossil_free(zUuid);
396 }else{
@@ -416,12 +416,10 @@
416 const char *zBr = db_column_text(&q, 9);
417 int fmid = db_column_int(&q, 10);
418 int pfnid = db_column_int(&q, 11);
419 int gidx;
420 char zTime[10];
421 char zShort[20];
422 char zShortCkin[20];
423 if( zBr==0 ) zBr = "trunk";
424 if( uBg ){
425 zBgClr = hash_color(zUser);
426 }else if( brBg || zBgClr==0 || zBgClr[0]==0 ){
427 zBgClr = strcmp(zBr,"trunk")==0 ? "" : hash_color(zBr);
@@ -442,12 +440,10 @@
442 if( zBgClr && zBgClr[0] ){
443 @ <td class="timelineTableCell" style="background-color: %h(zBgClr);">
444 }else{
445 @ <td class="timelineTableCell">
446 }
447 sqlite3_snprintf(sizeof(zShort), zShort, "%.10s", zUuid);
448 sqlite3_snprintf(sizeof(zShortCkin), zShortCkin, "%.10s", zCkin);
449 if( zUuid ){
450 if( fpid==0 ){
451 @ <b>Added</b>
452 }else if( pfnid ){
453 char *zPrevName = db_text(0, "SELECT name FROM filename WHERE fnid=%d",
@@ -470,23 +466,23 @@
470 fossil_free(zNewName);
471 }else{
472 @ <b>Deleted</b> by check-in
473 }
474 }
475 hyperlink_to_uuid(zShortCkin);
476 @ %w(zCom) (user:
477 hyperlink_to_user(zUser, zDate, "");
478 @ branch: %h(zBr))
479 if( g.perm.Hyperlink && zUuid ){
480 const char *z = zFilename;
481 @ %z(href("%R/annotate?checkin=%S&filename=%h",zCkin,z))
482 @ [annotate]</a>
483 @ %z(href("%R/blame?checkin=%S&filename=%h",zCkin,z))
484 @ [blame]</a>
485 @ %z(href("%R/timeline?n=200&uf=%S",zUuid))[checkins&nbsp;using]</a>
486 if( fpid ){
487 @ %z(href("%R/fdiff?v1=%S&v2=%S&sbs=1",zPUuid,zUuid))[diff]</a>
488 }
489 }
490 if( fDebug & FINFO_DEBUG_MLINK ){
491 int srcid = db_int(0, "SELECT srcid FROM delta WHERE rid=%d", frid);
492 int sz = db_int(0, "SELECT length(content) FROM blob WHERE rid=%d", frid);
493
--- src/finfo.c
+++ src/finfo.c
@@ -386,11 +386,11 @@
386 }
387 blob_reset(&sql);
388 blob_zero(&title);
389 if( baseCheckin ){
390 char *zUuid = db_text(0, "SELECT uuid FROM blob WHERE rid=%d", baseCheckin);
391 char *zLink = href("%R/info/%s", zUuid);
392 blob_appendf(&title, "Ancestors of file ");
393 hyperlinked_path(zFilename, &title, zUuid, "tree", "");
394 blob_appendf(&title, " from check-in %z%.10s</a>", zLink, zUuid);
395 fossil_free(zUuid);
396 }else{
@@ -416,12 +416,10 @@
416 const char *zBr = db_column_text(&q, 9);
417 int fmid = db_column_int(&q, 10);
418 int pfnid = db_column_int(&q, 11);
419 int gidx;
420 char zTime[10];
 
 
421 if( zBr==0 ) zBr = "trunk";
422 if( uBg ){
423 zBgClr = hash_color(zUser);
424 }else if( brBg || zBgClr==0 || zBgClr[0]==0 ){
425 zBgClr = strcmp(zBr,"trunk")==0 ? "" : hash_color(zBr);
@@ -442,12 +440,10 @@
440 if( zBgClr && zBgClr[0] ){
441 @ <td class="timelineTableCell" style="background-color: %h(zBgClr);">
442 }else{
443 @ <td class="timelineTableCell">
444 }
 
 
445 if( zUuid ){
446 if( fpid==0 ){
447 @ <b>Added</b>
448 }else if( pfnid ){
449 char *zPrevName = db_text(0, "SELECT name FROM filename WHERE fnid=%d",
@@ -470,23 +466,23 @@
466 fossil_free(zNewName);
467 }else{
468 @ <b>Deleted</b> by check-in
469 }
470 }
471 hyperlink_to_uuid(zCkin);
472 @ %w(zCom) (user:
473 hyperlink_to_user(zUser, zDate, "");
474 @ branch: %h(zBr))
475 if( g.perm.Hyperlink && zUuid ){
476 const char *z = zFilename;
477 @ %z(href("%R/annotate?filename=%h&checkin=%s",z,zCkin))
478 @ [annotate]</a>
479 @ %z(href("%R/blame?filename=%h&checkin=%s",z,zCkin))
480 @ [blame]</a>
481 @ %z(href("%R/timeline?n=200&uf=%s",zUuid))[checkins&nbsp;using]</a>
482 if( fpid ){
483 @ %z(href("%R/fdiff?sbs=1&v1=%s&v2=%s",zPUuid,zUuid))[diff]</a>
484 }
485 }
486 if( fDebug & FINFO_DEBUG_MLINK ){
487 int srcid = db_int(0, "SELECT srcid FROM delta WHERE rid=%d", frid);
488 int sz = db_int(0, "SELECT length(content) FROM blob WHERE rid=%d", frid);
489
+31 -31
--- src/http.c
+++ src/http.c
@@ -55,31 +55,31 @@
5555
const char *zPw; /* The user password */
5656
Blob pw; /* The nonce with user password appended */
5757
Blob sig; /* The signature field */
5858
5959
blob_zero(pLogin);
60
- if( g.urlUser==0 || fossil_strcmp(g.urlUser, "anonymous")==0 ){
60
+ if( g.url.user==0 || fossil_strcmp(g.url.user, "anonymous")==0 ){
6161
return; /* If no login card for users "nobody" and "anonymous" */
6262
}
63
- if( g.urlIsSsh ){
63
+ if( g.url.isSsh ){
6464
return; /* If no login card for SSH: */
6565
}
6666
blob_zero(&nonce);
6767
blob_zero(&pw);
6868
sha1sum_blob(pPayload, &nonce);
6969
blob_copy(&pw, &nonce);
70
- zLogin = g.urlUser;
71
- if( g.urlPasswd ){
72
- zPw = g.urlPasswd;
70
+ zLogin = g.url.user;
71
+ if( g.url.passwd ){
72
+ zPw = g.url.passwd;
7373
}else if( g.cgiOutput ){
7474
/* Password failure while doing a sync from the web interface */
7575
cgi_printf("*** incorrect or missing password for user %h\n", zLogin);
7676
zPw = 0;
7777
}else{
7878
/* Password failure while doing a sync from the command-line interface */
7979
url_prompt_for_password();
80
- zPw = g.urlPasswd;
80
+ zPw = g.url.passwd;
8181
}
8282
8383
/* The login card wants the SHA1 hash of the password, so convert the
8484
** password to its SHA1 hash it it isn't already a SHA1 hash.
8585
*/
@@ -102,29 +102,29 @@
102102
static void http_build_header(Blob *pPayload, Blob *pHdr){
103103
int i;
104104
const char *zSep;
105105
106106
blob_zero(pHdr);
107
- i = strlen(g.urlPath);
108
- if( i>0 && g.urlPath[i-1]=='/' ){
107
+ i = strlen(g.url.path);
108
+ if( i>0 && g.url.path[i-1]=='/' ){
109109
zSep = "";
110110
}else{
111111
zSep = "/";
112112
}
113
- blob_appendf(pHdr, "POST %s%sxfer/xfer HTTP/1.0\r\n", g.urlPath, zSep);
114
- if( g.urlProxyAuth ){
115
- blob_appendf(pHdr, "Proxy-Authorization: %s\r\n", g.urlProxyAuth);
113
+ blob_appendf(pHdr, "POST %s%sxfer/xfer HTTP/1.0\r\n", g.url.path, zSep);
114
+ if( g.url.proxyAuth ){
115
+ blob_appendf(pHdr, "Proxy-Authorization: %s\r\n", g.url.proxyAuth);
116116
}
117117
if( g.zHttpAuth && g.zHttpAuth[0] ){
118118
const char *zCredentials = g.zHttpAuth;
119119
char *zEncoded = encode64(zCredentials, -1);
120120
blob_appendf(pHdr, "Authorization: Basic %s\r\n", zEncoded);
121121
fossil_free(zEncoded);
122122
}
123
- blob_appendf(pHdr, "Host: %s\r\n", g.urlHostname);
123
+ blob_appendf(pHdr, "Host: %s\r\n", g.url.hostname);
124124
blob_appendf(pHdr, "User-Agent: %s\r\n", get_user_agent());
125
- if( g.urlIsSsh ) blob_appendf(pHdr, "X-Fossil-Transport: SSH\r\n");
125
+ if( g.url.isSsh ) blob_appendf(pHdr, "X-Fossil-Transport: SSH\r\n");
126126
if( g.fHttpTrace ){
127127
blob_appendf(pHdr, "Content-Type: application/x-fossil-debug\r\n");
128128
}else{
129129
blob_appendf(pHdr, "Content-Type: application/x-fossil\r\n");
130130
}
@@ -147,11 +147,11 @@
147147
** Prompt to save HTTP Basic Authorization information
148148
*/
149149
static int save_httpauth_prompt(void){
150150
Blob x;
151151
char c;
152
- if( (g.urlFlags & URL_REMEMBER)==0 ) return 0;
152
+ if( (g.url.flags & URL_REMEMBER)==0 ) return 0;
153153
prompt_user("Remember Basic Authorization credentials (Y/n)? ", &x);
154154
c = blob_str(&x)[0];
155155
blob_reset(&x);
156156
return ( c!='n' && c!='N' );
157157
}
@@ -166,15 +166,15 @@
166166
char *zPw;
167167
char *zPrompt;
168168
char *zHttpAuth = 0;
169169
if( !isatty(fileno(stdin)) ) return 0;
170170
zPrompt = mprintf("\n%s authorization required by\n%s\n",
171
- g.urlIsHttps==1 ? "Encrypted HTTPS" : "Unencrypted HTTP", g.urlCanonical);
171
+ g.url.isHttps==1 ? "Encrypted HTTPS" : "Unencrypted HTTP", g.url.canonical);
172172
fossil_print(zPrompt);
173173
free(zPrompt);
174
- if ( g.urlUser && g.urlPasswd && use_fossil_creds_for_httpauth_prompt() ){
175
- zHttpAuth = mprintf("%s:%s", g.urlUser, g.urlPasswd);
174
+ if ( g.url.user && g.url.passwd && use_fossil_creds_for_httpauth_prompt() ){
175
+ zHttpAuth = mprintf("%s:%s", g.url.user, g.url.passwd);
176176
}else{
177177
prompt_user("Basic Authorization user: ", &x);
178178
zUser = mprintf("%b", &x);
179179
zPrompt = mprintf("HTTP password for %b: ", &x);
180180
blob_reset(&x);
@@ -213,12 +213,12 @@
213213
char *zLine; /* A single line of the reply header */
214214
int i; /* Loop counter */
215215
int isError = 0; /* True if the reply is an error message */
216216
int isCompressed = 1; /* True if the reply is compressed */
217217
218
- if( transport_open(GLOBAL_URL()) ){
219
- fossil_warning(transport_errmsg(GLOBAL_URL()));
218
+ if( transport_open(&g.url) ){
219
+ fossil_warning(transport_errmsg(&g.url));
220220
return 1;
221221
}
222222
223223
/* Construct the login card and prepare the complete payload */
224224
blob_zero(&login);
@@ -260,32 +260,32 @@
260260
}
261261
262262
/*
263263
** Send the request to the server.
264264
*/
265
- transport_send(GLOBAL_URL(), &hdr);
266
- transport_send(GLOBAL_URL(), &payload);
265
+ transport_send(&g.url, &hdr);
266
+ transport_send(&g.url, &payload);
267267
blob_reset(&hdr);
268268
blob_reset(&payload);
269
- transport_flip(GLOBAL_URL());
269
+ transport_flip(&g.url);
270270
271271
/*
272272
** Read and interpret the server reply
273273
*/
274274
closeConnection = 1;
275275
iLength = -1;
276
- while( (zLine = transport_receive_line(GLOBAL_URL()))!=0 && zLine[0]!=0 ){
276
+ while( (zLine = transport_receive_line(&g.url))!=0 && zLine[0]!=0 ){
277277
/* printf("[%s]\n", zLine); fflush(stdout); */
278278
if( fossil_strnicmp(zLine, "http/1.", 7)==0 ){
279279
if( sscanf(zLine, "HTTP/1.%d %d", &iHttpVersion, &rc)!=2 ) goto write_err;
280280
if( rc==401 ){
281281
if( fSeenHttpAuth++ < MAX_HTTP_AUTH ){
282282
if( g.zHttpAuth ){
283283
if( g.zHttpAuth ) free(g.zHttpAuth);
284284
}
285285
g.zHttpAuth = prompt_for_httpauth_creds();
286
- transport_close(GLOBAL_URL());
286
+ transport_close(&g.url);
287287
return http_exchange(pSend, pReply, useLogin, maxRedirect);
288288
}
289289
}
290290
if( rc!=200 && rc!=302 ){
291291
int ii;
@@ -297,11 +297,11 @@
297297
if( iHttpVersion==0 ){
298298
closeConnection = 1;
299299
}else{
300300
closeConnection = 0;
301301
}
302
- }else if( g.urlIsSsh && fossil_strnicmp(zLine, "status:", 7)==0 ){
302
+ }else if( g.url.isSsh && fossil_strnicmp(zLine, "status:", 7)==0 ){
303303
if( sscanf(zLine, "Status: %d", &rc)!=1 ) goto write_err;
304304
if( rc!=200 && rc!=302 ){
305305
int ii;
306306
for(ii=7; zLine[ii] && zLine[ii]!=' '; ii++){}
307307
while( zLine[ii]==' ' ) ii++;
@@ -337,11 +337,11 @@
337337
fossil_print("redirect to %s\n", &zLine[i]);
338338
url_parse(&zLine[i], 0);
339339
fSeenHttpAuth = 0;
340340
if( g.zHttpAuth ) free(g.zHttpAuth);
341341
g.zHttpAuth = get_httpauth();
342
- transport_close(GLOBAL_URL());
342
+ transport_close(&g.url);
343343
return http_exchange(pSend, pReply, useLogin, maxRedirect);
344344
}else if( fossil_strnicmp(zLine, "content-type: ", 14)==0 ){
345345
if( fossil_strnicmp(&zLine[14], "application/x-fossil-debug", -1)==0 ){
346346
isCompressed = 0;
347347
}else if( fossil_strnicmp(&zLine[14],
@@ -364,11 +364,11 @@
364364
/*
365365
** Extract the reply payload that follows the header
366366
*/
367367
blob_zero(pReply);
368368
blob_resize(pReply, iLength);
369
- iLength = transport_receive(GLOBAL_URL(), blob_buffer(pReply), iLength);
369
+ iLength = transport_receive(&g.url, blob_buffer(pReply), iLength);
370370
blob_resize(pReply, iLength);
371371
if( isError ){
372372
char *z;
373373
int i, j;
374374
z = blob_str(pReply);
@@ -391,20 +391,20 @@
391391
** connection from remaining open. The easiest fix for now is to
392392
** simply close and restart the connection for each round-trip.
393393
**
394394
** For SSH we will leave the connection open.
395395
*/
396
- if( ! g.urlIsSsh ) closeConnection = 1; /* FIX ME */
396
+ if( ! g.url.isSsh ) closeConnection = 1; /* FIX ME */
397397
if( closeConnection ){
398
- transport_close(GLOBAL_URL());
398
+ transport_close(&g.url);
399399
}else{
400
- transport_rewind(GLOBAL_URL());
400
+ transport_rewind(&g.url);
401401
}
402402
return 0;
403403
404404
/*
405405
** Jump to here if an error is seen.
406406
*/
407407
write_err:
408
- transport_close(GLOBAL_URL());
408
+ transport_close(&g.url);
409409
return 1;
410410
}
411411
--- src/http.c
+++ src/http.c
@@ -55,31 +55,31 @@
55 const char *zPw; /* The user password */
56 Blob pw; /* The nonce with user password appended */
57 Blob sig; /* The signature field */
58
59 blob_zero(pLogin);
60 if( g.urlUser==0 || fossil_strcmp(g.urlUser, "anonymous")==0 ){
61 return; /* If no login card for users "nobody" and "anonymous" */
62 }
63 if( g.urlIsSsh ){
64 return; /* If no login card for SSH: */
65 }
66 blob_zero(&nonce);
67 blob_zero(&pw);
68 sha1sum_blob(pPayload, &nonce);
69 blob_copy(&pw, &nonce);
70 zLogin = g.urlUser;
71 if( g.urlPasswd ){
72 zPw = g.urlPasswd;
73 }else if( g.cgiOutput ){
74 /* Password failure while doing a sync from the web interface */
75 cgi_printf("*** incorrect or missing password for user %h\n", zLogin);
76 zPw = 0;
77 }else{
78 /* Password failure while doing a sync from the command-line interface */
79 url_prompt_for_password();
80 zPw = g.urlPasswd;
81 }
82
83 /* The login card wants the SHA1 hash of the password, so convert the
84 ** password to its SHA1 hash it it isn't already a SHA1 hash.
85 */
@@ -102,29 +102,29 @@
102 static void http_build_header(Blob *pPayload, Blob *pHdr){
103 int i;
104 const char *zSep;
105
106 blob_zero(pHdr);
107 i = strlen(g.urlPath);
108 if( i>0 && g.urlPath[i-1]=='/' ){
109 zSep = "";
110 }else{
111 zSep = "/";
112 }
113 blob_appendf(pHdr, "POST %s%sxfer/xfer HTTP/1.0\r\n", g.urlPath, zSep);
114 if( g.urlProxyAuth ){
115 blob_appendf(pHdr, "Proxy-Authorization: %s\r\n", g.urlProxyAuth);
116 }
117 if( g.zHttpAuth && g.zHttpAuth[0] ){
118 const char *zCredentials = g.zHttpAuth;
119 char *zEncoded = encode64(zCredentials, -1);
120 blob_appendf(pHdr, "Authorization: Basic %s\r\n", zEncoded);
121 fossil_free(zEncoded);
122 }
123 blob_appendf(pHdr, "Host: %s\r\n", g.urlHostname);
124 blob_appendf(pHdr, "User-Agent: %s\r\n", get_user_agent());
125 if( g.urlIsSsh ) blob_appendf(pHdr, "X-Fossil-Transport: SSH\r\n");
126 if( g.fHttpTrace ){
127 blob_appendf(pHdr, "Content-Type: application/x-fossil-debug\r\n");
128 }else{
129 blob_appendf(pHdr, "Content-Type: application/x-fossil\r\n");
130 }
@@ -147,11 +147,11 @@
147 ** Prompt to save HTTP Basic Authorization information
148 */
149 static int save_httpauth_prompt(void){
150 Blob x;
151 char c;
152 if( (g.urlFlags & URL_REMEMBER)==0 ) return 0;
153 prompt_user("Remember Basic Authorization credentials (Y/n)? ", &x);
154 c = blob_str(&x)[0];
155 blob_reset(&x);
156 return ( c!='n' && c!='N' );
157 }
@@ -166,15 +166,15 @@
166 char *zPw;
167 char *zPrompt;
168 char *zHttpAuth = 0;
169 if( !isatty(fileno(stdin)) ) return 0;
170 zPrompt = mprintf("\n%s authorization required by\n%s\n",
171 g.urlIsHttps==1 ? "Encrypted HTTPS" : "Unencrypted HTTP", g.urlCanonical);
172 fossil_print(zPrompt);
173 free(zPrompt);
174 if ( g.urlUser && g.urlPasswd && use_fossil_creds_for_httpauth_prompt() ){
175 zHttpAuth = mprintf("%s:%s", g.urlUser, g.urlPasswd);
176 }else{
177 prompt_user("Basic Authorization user: ", &x);
178 zUser = mprintf("%b", &x);
179 zPrompt = mprintf("HTTP password for %b: ", &x);
180 blob_reset(&x);
@@ -213,12 +213,12 @@
213 char *zLine; /* A single line of the reply header */
214 int i; /* Loop counter */
215 int isError = 0; /* True if the reply is an error message */
216 int isCompressed = 1; /* True if the reply is compressed */
217
218 if( transport_open(GLOBAL_URL()) ){
219 fossil_warning(transport_errmsg(GLOBAL_URL()));
220 return 1;
221 }
222
223 /* Construct the login card and prepare the complete payload */
224 blob_zero(&login);
@@ -260,32 +260,32 @@
260 }
261
262 /*
263 ** Send the request to the server.
264 */
265 transport_send(GLOBAL_URL(), &hdr);
266 transport_send(GLOBAL_URL(), &payload);
267 blob_reset(&hdr);
268 blob_reset(&payload);
269 transport_flip(GLOBAL_URL());
270
271 /*
272 ** Read and interpret the server reply
273 */
274 closeConnection = 1;
275 iLength = -1;
276 while( (zLine = transport_receive_line(GLOBAL_URL()))!=0 && zLine[0]!=0 ){
277 /* printf("[%s]\n", zLine); fflush(stdout); */
278 if( fossil_strnicmp(zLine, "http/1.", 7)==0 ){
279 if( sscanf(zLine, "HTTP/1.%d %d", &iHttpVersion, &rc)!=2 ) goto write_err;
280 if( rc==401 ){
281 if( fSeenHttpAuth++ < MAX_HTTP_AUTH ){
282 if( g.zHttpAuth ){
283 if( g.zHttpAuth ) free(g.zHttpAuth);
284 }
285 g.zHttpAuth = prompt_for_httpauth_creds();
286 transport_close(GLOBAL_URL());
287 return http_exchange(pSend, pReply, useLogin, maxRedirect);
288 }
289 }
290 if( rc!=200 && rc!=302 ){
291 int ii;
@@ -297,11 +297,11 @@
297 if( iHttpVersion==0 ){
298 closeConnection = 1;
299 }else{
300 closeConnection = 0;
301 }
302 }else if( g.urlIsSsh && fossil_strnicmp(zLine, "status:", 7)==0 ){
303 if( sscanf(zLine, "Status: %d", &rc)!=1 ) goto write_err;
304 if( rc!=200 && rc!=302 ){
305 int ii;
306 for(ii=7; zLine[ii] && zLine[ii]!=' '; ii++){}
307 while( zLine[ii]==' ' ) ii++;
@@ -337,11 +337,11 @@
337 fossil_print("redirect to %s\n", &zLine[i]);
338 url_parse(&zLine[i], 0);
339 fSeenHttpAuth = 0;
340 if( g.zHttpAuth ) free(g.zHttpAuth);
341 g.zHttpAuth = get_httpauth();
342 transport_close(GLOBAL_URL());
343 return http_exchange(pSend, pReply, useLogin, maxRedirect);
344 }else if( fossil_strnicmp(zLine, "content-type: ", 14)==0 ){
345 if( fossil_strnicmp(&zLine[14], "application/x-fossil-debug", -1)==0 ){
346 isCompressed = 0;
347 }else if( fossil_strnicmp(&zLine[14],
@@ -364,11 +364,11 @@
364 /*
365 ** Extract the reply payload that follows the header
366 */
367 blob_zero(pReply);
368 blob_resize(pReply, iLength);
369 iLength = transport_receive(GLOBAL_URL(), blob_buffer(pReply), iLength);
370 blob_resize(pReply, iLength);
371 if( isError ){
372 char *z;
373 int i, j;
374 z = blob_str(pReply);
@@ -391,20 +391,20 @@
391 ** connection from remaining open. The easiest fix for now is to
392 ** simply close and restart the connection for each round-trip.
393 **
394 ** For SSH we will leave the connection open.
395 */
396 if( ! g.urlIsSsh ) closeConnection = 1; /* FIX ME */
397 if( closeConnection ){
398 transport_close(GLOBAL_URL());
399 }else{
400 transport_rewind(GLOBAL_URL());
401 }
402 return 0;
403
404 /*
405 ** Jump to here if an error is seen.
406 */
407 write_err:
408 transport_close(GLOBAL_URL());
409 return 1;
410 }
411
--- src/http.c
+++ src/http.c
@@ -55,31 +55,31 @@
55 const char *zPw; /* The user password */
56 Blob pw; /* The nonce with user password appended */
57 Blob sig; /* The signature field */
58
59 blob_zero(pLogin);
60 if( g.url.user==0 || fossil_strcmp(g.url.user, "anonymous")==0 ){
61 return; /* If no login card for users "nobody" and "anonymous" */
62 }
63 if( g.url.isSsh ){
64 return; /* If no login card for SSH: */
65 }
66 blob_zero(&nonce);
67 blob_zero(&pw);
68 sha1sum_blob(pPayload, &nonce);
69 blob_copy(&pw, &nonce);
70 zLogin = g.url.user;
71 if( g.url.passwd ){
72 zPw = g.url.passwd;
73 }else if( g.cgiOutput ){
74 /* Password failure while doing a sync from the web interface */
75 cgi_printf("*** incorrect or missing password for user %h\n", zLogin);
76 zPw = 0;
77 }else{
78 /* Password failure while doing a sync from the command-line interface */
79 url_prompt_for_password();
80 zPw = g.url.passwd;
81 }
82
83 /* The login card wants the SHA1 hash of the password, so convert the
84 ** password to its SHA1 hash it it isn't already a SHA1 hash.
85 */
@@ -102,29 +102,29 @@
102 static void http_build_header(Blob *pPayload, Blob *pHdr){
103 int i;
104 const char *zSep;
105
106 blob_zero(pHdr);
107 i = strlen(g.url.path);
108 if( i>0 && g.url.path[i-1]=='/' ){
109 zSep = "";
110 }else{
111 zSep = "/";
112 }
113 blob_appendf(pHdr, "POST %s%sxfer/xfer HTTP/1.0\r\n", g.url.path, zSep);
114 if( g.url.proxyAuth ){
115 blob_appendf(pHdr, "Proxy-Authorization: %s\r\n", g.url.proxyAuth);
116 }
117 if( g.zHttpAuth && g.zHttpAuth[0] ){
118 const char *zCredentials = g.zHttpAuth;
119 char *zEncoded = encode64(zCredentials, -1);
120 blob_appendf(pHdr, "Authorization: Basic %s\r\n", zEncoded);
121 fossil_free(zEncoded);
122 }
123 blob_appendf(pHdr, "Host: %s\r\n", g.url.hostname);
124 blob_appendf(pHdr, "User-Agent: %s\r\n", get_user_agent());
125 if( g.url.isSsh ) blob_appendf(pHdr, "X-Fossil-Transport: SSH\r\n");
126 if( g.fHttpTrace ){
127 blob_appendf(pHdr, "Content-Type: application/x-fossil-debug\r\n");
128 }else{
129 blob_appendf(pHdr, "Content-Type: application/x-fossil\r\n");
130 }
@@ -147,11 +147,11 @@
147 ** Prompt to save HTTP Basic Authorization information
148 */
149 static int save_httpauth_prompt(void){
150 Blob x;
151 char c;
152 if( (g.url.flags & URL_REMEMBER)==0 ) return 0;
153 prompt_user("Remember Basic Authorization credentials (Y/n)? ", &x);
154 c = blob_str(&x)[0];
155 blob_reset(&x);
156 return ( c!='n' && c!='N' );
157 }
@@ -166,15 +166,15 @@
166 char *zPw;
167 char *zPrompt;
168 char *zHttpAuth = 0;
169 if( !isatty(fileno(stdin)) ) return 0;
170 zPrompt = mprintf("\n%s authorization required by\n%s\n",
171 g.url.isHttps==1 ? "Encrypted HTTPS" : "Unencrypted HTTP", g.url.canonical);
172 fossil_print(zPrompt);
173 free(zPrompt);
174 if ( g.url.user && g.url.passwd && use_fossil_creds_for_httpauth_prompt() ){
175 zHttpAuth = mprintf("%s:%s", g.url.user, g.url.passwd);
176 }else{
177 prompt_user("Basic Authorization user: ", &x);
178 zUser = mprintf("%b", &x);
179 zPrompt = mprintf("HTTP password for %b: ", &x);
180 blob_reset(&x);
@@ -213,12 +213,12 @@
213 char *zLine; /* A single line of the reply header */
214 int i; /* Loop counter */
215 int isError = 0; /* True if the reply is an error message */
216 int isCompressed = 1; /* True if the reply is compressed */
217
218 if( transport_open(&g.url) ){
219 fossil_warning(transport_errmsg(&g.url));
220 return 1;
221 }
222
223 /* Construct the login card and prepare the complete payload */
224 blob_zero(&login);
@@ -260,32 +260,32 @@
260 }
261
262 /*
263 ** Send the request to the server.
264 */
265 transport_send(&g.url, &hdr);
266 transport_send(&g.url, &payload);
267 blob_reset(&hdr);
268 blob_reset(&payload);
269 transport_flip(&g.url);
270
271 /*
272 ** Read and interpret the server reply
273 */
274 closeConnection = 1;
275 iLength = -1;
276 while( (zLine = transport_receive_line(&g.url))!=0 && zLine[0]!=0 ){
277 /* printf("[%s]\n", zLine); fflush(stdout); */
278 if( fossil_strnicmp(zLine, "http/1.", 7)==0 ){
279 if( sscanf(zLine, "HTTP/1.%d %d", &iHttpVersion, &rc)!=2 ) goto write_err;
280 if( rc==401 ){
281 if( fSeenHttpAuth++ < MAX_HTTP_AUTH ){
282 if( g.zHttpAuth ){
283 if( g.zHttpAuth ) free(g.zHttpAuth);
284 }
285 g.zHttpAuth = prompt_for_httpauth_creds();
286 transport_close(&g.url);
287 return http_exchange(pSend, pReply, useLogin, maxRedirect);
288 }
289 }
290 if( rc!=200 && rc!=302 ){
291 int ii;
@@ -297,11 +297,11 @@
297 if( iHttpVersion==0 ){
298 closeConnection = 1;
299 }else{
300 closeConnection = 0;
301 }
302 }else if( g.url.isSsh && fossil_strnicmp(zLine, "status:", 7)==0 ){
303 if( sscanf(zLine, "Status: %d", &rc)!=1 ) goto write_err;
304 if( rc!=200 && rc!=302 ){
305 int ii;
306 for(ii=7; zLine[ii] && zLine[ii]!=' '; ii++){}
307 while( zLine[ii]==' ' ) ii++;
@@ -337,11 +337,11 @@
337 fossil_print("redirect to %s\n", &zLine[i]);
338 url_parse(&zLine[i], 0);
339 fSeenHttpAuth = 0;
340 if( g.zHttpAuth ) free(g.zHttpAuth);
341 g.zHttpAuth = get_httpauth();
342 transport_close(&g.url);
343 return http_exchange(pSend, pReply, useLogin, maxRedirect);
344 }else if( fossil_strnicmp(zLine, "content-type: ", 14)==0 ){
345 if( fossil_strnicmp(&zLine[14], "application/x-fossil-debug", -1)==0 ){
346 isCompressed = 0;
347 }else if( fossil_strnicmp(&zLine[14],
@@ -364,11 +364,11 @@
364 /*
365 ** Extract the reply payload that follows the header
366 */
367 blob_zero(pReply);
368 blob_resize(pReply, iLength);
369 iLength = transport_receive(&g.url, blob_buffer(pReply), iLength);
370 blob_resize(pReply, iLength);
371 if( isError ){
372 char *z;
373 int i, j;
374 z = blob_str(pReply);
@@ -391,20 +391,20 @@
391 ** connection from remaining open. The easiest fix for now is to
392 ** simply close and restart the connection for each round-trip.
393 **
394 ** For SSH we will leave the connection open.
395 */
396 if( ! g.url.isSsh ) closeConnection = 1; /* FIX ME */
397 if( closeConnection ){
398 transport_close(&g.url);
399 }else{
400 transport_rewind(&g.url);
401 }
402 return 0;
403
404 /*
405 ** Jump to here if an error is seen.
406 */
407 write_err:
408 transport_close(&g.url);
409 return 1;
410 }
411
--- src/http_socket.c
+++ src/http_socket.c
@@ -124,14 +124,14 @@
124124
}
125125
}
126126
127127
/*
128128
** Open a socket connection. The identify of the server is determined
129
-** by global variables that are set using url_parse():
129
+** by pUrlData
130130
**
131
-** g.urlName Name of the server. Ex: www.fossil-scm.org
132
-** g.urlPort TCP/IP port to use. Ex: 80
131
+** pUrlDAta->name Name of the server. Ex: www.fossil-scm.org
132
+** pUrlDAta->port TCP/IP port to use. Ex: 80
133133
**
134134
** Return the number of errors.
135135
*/
136136
int socket_open(UrlData *pUrlData){
137137
static struct sockaddr_in addr; /* The server address */
@@ -212,13 +212,14 @@
212212
}
213213
return total;
214214
}
215215
216216
/*
217
-** Attempt to resolve g.urlName to IP and setup g.zIpAddr so rcvfrom gets
218
-** populated. For hostnames with more than one IP (or if overridden in
219
-** ~/.ssh/config) the rcvfrom may not match the host to which we connect.
217
+** Attempt to resolve pUrlData->name to an IP address and setup g.zIpAddr
218
+** so rcvfrom gets populated. For hostnames with more than one IP (or
219
+** if overridden in ~/.ssh/config) the rcvfrom may not match the host
220
+** to which we connect.
220221
*/
221222
void socket_ssh_resolve_addr(UrlData *pUrlData){
222223
struct hostent *pHost; /* Used to make best effort for rcvfrom */
223224
struct sockaddr_in addr;
224225
225226
--- src/http_socket.c
+++ src/http_socket.c
@@ -124,14 +124,14 @@
124 }
125 }
126
127 /*
128 ** Open a socket connection. The identify of the server is determined
129 ** by global variables that are set using url_parse():
130 **
131 ** g.urlName Name of the server. Ex: www.fossil-scm.org
132 ** g.urlPort TCP/IP port to use. Ex: 80
133 **
134 ** Return the number of errors.
135 */
136 int socket_open(UrlData *pUrlData){
137 static struct sockaddr_in addr; /* The server address */
@@ -212,13 +212,14 @@
212 }
213 return total;
214 }
215
216 /*
217 ** Attempt to resolve g.urlName to IP and setup g.zIpAddr so rcvfrom gets
218 ** populated. For hostnames with more than one IP (or if overridden in
219 ** ~/.ssh/config) the rcvfrom may not match the host to which we connect.
 
220 */
221 void socket_ssh_resolve_addr(UrlData *pUrlData){
222 struct hostent *pHost; /* Used to make best effort for rcvfrom */
223 struct sockaddr_in addr;
224
225
--- src/http_socket.c
+++ src/http_socket.c
@@ -124,14 +124,14 @@
124 }
125 }
126
127 /*
128 ** Open a socket connection. The identify of the server is determined
129 ** by pUrlData
130 **
131 ** pUrlDAta->name Name of the server. Ex: www.fossil-scm.org
132 ** pUrlDAta->port TCP/IP port to use. Ex: 80
133 **
134 ** Return the number of errors.
135 */
136 int socket_open(UrlData *pUrlData){
137 static struct sockaddr_in addr; /* The server address */
@@ -212,13 +212,14 @@
212 }
213 return total;
214 }
215
216 /*
217 ** Attempt to resolve pUrlData->name to an IP address and setup g.zIpAddr
218 ** so rcvfrom gets populated. For hostnames with more than one IP (or
219 ** if overridden in ~/.ssh/config) the rcvfrom may not match the host
220 ** to which we connect.
221 */
222 void socket_ssh_resolve_addr(UrlData *pUrlData){
223 struct hostent *pHost; /* Used to make best effort for rcvfrom */
224 struct sockaddr_in addr;
225
226
+8 -6
--- src/http_ssl.c
+++ src/http_ssl.c
@@ -224,13 +224,13 @@
224224
return rc;
225225
}
226226
227227
/*
228228
** Open an SSL connection. The identify of the server is determined
229
-** by variables that are set using url_parse():
229
+** as follows:
230230
**
231
-** pUrlData->name Name of the server. Ex: www.fossil-scm.org
231
+** g.url.name Name of the server. Ex: www.fossil-scm.org
232232
** pUrlData->port TCP/IP port to use. Ex: 80
233233
**
234234
** Return the number of errors.
235235
*/
236236
int ssl_open(UrlData *pUrlData){
@@ -253,11 +253,11 @@
253253
254254
if( pUrlData->useProxy ){
255255
int rc;
256256
BIO *sBio;
257257
char *connStr;
258
- connStr = mprintf("%s:%d", g.urlName, pUrlData->port);
258
+ connStr = mprintf("%s:%d", g.url.name, pUrlData->port);
259259
sBio = BIO_new_connect(connStr);
260260
free(connStr);
261261
if( BIO_do_connect(sBio)<=0 ){
262262
ssl_set_errmsg("SSL: cannot connect to proxy %s:%d (%s)",
263263
pUrlData->name, pUrlData->port, ERR_reason_error_string(ERR_get_error()));
@@ -417,26 +417,28 @@
417417
free(zHost);
418418
BIO_free(mem);
419419
}
420420
421421
/*
422
-** Get certificate for g.urlName from global config.
422
+** Get certificate for pUrlData->urlName from global config.
423423
** Return NULL if no certificate found.
424424
*/
425425
X509 *ssl_get_certificate(UrlData *pUrlData, int *pTrusted){
426426
char *zHost, *zCert;
427427
BIO *mem;
428428
X509 *cert;
429429
430
- zHost = mprintf("cert:%s", pUrlData->useProxy?pUrlData->hostname:pUrlData->name);
430
+ zHost = mprintf("cert:%s",
431
+ pUrlData->useProxy ? pUrlData->hostname : pUrlData->name);
431432
zCert = db_get(zHost, NULL);
432433
free(zHost);
433434
if ( zCert==NULL )
434435
return NULL;
435436
436437
if ( pTrusted!=0 ){
437
- zHost = mprintf("trusted:%s", pUrlData->useProxy?pUrlData->hostname:pUrlData->name);
438
+ zHost = mprintf("trusted:%s",
439
+ pUrlData->useProxy ? pUrlData->hostname : pUrlData->name);
438440
*pTrusted = db_get_int(zHost, 0);
439441
free(zHost);
440442
}
441443
442444
mem = BIO_new(BIO_s_mem());
443445
--- src/http_ssl.c
+++ src/http_ssl.c
@@ -224,13 +224,13 @@
224 return rc;
225 }
226
227 /*
228 ** Open an SSL connection. The identify of the server is determined
229 ** by variables that are set using url_parse():
230 **
231 ** pUrlData->name Name of the server. Ex: www.fossil-scm.org
232 ** pUrlData->port TCP/IP port to use. Ex: 80
233 **
234 ** Return the number of errors.
235 */
236 int ssl_open(UrlData *pUrlData){
@@ -253,11 +253,11 @@
253
254 if( pUrlData->useProxy ){
255 int rc;
256 BIO *sBio;
257 char *connStr;
258 connStr = mprintf("%s:%d", g.urlName, pUrlData->port);
259 sBio = BIO_new_connect(connStr);
260 free(connStr);
261 if( BIO_do_connect(sBio)<=0 ){
262 ssl_set_errmsg("SSL: cannot connect to proxy %s:%d (%s)",
263 pUrlData->name, pUrlData->port, ERR_reason_error_string(ERR_get_error()));
@@ -417,26 +417,28 @@
417 free(zHost);
418 BIO_free(mem);
419 }
420
421 /*
422 ** Get certificate for g.urlName from global config.
423 ** Return NULL if no certificate found.
424 */
425 X509 *ssl_get_certificate(UrlData *pUrlData, int *pTrusted){
426 char *zHost, *zCert;
427 BIO *mem;
428 X509 *cert;
429
430 zHost = mprintf("cert:%s", pUrlData->useProxy?pUrlData->hostname:pUrlData->name);
 
431 zCert = db_get(zHost, NULL);
432 free(zHost);
433 if ( zCert==NULL )
434 return NULL;
435
436 if ( pTrusted!=0 ){
437 zHost = mprintf("trusted:%s", pUrlData->useProxy?pUrlData->hostname:pUrlData->name);
 
438 *pTrusted = db_get_int(zHost, 0);
439 free(zHost);
440 }
441
442 mem = BIO_new(BIO_s_mem());
443
--- src/http_ssl.c
+++ src/http_ssl.c
@@ -224,13 +224,13 @@
224 return rc;
225 }
226
227 /*
228 ** Open an SSL connection. The identify of the server is determined
229 ** as follows:
230 **
231 ** g.url.name Name of the server. Ex: www.fossil-scm.org
232 ** pUrlData->port TCP/IP port to use. Ex: 80
233 **
234 ** Return the number of errors.
235 */
236 int ssl_open(UrlData *pUrlData){
@@ -253,11 +253,11 @@
253
254 if( pUrlData->useProxy ){
255 int rc;
256 BIO *sBio;
257 char *connStr;
258 connStr = mprintf("%s:%d", g.url.name, pUrlData->port);
259 sBio = BIO_new_connect(connStr);
260 free(connStr);
261 if( BIO_do_connect(sBio)<=0 ){
262 ssl_set_errmsg("SSL: cannot connect to proxy %s:%d (%s)",
263 pUrlData->name, pUrlData->port, ERR_reason_error_string(ERR_get_error()));
@@ -417,26 +417,28 @@
417 free(zHost);
418 BIO_free(mem);
419 }
420
421 /*
422 ** Get certificate for pUrlData->urlName from global config.
423 ** Return NULL if no certificate found.
424 */
425 X509 *ssl_get_certificate(UrlData *pUrlData, int *pTrusted){
426 char *zHost, *zCert;
427 BIO *mem;
428 X509 *cert;
429
430 zHost = mprintf("cert:%s",
431 pUrlData->useProxy ? pUrlData->hostname : pUrlData->name);
432 zCert = db_get(zHost, NULL);
433 free(zHost);
434 if ( zCert==NULL )
435 return NULL;
436
437 if ( pTrusted!=0 ){
438 zHost = mprintf("trusted:%s",
439 pUrlData->useProxy ? pUrlData->hostname : pUrlData->name);
440 *pTrusted = db_get_int(zHost, 0);
441 free(zHost);
442 }
443
444 mem = BIO_new(BIO_s_mem());
445
--- src/http_transport.c
+++ src/http_transport.c
@@ -138,15 +138,15 @@
138138
return sshPid==0;
139139
}
140140
141141
/*
142142
** Open a connection to the server. The server is defined by the following
143
-** global variables:
143
+** variables:
144144
**
145
-** g.urlName Name of the server. Ex: www.fossil-scm.org
146
-** g.urlPort TCP/IP port. Ex: 80
147
-** g.urlIsHttps Use TLS for the connection
145
+** pUrlData->name Name of the server. Ex: www.fossil-scm.org
146
+** pUrlData->port TCP/IP port. Ex: 80
147
+** pUrlData->isHttps Use TLS for the connection
148148
**
149149
** Return the number of errors.
150150
*/
151151
int transport_open(UrlData *pUrlData){
152152
int rc = 0;
153153
--- src/http_transport.c
+++ src/http_transport.c
@@ -138,15 +138,15 @@
138 return sshPid==0;
139 }
140
141 /*
142 ** Open a connection to the server. The server is defined by the following
143 ** global variables:
144 **
145 ** g.urlName Name of the server. Ex: www.fossil-scm.org
146 ** g.urlPort TCP/IP port. Ex: 80
147 ** g.urlIsHttps Use TLS for the connection
148 **
149 ** Return the number of errors.
150 */
151 int transport_open(UrlData *pUrlData){
152 int rc = 0;
153
--- src/http_transport.c
+++ src/http_transport.c
@@ -138,15 +138,15 @@
138 return sshPid==0;
139 }
140
141 /*
142 ** Open a connection to the server. The server is defined by the following
143 ** variables:
144 **
145 ** pUrlData->name Name of the server. Ex: www.fossil-scm.org
146 ** pUrlData->port TCP/IP port. Ex: 80
147 ** pUrlData->isHttps Use TLS for the connection
148 **
149 ** Return the number of errors.
150 */
151 int transport_open(UrlData *pUrlData){
152 int rc = 0;
153
+28 -28
--- src/info.c
+++ src/info.c
@@ -399,11 +399,11 @@
399399
}
400400
if( diffFlags ){
401401
append_diff(zOld, zNew, diffFlags, pRe);
402402
}else if( zOld && zNew && fossil_strcmp(zOld,zNew)!=0 ){
403403
@ &nbsp;&nbsp;
404
- @ %z(href("%R/fdiff?v1=%S&v2=%S&sbs=1",zOld,zNew))[diff]</a>
404
+ @ %z(href("%R/fdiff?v1=%s&v2=%s&sbs=1",zOld,zNew))[diff]</a>
405405
}
406406
}
407407
}
408408
409409
/*
@@ -612,19 +612,19 @@
612612
if( (zPJ[jj]>0 && zPJ[jj]<' ') || strchr("\"*/:<>?\\|", zPJ[jj]) ){
613613
zPJ[jj] = '_';
614614
}
615615
}
616616
@ <tr><th>Timelines:</th><td>
617
- @ %z(href("%R/timeline?f=%S&unhide",zUuid))family</a>
617
+ @ %z(href("%R/timeline?f=%s&unhide",zUuid))family</a>
618618
if( zParent ){
619
- @ | %z(href("%R/timeline?p=%S&unhide",zUuid))ancestors</a>
619
+ @ | %z(href("%R/timeline?p=%s&unhide",zUuid))ancestors</a>
620620
}
621621
if( !isLeaf ){
622
- @ | %z(href("%R/timeline?d=%S&unhide",zUuid))descendants</a>
622
+ @ | %z(href("%R/timeline?d=%s&unhide",zUuid))descendants</a>
623623
}
624624
if( zParent && !isLeaf ){
625
- @ | %z(href("%R/timeline?dp=%S&unhide",zUuid))both</a>
625
+ @ | %z(href("%R/timeline?dp=%s&unhide",zUuid))both</a>
626626
}
627627
db_prepare(&q2,"SELECT substr(tag.tagname,5) FROM tagxref, tag "
628628
" WHERE rid=%d AND tagtype>0 "
629629
" AND tag.tagid=tagxref.tagid "
630630
" AND +tag.tagname GLOB 'sym-*'", rid);
@@ -647,16 +647,16 @@
647647
fossil_free(zUrl);
648648
}
649649
@ </td></tr>
650650
@ <tr><th>Other&nbsp;Links:</th>
651651
@ <td>
652
- @ %z(href("%R/tree?ci=%S",zUuid))files</a>
653
- @ | %z(href("%R/fileage?name=%S",zUuid))file ages</a>
654
- @ | %z(href("%R/tree?ci=%S&nofiles",zUuid))folders</a>
655
- @ | %z(href("%R/artifact/%S",zUuid))manifest</a>
652
+ @ %z(href("%R/tree?ci=%s",zUuid))files</a>
653
+ @ | %z(href("%R/fileage?name=%s",zUuid))file ages</a>
654
+ @ | %z(href("%R/tree?ci=%s&nofiles",zUuid))folders</a>
655
+ @ | %z(href("%R/artifact/%s",zUuid))manifest</a>
656656
if( g.perm.Write ){
657
- @ | %z(href("%R/ci_edit?r=%S",zUuid))edit</a>
657
+ @ | %z(href("%R/ci_edit?r=%s",zUuid))edit</a>
658658
}
659659
@ </td>
660660
@ </tr>
661661
blob_reset(&projName);
662662
}
@@ -699,11 +699,11 @@
699699
@ Show&nbsp;Unified&nbsp;Diffs</a>
700700
@ %z(xhref("class='button'","%R/%s/%T?sbs=1",zPage,zName))
701701
@ Show&nbsp;Side-by-Side&nbsp;Diffs</a>
702702
}
703703
if( zParent ){
704
- @ %z(xhref("class='button'","%R/vpatch?from=%S&to=%S",zParent,zUuid))
704
+ @ %z(xhref("class='button'","%R/vpatch?from=%s&to=%s",zParent,zUuid))
705705
@ Patch</a>
706706
}
707707
@</div>
708708
if( pRe ){
709709
@ <p><b>Only differences that match regular expression "%h(zRe)"
@@ -770,11 +770,11 @@
770770
}
771771
}
772772
style_header("Update of \"%h\"", pWiki->zWikiTitle);
773773
zUuid = db_text(0, "SELECT uuid FROM blob WHERE rid=%d", rid);
774774
zDate = db_text(0, "SELECT datetime(%.17g)", pWiki->rDate);
775
- style_submenu_element("Raw", "Raw", "artifact/%S", zUuid);
775
+ style_submenu_element("Raw", "Raw", "artifact/%s", zUuid);
776776
style_submenu_element("History", "History", "whistory?name=%t",
777777
pWiki->zWikiTitle);
778778
style_submenu_element("Page", "Page", "wiki?name=%t",
779779
pWiki->zWikiTitle);
780780
login_anonymous_available();
@@ -798,11 +798,11 @@
798798
if( pWiki->nParent>0 ){
799799
int i;
800800
@ <tr><th>Parent%s(pWiki->nParent==1?"":"s"):</th><td>
801801
for(i=0; i<pWiki->nParent; i++){
802802
char *zParent = pWiki->azParent[i];
803
- @ %z(href("info/%S",zParent))%s(zParent)</a>
803
+ @ %z(href("info/%s",zParent))%s(zParent)</a>
804804
}
805805
@ </td></tr>
806806
}
807807
@ </table>
808808
@@ -1188,14 +1188,14 @@
11881188
@ on branch %z(href("%R/timeline?r=%T",zBr))%h(zBr)</a>
11891189
}
11901190
@ - %!w(zCom) (user:
11911191
hyperlink_to_user(zUser,zDate,")");
11921192
if( g.perm.Hyperlink ){
1193
- @ %z(href("%R/finfo?name=%T&ci=%S",zName,zVers))[ancestry]</a>
1194
- @ %z(href("%R/annotate?checkin=%S&filename=%T",zVers,zName))
1193
+ @ %z(href("%R/finfo?name=%T&ci=%s",zName,zVers))[ancestry]</a>
1194
+ @ %z(href("%R/annotate?checkin=%s&filename=%T",zVers,zName))
11951195
@ [annotate]</a>
1196
- @ %z(href("%R/blame?checkin=%S&filename=%T",zVers,zName))
1196
+ @ %z(href("%R/blame?filename=%T&checkin=%s",zName,zVers))
11971197
@ [blame]</a>
11981198
}
11991199
cnt++;
12001200
if( pDownloadName && blob_size(pDownloadName)==0 ){
12011201
blob_append(pDownloadName, zName, -1);
@@ -1302,11 +1302,11 @@
13021302
@ Attachment "%h(zFilename)" to
13031303
}
13041304
objType |= OBJTYPE_ATTACHMENT;
13051305
if( strlen(zTarget)==UUID_SIZE && validate16(zTarget,UUID_SIZE) ){
13061306
if( g.perm.Hyperlink && g.perm.RdTkt ){
1307
- @ ticket [%z(href("%R/tktview?name=%S",zTarget))%S(zTarget)</a>]
1307
+ @ ticket [%z(href("%R/tktview?name=%s",zTarget))%S(zTarget)</a>]
13081308
}else{
13091309
@ ticket [%S(zTarget)]
13101310
}
13111311
}else{
13121312
if( g.perm.Hyperlink && g.perm.RdWiki ){
@@ -1328,11 +1328,11 @@
13281328
@ Control artifact.
13291329
if( pDownloadName && blob_size(pDownloadName)==0 ){
13301330
blob_appendf(pDownloadName, "%.10s.txt", zUuid);
13311331
}
13321332
}else if( linkToView && g.perm.Hyperlink ){
1333
- @ %z(href("%R/artifact/%S",zUuid))[view]</a>
1333
+ @ %z(href("%R/artifact/%s",zUuid))[view]</a>
13341334
}
13351335
return objType;
13361336
}
13371337
13381338
@@ -1404,17 +1404,17 @@
14041404
g.zTop, P("v1"), P("v2"), zW);
14051405
}
14061406
14071407
if( P("smhdr")!=0 ){
14081408
@ <h2>Differences From Artifact
1409
- @ %z(href("%R/artifact/%S",zV1))[%S(zV1)]</a> To
1410
- @ %z(href("%R/artifact/%S",zV2))[%S(zV2)]</a>.</h2>
1409
+ @ %z(href("%R/artifact/%s",zV1))[%S(zV1)]</a> To
1410
+ @ %z(href("%R/artifact/%s",zV2))[%S(zV2)]</a>.</h2>
14111411
}else{
14121412
@ <h2>Differences From
1413
- @ Artifact %z(href("%R/artifact/%S",zV1))[%S(zV1)]</a>:</h2>
1413
+ @ Artifact %z(href("%R/artifact/%s",zV1))[%S(zV1)]</a>:</h2>
14141414
object_description(v1, 0, 0);
1415
- @ <h2>To Artifact %z(href("%R/artifact/%S",zV2))[%S(zV2)]</a>:</h2>
1415
+ @ <h2>To Artifact %z(href("%R/artifact/%s",zV2))[%S(zV2)]</a>:</h2>
14161416
object_description(v2, 0, 0);
14171417
}
14181418
if( pRe ){
14191419
@ <b>Only differences that match regular expression "%h(zRe)"
14201420
@ are shown.</b>
@@ -1761,13 +1761,13 @@
17611761
@ <pre>
17621762
@ %h(z)
17631763
@ </pre>
17641764
}
17651765
}else if( strncmp(zMime, "image/", 6)==0 ){
1766
- @ <img src="%R/raw/%S(zUuid)?m=%s(zMime)" />
1766
+ @ <img src="%R/raw/%s(zUuid)?m=%s(zMime)" />
17671767
style_submenu_element("Image", "Image",
1768
- "%R/raw/%S?m=%s", zUuid, zMime);
1768
+ "%R/raw/%s?m=%s", zUuid, zMime);
17691769
}else{
17701770
@ <i>(file is %d(blob_size(&content)) bytes of binary data)</i>
17711771
}
17721772
@ </blockquote>
17731773
}
@@ -1819,19 +1819,19 @@
18191819
}
18201820
zTktTitle = db_table_has_column( "ticket", "title" )
18211821
? db_text("(No title)", "SELECT title FROM ticket WHERE tkt_uuid=%Q", zTktName)
18221822
: 0;
18231823
style_header("Ticket Change Details");
1824
- style_submenu_element("Raw", "Raw", "%R/artifact/%S", zUuid);
1824
+ style_submenu_element("Raw", "Raw", "%R/artifact/%s", zUuid);
18251825
style_submenu_element("History", "History", "%R/tkthistory/%s", zTktName);
18261826
style_submenu_element("Page", "Page", "%R/tktview/%t", zTktName);
18271827
style_submenu_element("Timeline", "Timeline", "%R/tkttimeline/%t", zTktName);
18281828
if( P("plaintext") ){
1829
- style_submenu_element("Formatted", "Formatted", "%R/info/%S", zUuid);
1829
+ style_submenu_element("Formatted", "Formatted", "%R/info/%s", zUuid);
18301830
}else{
18311831
style_submenu_element("Plaintext", "Plaintext",
1832
- "%R/info/%S?plaintext", zUuid);
1832
+ "%R/info/%s?plaintext", zUuid);
18331833
}
18341834
18351835
@ <div class="section">Overview</div>
18361836
@ <p><table class="label-value">
18371837
@ <tr><th>Artifact&nbsp;ID:</th>
@@ -2341,11 +2341,11 @@
23412341
}
23422342
@ <p>Make changes to attributes of check-in
23432343
@ [%z(href("%R/ci/%s",zUuid))%s(zUuid)</a>]:</p>
23442344
form_begin(0, "%R/ci_edit");
23452345
login_insert_csrf_secret();
2346
- @ <div><input type="hidden" name="r" value="%S(zUuid)" />
2346
+ @ <div><input type="hidden" name="r" value="%s(zUuid)" />
23472347
@ <table border="0" cellspacing="10">
23482348
23492349
@ <tr><th align="right" valign="top">User:</th>
23502350
@ <td valign="top">
23512351
@ <input type="text" name="u" size="20" value="%h(zNewUser)" />
23522352
--- src/info.c
+++ src/info.c
@@ -399,11 +399,11 @@
399 }
400 if( diffFlags ){
401 append_diff(zOld, zNew, diffFlags, pRe);
402 }else if( zOld && zNew && fossil_strcmp(zOld,zNew)!=0 ){
403 @ &nbsp;&nbsp;
404 @ %z(href("%R/fdiff?v1=%S&v2=%S&sbs=1",zOld,zNew))[diff]</a>
405 }
406 }
407 }
408
409 /*
@@ -612,19 +612,19 @@
612 if( (zPJ[jj]>0 && zPJ[jj]<' ') || strchr("\"*/:<>?\\|", zPJ[jj]) ){
613 zPJ[jj] = '_';
614 }
615 }
616 @ <tr><th>Timelines:</th><td>
617 @ %z(href("%R/timeline?f=%S&unhide",zUuid))family</a>
618 if( zParent ){
619 @ | %z(href("%R/timeline?p=%S&unhide",zUuid))ancestors</a>
620 }
621 if( !isLeaf ){
622 @ | %z(href("%R/timeline?d=%S&unhide",zUuid))descendants</a>
623 }
624 if( zParent && !isLeaf ){
625 @ | %z(href("%R/timeline?dp=%S&unhide",zUuid))both</a>
626 }
627 db_prepare(&q2,"SELECT substr(tag.tagname,5) FROM tagxref, tag "
628 " WHERE rid=%d AND tagtype>0 "
629 " AND tag.tagid=tagxref.tagid "
630 " AND +tag.tagname GLOB 'sym-*'", rid);
@@ -647,16 +647,16 @@
647 fossil_free(zUrl);
648 }
649 @ </td></tr>
650 @ <tr><th>Other&nbsp;Links:</th>
651 @ <td>
652 @ %z(href("%R/tree?ci=%S",zUuid))files</a>
653 @ | %z(href("%R/fileage?name=%S",zUuid))file ages</a>
654 @ | %z(href("%R/tree?ci=%S&nofiles",zUuid))folders</a>
655 @ | %z(href("%R/artifact/%S",zUuid))manifest</a>
656 if( g.perm.Write ){
657 @ | %z(href("%R/ci_edit?r=%S",zUuid))edit</a>
658 }
659 @ </td>
660 @ </tr>
661 blob_reset(&projName);
662 }
@@ -699,11 +699,11 @@
699 @ Show&nbsp;Unified&nbsp;Diffs</a>
700 @ %z(xhref("class='button'","%R/%s/%T?sbs=1",zPage,zName))
701 @ Show&nbsp;Side-by-Side&nbsp;Diffs</a>
702 }
703 if( zParent ){
704 @ %z(xhref("class='button'","%R/vpatch?from=%S&to=%S",zParent,zUuid))
705 @ Patch</a>
706 }
707 @</div>
708 if( pRe ){
709 @ <p><b>Only differences that match regular expression "%h(zRe)"
@@ -770,11 +770,11 @@
770 }
771 }
772 style_header("Update of \"%h\"", pWiki->zWikiTitle);
773 zUuid = db_text(0, "SELECT uuid FROM blob WHERE rid=%d", rid);
774 zDate = db_text(0, "SELECT datetime(%.17g)", pWiki->rDate);
775 style_submenu_element("Raw", "Raw", "artifact/%S", zUuid);
776 style_submenu_element("History", "History", "whistory?name=%t",
777 pWiki->zWikiTitle);
778 style_submenu_element("Page", "Page", "wiki?name=%t",
779 pWiki->zWikiTitle);
780 login_anonymous_available();
@@ -798,11 +798,11 @@
798 if( pWiki->nParent>0 ){
799 int i;
800 @ <tr><th>Parent%s(pWiki->nParent==1?"":"s"):</th><td>
801 for(i=0; i<pWiki->nParent; i++){
802 char *zParent = pWiki->azParent[i];
803 @ %z(href("info/%S",zParent))%s(zParent)</a>
804 }
805 @ </td></tr>
806 }
807 @ </table>
808
@@ -1188,14 +1188,14 @@
1188 @ on branch %z(href("%R/timeline?r=%T",zBr))%h(zBr)</a>
1189 }
1190 @ - %!w(zCom) (user:
1191 hyperlink_to_user(zUser,zDate,")");
1192 if( g.perm.Hyperlink ){
1193 @ %z(href("%R/finfo?name=%T&ci=%S",zName,zVers))[ancestry]</a>
1194 @ %z(href("%R/annotate?checkin=%S&filename=%T",zVers,zName))
1195 @ [annotate]</a>
1196 @ %z(href("%R/blame?checkin=%S&filename=%T",zVers,zName))
1197 @ [blame]</a>
1198 }
1199 cnt++;
1200 if( pDownloadName && blob_size(pDownloadName)==0 ){
1201 blob_append(pDownloadName, zName, -1);
@@ -1302,11 +1302,11 @@
1302 @ Attachment "%h(zFilename)" to
1303 }
1304 objType |= OBJTYPE_ATTACHMENT;
1305 if( strlen(zTarget)==UUID_SIZE && validate16(zTarget,UUID_SIZE) ){
1306 if( g.perm.Hyperlink && g.perm.RdTkt ){
1307 @ ticket [%z(href("%R/tktview?name=%S",zTarget))%S(zTarget)</a>]
1308 }else{
1309 @ ticket [%S(zTarget)]
1310 }
1311 }else{
1312 if( g.perm.Hyperlink && g.perm.RdWiki ){
@@ -1328,11 +1328,11 @@
1328 @ Control artifact.
1329 if( pDownloadName && blob_size(pDownloadName)==0 ){
1330 blob_appendf(pDownloadName, "%.10s.txt", zUuid);
1331 }
1332 }else if( linkToView && g.perm.Hyperlink ){
1333 @ %z(href("%R/artifact/%S",zUuid))[view]</a>
1334 }
1335 return objType;
1336 }
1337
1338
@@ -1404,17 +1404,17 @@
1404 g.zTop, P("v1"), P("v2"), zW);
1405 }
1406
1407 if( P("smhdr")!=0 ){
1408 @ <h2>Differences From Artifact
1409 @ %z(href("%R/artifact/%S",zV1))[%S(zV1)]</a> To
1410 @ %z(href("%R/artifact/%S",zV2))[%S(zV2)]</a>.</h2>
1411 }else{
1412 @ <h2>Differences From
1413 @ Artifact %z(href("%R/artifact/%S",zV1))[%S(zV1)]</a>:</h2>
1414 object_description(v1, 0, 0);
1415 @ <h2>To Artifact %z(href("%R/artifact/%S",zV2))[%S(zV2)]</a>:</h2>
1416 object_description(v2, 0, 0);
1417 }
1418 if( pRe ){
1419 @ <b>Only differences that match regular expression "%h(zRe)"
1420 @ are shown.</b>
@@ -1761,13 +1761,13 @@
1761 @ <pre>
1762 @ %h(z)
1763 @ </pre>
1764 }
1765 }else if( strncmp(zMime, "image/", 6)==0 ){
1766 @ <img src="%R/raw/%S(zUuid)?m=%s(zMime)" />
1767 style_submenu_element("Image", "Image",
1768 "%R/raw/%S?m=%s", zUuid, zMime);
1769 }else{
1770 @ <i>(file is %d(blob_size(&content)) bytes of binary data)</i>
1771 }
1772 @ </blockquote>
1773 }
@@ -1819,19 +1819,19 @@
1819 }
1820 zTktTitle = db_table_has_column( "ticket", "title" )
1821 ? db_text("(No title)", "SELECT title FROM ticket WHERE tkt_uuid=%Q", zTktName)
1822 : 0;
1823 style_header("Ticket Change Details");
1824 style_submenu_element("Raw", "Raw", "%R/artifact/%S", zUuid);
1825 style_submenu_element("History", "History", "%R/tkthistory/%s", zTktName);
1826 style_submenu_element("Page", "Page", "%R/tktview/%t", zTktName);
1827 style_submenu_element("Timeline", "Timeline", "%R/tkttimeline/%t", zTktName);
1828 if( P("plaintext") ){
1829 style_submenu_element("Formatted", "Formatted", "%R/info/%S", zUuid);
1830 }else{
1831 style_submenu_element("Plaintext", "Plaintext",
1832 "%R/info/%S?plaintext", zUuid);
1833 }
1834
1835 @ <div class="section">Overview</div>
1836 @ <p><table class="label-value">
1837 @ <tr><th>Artifact&nbsp;ID:</th>
@@ -2341,11 +2341,11 @@
2341 }
2342 @ <p>Make changes to attributes of check-in
2343 @ [%z(href("%R/ci/%s",zUuid))%s(zUuid)</a>]:</p>
2344 form_begin(0, "%R/ci_edit");
2345 login_insert_csrf_secret();
2346 @ <div><input type="hidden" name="r" value="%S(zUuid)" />
2347 @ <table border="0" cellspacing="10">
2348
2349 @ <tr><th align="right" valign="top">User:</th>
2350 @ <td valign="top">
2351 @ <input type="text" name="u" size="20" value="%h(zNewUser)" />
2352
--- src/info.c
+++ src/info.c
@@ -399,11 +399,11 @@
399 }
400 if( diffFlags ){
401 append_diff(zOld, zNew, diffFlags, pRe);
402 }else if( zOld && zNew && fossil_strcmp(zOld,zNew)!=0 ){
403 @ &nbsp;&nbsp;
404 @ %z(href("%R/fdiff?v1=%s&v2=%s&sbs=1",zOld,zNew))[diff]</a>
405 }
406 }
407 }
408
409 /*
@@ -612,19 +612,19 @@
612 if( (zPJ[jj]>0 && zPJ[jj]<' ') || strchr("\"*/:<>?\\|", zPJ[jj]) ){
613 zPJ[jj] = '_';
614 }
615 }
616 @ <tr><th>Timelines:</th><td>
617 @ %z(href("%R/timeline?f=%s&unhide",zUuid))family</a>
618 if( zParent ){
619 @ | %z(href("%R/timeline?p=%s&unhide",zUuid))ancestors</a>
620 }
621 if( !isLeaf ){
622 @ | %z(href("%R/timeline?d=%s&unhide",zUuid))descendants</a>
623 }
624 if( zParent && !isLeaf ){
625 @ | %z(href("%R/timeline?dp=%s&unhide",zUuid))both</a>
626 }
627 db_prepare(&q2,"SELECT substr(tag.tagname,5) FROM tagxref, tag "
628 " WHERE rid=%d AND tagtype>0 "
629 " AND tag.tagid=tagxref.tagid "
630 " AND +tag.tagname GLOB 'sym-*'", rid);
@@ -647,16 +647,16 @@
647 fossil_free(zUrl);
648 }
649 @ </td></tr>
650 @ <tr><th>Other&nbsp;Links:</th>
651 @ <td>
652 @ %z(href("%R/tree?ci=%s",zUuid))files</a>
653 @ | %z(href("%R/fileage?name=%s",zUuid))file ages</a>
654 @ | %z(href("%R/tree?ci=%s&nofiles",zUuid))folders</a>
655 @ | %z(href("%R/artifact/%s",zUuid))manifest</a>
656 if( g.perm.Write ){
657 @ | %z(href("%R/ci_edit?r=%s",zUuid))edit</a>
658 }
659 @ </td>
660 @ </tr>
661 blob_reset(&projName);
662 }
@@ -699,11 +699,11 @@
699 @ Show&nbsp;Unified&nbsp;Diffs</a>
700 @ %z(xhref("class='button'","%R/%s/%T?sbs=1",zPage,zName))
701 @ Show&nbsp;Side-by-Side&nbsp;Diffs</a>
702 }
703 if( zParent ){
704 @ %z(xhref("class='button'","%R/vpatch?from=%s&to=%s",zParent,zUuid))
705 @ Patch</a>
706 }
707 @</div>
708 if( pRe ){
709 @ <p><b>Only differences that match regular expression "%h(zRe)"
@@ -770,11 +770,11 @@
770 }
771 }
772 style_header("Update of \"%h\"", pWiki->zWikiTitle);
773 zUuid = db_text(0, "SELECT uuid FROM blob WHERE rid=%d", rid);
774 zDate = db_text(0, "SELECT datetime(%.17g)", pWiki->rDate);
775 style_submenu_element("Raw", "Raw", "artifact/%s", zUuid);
776 style_submenu_element("History", "History", "whistory?name=%t",
777 pWiki->zWikiTitle);
778 style_submenu_element("Page", "Page", "wiki?name=%t",
779 pWiki->zWikiTitle);
780 login_anonymous_available();
@@ -798,11 +798,11 @@
798 if( pWiki->nParent>0 ){
799 int i;
800 @ <tr><th>Parent%s(pWiki->nParent==1?"":"s"):</th><td>
801 for(i=0; i<pWiki->nParent; i++){
802 char *zParent = pWiki->azParent[i];
803 @ %z(href("info/%s",zParent))%s(zParent)</a>
804 }
805 @ </td></tr>
806 }
807 @ </table>
808
@@ -1188,14 +1188,14 @@
1188 @ on branch %z(href("%R/timeline?r=%T",zBr))%h(zBr)</a>
1189 }
1190 @ - %!w(zCom) (user:
1191 hyperlink_to_user(zUser,zDate,")");
1192 if( g.perm.Hyperlink ){
1193 @ %z(href("%R/finfo?name=%T&ci=%s",zName,zVers))[ancestry]</a>
1194 @ %z(href("%R/annotate?checkin=%s&filename=%T",zVers,zName))
1195 @ [annotate]</a>
1196 @ %z(href("%R/blame?filename=%T&checkin=%s",zName,zVers))
1197 @ [blame]</a>
1198 }
1199 cnt++;
1200 if( pDownloadName && blob_size(pDownloadName)==0 ){
1201 blob_append(pDownloadName, zName, -1);
@@ -1302,11 +1302,11 @@
1302 @ Attachment "%h(zFilename)" to
1303 }
1304 objType |= OBJTYPE_ATTACHMENT;
1305 if( strlen(zTarget)==UUID_SIZE && validate16(zTarget,UUID_SIZE) ){
1306 if( g.perm.Hyperlink && g.perm.RdTkt ){
1307 @ ticket [%z(href("%R/tktview?name=%s",zTarget))%S(zTarget)</a>]
1308 }else{
1309 @ ticket [%S(zTarget)]
1310 }
1311 }else{
1312 if( g.perm.Hyperlink && g.perm.RdWiki ){
@@ -1328,11 +1328,11 @@
1328 @ Control artifact.
1329 if( pDownloadName && blob_size(pDownloadName)==0 ){
1330 blob_appendf(pDownloadName, "%.10s.txt", zUuid);
1331 }
1332 }else if( linkToView && g.perm.Hyperlink ){
1333 @ %z(href("%R/artifact/%s",zUuid))[view]</a>
1334 }
1335 return objType;
1336 }
1337
1338
@@ -1404,17 +1404,17 @@
1404 g.zTop, P("v1"), P("v2"), zW);
1405 }
1406
1407 if( P("smhdr")!=0 ){
1408 @ <h2>Differences From Artifact
1409 @ %z(href("%R/artifact/%s",zV1))[%S(zV1)]</a> To
1410 @ %z(href("%R/artifact/%s",zV2))[%S(zV2)]</a>.</h2>
1411 }else{
1412 @ <h2>Differences From
1413 @ Artifact %z(href("%R/artifact/%s",zV1))[%S(zV1)]</a>:</h2>
1414 object_description(v1, 0, 0);
1415 @ <h2>To Artifact %z(href("%R/artifact/%s",zV2))[%S(zV2)]</a>:</h2>
1416 object_description(v2, 0, 0);
1417 }
1418 if( pRe ){
1419 @ <b>Only differences that match regular expression "%h(zRe)"
1420 @ are shown.</b>
@@ -1761,13 +1761,13 @@
1761 @ <pre>
1762 @ %h(z)
1763 @ </pre>
1764 }
1765 }else if( strncmp(zMime, "image/", 6)==0 ){
1766 @ <img src="%R/raw/%s(zUuid)?m=%s(zMime)" />
1767 style_submenu_element("Image", "Image",
1768 "%R/raw/%s?m=%s", zUuid, zMime);
1769 }else{
1770 @ <i>(file is %d(blob_size(&content)) bytes of binary data)</i>
1771 }
1772 @ </blockquote>
1773 }
@@ -1819,19 +1819,19 @@
1819 }
1820 zTktTitle = db_table_has_column( "ticket", "title" )
1821 ? db_text("(No title)", "SELECT title FROM ticket WHERE tkt_uuid=%Q", zTktName)
1822 : 0;
1823 style_header("Ticket Change Details");
1824 style_submenu_element("Raw", "Raw", "%R/artifact/%s", zUuid);
1825 style_submenu_element("History", "History", "%R/tkthistory/%s", zTktName);
1826 style_submenu_element("Page", "Page", "%R/tktview/%t", zTktName);
1827 style_submenu_element("Timeline", "Timeline", "%R/tkttimeline/%t", zTktName);
1828 if( P("plaintext") ){
1829 style_submenu_element("Formatted", "Formatted", "%R/info/%s", zUuid);
1830 }else{
1831 style_submenu_element("Plaintext", "Plaintext",
1832 "%R/info/%s?plaintext", zUuid);
1833 }
1834
1835 @ <div class="section">Overview</div>
1836 @ <p><table class="label-value">
1837 @ <tr><th>Artifact&nbsp;ID:</th>
@@ -2341,11 +2341,11 @@
2341 }
2342 @ <p>Make changes to attributes of check-in
2343 @ [%z(href("%R/ci/%s",zUuid))%s(zUuid)</a>]:</p>
2344 form_begin(0, "%R/ci_edit");
2345 login_insert_csrf_secret();
2346 @ <div><input type="hidden" name="r" value="%s(zUuid)" />
2347 @ <table border="0" cellspacing="10">
2348
2349 @ <tr><th align="right" valign="top">User:</th>
2350 @ <td valign="top">
2351 @ <input type="text" name="u" size="20" value="%h(zNewUser)" />
2352
+14 -14
--- src/json.c
+++ src/json.c
@@ -1275,15 +1275,15 @@
12751275
INT(g, xlinkClusterOnly);
12761276
INT(g, fTimeFormat);
12771277
INT(g, markPrivate);
12781278
INT(g, clockSkewSeen);
12791279
INT(g, isHTTP);
1280
- INT(g, urlIsFile);
1281
- INT(g, urlIsHttps);
1282
- INT(g, urlIsSsh);
1283
- INT(g, urlPort);
1284
- INT(g, urlDfltPort);
1280
+ INT(g.url, isFile);
1281
+ INT(g.url, isHttps);
1282
+ INT(g.url, isSsh);
1283
+ INT(g.url, port);
1284
+ INT(g.url, dfltPort);
12851285
INT(g, useLocalauth);
12861286
INT(g, noPswd);
12871287
INT(g, userUid);
12881288
INT(g, rcvid);
12891289
INT(g, okCsrf);
@@ -1299,19 +1299,19 @@
12991299
CSTR(g, zExtra);
13001300
CSTR(g, zBaseURL);
13011301
CSTR(g, zTop);
13021302
CSTR(g, zContentType);
13031303
CSTR(g, zErrMsg);
1304
- CSTR(g, urlName);
1305
- CSTR(g, urlHostname);
1306
- CSTR(g, urlProtocol);
1307
- CSTR(g, urlPath);
1308
- CSTR(g, urlUser);
1309
- CSTR(g, urlPasswd);
1310
- CSTR(g, urlCanonical);
1311
- CSTR(g, urlProxyAuth);
1312
- CSTR(g, urlFossil);
1304
+ CSTR(g.url, name);
1305
+ CSTR(g.url, hostname);
1306
+ CSTR(g.url, protocol);
1307
+ CSTR(g.url, path);
1308
+ CSTR(g.url, user);
1309
+ CSTR(g.url, passwd);
1310
+ CSTR(g.url, canonical);
1311
+ CSTR(g.url, proxyAuth);
1312
+ CSTR(g.url, fossil);
13131313
CSTR(g, zLogin);
13141314
CSTR(g, zSSLIdentity);
13151315
CSTR(g, zIpAddr);
13161316
CSTR(g, zNonce);
13171317
CSTR(g, zCsrfToken);
13181318
--- src/json.c
+++ src/json.c
@@ -1275,15 +1275,15 @@
1275 INT(g, xlinkClusterOnly);
1276 INT(g, fTimeFormat);
1277 INT(g, markPrivate);
1278 INT(g, clockSkewSeen);
1279 INT(g, isHTTP);
1280 INT(g, urlIsFile);
1281 INT(g, urlIsHttps);
1282 INT(g, urlIsSsh);
1283 INT(g, urlPort);
1284 INT(g, urlDfltPort);
1285 INT(g, useLocalauth);
1286 INT(g, noPswd);
1287 INT(g, userUid);
1288 INT(g, rcvid);
1289 INT(g, okCsrf);
@@ -1299,19 +1299,19 @@
1299 CSTR(g, zExtra);
1300 CSTR(g, zBaseURL);
1301 CSTR(g, zTop);
1302 CSTR(g, zContentType);
1303 CSTR(g, zErrMsg);
1304 CSTR(g, urlName);
1305 CSTR(g, urlHostname);
1306 CSTR(g, urlProtocol);
1307 CSTR(g, urlPath);
1308 CSTR(g, urlUser);
1309 CSTR(g, urlPasswd);
1310 CSTR(g, urlCanonical);
1311 CSTR(g, urlProxyAuth);
1312 CSTR(g, urlFossil);
1313 CSTR(g, zLogin);
1314 CSTR(g, zSSLIdentity);
1315 CSTR(g, zIpAddr);
1316 CSTR(g, zNonce);
1317 CSTR(g, zCsrfToken);
1318
--- src/json.c
+++ src/json.c
@@ -1275,15 +1275,15 @@
1275 INT(g, xlinkClusterOnly);
1276 INT(g, fTimeFormat);
1277 INT(g, markPrivate);
1278 INT(g, clockSkewSeen);
1279 INT(g, isHTTP);
1280 INT(g.url, isFile);
1281 INT(g.url, isHttps);
1282 INT(g.url, isSsh);
1283 INT(g.url, port);
1284 INT(g.url, dfltPort);
1285 INT(g, useLocalauth);
1286 INT(g, noPswd);
1287 INT(g, userUid);
1288 INT(g, rcvid);
1289 INT(g, okCsrf);
@@ -1299,19 +1299,19 @@
1299 CSTR(g, zExtra);
1300 CSTR(g, zBaseURL);
1301 CSTR(g, zTop);
1302 CSTR(g, zContentType);
1303 CSTR(g, zErrMsg);
1304 CSTR(g.url, name);
1305 CSTR(g.url, hostname);
1306 CSTR(g.url, protocol);
1307 CSTR(g.url, path);
1308 CSTR(g.url, user);
1309 CSTR(g.url, passwd);
1310 CSTR(g.url, canonical);
1311 CSTR(g.url, proxyAuth);
1312 CSTR(g.url, fossil);
1313 CSTR(g, zLogin);
1314 CSTR(g, zSSLIdentity);
1315 CSTR(g, zIpAddr);
1316 CSTR(g, zNonce);
1317 CSTR(g, zCsrfToken);
1318
+4 -6
--- src/main.c
+++ src/main.c
@@ -112,15 +112,10 @@
112112
void *xPostEval; /* Optional, called after Tcl_Eval*(). */
113113
void *pPostContext; /* Optional, provided to xPostEval(). */
114114
};
115115
#endif
116116
117
-/*
118
-** All global variables are in this structure.
119
-*/
120
-#define GLOBAL_URL() ((UrlData *)(&g.urlIsFile))
121
-
122117
struct Global {
123118
int argc; char **argv; /* Command-line arguments to the program */
124119
char *nameOfExe; /* Full path of executable. */
125120
const char *zErrlog; /* Log errors to this file, if not NULL */
126121
int isConst; /* True if the output is unchanging & cacheable */
@@ -172,11 +167,12 @@
172167
int wikiFlags; /* Wiki conversion flags applied to %w and %W */
173168
char isHTTP; /* True if server/CGI modes, else assume CLI. */
174169
char javascriptHyperlink; /* If true, set href= using script, not HTML */
175170
Blob httpHeader; /* Complete text of the HTTP request header */
176171
int useRepositoryFromCmdArg; /* -R <repository> specified on command line */
177
-
172
+ UrlData url; /* Information about current URL */
173
+#if 0
178174
/*
179175
** NOTE: These members MUST be kept in sync with those in the "UrlData"
180176
** structure defined in "url.c".
181177
*/
182178
int urlIsFile; /* True if a "file:" url */
@@ -195,10 +191,12 @@
195191
char *urlFossil; /* The fossil query parameter on ssh: */
196192
unsigned urlFlags; /* Boolean flags controlling URL processing */
197193
int useProxy; /* Used to remember that a proxy is in use */
198194
char *proxyUrlPath;
199195
int proxyOrigPort; /* Tunneled port number for https through proxy */
196
+#endif
197
+
200198
const char *zLogin; /* Login name. NULL or "" if not logged in. */
201199
const char *zSSLIdentity; /* Value of --ssl-identity option, filename of
202200
** SSL client identity */
203201
int useLocalauth; /* No login required if from 127.0.0.1 */
204202
int noPswd; /* Logged in without password (on 127.0.0.1) */
205203
--- src/main.c
+++ src/main.c
@@ -112,15 +112,10 @@
112 void *xPostEval; /* Optional, called after Tcl_Eval*(). */
113 void *pPostContext; /* Optional, provided to xPostEval(). */
114 };
115 #endif
116
117 /*
118 ** All global variables are in this structure.
119 */
120 #define GLOBAL_URL() ((UrlData *)(&g.urlIsFile))
121
122 struct Global {
123 int argc; char **argv; /* Command-line arguments to the program */
124 char *nameOfExe; /* Full path of executable. */
125 const char *zErrlog; /* Log errors to this file, if not NULL */
126 int isConst; /* True if the output is unchanging & cacheable */
@@ -172,11 +167,12 @@
172 int wikiFlags; /* Wiki conversion flags applied to %w and %W */
173 char isHTTP; /* True if server/CGI modes, else assume CLI. */
174 char javascriptHyperlink; /* If true, set href= using script, not HTML */
175 Blob httpHeader; /* Complete text of the HTTP request header */
176 int useRepositoryFromCmdArg; /* -R <repository> specified on command line */
177
 
178 /*
179 ** NOTE: These members MUST be kept in sync with those in the "UrlData"
180 ** structure defined in "url.c".
181 */
182 int urlIsFile; /* True if a "file:" url */
@@ -195,10 +191,12 @@
195 char *urlFossil; /* The fossil query parameter on ssh: */
196 unsigned urlFlags; /* Boolean flags controlling URL processing */
197 int useProxy; /* Used to remember that a proxy is in use */
198 char *proxyUrlPath;
199 int proxyOrigPort; /* Tunneled port number for https through proxy */
 
 
200 const char *zLogin; /* Login name. NULL or "" if not logged in. */
201 const char *zSSLIdentity; /* Value of --ssl-identity option, filename of
202 ** SSL client identity */
203 int useLocalauth; /* No login required if from 127.0.0.1 */
204 int noPswd; /* Logged in without password (on 127.0.0.1) */
205
--- src/main.c
+++ src/main.c
@@ -112,15 +112,10 @@
112 void *xPostEval; /* Optional, called after Tcl_Eval*(). */
113 void *pPostContext; /* Optional, provided to xPostEval(). */
114 };
115 #endif
116
 
 
 
 
 
117 struct Global {
118 int argc; char **argv; /* Command-line arguments to the program */
119 char *nameOfExe; /* Full path of executable. */
120 const char *zErrlog; /* Log errors to this file, if not NULL */
121 int isConst; /* True if the output is unchanging & cacheable */
@@ -172,11 +167,12 @@
167 int wikiFlags; /* Wiki conversion flags applied to %w and %W */
168 char isHTTP; /* True if server/CGI modes, else assume CLI. */
169 char javascriptHyperlink; /* If true, set href= using script, not HTML */
170 Blob httpHeader; /* Complete text of the HTTP request header */
171 int useRepositoryFromCmdArg; /* -R <repository> specified on command line */
172 UrlData url; /* Information about current URL */
173 #if 0
174 /*
175 ** NOTE: These members MUST be kept in sync with those in the "UrlData"
176 ** structure defined in "url.c".
177 */
178 int urlIsFile; /* True if a "file:" url */
@@ -195,10 +191,12 @@
191 char *urlFossil; /* The fossil query parameter on ssh: */
192 unsigned urlFlags; /* Boolean flags controlling URL processing */
193 int useProxy; /* Used to remember that a proxy is in use */
194 char *proxyUrlPath;
195 int proxyOrigPort; /* Tunneled port number for https through proxy */
196 #endif
197
198 const char *zLogin; /* Login name. NULL or "" if not logged in. */
199 const char *zSSLIdentity; /* Value of --ssl-identity option, filename of
200 ** SSL client identity */
201 int useLocalauth; /* No login required if from 127.0.0.1 */
202 int noPswd; /* Logged in without password (on 127.0.0.1) */
203
+4 -6
--- src/main.c
+++ src/main.c
@@ -112,15 +112,10 @@
112112
void *xPostEval; /* Optional, called after Tcl_Eval*(). */
113113
void *pPostContext; /* Optional, provided to xPostEval(). */
114114
};
115115
#endif
116116
117
-/*
118
-** All global variables are in this structure.
119
-*/
120
-#define GLOBAL_URL() ((UrlData *)(&g.urlIsFile))
121
-
122117
struct Global {
123118
int argc; char **argv; /* Command-line arguments to the program */
124119
char *nameOfExe; /* Full path of executable. */
125120
const char *zErrlog; /* Log errors to this file, if not NULL */
126121
int isConst; /* True if the output is unchanging & cacheable */
@@ -172,11 +167,12 @@
172167
int wikiFlags; /* Wiki conversion flags applied to %w and %W */
173168
char isHTTP; /* True if server/CGI modes, else assume CLI. */
174169
char javascriptHyperlink; /* If true, set href= using script, not HTML */
175170
Blob httpHeader; /* Complete text of the HTTP request header */
176171
int useRepositoryFromCmdArg; /* -R <repository> specified on command line */
177
-
172
+ UrlData url; /* Information about current URL */
173
+#if 0
178174
/*
179175
** NOTE: These members MUST be kept in sync with those in the "UrlData"
180176
** structure defined in "url.c".
181177
*/
182178
int urlIsFile; /* True if a "file:" url */
@@ -195,10 +191,12 @@
195191
char *urlFossil; /* The fossil query parameter on ssh: */
196192
unsigned urlFlags; /* Boolean flags controlling URL processing */
197193
int useProxy; /* Used to remember that a proxy is in use */
198194
char *proxyUrlPath;
199195
int proxyOrigPort; /* Tunneled port number for https through proxy */
196
+#endif
197
+
200198
const char *zLogin; /* Login name. NULL or "" if not logged in. */
201199
const char *zSSLIdentity; /* Value of --ssl-identity option, filename of
202200
** SSL client identity */
203201
int useLocalauth; /* No login required if from 127.0.0.1 */
204202
int noPswd; /* Logged in without password (on 127.0.0.1) */
205203
--- src/main.c
+++ src/main.c
@@ -112,15 +112,10 @@
112 void *xPostEval; /* Optional, called after Tcl_Eval*(). */
113 void *pPostContext; /* Optional, provided to xPostEval(). */
114 };
115 #endif
116
117 /*
118 ** All global variables are in this structure.
119 */
120 #define GLOBAL_URL() ((UrlData *)(&g.urlIsFile))
121
122 struct Global {
123 int argc; char **argv; /* Command-line arguments to the program */
124 char *nameOfExe; /* Full path of executable. */
125 const char *zErrlog; /* Log errors to this file, if not NULL */
126 int isConst; /* True if the output is unchanging & cacheable */
@@ -172,11 +167,12 @@
172 int wikiFlags; /* Wiki conversion flags applied to %w and %W */
173 char isHTTP; /* True if server/CGI modes, else assume CLI. */
174 char javascriptHyperlink; /* If true, set href= using script, not HTML */
175 Blob httpHeader; /* Complete text of the HTTP request header */
176 int useRepositoryFromCmdArg; /* -R <repository> specified on command line */
177
 
178 /*
179 ** NOTE: These members MUST be kept in sync with those in the "UrlData"
180 ** structure defined in "url.c".
181 */
182 int urlIsFile; /* True if a "file:" url */
@@ -195,10 +191,12 @@
195 char *urlFossil; /* The fossil query parameter on ssh: */
196 unsigned urlFlags; /* Boolean flags controlling URL processing */
197 int useProxy; /* Used to remember that a proxy is in use */
198 char *proxyUrlPath;
199 int proxyOrigPort; /* Tunneled port number for https through proxy */
 
 
200 const char *zLogin; /* Login name. NULL or "" if not logged in. */
201 const char *zSSLIdentity; /* Value of --ssl-identity option, filename of
202 ** SSL client identity */
203 int useLocalauth; /* No login required if from 127.0.0.1 */
204 int noPswd; /* Logged in without password (on 127.0.0.1) */
205
--- src/main.c
+++ src/main.c
@@ -112,15 +112,10 @@
112 void *xPostEval; /* Optional, called after Tcl_Eval*(). */
113 void *pPostContext; /* Optional, provided to xPostEval(). */
114 };
115 #endif
116
 
 
 
 
 
117 struct Global {
118 int argc; char **argv; /* Command-line arguments to the program */
119 char *nameOfExe; /* Full path of executable. */
120 const char *zErrlog; /* Log errors to this file, if not NULL */
121 int isConst; /* True if the output is unchanging & cacheable */
@@ -172,11 +167,12 @@
167 int wikiFlags; /* Wiki conversion flags applied to %w and %W */
168 char isHTTP; /* True if server/CGI modes, else assume CLI. */
169 char javascriptHyperlink; /* If true, set href= using script, not HTML */
170 Blob httpHeader; /* Complete text of the HTTP request header */
171 int useRepositoryFromCmdArg; /* -R <repository> specified on command line */
172 UrlData url; /* Information about current URL */
173 #if 0
174 /*
175 ** NOTE: These members MUST be kept in sync with those in the "UrlData"
176 ** structure defined in "url.c".
177 */
178 int urlIsFile; /* True if a "file:" url */
@@ -195,10 +191,12 @@
191 char *urlFossil; /* The fossil query parameter on ssh: */
192 unsigned urlFlags; /* Boolean flags controlling URL processing */
193 int useProxy; /* Used to remember that a proxy is in use */
194 char *proxyUrlPath;
195 int proxyOrigPort; /* Tunneled port number for https through proxy */
196 #endif
197
198 const char *zLogin; /* Login name. NULL or "" if not logged in. */
199 const char *zSSLIdentity; /* Value of --ssl-identity option, filename of
200 ** SSL client identity */
201 int useLocalauth; /* No login required if from 127.0.0.1 */
202 int noPswd; /* Logged in without password (on 127.0.0.1) */
203
+2 -2
--- src/manifest.c
+++ src/manifest.c
@@ -1931,11 +1931,11 @@
19311931
|| !validate16(p->zAttachTarget, UUID_SIZE)
19321932
){
19331933
char *zComment;
19341934
if( p->zAttachSrc && p->zAttachSrc[0] ){
19351935
zComment = mprintf(
1936
- "Add attachment [/artifact/%S|%h] to wiki page [%h]",
1936
+ "Add attachment [/artifact/%s|%h] to wiki page [%h]",
19371937
p->zAttachSrc, p->zAttachName, p->zAttachTarget);
19381938
}else{
19391939
zComment = mprintf("Delete attachment \"%h\" from wiki page [%h]",
19401940
p->zAttachName, p->zAttachTarget);
19411941
}
@@ -1947,11 +1947,11 @@
19471947
free(zComment);
19481948
}else{
19491949
char *zComment;
19501950
if( p->zAttachSrc && p->zAttachSrc[0] ){
19511951
zComment = mprintf(
1952
- "Add attachment [/artifact/%S|%h] to ticket [%s|%.10s]",
1952
+ "Add attachment [/artifact/%s|%h] to ticket [%s|%.10s]",
19531953
p->zAttachSrc, p->zAttachName, p->zAttachTarget, p->zAttachTarget);
19541954
}else{
19551955
zComment = mprintf("Delete attachment \"%h\" from ticket [%s|%.10s]",
19561956
p->zAttachName, p->zAttachTarget, p->zAttachTarget);
19571957
}
19581958
--- src/manifest.c
+++ src/manifest.c
@@ -1931,11 +1931,11 @@
1931 || !validate16(p->zAttachTarget, UUID_SIZE)
1932 ){
1933 char *zComment;
1934 if( p->zAttachSrc && p->zAttachSrc[0] ){
1935 zComment = mprintf(
1936 "Add attachment [/artifact/%S|%h] to wiki page [%h]",
1937 p->zAttachSrc, p->zAttachName, p->zAttachTarget);
1938 }else{
1939 zComment = mprintf("Delete attachment \"%h\" from wiki page [%h]",
1940 p->zAttachName, p->zAttachTarget);
1941 }
@@ -1947,11 +1947,11 @@
1947 free(zComment);
1948 }else{
1949 char *zComment;
1950 if( p->zAttachSrc && p->zAttachSrc[0] ){
1951 zComment = mprintf(
1952 "Add attachment [/artifact/%S|%h] to ticket [%s|%.10s]",
1953 p->zAttachSrc, p->zAttachName, p->zAttachTarget, p->zAttachTarget);
1954 }else{
1955 zComment = mprintf("Delete attachment \"%h\" from ticket [%s|%.10s]",
1956 p->zAttachName, p->zAttachTarget, p->zAttachTarget);
1957 }
1958
--- src/manifest.c
+++ src/manifest.c
@@ -1931,11 +1931,11 @@
1931 || !validate16(p->zAttachTarget, UUID_SIZE)
1932 ){
1933 char *zComment;
1934 if( p->zAttachSrc && p->zAttachSrc[0] ){
1935 zComment = mprintf(
1936 "Add attachment [/artifact/%s|%h] to wiki page [%h]",
1937 p->zAttachSrc, p->zAttachName, p->zAttachTarget);
1938 }else{
1939 zComment = mprintf("Delete attachment \"%h\" from wiki page [%h]",
1940 p->zAttachName, p->zAttachTarget);
1941 }
@@ -1947,11 +1947,11 @@
1947 free(zComment);
1948 }else{
1949 char *zComment;
1950 if( p->zAttachSrc && p->zAttachSrc[0] ){
1951 zComment = mprintf(
1952 "Add attachment [/artifact/%s|%h] to ticket [%s|%.10s]",
1953 p->zAttachSrc, p->zAttachName, p->zAttachTarget, p->zAttachTarget);
1954 }else{
1955 zComment = mprintf("Delete attachment \"%h\" from ticket [%s|%.10s]",
1956 p->zAttachName, p->zAttachTarget, p->zAttachTarget);
1957 }
1958
+3 -2
--- src/name.c
+++ src/name.c
@@ -402,16 +402,17 @@
402402
canonical16(z, strlen(z));
403403
db_prepare(&q, "SELECT uuid, rid FROM blob WHERE uuid GLOB '%q*'", z);
404404
while( db_step(&q)==SQLITE_ROW ){
405405
const char *zUuid = db_column_text(&q, 0);
406406
int rid = db_column_int(&q, 1);
407
- @ <li><p><a href="%s(g.zTop)/%T(zSrc)/%S(zUuid)">
408
- @ %S(zUuid)</a> -
407
+ @ <li><p><a href="%s(g.zTop)/%T(zSrc)/%s(zUuid)">
408
+ @ %s(zUuid)</a> -
409409
object_description(rid, 0, 0);
410410
@ </p></li>
411411
}
412412
@ </ol>
413
+ db_finalize(&q);
413414
style_footer();
414415
}
415416
416417
/*
417418
** Convert the name in CGI parameter zParamName into a rid and return that
418419
--- src/name.c
+++ src/name.c
@@ -402,16 +402,17 @@
402 canonical16(z, strlen(z));
403 db_prepare(&q, "SELECT uuid, rid FROM blob WHERE uuid GLOB '%q*'", z);
404 while( db_step(&q)==SQLITE_ROW ){
405 const char *zUuid = db_column_text(&q, 0);
406 int rid = db_column_int(&q, 1);
407 @ <li><p><a href="%s(g.zTop)/%T(zSrc)/%S(zUuid)">
408 @ %S(zUuid)</a> -
409 object_description(rid, 0, 0);
410 @ </p></li>
411 }
412 @ </ol>
 
413 style_footer();
414 }
415
416 /*
417 ** Convert the name in CGI parameter zParamName into a rid and return that
418
--- src/name.c
+++ src/name.c
@@ -402,16 +402,17 @@
402 canonical16(z, strlen(z));
403 db_prepare(&q, "SELECT uuid, rid FROM blob WHERE uuid GLOB '%q*'", z);
404 while( db_step(&q)==SQLITE_ROW ){
405 const char *zUuid = db_column_text(&q, 0);
406 int rid = db_column_int(&q, 1);
407 @ <li><p><a href="%s(g.zTop)/%T(zSrc)/%s(zUuid)">
408 @ %s(zUuid)</a> -
409 object_description(rid, 0, 0);
410 @ </p></li>
411 }
412 @ </ol>
413 db_finalize(&q);
414 style_footer();
415 }
416
417 /*
418 ** Convert the name in CGI parameter zParamName into a rid and return that
419
--- src/report.c
+++ src/report.c
@@ -302,10 +302,11 @@
302302
"FROM reportfmt WHERE rn=%d",rn);
303303
style_header("SQL For Report Format Number %d", rn);
304304
if( db_step(&q)!=SQLITE_ROW ){
305305
@ <p>Unknown report number: %d(rn)</p>
306306
style_footer();
307
+ db_finalize(&q);
307308
return;
308309
}
309310
zTitle = db_column_text(&q, 0);
310311
zSQL = db_column_text(&q, 1);
311312
zOwner = db_column_text(&q, 2);
@@ -323,10 +324,11 @@
323324
output_color_key(zClrKey, 0, "border=0 cellspacing=0 cellpadding=3");
324325
@ </td>
325326
@ </tr></table>
326327
report_format_hints();
327328
style_footer();
329
+ db_finalize(&q);
328330
}
329331
330332
/*
331333
** WEBPAGE: /rptnew
332334
** WEBPAGE: /rptedit
@@ -1026,10 +1028,11 @@
10261028
/* view_add_functions(tabs); */
10271029
db_prepare(&q,
10281030
"SELECT title, sqlcode, owner, cols FROM reportfmt WHERE rn=%d", rn);
10291031
if( db_step(&q)!=SQLITE_ROW ){
10301032
cgi_redirect("reportlist");
1033
+ db_finalize(&q);
10311034
return;
10321035
}
10331036
zTitle = db_column_malloc(&q, 0);
10341037
zSql = db_column_malloc(&q, 1);
10351038
zOwner = db_column_malloc(&q, 2);
10361039
--- src/report.c
+++ src/report.c
@@ -302,10 +302,11 @@
302 "FROM reportfmt WHERE rn=%d",rn);
303 style_header("SQL For Report Format Number %d", rn);
304 if( db_step(&q)!=SQLITE_ROW ){
305 @ <p>Unknown report number: %d(rn)</p>
306 style_footer();
 
307 return;
308 }
309 zTitle = db_column_text(&q, 0);
310 zSQL = db_column_text(&q, 1);
311 zOwner = db_column_text(&q, 2);
@@ -323,10 +324,11 @@
323 output_color_key(zClrKey, 0, "border=0 cellspacing=0 cellpadding=3");
324 @ </td>
325 @ </tr></table>
326 report_format_hints();
327 style_footer();
 
328 }
329
330 /*
331 ** WEBPAGE: /rptnew
332 ** WEBPAGE: /rptedit
@@ -1026,10 +1028,11 @@
1026 /* view_add_functions(tabs); */
1027 db_prepare(&q,
1028 "SELECT title, sqlcode, owner, cols FROM reportfmt WHERE rn=%d", rn);
1029 if( db_step(&q)!=SQLITE_ROW ){
1030 cgi_redirect("reportlist");
 
1031 return;
1032 }
1033 zTitle = db_column_malloc(&q, 0);
1034 zSql = db_column_malloc(&q, 1);
1035 zOwner = db_column_malloc(&q, 2);
1036
--- src/report.c
+++ src/report.c
@@ -302,10 +302,11 @@
302 "FROM reportfmt WHERE rn=%d",rn);
303 style_header("SQL For Report Format Number %d", rn);
304 if( db_step(&q)!=SQLITE_ROW ){
305 @ <p>Unknown report number: %d(rn)</p>
306 style_footer();
307 db_finalize(&q);
308 return;
309 }
310 zTitle = db_column_text(&q, 0);
311 zSQL = db_column_text(&q, 1);
312 zOwner = db_column_text(&q, 2);
@@ -323,10 +324,11 @@
324 output_color_key(zClrKey, 0, "border=0 cellspacing=0 cellpadding=3");
325 @ </td>
326 @ </tr></table>
327 report_format_hints();
328 style_footer();
329 db_finalize(&q);
330 }
331
332 /*
333 ** WEBPAGE: /rptnew
334 ** WEBPAGE: /rptedit
@@ -1026,10 +1028,11 @@
1028 /* view_add_functions(tabs); */
1029 db_prepare(&q,
1030 "SELECT title, sqlcode, owner, cols FROM reportfmt WHERE rn=%d", rn);
1031 if( db_step(&q)!=SQLITE_ROW ){
1032 cgi_redirect("reportlist");
1033 db_finalize(&q);
1034 return;
1035 }
1036 zTitle = db_column_malloc(&q, 0);
1037 zSql = db_column_malloc(&q, 1);
1038 zOwner = db_column_malloc(&q, 2);
1039
--- src/setup.c
+++ src/setup.c
@@ -277,10 +277,11 @@
277277
@ </p></li>
278278
@
279279
@ </ol>
280280
@ </td></tr></table>
281281
style_footer();
282
+ db_finalize(&s);
282283
}
283284
284285
/*
285286
** Return true if zPw is a valid password string. A valid
286287
** password string is:
287288
--- src/setup.c
+++ src/setup.c
@@ -277,10 +277,11 @@
277 @ </p></li>
278 @
279 @ </ol>
280 @ </td></tr></table>
281 style_footer();
 
282 }
283
284 /*
285 ** Return true if zPw is a valid password string. A valid
286 ** password string is:
287
--- src/setup.c
+++ src/setup.c
@@ -277,10 +277,11 @@
277 @ </p></li>
278 @
279 @ </ol>
280 @ </td></tr></table>
281 style_footer();
282 db_finalize(&s);
283 }
284
285 /*
286 ** Return true if zPw is a valid password string. A valid
287 ** password string is:
288
+4 -3
--- src/sqlite3.c
+++ src/sqlite3.c
@@ -1,8 +1,8 @@
11
/******************************************************************************
22
** This file is an amalgamation of many separate C source files from SQLite
3
-** version 3.8.4.1. By combining all the individual C code files into this
3
+** version 3.8.4.2. By combining all the individual C code files into this
44
** single large file, the entire code can be compiled as a single translation
55
** unit. This allows many compilers to do optimizations that would not be
66
** possible if the files were compiled separately. Performance improvements
77
** of 5% or more are commonly seen when SQLite is compiled as a single
88
** translation unit.
@@ -220,13 +220,13 @@
220220
**
221221
** See also: [sqlite3_libversion()],
222222
** [sqlite3_libversion_number()], [sqlite3_sourceid()],
223223
** [sqlite_version()] and [sqlite_source_id()].
224224
*/
225
-#define SQLITE_VERSION "3.8.4.1"
225
+#define SQLITE_VERSION "3.8.4.2"
226226
#define SQLITE_VERSION_NUMBER 3008004
227
-#define SQLITE_SOURCE_ID "2014-03-11 15:27:36 018d317b1257ce68a92908b05c9c7cf1494050d0"
227
+#define SQLITE_SOURCE_ID "2014-03-26 18:51:19 02ea166372bdb2ef9d8dfbb05e78a97609673a8e"
228228
229229
/*
230230
** CAPI3REF: Run-Time Library Version Numbers
231231
** KEYWORDS: sqlite3_version, sqlite3_sourceid
232232
**
@@ -64780,10 +64780,11 @@
6478064780
i = 1;
6478164781
pRhs++;
6478264782
}else{
6478364783
idx1 = getVarint32(aKey1, szHdr1);
6478464784
d1 = szHdr1;
64785
+ if( d1>(unsigned)nKey1 ) return 1; /* Corruption */
6478564786
i = 0;
6478664787
}
6478764788
6478864789
VVA_ONLY( mem1.zMalloc = 0; ) /* Only needed by assert() statements */
6478964790
assert( pPKey2->pKeyInfo->nField+pPKey2->pKeyInfo->nXField>=pPKey2->nField
6479064791
--- src/sqlite3.c
+++ src/sqlite3.c
@@ -1,8 +1,8 @@
1 /******************************************************************************
2 ** This file is an amalgamation of many separate C source files from SQLite
3 ** version 3.8.4.1. By combining all the individual C code files into this
4 ** single large file, the entire code can be compiled as a single translation
5 ** unit. This allows many compilers to do optimizations that would not be
6 ** possible if the files were compiled separately. Performance improvements
7 ** of 5% or more are commonly seen when SQLite is compiled as a single
8 ** translation unit.
@@ -220,13 +220,13 @@
220 **
221 ** See also: [sqlite3_libversion()],
222 ** [sqlite3_libversion_number()], [sqlite3_sourceid()],
223 ** [sqlite_version()] and [sqlite_source_id()].
224 */
225 #define SQLITE_VERSION "3.8.4.1"
226 #define SQLITE_VERSION_NUMBER 3008004
227 #define SQLITE_SOURCE_ID "2014-03-11 15:27:36 018d317b1257ce68a92908b05c9c7cf1494050d0"
228
229 /*
230 ** CAPI3REF: Run-Time Library Version Numbers
231 ** KEYWORDS: sqlite3_version, sqlite3_sourceid
232 **
@@ -64780,10 +64780,11 @@
64780 i = 1;
64781 pRhs++;
64782 }else{
64783 idx1 = getVarint32(aKey1, szHdr1);
64784 d1 = szHdr1;
 
64785 i = 0;
64786 }
64787
64788 VVA_ONLY( mem1.zMalloc = 0; ) /* Only needed by assert() statements */
64789 assert( pPKey2->pKeyInfo->nField+pPKey2->pKeyInfo->nXField>=pPKey2->nField
64790
--- src/sqlite3.c
+++ src/sqlite3.c
@@ -1,8 +1,8 @@
1 /******************************************************************************
2 ** This file is an amalgamation of many separate C source files from SQLite
3 ** version 3.8.4.2. By combining all the individual C code files into this
4 ** single large file, the entire code can be compiled as a single translation
5 ** unit. This allows many compilers to do optimizations that would not be
6 ** possible if the files were compiled separately. Performance improvements
7 ** of 5% or more are commonly seen when SQLite is compiled as a single
8 ** translation unit.
@@ -220,13 +220,13 @@
220 **
221 ** See also: [sqlite3_libversion()],
222 ** [sqlite3_libversion_number()], [sqlite3_sourceid()],
223 ** [sqlite_version()] and [sqlite_source_id()].
224 */
225 #define SQLITE_VERSION "3.8.4.2"
226 #define SQLITE_VERSION_NUMBER 3008004
227 #define SQLITE_SOURCE_ID "2014-03-26 18:51:19 02ea166372bdb2ef9d8dfbb05e78a97609673a8e"
228
229 /*
230 ** CAPI3REF: Run-Time Library Version Numbers
231 ** KEYWORDS: sqlite3_version, sqlite3_sourceid
232 **
@@ -64780,10 +64780,11 @@
64780 i = 1;
64781 pRhs++;
64782 }else{
64783 idx1 = getVarint32(aKey1, szHdr1);
64784 d1 = szHdr1;
64785 if( d1>(unsigned)nKey1 ) return 1; /* Corruption */
64786 i = 0;
64787 }
64788
64789 VVA_ONLY( mem1.zMalloc = 0; ) /* Only needed by assert() statements */
64790 assert( pPKey2->pKeyInfo->nField+pPKey2->pKeyInfo->nXField>=pPKey2->nField
64791
+2 -2
--- src/sqlite3.h
+++ src/sqlite3.h
@@ -105,13 +105,13 @@
105105
**
106106
** See also: [sqlite3_libversion()],
107107
** [sqlite3_libversion_number()], [sqlite3_sourceid()],
108108
** [sqlite_version()] and [sqlite_source_id()].
109109
*/
110
-#define SQLITE_VERSION "3.8.4.1"
110
+#define SQLITE_VERSION "3.8.4.2"
111111
#define SQLITE_VERSION_NUMBER 3008004
112
-#define SQLITE_SOURCE_ID "2014-03-11 15:27:36 018d317b1257ce68a92908b05c9c7cf1494050d0"
112
+#define SQLITE_SOURCE_ID "2014-03-26 18:51:19 02ea166372bdb2ef9d8dfbb05e78a97609673a8e"
113113
114114
/*
115115
** CAPI3REF: Run-Time Library Version Numbers
116116
** KEYWORDS: sqlite3_version, sqlite3_sourceid
117117
**
118118
--- src/sqlite3.h
+++ src/sqlite3.h
@@ -105,13 +105,13 @@
105 **
106 ** See also: [sqlite3_libversion()],
107 ** [sqlite3_libversion_number()], [sqlite3_sourceid()],
108 ** [sqlite_version()] and [sqlite_source_id()].
109 */
110 #define SQLITE_VERSION "3.8.4.1"
111 #define SQLITE_VERSION_NUMBER 3008004
112 #define SQLITE_SOURCE_ID "2014-03-11 15:27:36 018d317b1257ce68a92908b05c9c7cf1494050d0"
113
114 /*
115 ** CAPI3REF: Run-Time Library Version Numbers
116 ** KEYWORDS: sqlite3_version, sqlite3_sourceid
117 **
118
--- src/sqlite3.h
+++ src/sqlite3.h
@@ -105,13 +105,13 @@
105 **
106 ** See also: [sqlite3_libversion()],
107 ** [sqlite3_libversion_number()], [sqlite3_sourceid()],
108 ** [sqlite_version()] and [sqlite_source_id()].
109 */
110 #define SQLITE_VERSION "3.8.4.2"
111 #define SQLITE_VERSION_NUMBER 3008004
112 #define SQLITE_SOURCE_ID "2014-03-26 18:51:19 02ea166372bdb2ef9d8dfbb05e78a97609673a8e"
113
114 /*
115 ** CAPI3REF: Run-Time Library Version Numbers
116 ** KEYWORDS: sqlite3_version, sqlite3_sourceid
117 **
118
+10 -10
--- src/sync.c
+++ src/sync.c
@@ -48,14 +48,14 @@
4848
}
4949
}else{
5050
/* Autosync defaults on. To make it default off, "return" here. */
5151
}
5252
url_parse(0, URL_REMEMBER);
53
- if( g.urlProtocol==0 ) return 0;
54
- if( g.urlUser!=0 && g.urlPasswd==0 ){
55
- g.urlPasswd = unobscure(db_get("last-sync-pw", 0));
56
- g.urlFlags |= URL_PROMPT_PW;
53
+ if( g.url.protocol==0 ) return 0;
54
+ if( g.url.user!=0 && g.url.passwd==0 ){
55
+ g.url.passwd = unobscure(db_get("last-sync-pw", 0));
56
+ g.url.flags |= URL_PROMPT_PW;
5757
url_prompt_for_password();
5858
}
5959
g.zHttpAuth = get_httpauth();
6060
url_remember();
6161
#if 0 /* Disabled for now */
@@ -69,11 +69,11 @@
6969
*/
7070
configSync = CONFIGSET_SHUN;
7171
}
7272
#endif
7373
if( find_option("verbose","v",0)!=0 ) flags |= SYNC_VERBOSE;
74
- fossil_print("Autosync: %s\n", g.urlCanonical);
74
+ fossil_print("Autosync: %s\n", g.url.canonical);
7575
url_enable_proxy("via proxy: ");
7676
rc = client_sync(flags, configSync, 0);
7777
if( rc ) fossil_warning("Autosync failed");
7878
return rc;
7979
}
@@ -121,22 +121,22 @@
121121
clone_ssh_db_set_options();
122122
}
123123
url_parse(zUrl, urlFlags);
124124
remember_or_get_http_auth(zHttpAuth, urlFlags & URL_REMEMBER, zUrl);
125125
url_remember();
126
- if( g.urlProtocol==0 ){
126
+ if( g.url.protocol==0 ){
127127
if( urlOptional ) fossil_exit(0);
128128
usage("URL");
129129
}
130130
user_select();
131131
if( g.argc==2 ){
132132
if( ((*pSyncFlags) & (SYNC_PUSH|SYNC_PULL))==(SYNC_PUSH|SYNC_PULL) ){
133
- fossil_print("Sync with %s\n", g.urlCanonical);
133
+ fossil_print("Sync with %s\n", g.url.canonical);
134134
}else if( (*pSyncFlags) & SYNC_PUSH ){
135
- fossil_print("Push to %s\n", g.urlCanonical);
135
+ fossil_print("Push to %s\n", g.url.canonical);
136136
}else if( (*pSyncFlags) & SYNC_PULL ){
137
- fossil_print("Pull from %s\n", g.urlCanonical);
137
+ fossil_print("Pull from %s\n", g.url.canonical);
138138
}
139139
}
140140
url_enable_proxy("via proxy: ");
141141
*pConfigFlags |= configSync;
142142
}
@@ -278,8 +278,8 @@
278278
if( zUrl==0 ){
279279
fossil_print("off\n");
280280
return;
281281
}else{
282282
url_parse(zUrl, 0);
283
- fossil_print("%s\n", g.urlCanonical);
283
+ fossil_print("%s\n", g.url.canonical);
284284
}
285285
}
286286
--- src/sync.c
+++ src/sync.c
@@ -48,14 +48,14 @@
48 }
49 }else{
50 /* Autosync defaults on. To make it default off, "return" here. */
51 }
52 url_parse(0, URL_REMEMBER);
53 if( g.urlProtocol==0 ) return 0;
54 if( g.urlUser!=0 && g.urlPasswd==0 ){
55 g.urlPasswd = unobscure(db_get("last-sync-pw", 0));
56 g.urlFlags |= URL_PROMPT_PW;
57 url_prompt_for_password();
58 }
59 g.zHttpAuth = get_httpauth();
60 url_remember();
61 #if 0 /* Disabled for now */
@@ -69,11 +69,11 @@
69 */
70 configSync = CONFIGSET_SHUN;
71 }
72 #endif
73 if( find_option("verbose","v",0)!=0 ) flags |= SYNC_VERBOSE;
74 fossil_print("Autosync: %s\n", g.urlCanonical);
75 url_enable_proxy("via proxy: ");
76 rc = client_sync(flags, configSync, 0);
77 if( rc ) fossil_warning("Autosync failed");
78 return rc;
79 }
@@ -121,22 +121,22 @@
121 clone_ssh_db_set_options();
122 }
123 url_parse(zUrl, urlFlags);
124 remember_or_get_http_auth(zHttpAuth, urlFlags & URL_REMEMBER, zUrl);
125 url_remember();
126 if( g.urlProtocol==0 ){
127 if( urlOptional ) fossil_exit(0);
128 usage("URL");
129 }
130 user_select();
131 if( g.argc==2 ){
132 if( ((*pSyncFlags) & (SYNC_PUSH|SYNC_PULL))==(SYNC_PUSH|SYNC_PULL) ){
133 fossil_print("Sync with %s\n", g.urlCanonical);
134 }else if( (*pSyncFlags) & SYNC_PUSH ){
135 fossil_print("Push to %s\n", g.urlCanonical);
136 }else if( (*pSyncFlags) & SYNC_PULL ){
137 fossil_print("Pull from %s\n", g.urlCanonical);
138 }
139 }
140 url_enable_proxy("via proxy: ");
141 *pConfigFlags |= configSync;
142 }
@@ -278,8 +278,8 @@
278 if( zUrl==0 ){
279 fossil_print("off\n");
280 return;
281 }else{
282 url_parse(zUrl, 0);
283 fossil_print("%s\n", g.urlCanonical);
284 }
285 }
286
--- src/sync.c
+++ src/sync.c
@@ -48,14 +48,14 @@
48 }
49 }else{
50 /* Autosync defaults on. To make it default off, "return" here. */
51 }
52 url_parse(0, URL_REMEMBER);
53 if( g.url.protocol==0 ) return 0;
54 if( g.url.user!=0 && g.url.passwd==0 ){
55 g.url.passwd = unobscure(db_get("last-sync-pw", 0));
56 g.url.flags |= URL_PROMPT_PW;
57 url_prompt_for_password();
58 }
59 g.zHttpAuth = get_httpauth();
60 url_remember();
61 #if 0 /* Disabled for now */
@@ -69,11 +69,11 @@
69 */
70 configSync = CONFIGSET_SHUN;
71 }
72 #endif
73 if( find_option("verbose","v",0)!=0 ) flags |= SYNC_VERBOSE;
74 fossil_print("Autosync: %s\n", g.url.canonical);
75 url_enable_proxy("via proxy: ");
76 rc = client_sync(flags, configSync, 0);
77 if( rc ) fossil_warning("Autosync failed");
78 return rc;
79 }
@@ -121,22 +121,22 @@
121 clone_ssh_db_set_options();
122 }
123 url_parse(zUrl, urlFlags);
124 remember_or_get_http_auth(zHttpAuth, urlFlags & URL_REMEMBER, zUrl);
125 url_remember();
126 if( g.url.protocol==0 ){
127 if( urlOptional ) fossil_exit(0);
128 usage("URL");
129 }
130 user_select();
131 if( g.argc==2 ){
132 if( ((*pSyncFlags) & (SYNC_PUSH|SYNC_PULL))==(SYNC_PUSH|SYNC_PULL) ){
133 fossil_print("Sync with %s\n", g.url.canonical);
134 }else if( (*pSyncFlags) & SYNC_PUSH ){
135 fossil_print("Push to %s\n", g.url.canonical);
136 }else if( (*pSyncFlags) & SYNC_PULL ){
137 fossil_print("Pull from %s\n", g.url.canonical);
138 }
139 }
140 url_enable_proxy("via proxy: ");
141 *pConfigFlags |= configSync;
142 }
@@ -278,8 +278,8 @@
278 if( zUrl==0 ){
279 fossil_print("off\n");
280 return;
281 }else{
282 url_parse(zUrl, 0);
283 fossil_print("%s\n", g.url.canonical);
284 }
285 }
286
+6 -19
--- src/timeline.c
+++ src/timeline.c
@@ -54,23 +54,10 @@
5454
}else{
5555
@ <span class="timelineHistDsp">[%s(z)]</span>
5656
}
5757
}
5858
59
-/*
60
-** Generate a hyperlink to a diff between two versions.
61
-*/
62
-void hyperlink_to_diff(const char *zV1, const char *zV2){
63
- if( g.perm.Hyperlink ){
64
- if( zV2==0 ){
65
- @ %z(href("%R/diff?v2=%s",zV1))[diff]</a>
66
- }else{
67
- @ %z(href("%R/diff?v1=%s&v2=%s",zV1,zV2))[diff]</a>
68
- }
69
- }
70
-}
71
-
7259
/*
7360
** Generate a hyperlink to a date & time.
7461
*/
7562
void hyperlink_to_date(const char *zDate, const char *zSuffix){
7663
if( zSuffix==0 ) zSuffix = "";
@@ -448,11 +435,11 @@
448435
@ (user: %h(zDispUser)%s(zTagList?",":"\051")
449436
}
450437
451438
/* Generate a "detail" link for tags. */
452439
if( (zType[0]=='g' || zType[0]=='w' || zType[0]=='t') && g.perm.Hyperlink ){
453
- @ [%z(href("%R/info/%S",zUuid))details</a>]
440
+ @ [%z(href("%R/info/%s",zUuid))details</a>]
454441
}
455442
456443
/* Generate the "tags: TAGLIST" at the end of the comment, together
457444
** with hyperlinks to the tag list.
458445
*/
@@ -527,23 +514,23 @@
527514
}
528515
continue;
529516
}
530517
if( isNew ){
531518
@ <li> %h(zFilename) (new file) &nbsp;
532
- @ %z(href("%R/artifact/%S",zNew))[view]</a></li>
519
+ @ %z(href("%R/artifact/%s",zNew))[view]</a></li>
533520
}else if( isDel ){
534521
@ <li> %h(zFilename) (deleted)</li>
535522
}else if( fossil_strcmp(zOld,zNew)==0 && zOldName!=0 ){
536523
@ <li> %h(zOldName) &rarr; %h(zFilename)
537
- @ %z(href("%R/artifact/%S",zNew))[view]</a></li>
524
+ @ %z(href("%R/artifact/%s",zNew))[view]</a></li>
538525
}else{
539526
if( zOldName!=0 ){
540527
@ <li> %h(zOldName) &rarr; %h(zFilename)
541528
}else{
542529
@ <li> %h(zFilename) &nbsp;
543530
}
544
- @ %z(href("%R/fdiff?v1=%S&v2=%S&sbs=1",zOld,zNew))[diff]</a></li>
531
+ @ %z(href("%R/fdiff?sbs=1&v1=%s&v2=%s",zOld,zNew))[diff]</a></li>
545532
}
546533
}
547534
db_reset(&fchngQuery);
548535
if( inUl ){
549536
@ </ul>
@@ -1442,11 +1429,11 @@
14421429
blob_appendf(&desc, "%d %ss", n, zEType);
14431430
}
14441431
if( zUses ){
14451432
char *zFilenames = names_of_file(zUses);
14461433
blob_appendf(&desc, " using file %s version %z%S</a>", zFilenames,
1447
- href("%R/artifact/%S",zUses), zUses);
1434
+ href("%R/artifact/%s",zUses), zUses);
14481435
tmFlags |= TIMELINE_DISJOINT;
14491436
}
14501437
if( renameOnly ){
14511438
blob_appendf(&desc, " that contain filename changes");
14521439
tmFlags |= TIMELINE_DISJOINT|TIMELINE_FRENAMES;
@@ -1963,11 +1950,11 @@
19631950
" AND blob.rid=c.cid"
19641951
);
19651952
while( db_step(&q)==SQLITE_ROW ){
19661953
const char *zUuid = db_column_text(&q, 0);
19671954
@ <li>
1968
- @ <a href="%s(g.zTop)/timeline?p=%S(zUuid)&amp;d=%S(zUuid)&amp;unhide">%S(zUuid)</a>
1955
+ @ <a href="%s(g.zTop)/timeline?p=%s(zUuid)&amp;d=%s(zUuid)&amp;unhide">%S(zUuid)</a>
19691956
}
19701957
db_finalize(&q);
19711958
style_footer();
19721959
}
19731960
19741961
--- src/timeline.c
+++ src/timeline.c
@@ -54,23 +54,10 @@
54 }else{
55 @ <span class="timelineHistDsp">[%s(z)]</span>
56 }
57 }
58
59 /*
60 ** Generate a hyperlink to a diff between two versions.
61 */
62 void hyperlink_to_diff(const char *zV1, const char *zV2){
63 if( g.perm.Hyperlink ){
64 if( zV2==0 ){
65 @ %z(href("%R/diff?v2=%s",zV1))[diff]</a>
66 }else{
67 @ %z(href("%R/diff?v1=%s&v2=%s",zV1,zV2))[diff]</a>
68 }
69 }
70 }
71
72 /*
73 ** Generate a hyperlink to a date & time.
74 */
75 void hyperlink_to_date(const char *zDate, const char *zSuffix){
76 if( zSuffix==0 ) zSuffix = "";
@@ -448,11 +435,11 @@
448 @ (user: %h(zDispUser)%s(zTagList?",":"\051")
449 }
450
451 /* Generate a "detail" link for tags. */
452 if( (zType[0]=='g' || zType[0]=='w' || zType[0]=='t') && g.perm.Hyperlink ){
453 @ [%z(href("%R/info/%S",zUuid))details</a>]
454 }
455
456 /* Generate the "tags: TAGLIST" at the end of the comment, together
457 ** with hyperlinks to the tag list.
458 */
@@ -527,23 +514,23 @@
527 }
528 continue;
529 }
530 if( isNew ){
531 @ <li> %h(zFilename) (new file) &nbsp;
532 @ %z(href("%R/artifact/%S",zNew))[view]</a></li>
533 }else if( isDel ){
534 @ <li> %h(zFilename) (deleted)</li>
535 }else if( fossil_strcmp(zOld,zNew)==0 && zOldName!=0 ){
536 @ <li> %h(zOldName) &rarr; %h(zFilename)
537 @ %z(href("%R/artifact/%S",zNew))[view]</a></li>
538 }else{
539 if( zOldName!=0 ){
540 @ <li> %h(zOldName) &rarr; %h(zFilename)
541 }else{
542 @ <li> %h(zFilename) &nbsp;
543 }
544 @ %z(href("%R/fdiff?v1=%S&v2=%S&sbs=1",zOld,zNew))[diff]</a></li>
545 }
546 }
547 db_reset(&fchngQuery);
548 if( inUl ){
549 @ </ul>
@@ -1442,11 +1429,11 @@
1442 blob_appendf(&desc, "%d %ss", n, zEType);
1443 }
1444 if( zUses ){
1445 char *zFilenames = names_of_file(zUses);
1446 blob_appendf(&desc, " using file %s version %z%S</a>", zFilenames,
1447 href("%R/artifact/%S",zUses), zUses);
1448 tmFlags |= TIMELINE_DISJOINT;
1449 }
1450 if( renameOnly ){
1451 blob_appendf(&desc, " that contain filename changes");
1452 tmFlags |= TIMELINE_DISJOINT|TIMELINE_FRENAMES;
@@ -1963,11 +1950,11 @@
1963 " AND blob.rid=c.cid"
1964 );
1965 while( db_step(&q)==SQLITE_ROW ){
1966 const char *zUuid = db_column_text(&q, 0);
1967 @ <li>
1968 @ <a href="%s(g.zTop)/timeline?p=%S(zUuid)&amp;d=%S(zUuid)&amp;unhide">%S(zUuid)</a>
1969 }
1970 db_finalize(&q);
1971 style_footer();
1972 }
1973
1974
--- src/timeline.c
+++ src/timeline.c
@@ -54,23 +54,10 @@
54 }else{
55 @ <span class="timelineHistDsp">[%s(z)]</span>
56 }
57 }
58
 
 
 
 
 
 
 
 
 
 
 
 
 
59 /*
60 ** Generate a hyperlink to a date & time.
61 */
62 void hyperlink_to_date(const char *zDate, const char *zSuffix){
63 if( zSuffix==0 ) zSuffix = "";
@@ -448,11 +435,11 @@
435 @ (user: %h(zDispUser)%s(zTagList?",":"\051")
436 }
437
438 /* Generate a "detail" link for tags. */
439 if( (zType[0]=='g' || zType[0]=='w' || zType[0]=='t') && g.perm.Hyperlink ){
440 @ [%z(href("%R/info/%s",zUuid))details</a>]
441 }
442
443 /* Generate the "tags: TAGLIST" at the end of the comment, together
444 ** with hyperlinks to the tag list.
445 */
@@ -527,23 +514,23 @@
514 }
515 continue;
516 }
517 if( isNew ){
518 @ <li> %h(zFilename) (new file) &nbsp;
519 @ %z(href("%R/artifact/%s",zNew))[view]</a></li>
520 }else if( isDel ){
521 @ <li> %h(zFilename) (deleted)</li>
522 }else if( fossil_strcmp(zOld,zNew)==0 && zOldName!=0 ){
523 @ <li> %h(zOldName) &rarr; %h(zFilename)
524 @ %z(href("%R/artifact/%s",zNew))[view]</a></li>
525 }else{
526 if( zOldName!=0 ){
527 @ <li> %h(zOldName) &rarr; %h(zFilename)
528 }else{
529 @ <li> %h(zFilename) &nbsp;
530 }
531 @ %z(href("%R/fdiff?sbs=1&v1=%s&v2=%s",zOld,zNew))[diff]</a></li>
532 }
533 }
534 db_reset(&fchngQuery);
535 if( inUl ){
536 @ </ul>
@@ -1442,11 +1429,11 @@
1429 blob_appendf(&desc, "%d %ss", n, zEType);
1430 }
1431 if( zUses ){
1432 char *zFilenames = names_of_file(zUses);
1433 blob_appendf(&desc, " using file %s version %z%S</a>", zFilenames,
1434 href("%R/artifact/%s",zUses), zUses);
1435 tmFlags |= TIMELINE_DISJOINT;
1436 }
1437 if( renameOnly ){
1438 blob_appendf(&desc, " that contain filename changes");
1439 tmFlags |= TIMELINE_DISJOINT|TIMELINE_FRENAMES;
@@ -1963,11 +1950,11 @@
1950 " AND blob.rid=c.cid"
1951 );
1952 while( db_step(&q)==SQLITE_ROW ){
1953 const char *zUuid = db_column_text(&q, 0);
1954 @ <li>
1955 @ <a href="%s(g.zTop)/timeline?p=%s(zUuid)&amp;d=%s(zUuid)&amp;unhide">%S(zUuid)</a>
1956 }
1957 db_finalize(&q);
1958 style_footer();
1959 }
1960
1961
+61 -61
--- src/url.c
+++ src/url.c
@@ -275,22 +275,22 @@
275275
276276
/*
277277
** Parse the given URL, which describes a sync server. Populate variables
278278
** in the global "g" structure as follows:
279279
**
280
-** g.urlIsFile True if FILE:
281
-** g.urlIsHttps True if HTTPS:
282
-** g.urlIsSsh True if SSH:
283
-** g.urlProtocol "http" or "https" or "file"
284
-** g.urlName Hostname for HTTP:, HTTPS:, SSH:. Filename for FILE:
285
-** g.urlPort TCP port number for HTTP or HTTPS.
286
-** g.urlDfltPort Default TCP port number (80 or 443).
287
-** g.urlPath Path name for HTTP or HTTPS.
288
-** g.urlUser Userid.
289
-** g.urlPasswd Password.
290
-** g.urlHostname HOST:PORT or just HOST if port is the default.
291
-** g.urlCanonical The URL in canonical form, omitting the password
280
+** g.url.isFile True if FILE:
281
+** g.url.isHttps True if HTTPS:
282
+** g.url.isSsh True if SSH:
283
+** g.url.protocol "http" or "https" or "file"
284
+** g.url.name Hostname for HTTP:, HTTPS:, SSH:. Filename for FILE:
285
+** g.url.port TCP port number for HTTP or HTTPS.
286
+** g.url.dfltPort Default TCP port number (80 or 443).
287
+** g.url.path Path name for HTTP or HTTPS.
288
+** g.url.user Userid.
289
+** g.url.passwd Password.
290
+** g.url.hostname HOST:PORT or just HOST if port is the default.
291
+** g.url.canonical The URL in canonical form, omitting the password
292292
**
293293
** HTTP url format as follows (HTTPS is the same with a different scheme):
294294
**
295295
** http://userid:password@host:port/path
296296
**
@@ -298,11 +298,11 @@
298298
**
299299
** ssh://userid@host:port/path?fossil=path/to/fossil.exe
300300
**
301301
*/
302302
void url_parse(const char *zUrl, unsigned int urlFlags){
303
- url_parse_local(zUrl, urlFlags, GLOBAL_URL());
303
+ url_parse_local(zUrl, urlFlags, &g.url);
304304
}
305305
306306
/*
307307
** COMMAND: test-urlparser
308308
**
@@ -323,25 +323,25 @@
323323
if( g.argc!=3 && g.argc!=4 ){
324324
usage("URL");
325325
}
326326
url_parse(g.argv[2], fg);
327327
for(i=0; i<2; i++){
328
- fossil_print("g.urlIsFile = %d\n", g.urlIsFile);
329
- fossil_print("g.urlIsHttps = %d\n", g.urlIsHttps);
330
- fossil_print("g.urlIsSsh = %d\n", g.urlIsSsh);
331
- fossil_print("g.urlProtocol = %s\n", g.urlProtocol);
332
- fossil_print("g.urlName = %s\n", g.urlName);
333
- fossil_print("g.urlPort = %d\n", g.urlPort);
334
- fossil_print("g.urlDfltPort = %d\n", g.urlDfltPort);
335
- fossil_print("g.urlHostname = %s\n", g.urlHostname);
336
- fossil_print("g.urlPath = %s\n", g.urlPath);
337
- fossil_print("g.urlUser = %s\n", g.urlUser);
338
- fossil_print("g.urlPasswd = %s\n", g.urlPasswd);
339
- fossil_print("g.urlCanonical = %s\n", g.urlCanonical);
340
- fossil_print("g.urlFossil = %s\n", g.urlFossil);
341
- fossil_print("g.urlFlags = 0x%02x\n", g.urlFlags);
342
- if( g.urlIsFile || g.urlIsSsh ) break;
328
+ fossil_print("g.url.isFile = %d\n", g.url.isFile);
329
+ fossil_print("g.url.isHttps = %d\n", g.url.isHttps);
330
+ fossil_print("g.url.isSsh = %d\n", g.url.isSsh);
331
+ fossil_print("g.url.protocol = %s\n", g.url.protocol);
332
+ fossil_print("g.url.name = %s\n", g.url.name);
333
+ fossil_print("g.url.port = %d\n", g.url.port);
334
+ fossil_print("g.url.dfltPort = %d\n", g.url.dfltPort);
335
+ fossil_print("g.url.hostname = %s\n", g.url.hostname);
336
+ fossil_print("g.url.path = %s\n", g.url.path);
337
+ fossil_print("g.url.user = %s\n", g.url.user);
338
+ fossil_print("g.url.passwd = %s\n", g.url.passwd);
339
+ fossil_print("g.url.canonical = %s\n", g.url.canonical);
340
+ fossil_print("g.url.fossil = %s\n", g.url.fossil);
341
+ fossil_print("g.url.flags = 0x%02x\n", g.url.flags);
342
+ if( g.url.isFile || g.url.isSsh ) break;
343343
if( i==0 ){
344344
fossil_print("********\n");
345345
url_enable_proxy("Using proxy: ");
346346
}
347347
}
@@ -385,38 +385,38 @@
385385
if( zProxy==0 || zProxy[0]==0 || is_truth(zProxy) ){
386386
zProxy = fossil_getenv("http_proxy");
387387
}
388388
}
389389
if( zProxy && zProxy[0] && !is_false(zProxy)
390
- && !g.urlIsSsh && !g.urlIsFile ){
391
- char *zOriginalUrl = g.urlCanonical;
392
- char *zOriginalHost = g.urlHostname;
393
- int fOriginalIsHttps = g.urlIsHttps;
394
- char *zOriginalUser = g.urlUser;
395
- char *zOriginalPasswd = g.urlPasswd;
396
- char *zOriginalUrlPath = g.urlPath;
397
- int iOriginalPort = g.urlPort;
398
- unsigned uOriginalFlags = g.urlFlags;
399
- g.urlUser = 0;
400
- g.urlPasswd = "";
390
+ && !g.url.isSsh && !g.url.isFile ){
391
+ char *zOriginalUrl = g.url.canonical;
392
+ char *zOriginalHost = g.url.hostname;
393
+ int fOriginalIsHttps = g.url.isHttps;
394
+ char *zOriginalUser = g.url.user;
395
+ char *zOriginalPasswd = g.url.passwd;
396
+ char *zOriginalUrlPath = g.url.path;
397
+ int iOriginalPort = g.url.port;
398
+ unsigned uOriginalFlags = g.url.flags;
399
+ g.url.user = 0;
400
+ g.url.passwd = "";
401401
url_parse(zProxy, 0);
402
- if( zMsg ) fossil_print("%s%s\n", zMsg, g.urlCanonical);
403
- g.urlPath = zOriginalUrl;
404
- g.urlHostname = zOriginalHost;
405
- if( g.urlUser ){
406
- char *zCredentials1 = mprintf("%s:%s", g.urlUser, g.urlPasswd);
402
+ if( zMsg ) fossil_print("%s%s\n", zMsg, g.url.canonical);
403
+ g.url.path = zOriginalUrl;
404
+ g.url.hostname = zOriginalHost;
405
+ if( g.url.user ){
406
+ char *zCredentials1 = mprintf("%s:%s", g.url.user, g.url.passwd);
407407
char *zCredentials2 = encode64(zCredentials1, -1);
408
- g.urlProxyAuth = mprintf("Basic %z", zCredentials2);
408
+ g.url.proxyAuth = mprintf("Basic %z", zCredentials2);
409409
free(zCredentials1);
410410
}
411
- g.urlUser = zOriginalUser;
412
- g.urlPasswd = zOriginalPasswd;
413
- g.urlIsHttps = fOriginalIsHttps;
414
- g.useProxy = 1;
415
- g.proxyUrlPath = zOriginalUrlPath;
416
- g.proxyOrigPort = iOriginalPort;
417
- g.urlFlags = uOriginalFlags;
411
+ g.url.user = zOriginalUser;
412
+ g.url.passwd = zOriginalPasswd;
413
+ g.url.isHttps = fOriginalIsHttps;
414
+ g.url.useProxy = 1;
415
+ g.url.proxyUrlPath = zOriginalUrlPath;
416
+ g.url.proxyOrigPort = iOriginalPort;
417
+ g.url.flags = uOriginalFlags;
418418
}
419419
}
420420
421421
#if INTERFACE
422422
/*
@@ -529,35 +529,35 @@
529529
pUrlData->user);
530530
}
531531
}
532532
533533
/*
534
-** Prompt the user for the password for g.urlUser. Store the result
535
-** in g.urlPasswd.
534
+** Prompt the user for the password for g.url.user. Store the result
535
+** in g.url.passwd.
536536
*/
537537
void url_prompt_for_password(void){
538
- url_prompt_for_password_local(GLOBAL_URL());
538
+ url_prompt_for_password_local(&g.url);
539539
}
540540
541541
/*
542542
** Remember the URL and password if requested.
543543
*/
544544
void url_remember(void){
545
- if( g.urlFlags & URL_REMEMBER ){
546
- db_set("last-sync-url", g.urlCanonical, 0);
547
- if( g.urlUser!=0 && g.urlPasswd!=0 && ( g.urlFlags & URL_REMEMBER_PW ) ){
548
- db_set("last-sync-pw", obscure(g.urlPasswd), 0);
545
+ if( g.url.flags & URL_REMEMBER ){
546
+ db_set("last-sync-url", g.url.canonical, 0);
547
+ if( g.url.user!=0 && g.url.passwd!=0 && ( g.url.flags & URL_REMEMBER_PW ) ){
548
+ db_set("last-sync-pw", obscure(g.url.passwd), 0);
549549
}
550550
}
551551
}
552552
553553
/* Preemptively prompt for a password if a username is given in the
554554
** URL but no password.
555555
*/
556556
void url_get_password_if_needed(void){
557
- if( (g.urlUser && g.urlUser[0])
558
- && (g.urlPasswd==0 || g.urlPasswd[0]==0)
557
+ if( (g.url.user && g.url.user[0])
558
+ && (g.url.passwd==0 || g.url.passwd[0]==0)
559559
&& isatty(fileno(stdin))
560560
){
561561
url_prompt_for_password();
562562
}
563563
}
564564
--- src/url.c
+++ src/url.c
@@ -275,22 +275,22 @@
275
276 /*
277 ** Parse the given URL, which describes a sync server. Populate variables
278 ** in the global "g" structure as follows:
279 **
280 ** g.urlIsFile True if FILE:
281 ** g.urlIsHttps True if HTTPS:
282 ** g.urlIsSsh True if SSH:
283 ** g.urlProtocol "http" or "https" or "file"
284 ** g.urlName Hostname for HTTP:, HTTPS:, SSH:. Filename for FILE:
285 ** g.urlPort TCP port number for HTTP or HTTPS.
286 ** g.urlDfltPort Default TCP port number (80 or 443).
287 ** g.urlPath Path name for HTTP or HTTPS.
288 ** g.urlUser Userid.
289 ** g.urlPasswd Password.
290 ** g.urlHostname HOST:PORT or just HOST if port is the default.
291 ** g.urlCanonical The URL in canonical form, omitting the password
292 **
293 ** HTTP url format as follows (HTTPS is the same with a different scheme):
294 **
295 ** http://userid:password@host:port/path
296 **
@@ -298,11 +298,11 @@
298 **
299 ** ssh://userid@host:port/path?fossil=path/to/fossil.exe
300 **
301 */
302 void url_parse(const char *zUrl, unsigned int urlFlags){
303 url_parse_local(zUrl, urlFlags, GLOBAL_URL());
304 }
305
306 /*
307 ** COMMAND: test-urlparser
308 **
@@ -323,25 +323,25 @@
323 if( g.argc!=3 && g.argc!=4 ){
324 usage("URL");
325 }
326 url_parse(g.argv[2], fg);
327 for(i=0; i<2; i++){
328 fossil_print("g.urlIsFile = %d\n", g.urlIsFile);
329 fossil_print("g.urlIsHttps = %d\n", g.urlIsHttps);
330 fossil_print("g.urlIsSsh = %d\n", g.urlIsSsh);
331 fossil_print("g.urlProtocol = %s\n", g.urlProtocol);
332 fossil_print("g.urlName = %s\n", g.urlName);
333 fossil_print("g.urlPort = %d\n", g.urlPort);
334 fossil_print("g.urlDfltPort = %d\n", g.urlDfltPort);
335 fossil_print("g.urlHostname = %s\n", g.urlHostname);
336 fossil_print("g.urlPath = %s\n", g.urlPath);
337 fossil_print("g.urlUser = %s\n", g.urlUser);
338 fossil_print("g.urlPasswd = %s\n", g.urlPasswd);
339 fossil_print("g.urlCanonical = %s\n", g.urlCanonical);
340 fossil_print("g.urlFossil = %s\n", g.urlFossil);
341 fossil_print("g.urlFlags = 0x%02x\n", g.urlFlags);
342 if( g.urlIsFile || g.urlIsSsh ) break;
343 if( i==0 ){
344 fossil_print("********\n");
345 url_enable_proxy("Using proxy: ");
346 }
347 }
@@ -385,38 +385,38 @@
385 if( zProxy==0 || zProxy[0]==0 || is_truth(zProxy) ){
386 zProxy = fossil_getenv("http_proxy");
387 }
388 }
389 if( zProxy && zProxy[0] && !is_false(zProxy)
390 && !g.urlIsSsh && !g.urlIsFile ){
391 char *zOriginalUrl = g.urlCanonical;
392 char *zOriginalHost = g.urlHostname;
393 int fOriginalIsHttps = g.urlIsHttps;
394 char *zOriginalUser = g.urlUser;
395 char *zOriginalPasswd = g.urlPasswd;
396 char *zOriginalUrlPath = g.urlPath;
397 int iOriginalPort = g.urlPort;
398 unsigned uOriginalFlags = g.urlFlags;
399 g.urlUser = 0;
400 g.urlPasswd = "";
401 url_parse(zProxy, 0);
402 if( zMsg ) fossil_print("%s%s\n", zMsg, g.urlCanonical);
403 g.urlPath = zOriginalUrl;
404 g.urlHostname = zOriginalHost;
405 if( g.urlUser ){
406 char *zCredentials1 = mprintf("%s:%s", g.urlUser, g.urlPasswd);
407 char *zCredentials2 = encode64(zCredentials1, -1);
408 g.urlProxyAuth = mprintf("Basic %z", zCredentials2);
409 free(zCredentials1);
410 }
411 g.urlUser = zOriginalUser;
412 g.urlPasswd = zOriginalPasswd;
413 g.urlIsHttps = fOriginalIsHttps;
414 g.useProxy = 1;
415 g.proxyUrlPath = zOriginalUrlPath;
416 g.proxyOrigPort = iOriginalPort;
417 g.urlFlags = uOriginalFlags;
418 }
419 }
420
421 #if INTERFACE
422 /*
@@ -529,35 +529,35 @@
529 pUrlData->user);
530 }
531 }
532
533 /*
534 ** Prompt the user for the password for g.urlUser. Store the result
535 ** in g.urlPasswd.
536 */
537 void url_prompt_for_password(void){
538 url_prompt_for_password_local(GLOBAL_URL());
539 }
540
541 /*
542 ** Remember the URL and password if requested.
543 */
544 void url_remember(void){
545 if( g.urlFlags & URL_REMEMBER ){
546 db_set("last-sync-url", g.urlCanonical, 0);
547 if( g.urlUser!=0 && g.urlPasswd!=0 && ( g.urlFlags & URL_REMEMBER_PW ) ){
548 db_set("last-sync-pw", obscure(g.urlPasswd), 0);
549 }
550 }
551 }
552
553 /* Preemptively prompt for a password if a username is given in the
554 ** URL but no password.
555 */
556 void url_get_password_if_needed(void){
557 if( (g.urlUser && g.urlUser[0])
558 && (g.urlPasswd==0 || g.urlPasswd[0]==0)
559 && isatty(fileno(stdin))
560 ){
561 url_prompt_for_password();
562 }
563 }
564
--- src/url.c
+++ src/url.c
@@ -275,22 +275,22 @@
275
276 /*
277 ** Parse the given URL, which describes a sync server. Populate variables
278 ** in the global "g" structure as follows:
279 **
280 ** g.url.isFile True if FILE:
281 ** g.url.isHttps True if HTTPS:
282 ** g.url.isSsh True if SSH:
283 ** g.url.protocol "http" or "https" or "file"
284 ** g.url.name Hostname for HTTP:, HTTPS:, SSH:. Filename for FILE:
285 ** g.url.port TCP port number for HTTP or HTTPS.
286 ** g.url.dfltPort Default TCP port number (80 or 443).
287 ** g.url.path Path name for HTTP or HTTPS.
288 ** g.url.user Userid.
289 ** g.url.passwd Password.
290 ** g.url.hostname HOST:PORT or just HOST if port is the default.
291 ** g.url.canonical The URL in canonical form, omitting the password
292 **
293 ** HTTP url format as follows (HTTPS is the same with a different scheme):
294 **
295 ** http://userid:password@host:port/path
296 **
@@ -298,11 +298,11 @@
298 **
299 ** ssh://userid@host:port/path?fossil=path/to/fossil.exe
300 **
301 */
302 void url_parse(const char *zUrl, unsigned int urlFlags){
303 url_parse_local(zUrl, urlFlags, &g.url);
304 }
305
306 /*
307 ** COMMAND: test-urlparser
308 **
@@ -323,25 +323,25 @@
323 if( g.argc!=3 && g.argc!=4 ){
324 usage("URL");
325 }
326 url_parse(g.argv[2], fg);
327 for(i=0; i<2; i++){
328 fossil_print("g.url.isFile = %d\n", g.url.isFile);
329 fossil_print("g.url.isHttps = %d\n", g.url.isHttps);
330 fossil_print("g.url.isSsh = %d\n", g.url.isSsh);
331 fossil_print("g.url.protocol = %s\n", g.url.protocol);
332 fossil_print("g.url.name = %s\n", g.url.name);
333 fossil_print("g.url.port = %d\n", g.url.port);
334 fossil_print("g.url.dfltPort = %d\n", g.url.dfltPort);
335 fossil_print("g.url.hostname = %s\n", g.url.hostname);
336 fossil_print("g.url.path = %s\n", g.url.path);
337 fossil_print("g.url.user = %s\n", g.url.user);
338 fossil_print("g.url.passwd = %s\n", g.url.passwd);
339 fossil_print("g.url.canonical = %s\n", g.url.canonical);
340 fossil_print("g.url.fossil = %s\n", g.url.fossil);
341 fossil_print("g.url.flags = 0x%02x\n", g.url.flags);
342 if( g.url.isFile || g.url.isSsh ) break;
343 if( i==0 ){
344 fossil_print("********\n");
345 url_enable_proxy("Using proxy: ");
346 }
347 }
@@ -385,38 +385,38 @@
385 if( zProxy==0 || zProxy[0]==0 || is_truth(zProxy) ){
386 zProxy = fossil_getenv("http_proxy");
387 }
388 }
389 if( zProxy && zProxy[0] && !is_false(zProxy)
390 && !g.url.isSsh && !g.url.isFile ){
391 char *zOriginalUrl = g.url.canonical;
392 char *zOriginalHost = g.url.hostname;
393 int fOriginalIsHttps = g.url.isHttps;
394 char *zOriginalUser = g.url.user;
395 char *zOriginalPasswd = g.url.passwd;
396 char *zOriginalUrlPath = g.url.path;
397 int iOriginalPort = g.url.port;
398 unsigned uOriginalFlags = g.url.flags;
399 g.url.user = 0;
400 g.url.passwd = "";
401 url_parse(zProxy, 0);
402 if( zMsg ) fossil_print("%s%s\n", zMsg, g.url.canonical);
403 g.url.path = zOriginalUrl;
404 g.url.hostname = zOriginalHost;
405 if( g.url.user ){
406 char *zCredentials1 = mprintf("%s:%s", g.url.user, g.url.passwd);
407 char *zCredentials2 = encode64(zCredentials1, -1);
408 g.url.proxyAuth = mprintf("Basic %z", zCredentials2);
409 free(zCredentials1);
410 }
411 g.url.user = zOriginalUser;
412 g.url.passwd = zOriginalPasswd;
413 g.url.isHttps = fOriginalIsHttps;
414 g.url.useProxy = 1;
415 g.url.proxyUrlPath = zOriginalUrlPath;
416 g.url.proxyOrigPort = iOriginalPort;
417 g.url.flags = uOriginalFlags;
418 }
419 }
420
421 #if INTERFACE
422 /*
@@ -529,35 +529,35 @@
529 pUrlData->user);
530 }
531 }
532
533 /*
534 ** Prompt the user for the password for g.url.user. Store the result
535 ** in g.url.passwd.
536 */
537 void url_prompt_for_password(void){
538 url_prompt_for_password_local(&g.url);
539 }
540
541 /*
542 ** Remember the URL and password if requested.
543 */
544 void url_remember(void){
545 if( g.url.flags & URL_REMEMBER ){
546 db_set("last-sync-url", g.url.canonical, 0);
547 if( g.url.user!=0 && g.url.passwd!=0 && ( g.url.flags & URL_REMEMBER_PW ) ){
548 db_set("last-sync-pw", obscure(g.url.passwd), 0);
549 }
550 }
551 }
552
553 /* Preemptively prompt for a password if a username is given in the
554 ** URL but no password.
555 */
556 void url_get_password_if_needed(void){
557 if( (g.url.user && g.url.user[0])
558 && (g.url.passwd==0 || g.url.passwd[0]==0)
559 && isatty(fileno(stdin))
560 ){
561 url_prompt_for_password();
562 }
563 }
564
+1 -1
--- src/user.c
+++ src/user.c
@@ -375,11 +375,11 @@
375375
if( attempt_user(fossil_getenv("LOGNAME")) ) return;
376376
377377
if( attempt_user(fossil_getenv("USERNAME")) ) return;
378378
379379
url_parse(0, 0);
380
- if( g.urlUser && attempt_user(g.urlUser) ) return;
380
+ if( g.url.user && attempt_user(g.url.user) ) return;
381381
382382
fossil_print(
383383
"Cannot figure out who you are! Consider using the --user\n"
384384
"command line option, setting your USER environment variable,\n"
385385
"or setting a default user with \"fossil user default USER\".\n"
386386
--- src/user.c
+++ src/user.c
@@ -375,11 +375,11 @@
375 if( attempt_user(fossil_getenv("LOGNAME")) ) return;
376
377 if( attempt_user(fossil_getenv("USERNAME")) ) return;
378
379 url_parse(0, 0);
380 if( g.urlUser && attempt_user(g.urlUser) ) return;
381
382 fossil_print(
383 "Cannot figure out who you are! Consider using the --user\n"
384 "command line option, setting your USER environment variable,\n"
385 "or setting a default user with \"fossil user default USER\".\n"
386
--- src/user.c
+++ src/user.c
@@ -375,11 +375,11 @@
375 if( attempt_user(fossil_getenv("LOGNAME")) ) return;
376
377 if( attempt_user(fossil_getenv("USERNAME")) ) return;
378
379 url_parse(0, 0);
380 if( g.url.user && attempt_user(g.url.user) ) return;
381
382 fossil_print(
383 "Cannot figure out who you are! Consider using the --user\n"
384 "command line option, setting your USER environment variable,\n"
385 "or setting a default user with \"fossil user default USER\".\n"
386
+6 -6
--- src/xfer.c
+++ src/xfer.c
@@ -1375,11 +1375,11 @@
13751375
static double fossil_fabs(double x){
13761376
return x>0.0 ? x : -x;
13771377
}
13781378
13791379
/*
1380
-** Sync to the host identified in g.urlName and g.urlPath. This
1380
+** Sync to the host identified in g.url.name and g.url.path. This
13811381
** routine is called by the client.
13821382
**
13831383
** Records are pushed to the server if pushFlag is true. Records
13841384
** are pulled if pullFlag is true. A full sync occurs if both are
13851385
** true.
@@ -1823,15 +1823,15 @@
18231823
defossilize(zMsg);
18241824
fossil_force_newline();
18251825
fossil_print("Error: %s\n", zMsg);
18261826
if( fossil_strcmp(zMsg, "login failed")==0 ){
18271827
if( nCycle<2 ){
1828
- g.urlPasswd = 0;
1828
+ g.url.passwd = 0;
18291829
go = 1;
18301830
if( g.cgiOutput==0 ){
1831
- g.urlFlags |= URL_PROMPT_PW;
1832
- g.urlFlags &= ~URL_PROMPTED;
1831
+ g.url.flags |= URL_PROMPT_PW;
1832
+ g.url.flags &= ~URL_PROMPTED;
18331833
url_prompt_for_password();
18341834
url_remember();
18351835
}
18361836
}
18371837
}else{
@@ -1926,13 +1926,13 @@
19261926
19271927
fossil_force_newline();
19281928
fossil_print(
19291929
"%s finished with %lld bytes sent, %lld bytes received\n",
19301930
zOpType, nSent, nRcvd);
1931
- transport_close(GLOBAL_URL());
1932
- transport_global_shutdown(GLOBAL_URL());
1931
+ transport_close(&g.url);
1932
+ transport_global_shutdown(&g.url);
19331933
db_multi_exec("DROP TABLE onremote");
19341934
manifest_crosslink_end(MC_PERMIT_HOOKS);
19351935
content_enable_dephantomize(1);
19361936
db_end_transaction(0);
19371937
return nErr;
19381938
}
19391939
--- src/xfer.c
+++ src/xfer.c
@@ -1375,11 +1375,11 @@
1375 static double fossil_fabs(double x){
1376 return x>0.0 ? x : -x;
1377 }
1378
1379 /*
1380 ** Sync to the host identified in g.urlName and g.urlPath. This
1381 ** routine is called by the client.
1382 **
1383 ** Records are pushed to the server if pushFlag is true. Records
1384 ** are pulled if pullFlag is true. A full sync occurs if both are
1385 ** true.
@@ -1823,15 +1823,15 @@
1823 defossilize(zMsg);
1824 fossil_force_newline();
1825 fossil_print("Error: %s\n", zMsg);
1826 if( fossil_strcmp(zMsg, "login failed")==0 ){
1827 if( nCycle<2 ){
1828 g.urlPasswd = 0;
1829 go = 1;
1830 if( g.cgiOutput==0 ){
1831 g.urlFlags |= URL_PROMPT_PW;
1832 g.urlFlags &= ~URL_PROMPTED;
1833 url_prompt_for_password();
1834 url_remember();
1835 }
1836 }
1837 }else{
@@ -1926,13 +1926,13 @@
1926
1927 fossil_force_newline();
1928 fossil_print(
1929 "%s finished with %lld bytes sent, %lld bytes received\n",
1930 zOpType, nSent, nRcvd);
1931 transport_close(GLOBAL_URL());
1932 transport_global_shutdown(GLOBAL_URL());
1933 db_multi_exec("DROP TABLE onremote");
1934 manifest_crosslink_end(MC_PERMIT_HOOKS);
1935 content_enable_dephantomize(1);
1936 db_end_transaction(0);
1937 return nErr;
1938 }
1939
--- src/xfer.c
+++ src/xfer.c
@@ -1375,11 +1375,11 @@
1375 static double fossil_fabs(double x){
1376 return x>0.0 ? x : -x;
1377 }
1378
1379 /*
1380 ** Sync to the host identified in g.url.name and g.url.path. This
1381 ** routine is called by the client.
1382 **
1383 ** Records are pushed to the server if pushFlag is true. Records
1384 ** are pulled if pullFlag is true. A full sync occurs if both are
1385 ** true.
@@ -1823,15 +1823,15 @@
1823 defossilize(zMsg);
1824 fossil_force_newline();
1825 fossil_print("Error: %s\n", zMsg);
1826 if( fossil_strcmp(zMsg, "login failed")==0 ){
1827 if( nCycle<2 ){
1828 g.url.passwd = 0;
1829 go = 1;
1830 if( g.cgiOutput==0 ){
1831 g.url.flags |= URL_PROMPT_PW;
1832 g.url.flags &= ~URL_PROMPTED;
1833 url_prompt_for_password();
1834 url_remember();
1835 }
1836 }
1837 }else{
@@ -1926,13 +1926,13 @@
1926
1927 fossil_force_newline();
1928 fossil_print(
1929 "%s finished with %lld bytes sent, %lld bytes received\n",
1930 zOpType, nSent, nRcvd);
1931 transport_close(&g.url);
1932 transport_global_shutdown(&g.url);
1933 db_multi_exec("DROP TABLE onremote");
1934 manifest_crosslink_end(MC_PERMIT_HOOKS);
1935 content_enable_dephantomize(1);
1936 db_end_transaction(0);
1937 return nErr;
1938 }
1939
+3 -3
--- src/xfersetup.c
+++ src/xfersetup.c
@@ -44,11 +44,11 @@
4444
setup_menu_entry("Ticket", "xfersetup_ticket",
4545
"Specific TH1 code to run after processing a ticket change.");
4646
@ </table>
4747
4848
url_parse(0, 0);
49
- if( g.urlProtocol ){
49
+ if( g.url.protocol ){
5050
unsigned syncFlags;
5151
const char *zButton;
5252
char *zWarning;
5353
5454
if( db_get_boolean("dont-push", 0) ){
@@ -57,19 +57,19 @@
5757
zWarning = 0;
5858
}else{
5959
syncFlags = SYNC_PUSH | SYNC_PULL;
6060
zButton = "Synchronize";
6161
zWarning = mprintf("WARNING: Pushing to \"%s\" is enabled.",
62
- g.urlCanonical);
62
+ g.url.canonical);
6363
}
6464
if( P("sync") ){
6565
user_select();
6666
url_enable_proxy(0);
6767
client_sync(syncFlags, 0, 0);
6868
}
6969
@ <p>Press the %h(zButton) button below to synchronize with the
70
- @ "%h(g.urlCanonical)" repository now. This may be useful when
70
+ @ "%h(g.url.canonical)" repository now. This may be useful when
7171
@ testing the various transfer scripts.</p>
7272
@ <p>You can use the "http -async" command in your scripts, but
7373
@ make sure the "th1-uri-regexp" setting is set first.</p>
7474
if( zWarning ){
7575
@
7676
--- src/xfersetup.c
+++ src/xfersetup.c
@@ -44,11 +44,11 @@
44 setup_menu_entry("Ticket", "xfersetup_ticket",
45 "Specific TH1 code to run after processing a ticket change.");
46 @ </table>
47
48 url_parse(0, 0);
49 if( g.urlProtocol ){
50 unsigned syncFlags;
51 const char *zButton;
52 char *zWarning;
53
54 if( db_get_boolean("dont-push", 0) ){
@@ -57,19 +57,19 @@
57 zWarning = 0;
58 }else{
59 syncFlags = SYNC_PUSH | SYNC_PULL;
60 zButton = "Synchronize";
61 zWarning = mprintf("WARNING: Pushing to \"%s\" is enabled.",
62 g.urlCanonical);
63 }
64 if( P("sync") ){
65 user_select();
66 url_enable_proxy(0);
67 client_sync(syncFlags, 0, 0);
68 }
69 @ <p>Press the %h(zButton) button below to synchronize with the
70 @ "%h(g.urlCanonical)" repository now. This may be useful when
71 @ testing the various transfer scripts.</p>
72 @ <p>You can use the "http -async" command in your scripts, but
73 @ make sure the "th1-uri-regexp" setting is set first.</p>
74 if( zWarning ){
75 @
76
--- src/xfersetup.c
+++ src/xfersetup.c
@@ -44,11 +44,11 @@
44 setup_menu_entry("Ticket", "xfersetup_ticket",
45 "Specific TH1 code to run after processing a ticket change.");
46 @ </table>
47
48 url_parse(0, 0);
49 if( g.url.protocol ){
50 unsigned syncFlags;
51 const char *zButton;
52 char *zWarning;
53
54 if( db_get_boolean("dont-push", 0) ){
@@ -57,19 +57,19 @@
57 zWarning = 0;
58 }else{
59 syncFlags = SYNC_PUSH | SYNC_PULL;
60 zButton = "Synchronize";
61 zWarning = mprintf("WARNING: Pushing to \"%s\" is enabled.",
62 g.url.canonical);
63 }
64 if( P("sync") ){
65 user_select();
66 url_enable_proxy(0);
67 client_sync(syncFlags, 0, 0);
68 }
69 @ <p>Press the %h(zButton) button below to synchronize with the
70 @ "%h(g.url.canonical)" repository now. This may be useful when
71 @ testing the various transfer scripts.</p>
72 @ <p>You can use the "http -async" command in your scripts, but
73 @ make sure the "th1-uri-regexp" setting is set first.</p>
74 if( zWarning ){
75 @
76

Keyboard Shortcuts

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