Fossil SCM

Merge changes from trunk.

drh 2018-07-11 15:02 UTC smtp merge
Commit cde5b96deb110ddef8242c07843cca5f1c07a38b2705097fc79c23c21f555643
+5 -3
--- src/cgi.c
+++ src/cgi.c
@@ -200,22 +200,24 @@
200200
void cgi_append_header(const char *zLine){
201201
blob_append(&extraHeader, zLine, -1);
202202
}
203203
204204
/*
205
-** Set a cookie.
205
+** Set a cookie by queuing up the appropriate HTTP header output. If
206
+** !g.isHTTP, this is a no-op.
206207
**
207208
** Zero lifetime implies a session cookie.
208209
*/
209210
void cgi_set_cookie(
210211
const char *zName, /* Name of the cookie */
211212
const char *zValue, /* Value of the cookie. Automatically escaped */
212213
const char *zPath, /* Path cookie applies to. NULL means "/" */
213214
int lifetime /* Expiration of the cookie in seconds from now */
214215
){
215
- char *zSecure = "";
216
- if( zPath==0 ){
216
+ char const *zSecure = "";
217
+ if(!g.isHTTP) return /* e.g. JSON CLI mode, where g.zTop is not set */;
218
+ else if( zPath==0 ){
217219
zPath = g.zTop;
218220
if( zPath[0]==0 ) zPath = "/";
219221
}
220222
if( g.zBaseURL!=0 && strncmp(g.zBaseURL, "https:", 6)==0 ){
221223
zSecure = " secure;";
222224
--- src/cgi.c
+++ src/cgi.c
@@ -200,22 +200,24 @@
200 void cgi_append_header(const char *zLine){
201 blob_append(&extraHeader, zLine, -1);
202 }
203
204 /*
205 ** Set a cookie.
 
206 **
207 ** Zero lifetime implies a session cookie.
208 */
209 void cgi_set_cookie(
210 const char *zName, /* Name of the cookie */
211 const char *zValue, /* Value of the cookie. Automatically escaped */
212 const char *zPath, /* Path cookie applies to. NULL means "/" */
213 int lifetime /* Expiration of the cookie in seconds from now */
214 ){
215 char *zSecure = "";
216 if( zPath==0 ){
 
217 zPath = g.zTop;
218 if( zPath[0]==0 ) zPath = "/";
219 }
220 if( g.zBaseURL!=0 && strncmp(g.zBaseURL, "https:", 6)==0 ){
221 zSecure = " secure;";
222
--- src/cgi.c
+++ src/cgi.c
@@ -200,22 +200,24 @@
200 void cgi_append_header(const char *zLine){
201 blob_append(&extraHeader, zLine, -1);
202 }
203
204 /*
205 ** Set a cookie by queuing up the appropriate HTTP header output. If
206 ** !g.isHTTP, this is a no-op.
207 **
208 ** Zero lifetime implies a session cookie.
209 */
210 void cgi_set_cookie(
211 const char *zName, /* Name of the cookie */
212 const char *zValue, /* Value of the cookie. Automatically escaped */
213 const char *zPath, /* Path cookie applies to. NULL means "/" */
214 int lifetime /* Expiration of the cookie in seconds from now */
215 ){
216 char const *zSecure = "";
217 if(!g.isHTTP) return /* e.g. JSON CLI mode, where g.zTop is not set */;
218 else if( zPath==0 ){
219 zPath = g.zTop;
220 if( zPath[0]==0 ) zPath = "/";
221 }
222 if( g.zBaseURL!=0 && strncmp(g.zBaseURL, "https:", 6)==0 ){
223 zSecure = " secure;";
224
+12 -1
--- src/diff.c
+++ src/diff.c
@@ -2216,10 +2216,12 @@
22162216
Stmt q; /* Query returning all ancestor versions */
22172217
int cnt = 0; /* Number of versions analyzed */
22182218
int iLimit; /* Maximum number of versions to analyze */
22192219
sqlite3_int64 mxTime; /* Halt at this time if not already complete */
22202220
2221
+ memset(p, 0, sizeof(*p));
2222
+
22212223
if( zLimit ){
22222224
if( strcmp(zLimit,"none")==0 ){
22232225
iLimit = 0;
22242226
mxTime = 0;
22252227
}else if( sqlite3_strglob("*[0-9]s", zLimit)==0 ){
@@ -2235,11 +2237,11 @@
22352237
iLimit = 0;
22362238
mxTime = current_time_in_milliseconds()+1000;
22372239
}
22382240
db_begin_transaction();
22392241
2240
- /* Get the artificate ID for the check-in begin analyzed */
2242
+ /* Get the artifact ID for the check-in begin analyzed */
22412243
if( zRevision ){
22422244
cid = name_to_typed_rid(zRevision, "ci");
22432245
}else{
22442246
db_must_be_within_tree();
22452247
cid = db_lget_int("checkout", 0);
@@ -2308,10 +2310,19 @@
23082310
blob_reset(&step);
23092311
}
23102312
p->nVers++;
23112313
cnt++;
23122314
}
2315
+
2316
+ if( p->nVers==0 ){
2317
+ if( zRevision ){
2318
+ fossil_fatal("file %s does not exist in check-in %s", zFilename, zRevision);
2319
+ }else{
2320
+ fossil_fatal("no history for file: %s", zFilename);
2321
+ }
2322
+ }
2323
+
23132324
db_finalize(&q);
23142325
db_end_transaction(0);
23152326
}
23162327
23172328
/*
23182329
--- src/diff.c
+++ src/diff.c
@@ -2216,10 +2216,12 @@
2216 Stmt q; /* Query returning all ancestor versions */
2217 int cnt = 0; /* Number of versions analyzed */
2218 int iLimit; /* Maximum number of versions to analyze */
2219 sqlite3_int64 mxTime; /* Halt at this time if not already complete */
2220
 
 
2221 if( zLimit ){
2222 if( strcmp(zLimit,"none")==0 ){
2223 iLimit = 0;
2224 mxTime = 0;
2225 }else if( sqlite3_strglob("*[0-9]s", zLimit)==0 ){
@@ -2235,11 +2237,11 @@
2235 iLimit = 0;
2236 mxTime = current_time_in_milliseconds()+1000;
2237 }
2238 db_begin_transaction();
2239
2240 /* Get the artificate ID for the check-in begin analyzed */
2241 if( zRevision ){
2242 cid = name_to_typed_rid(zRevision, "ci");
2243 }else{
2244 db_must_be_within_tree();
2245 cid = db_lget_int("checkout", 0);
@@ -2308,10 +2310,19 @@
2308 blob_reset(&step);
2309 }
2310 p->nVers++;
2311 cnt++;
2312 }
 
 
 
 
 
 
 
 
 
2313 db_finalize(&q);
2314 db_end_transaction(0);
2315 }
2316
2317 /*
2318
--- src/diff.c
+++ src/diff.c
@@ -2216,10 +2216,12 @@
2216 Stmt q; /* Query returning all ancestor versions */
2217 int cnt = 0; /* Number of versions analyzed */
2218 int iLimit; /* Maximum number of versions to analyze */
2219 sqlite3_int64 mxTime; /* Halt at this time if not already complete */
2220
2221 memset(p, 0, sizeof(*p));
2222
2223 if( zLimit ){
2224 if( strcmp(zLimit,"none")==0 ){
2225 iLimit = 0;
2226 mxTime = 0;
2227 }else if( sqlite3_strglob("*[0-9]s", zLimit)==0 ){
@@ -2235,11 +2237,11 @@
2237 iLimit = 0;
2238 mxTime = current_time_in_milliseconds()+1000;
2239 }
2240 db_begin_transaction();
2241
2242 /* Get the artifact ID for the check-in begin analyzed */
2243 if( zRevision ){
2244 cid = name_to_typed_rid(zRevision, "ci");
2245 }else{
2246 db_must_be_within_tree();
2247 cid = db_lget_int("checkout", 0);
@@ -2308,10 +2310,19 @@
2310 blob_reset(&step);
2311 }
2312 p->nVers++;
2313 cnt++;
2314 }
2315
2316 if( p->nVers==0 ){
2317 if( zRevision ){
2318 fossil_fatal("file %s does not exist in check-in %s", zFilename, zRevision);
2319 }else{
2320 fossil_fatal("no history for file: %s", zFilename);
2321 }
2322 }
2323
2324 db_finalize(&q);
2325 db_end_transaction(0);
2326 }
2327
2328 /*
2329
+1 -1
--- src/style.c
+++ src/style.c
@@ -422,11 +422,11 @@
422422
image_url_var("logo");
423423
image_url_var("background");
424424
if( !login_is_nobody() ){
425425
Th_Store("login", g.zLogin);
426426
}
427
- if( sqlite3_strlike("%<body>%", zHeader, 0)!=0 ){
427
+ if( sqlite3_strlike("%<body%", zHeader, 0)!=0 ){
428428
Th_Render(zDfltHeader);
429429
}
430430
if( g.thTrace ) Th_Trace("BEGIN_HEADER_SCRIPT<br />\n", -1);
431431
Th_Render(zHeader);
432432
if( g.thTrace ) Th_Trace("END_HEADER<br />\n", -1);
433433
--- src/style.c
+++ src/style.c
@@ -422,11 +422,11 @@
422 image_url_var("logo");
423 image_url_var("background");
424 if( !login_is_nobody() ){
425 Th_Store("login", g.zLogin);
426 }
427 if( sqlite3_strlike("%<body>%", zHeader, 0)!=0 ){
428 Th_Render(zDfltHeader);
429 }
430 if( g.thTrace ) Th_Trace("BEGIN_HEADER_SCRIPT<br />\n", -1);
431 Th_Render(zHeader);
432 if( g.thTrace ) Th_Trace("END_HEADER<br />\n", -1);
433
--- src/style.c
+++ src/style.c
@@ -422,11 +422,11 @@
422 image_url_var("logo");
423 image_url_var("background");
424 if( !login_is_nobody() ){
425 Th_Store("login", g.zLogin);
426 }
427 if( sqlite3_strlike("%<body%", zHeader, 0)!=0 ){
428 Th_Render(zDfltHeader);
429 }
430 if( g.thTrace ) Th_Trace("BEGIN_HEADER_SCRIPT<br />\n", -1);
431 Th_Render(zHeader);
432 if( g.thTrace ) Th_Trace("END_HEADER<br />\n", -1);
433
--- www/customskin.md
+++ www/customskin.md
@@ -91,11 +91,11 @@
9191
the skin of the repository from which it was cloned.
9292
9393
Header And Footer Processing
9494
----------------------------
9595
96
-The header.txt and footer.txt files of a scan are merely the HTML text
96
+The header.txt and footer.txt files of a skin are merely the HTML text
9797
of the header and footer. Except, before being prepended and appended to
9898
the content, the header and footer text are run through a
9999
[TH1 interpreter](./th1.md) that might adjust the text as follows:
100100
101101
* All text within &lt;th1&gt;...&lt;/th1&gt; is elided from the
102102
--- www/customskin.md
+++ www/customskin.md
@@ -91,11 +91,11 @@
91 the skin of the repository from which it was cloned.
92
93 Header And Footer Processing
94 ----------------------------
95
96 The header.txt and footer.txt files of a scan are merely the HTML text
97 of the header and footer. Except, before being prepended and appended to
98 the content, the header and footer text are run through a
99 [TH1 interpreter](./th1.md) that might adjust the text as follows:
100
101 * All text within &lt;th1&gt;...&lt;/th1&gt; is elided from the
102
--- www/customskin.md
+++ www/customskin.md
@@ -91,11 +91,11 @@
91 the skin of the repository from which it was cloned.
92
93 Header And Footer Processing
94 ----------------------------
95
96 The header.txt and footer.txt files of a skin are merely the HTML text
97 of the header and footer. Except, before being prepended and appended to
98 the content, the header and footer text are run through a
99 [TH1 interpreter](./th1.md) that might adjust the text as follows:
100
101 * All text within &lt;th1&gt;...&lt;/th1&gt; is elided from the
102

Keyboard Shortcuts

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