Fossil SCM

Unfinished comment in search.c, and some more end-of-line spacing removals. No change in functionality.

jan.nijtmans 2015-02-05 09:01 trunk
Commit 5260fbf632874b61c491e5cf95a134342be3445f
+2 -2
--- src/doc.c
+++ src/doc.c
@@ -403,11 +403,11 @@
403403
const char *zAttr;
404404
const char *zValue;
405405
int nAttr, nValue;
406406
int seenClass = 0;
407407
int seenTitle = 0;
408
-
408
+
409409
while( fossil_isspace(zIn[0]) ) zIn++;
410410
if( fossil_strnicmp(zIn,"<div",4)!=0 ) return 0;
411411
zIn += 4;
412412
while( zIn[0] ){
413413
if( fossil_isspace(zIn[0]) ) zIn++;
@@ -444,11 +444,11 @@
444444
seenTitle = 1;
445445
if( seenClass ) return 1;
446446
}
447447
}
448448
return seenClass;
449
-}
449
+}
450450
451451
/*
452452
** Look for a file named zName in the checkin with RID=vid. Load the content
453453
** of that file into pContent and return the RID for the file. Or return 0
454454
** if the file is not found or could not be loaded.
455455
--- src/doc.c
+++ src/doc.c
@@ -403,11 +403,11 @@
403 const char *zAttr;
404 const char *zValue;
405 int nAttr, nValue;
406 int seenClass = 0;
407 int seenTitle = 0;
408
409 while( fossil_isspace(zIn[0]) ) zIn++;
410 if( fossil_strnicmp(zIn,"<div",4)!=0 ) return 0;
411 zIn += 4;
412 while( zIn[0] ){
413 if( fossil_isspace(zIn[0]) ) zIn++;
@@ -444,11 +444,11 @@
444 seenTitle = 1;
445 if( seenClass ) return 1;
446 }
447 }
448 return seenClass;
449 }
450
451 /*
452 ** Look for a file named zName in the checkin with RID=vid. Load the content
453 ** of that file into pContent and return the RID for the file. Or return 0
454 ** if the file is not found or could not be loaded.
455
--- src/doc.c
+++ src/doc.c
@@ -403,11 +403,11 @@
403 const char *zAttr;
404 const char *zValue;
405 int nAttr, nValue;
406 int seenClass = 0;
407 int seenTitle = 0;
408
409 while( fossil_isspace(zIn[0]) ) zIn++;
410 if( fossil_strnicmp(zIn,"<div",4)!=0 ) return 0;
411 zIn += 4;
412 while( zIn[0] ){
413 if( fossil_isspace(zIn[0]) ) zIn++;
@@ -444,11 +444,11 @@
444 seenTitle = 1;
445 if( seenClass ) return 1;
446 }
447 }
448 return seenClass;
449 }
450
451 /*
452 ** Look for a file named zName in the checkin with RID=vid. Load the content
453 ** of that file into pContent and return the RID for the file. Or return 0
454 ** if the file is not found or could not be loaded.
455
+3 -3
--- src/rebuild.c
+++ src/rebuild.c
@@ -586,11 +586,11 @@
586586
db_open_repository(g.zRepositoryName);
587587
}
588588
runReindex = search_index_exists();
589589
if( find_option("index",0,0)!=0 ) runReindex = 1;
590590
if( find_option("no-index",0,0)!=0 ) runReindex = 0;
591
-
591
+
592592
/* We should be done with options.. */
593593
verify_all_options();
594594
595595
db_begin_transaction();
596596
search_drop_index();
@@ -807,11 +807,11 @@
807807
int privateOnly = find_option("private",0,0)!=0;
808808
int bNeedRebuild = 0;
809809
db_find_and_open_repository(OPEN_ANY_SCHEMA, 2);
810810
db_close(1);
811811
db_open_repository(g.zRepositoryName);
812
-
812
+
813813
/* We should be done with options.. */
814814
verify_all_options();
815815
816816
if( !bForce ){
817817
Blob ans;
@@ -937,11 +937,11 @@
937937
fossil_print("\"%s\" is not a directory\n\n", g.argv[3]);
938938
usage("FILENAME DIRECTORY");
939939
}
940940
db_create_repository(g.argv[2]);
941941
db_open_repository(g.argv[2]);
942
-
942
+
943943
/* We should be done with options.. */
944944
verify_all_options();
945945
946946
db_open_config(0);
947947
db_begin_transaction();
948948
--- src/rebuild.c
+++ src/rebuild.c
@@ -586,11 +586,11 @@
586 db_open_repository(g.zRepositoryName);
587 }
588 runReindex = search_index_exists();
589 if( find_option("index",0,0)!=0 ) runReindex = 1;
590 if( find_option("no-index",0,0)!=0 ) runReindex = 0;
591
592 /* We should be done with options.. */
593 verify_all_options();
594
595 db_begin_transaction();
596 search_drop_index();
@@ -807,11 +807,11 @@
807 int privateOnly = find_option("private",0,0)!=0;
808 int bNeedRebuild = 0;
809 db_find_and_open_repository(OPEN_ANY_SCHEMA, 2);
810 db_close(1);
811 db_open_repository(g.zRepositoryName);
812
813 /* We should be done with options.. */
814 verify_all_options();
815
816 if( !bForce ){
817 Blob ans;
@@ -937,11 +937,11 @@
937 fossil_print("\"%s\" is not a directory\n\n", g.argv[3]);
938 usage("FILENAME DIRECTORY");
939 }
940 db_create_repository(g.argv[2]);
941 db_open_repository(g.argv[2]);
942
943 /* We should be done with options.. */
944 verify_all_options();
945
946 db_open_config(0);
947 db_begin_transaction();
948
--- src/rebuild.c
+++ src/rebuild.c
@@ -586,11 +586,11 @@
586 db_open_repository(g.zRepositoryName);
587 }
588 runReindex = search_index_exists();
589 if( find_option("index",0,0)!=0 ) runReindex = 1;
590 if( find_option("no-index",0,0)!=0 ) runReindex = 0;
591
592 /* We should be done with options.. */
593 verify_all_options();
594
595 db_begin_transaction();
596 search_drop_index();
@@ -807,11 +807,11 @@
807 int privateOnly = find_option("private",0,0)!=0;
808 int bNeedRebuild = 0;
809 db_find_and_open_repository(OPEN_ANY_SCHEMA, 2);
810 db_close(1);
811 db_open_repository(g.zRepositoryName);
812
813 /* We should be done with options.. */
814 verify_all_options();
815
816 if( !bForce ){
817 Blob ans;
@@ -937,11 +937,11 @@
937 fossil_print("\"%s\" is not a directory\n\n", g.argv[3]);
938 usage("FILENAME DIRECTORY");
939 }
940 db_create_repository(g.argv[2]);
941 db_open_repository(g.argv[2]);
942
943 /* We should be done with options.. */
944 verify_all_options();
945
946 db_open_config(0);
947 db_begin_transaction();
948
+2 -2
--- src/rss.c
+++ src/rss.c
@@ -65,11 +65,11 @@
6565
@ FROM event, blob
6666
@ WHERE blob.rid=event.objid
6767
;
6868
6969
login_check_credentials();
70
- if( !g.perm.Read && !g.perm.RdTkt && !g.perm.RdWiki ){
70
+ if( !g.perm.Read && !g.perm.RdTkt && !g.perm.RdWiki ){
7171
return;
7272
}
7373
7474
blob_zero(&bSQL);
7575
blob_append( &bSQL, zSQL1, -1 );
@@ -83,11 +83,11 @@
8383
if( !g.perm.Read ){
8484
if( g.perm.RdTkt && g.perm.RdWiki ){
8585
blob_append(&bSQL, " AND event.type!='ci'", -1);
8686
}else if( g.perm.RdTkt ){
8787
blob_append(&bSQL, " AND event.type=='t'", -1);
88
-
88
+
8989
}else{
9090
blob_append(&bSQL, " AND event.type=='w'", -1);
9191
}
9292
}else if( !g.perm.RdWiki ){
9393
if( g.perm.RdTkt ){
9494
--- src/rss.c
+++ src/rss.c
@@ -65,11 +65,11 @@
65 @ FROM event, blob
66 @ WHERE blob.rid=event.objid
67 ;
68
69 login_check_credentials();
70 if( !g.perm.Read && !g.perm.RdTkt && !g.perm.RdWiki ){
71 return;
72 }
73
74 blob_zero(&bSQL);
75 blob_append( &bSQL, zSQL1, -1 );
@@ -83,11 +83,11 @@
83 if( !g.perm.Read ){
84 if( g.perm.RdTkt && g.perm.RdWiki ){
85 blob_append(&bSQL, " AND event.type!='ci'", -1);
86 }else if( g.perm.RdTkt ){
87 blob_append(&bSQL, " AND event.type=='t'", -1);
88
89 }else{
90 blob_append(&bSQL, " AND event.type=='w'", -1);
91 }
92 }else if( !g.perm.RdWiki ){
93 if( g.perm.RdTkt ){
94
--- src/rss.c
+++ src/rss.c
@@ -65,11 +65,11 @@
65 @ FROM event, blob
66 @ WHERE blob.rid=event.objid
67 ;
68
69 login_check_credentials();
70 if( !g.perm.Read && !g.perm.RdTkt && !g.perm.RdWiki ){
71 return;
72 }
73
74 blob_zero(&bSQL);
75 blob_append( &bSQL, zSQL1, -1 );
@@ -83,11 +83,11 @@
83 if( !g.perm.Read ){
84 if( g.perm.RdTkt && g.perm.RdWiki ){
85 blob_append(&bSQL, " AND event.type!='ci'", -1);
86 }else if( g.perm.RdTkt ){
87 blob_append(&bSQL, " AND event.type=='t'", -1);
88
89 }else{
90 blob_append(&bSQL, " AND event.type=='w'", -1);
91 }
92 }else if( !g.perm.RdWiki ){
93 if( g.perm.RdTkt ){
94
+1 -1
--- src/schema.c
+++ src/schema.c
@@ -230,11 +230,11 @@
230230
@ name TEXT UNIQUE -- Name of file page
231231
@ );
232232
@
233233
@ -- Linkages between checkins, files created by each checkin, and
234234
@ -- the names of those files.
235
-@ --
235
+@ --
236236
@ -- Each entry represents a file that changed content from pid to fid
237237
@ -- due to the check-in that goes from pmid to mid. fnid is the name
238238
@ -- of the file in the mid check-in. If the file was renamed as part
239239
@ -- of the mid check-in, then pfnid is the previous filename.
240240
@
241241
--- src/schema.c
+++ src/schema.c
@@ -230,11 +230,11 @@
230 @ name TEXT UNIQUE -- Name of file page
231 @ );
232 @
233 @ -- Linkages between checkins, files created by each checkin, and
234 @ -- the names of those files.
235 @ --
236 @ -- Each entry represents a file that changed content from pid to fid
237 @ -- due to the check-in that goes from pmid to mid. fnid is the name
238 @ -- of the file in the mid check-in. If the file was renamed as part
239 @ -- of the mid check-in, then pfnid is the previous filename.
240 @
241
--- src/schema.c
+++ src/schema.c
@@ -230,11 +230,11 @@
230 @ name TEXT UNIQUE -- Name of file page
231 @ );
232 @
233 @ -- Linkages between checkins, files created by each checkin, and
234 @ -- the names of those files.
235 @ --
236 @ -- Each entry represents a file that changed content from pid to fid
237 @ -- due to the check-in that goes from pmid to mid. fnid is the name
238 @ -- of the file in the mid check-in. If the file was renamed as part
239 @ -- of the mid check-in, then pfnid is the previous filename.
240 @
241
+12 -13
--- src/search.c
+++ src/search.c
@@ -41,11 +41,11 @@
4141
char *z; /* Text */
4242
int n; /* length */
4343
} a[SEARCH_MAX_TERM];
4444
/* Snippet controls */
4545
char *zPattern; /* The search pattern */
46
- char *zMarkBegin; /* Start of a match */
46
+ char *zMarkBegin; /* Start of a match */
4747
char *zMarkEnd; /* End of a match */
4848
char *zMarkGap; /* A gap between two matches */
4949
unsigned fSrchFlg; /* Flags */
5050
int iScore; /* Score of the last match attempt */
5151
Blob snip; /* Snippet for the most recent match */
@@ -104,11 +104,11 @@
104104
/*
105105
** Compile a search pattern
106106
*/
107107
Search *search_init(
108108
const char *zPattern, /* The search pattern */
109
- const char *zMarkBegin, /* Start of a match */
109
+ const char *zMarkBegin, /* Start of a match */
110110
const char *zMarkEnd, /* End of a match */
111111
const char *zMarkGap, /* A gap between two matches */
112112
unsigned fSrchFlg /* Flags */
113113
){
114114
Search *p;
@@ -227,11 +227,11 @@
227227
if( zDoc[i]==0 ) break;
228228
}
229229
}
230230
231231
/* Finished search all documents.
232
- ** Every term must be seen or else the score is zero
232
+ ** Every term must be seen or else the score is zero
233233
*/
234234
score = 1;
235235
for(j=0; j<p->nTerm; j++) score *= anMatch[j];
236236
blob_reset(&p->snip);
237237
p->iScore = score;
@@ -317,11 +317,11 @@
317317
}
318318
319319
/*
320320
** COMMAND: test-match
321321
**
322
-** Usage: fossil test-match SEARCHSTRING FILE1 FILE2 ...
322
+** Usage: fossil test-match SEARCHSTRING FILE1 FILE2 ...
323323
*/
324324
void test_match_cmd(void){
325325
Search *p;
326326
int i;
327327
Blob x;
@@ -427,11 +427,11 @@
427427
}
428428
}
429429
430430
/*
431431
** This is an SQLite function that computes the searchable text.
432
-** It is a wrapper around the search_stext() routine. See the
432
+** It is a wrapper around the search_stext() routine. See the
433433
** search_stext() routine for further detail.
434434
*/
435435
static void search_stext_sqlfunc(
436436
sqlite3_context *context,
437437
int argc,
@@ -776,11 +776,10 @@
776776
}
777777
778778
/*
779779
** If z[] is of the form "<mark>TEXT</mark>" where TEXT contains
780780
** no white-space or punctuation, then return the length of the mark.
781
-** If
782781
*/
783782
static int isSnippetMark(const char *z){
784783
int n;
785784
if( strncmp(z,"<mark>",6)!=0 ) return 0;
786785
n = 6;
@@ -789,11 +788,11 @@
789788
return n+7;
790789
}
791790
792791
/*
793792
** Return a copy of zSnip (in memory obtained from fossil_malloc()) that
794
-** has all "<" characters, other than those on <mark> and </mark>,
793
+** has all "<" characters, other than those on <mark> and </mark>,
795794
** converted into "&lt;". This is similar to htmlize() except that
796795
** <mark> and </mark> are preserved.
797796
*/
798797
static char *cleanSnippet(const char *zSnip){
799798
int i;
@@ -1108,11 +1107,11 @@
11081107
blob_reset(&out);
11091108
}
11101109
11111110
/* The schema for the full-text index
11121111
*/
1113
-static const char zFtsSchema[] =
1112
+static const char zFtsSchema[] =
11141113
@ -- One entry for each possible search result
11151114
@ CREATE TABLE IF NOT EXISTS "%w".ftsdocs(
11161115
@ rowid INTEGER PRIMARY KEY, -- Maps to the ftsidx.docid
11171116
@ type CHAR(1), -- Type of document
11181117
@ rid INTEGER, -- BLOB.RID or TAG.TAGID for the document
@@ -1230,11 +1229,11 @@
12301229
}
12311230
}
12321231
12331232
/*
12341233
** If the doc-glob and doc-br settings are valid for document search
1235
-** and if the latest check-in on doc-br is in the unindexed set of
1234
+** and if the latest check-in on doc-br is in the unindexed set of
12361235
** check-ins, then update all 'd' entries in FTSDOCS that have
12371236
** changed.
12381237
*/
12391238
static void search_update_doc_index(void){
12401239
const char *zDocBr = db_get("doc-branch","trunk");
@@ -1284,11 +1283,11 @@
12841283
"UPDATE ftsdocs SET idxed=1 WHERE type='d' AND NOT idxed"
12851284
);
12861285
}
12871286
12881287
/*
1289
-** Deal with all of the unindexed 'c' terms in FTSDOCS
1288
+** Deal with all of the unindexed 'c' terms in FTSDOCS
12901289
*/
12911290
static void search_update_checkin_index(void){
12921291
db_multi_exec(
12931292
"INSERT INTO ftsidx(docid,stext)"
12941293
" SELECT rowid, stext('c',rid,NULL) FROM ftsdocs"
@@ -1306,11 +1305,11 @@
13061305
" AND blob.rid=ftsdocs.rid"
13071306
);
13081307
}
13091308
13101309
/*
1311
-** Deal with all of the unindexed 't' terms in FTSDOCS
1310
+** Deal with all of the unindexed 't' terms in FTSDOCS
13121311
*/
13131312
static void search_update_ticket_index(void){
13141313
db_multi_exec(
13151314
"INSERT INTO ftsidx(docid,stext)"
13161315
" SELECT rowid, stext('t',rid,NULL) FROM ftsdocs"
@@ -1328,11 +1327,11 @@
13281327
" AND ticket.tkt_id=ftsdocs.rid"
13291328
);
13301329
}
13311330
13321331
/*
1333
-** Deal with all of the unindexed 'w' terms in FTSDOCS
1332
+** Deal with all of the unindexed 'w' terms in FTSDOCS
13341333
*/
13351334
static void search_update_wiki_index(void){
13361335
db_multi_exec(
13371336
"INSERT INTO ftsidx(docid,stext)"
13381337
" SELECT rowid, stext('w',rid,NULL) FROM ftsdocs"
@@ -1468,11 +1467,11 @@
14681467
search_rebuild_index();
14691468
}
14701469
14711470
/* Always show the status before ending */
14721471
for(i=0; i<ArraySize(aSetng); i++){
1473
- fossil_print("%-16s %s\n", aSetng[i].zName,
1472
+ fossil_print("%-16s %s\n", aSetng[i].zName,
14741473
db_get_boolean(aSetng[i].zSetting,0) ? "on" : "off");
14751474
}
14761475
if( search_index_exists() ){
14771476
fossil_print("%-16s enabled\n", "full-text index:");
14781477
fossil_print("%-16s %d\n", "documents:",
14791478
--- src/search.c
+++ src/search.c
@@ -41,11 +41,11 @@
41 char *z; /* Text */
42 int n; /* length */
43 } a[SEARCH_MAX_TERM];
44 /* Snippet controls */
45 char *zPattern; /* The search pattern */
46 char *zMarkBegin; /* Start of a match */
47 char *zMarkEnd; /* End of a match */
48 char *zMarkGap; /* A gap between two matches */
49 unsigned fSrchFlg; /* Flags */
50 int iScore; /* Score of the last match attempt */
51 Blob snip; /* Snippet for the most recent match */
@@ -104,11 +104,11 @@
104 /*
105 ** Compile a search pattern
106 */
107 Search *search_init(
108 const char *zPattern, /* The search pattern */
109 const char *zMarkBegin, /* Start of a match */
110 const char *zMarkEnd, /* End of a match */
111 const char *zMarkGap, /* A gap between two matches */
112 unsigned fSrchFlg /* Flags */
113 ){
114 Search *p;
@@ -227,11 +227,11 @@
227 if( zDoc[i]==0 ) break;
228 }
229 }
230
231 /* Finished search all documents.
232 ** Every term must be seen or else the score is zero
233 */
234 score = 1;
235 for(j=0; j<p->nTerm; j++) score *= anMatch[j];
236 blob_reset(&p->snip);
237 p->iScore = score;
@@ -317,11 +317,11 @@
317 }
318
319 /*
320 ** COMMAND: test-match
321 **
322 ** Usage: fossil test-match SEARCHSTRING FILE1 FILE2 ...
323 */
324 void test_match_cmd(void){
325 Search *p;
326 int i;
327 Blob x;
@@ -427,11 +427,11 @@
427 }
428 }
429
430 /*
431 ** This is an SQLite function that computes the searchable text.
432 ** It is a wrapper around the search_stext() routine. See the
433 ** search_stext() routine for further detail.
434 */
435 static void search_stext_sqlfunc(
436 sqlite3_context *context,
437 int argc,
@@ -776,11 +776,10 @@
776 }
777
778 /*
779 ** If z[] is of the form "<mark>TEXT</mark>" where TEXT contains
780 ** no white-space or punctuation, then return the length of the mark.
781 ** If
782 */
783 static int isSnippetMark(const char *z){
784 int n;
785 if( strncmp(z,"<mark>",6)!=0 ) return 0;
786 n = 6;
@@ -789,11 +788,11 @@
789 return n+7;
790 }
791
792 /*
793 ** Return a copy of zSnip (in memory obtained from fossil_malloc()) that
794 ** has all "<" characters, other than those on <mark> and </mark>,
795 ** converted into "&lt;". This is similar to htmlize() except that
796 ** <mark> and </mark> are preserved.
797 */
798 static char *cleanSnippet(const char *zSnip){
799 int i;
@@ -1108,11 +1107,11 @@
1108 blob_reset(&out);
1109 }
1110
1111 /* The schema for the full-text index
1112 */
1113 static const char zFtsSchema[] =
1114 @ -- One entry for each possible search result
1115 @ CREATE TABLE IF NOT EXISTS "%w".ftsdocs(
1116 @ rowid INTEGER PRIMARY KEY, -- Maps to the ftsidx.docid
1117 @ type CHAR(1), -- Type of document
1118 @ rid INTEGER, -- BLOB.RID or TAG.TAGID for the document
@@ -1230,11 +1229,11 @@
1230 }
1231 }
1232
1233 /*
1234 ** If the doc-glob and doc-br settings are valid for document search
1235 ** and if the latest check-in on doc-br is in the unindexed set of
1236 ** check-ins, then update all 'd' entries in FTSDOCS that have
1237 ** changed.
1238 */
1239 static void search_update_doc_index(void){
1240 const char *zDocBr = db_get("doc-branch","trunk");
@@ -1284,11 +1283,11 @@
1284 "UPDATE ftsdocs SET idxed=1 WHERE type='d' AND NOT idxed"
1285 );
1286 }
1287
1288 /*
1289 ** Deal with all of the unindexed 'c' terms in FTSDOCS
1290 */
1291 static void search_update_checkin_index(void){
1292 db_multi_exec(
1293 "INSERT INTO ftsidx(docid,stext)"
1294 " SELECT rowid, stext('c',rid,NULL) FROM ftsdocs"
@@ -1306,11 +1305,11 @@
1306 " AND blob.rid=ftsdocs.rid"
1307 );
1308 }
1309
1310 /*
1311 ** Deal with all of the unindexed 't' terms in FTSDOCS
1312 */
1313 static void search_update_ticket_index(void){
1314 db_multi_exec(
1315 "INSERT INTO ftsidx(docid,stext)"
1316 " SELECT rowid, stext('t',rid,NULL) FROM ftsdocs"
@@ -1328,11 +1327,11 @@
1328 " AND ticket.tkt_id=ftsdocs.rid"
1329 );
1330 }
1331
1332 /*
1333 ** Deal with all of the unindexed 'w' terms in FTSDOCS
1334 */
1335 static void search_update_wiki_index(void){
1336 db_multi_exec(
1337 "INSERT INTO ftsidx(docid,stext)"
1338 " SELECT rowid, stext('w',rid,NULL) FROM ftsdocs"
@@ -1468,11 +1467,11 @@
1468 search_rebuild_index();
1469 }
1470
1471 /* Always show the status before ending */
1472 for(i=0; i<ArraySize(aSetng); i++){
1473 fossil_print("%-16s %s\n", aSetng[i].zName,
1474 db_get_boolean(aSetng[i].zSetting,0) ? "on" : "off");
1475 }
1476 if( search_index_exists() ){
1477 fossil_print("%-16s enabled\n", "full-text index:");
1478 fossil_print("%-16s %d\n", "documents:",
1479
--- src/search.c
+++ src/search.c
@@ -41,11 +41,11 @@
41 char *z; /* Text */
42 int n; /* length */
43 } a[SEARCH_MAX_TERM];
44 /* Snippet controls */
45 char *zPattern; /* The search pattern */
46 char *zMarkBegin; /* Start of a match */
47 char *zMarkEnd; /* End of a match */
48 char *zMarkGap; /* A gap between two matches */
49 unsigned fSrchFlg; /* Flags */
50 int iScore; /* Score of the last match attempt */
51 Blob snip; /* Snippet for the most recent match */
@@ -104,11 +104,11 @@
104 /*
105 ** Compile a search pattern
106 */
107 Search *search_init(
108 const char *zPattern, /* The search pattern */
109 const char *zMarkBegin, /* Start of a match */
110 const char *zMarkEnd, /* End of a match */
111 const char *zMarkGap, /* A gap between two matches */
112 unsigned fSrchFlg /* Flags */
113 ){
114 Search *p;
@@ -227,11 +227,11 @@
227 if( zDoc[i]==0 ) break;
228 }
229 }
230
231 /* Finished search all documents.
232 ** Every term must be seen or else the score is zero
233 */
234 score = 1;
235 for(j=0; j<p->nTerm; j++) score *= anMatch[j];
236 blob_reset(&p->snip);
237 p->iScore = score;
@@ -317,11 +317,11 @@
317 }
318
319 /*
320 ** COMMAND: test-match
321 **
322 ** Usage: fossil test-match SEARCHSTRING FILE1 FILE2 ...
323 */
324 void test_match_cmd(void){
325 Search *p;
326 int i;
327 Blob x;
@@ -427,11 +427,11 @@
427 }
428 }
429
430 /*
431 ** This is an SQLite function that computes the searchable text.
432 ** It is a wrapper around the search_stext() routine. See the
433 ** search_stext() routine for further detail.
434 */
435 static void search_stext_sqlfunc(
436 sqlite3_context *context,
437 int argc,
@@ -776,11 +776,10 @@
776 }
777
778 /*
779 ** If z[] is of the form "<mark>TEXT</mark>" where TEXT contains
780 ** no white-space or punctuation, then return the length of the mark.
 
781 */
782 static int isSnippetMark(const char *z){
783 int n;
784 if( strncmp(z,"<mark>",6)!=0 ) return 0;
785 n = 6;
@@ -789,11 +788,11 @@
788 return n+7;
789 }
790
791 /*
792 ** Return a copy of zSnip (in memory obtained from fossil_malloc()) that
793 ** has all "<" characters, other than those on <mark> and </mark>,
794 ** converted into "&lt;". This is similar to htmlize() except that
795 ** <mark> and </mark> are preserved.
796 */
797 static char *cleanSnippet(const char *zSnip){
798 int i;
@@ -1108,11 +1107,11 @@
1107 blob_reset(&out);
1108 }
1109
1110 /* The schema for the full-text index
1111 */
1112 static const char zFtsSchema[] =
1113 @ -- One entry for each possible search result
1114 @ CREATE TABLE IF NOT EXISTS "%w".ftsdocs(
1115 @ rowid INTEGER PRIMARY KEY, -- Maps to the ftsidx.docid
1116 @ type CHAR(1), -- Type of document
1117 @ rid INTEGER, -- BLOB.RID or TAG.TAGID for the document
@@ -1230,11 +1229,11 @@
1229 }
1230 }
1231
1232 /*
1233 ** If the doc-glob and doc-br settings are valid for document search
1234 ** and if the latest check-in on doc-br is in the unindexed set of
1235 ** check-ins, then update all 'd' entries in FTSDOCS that have
1236 ** changed.
1237 */
1238 static void search_update_doc_index(void){
1239 const char *zDocBr = db_get("doc-branch","trunk");
@@ -1284,11 +1283,11 @@
1283 "UPDATE ftsdocs SET idxed=1 WHERE type='d' AND NOT idxed"
1284 );
1285 }
1286
1287 /*
1288 ** Deal with all of the unindexed 'c' terms in FTSDOCS
1289 */
1290 static void search_update_checkin_index(void){
1291 db_multi_exec(
1292 "INSERT INTO ftsidx(docid,stext)"
1293 " SELECT rowid, stext('c',rid,NULL) FROM ftsdocs"
@@ -1306,11 +1305,11 @@
1305 " AND blob.rid=ftsdocs.rid"
1306 );
1307 }
1308
1309 /*
1310 ** Deal with all of the unindexed 't' terms in FTSDOCS
1311 */
1312 static void search_update_ticket_index(void){
1313 db_multi_exec(
1314 "INSERT INTO ftsidx(docid,stext)"
1315 " SELECT rowid, stext('t',rid,NULL) FROM ftsdocs"
@@ -1328,11 +1327,11 @@
1327 " AND ticket.tkt_id=ftsdocs.rid"
1328 );
1329 }
1330
1331 /*
1332 ** Deal with all of the unindexed 'w' terms in FTSDOCS
1333 */
1334 static void search_update_wiki_index(void){
1335 db_multi_exec(
1336 "INSERT INTO ftsidx(docid,stext)"
1337 " SELECT rowid, stext('w',rid,NULL) FROM ftsdocs"
@@ -1468,11 +1467,11 @@
1467 search_rebuild_index();
1468 }
1469
1470 /* Always show the status before ending */
1471 for(i=0; i<ArraySize(aSetng); i++){
1472 fossil_print("%-16s %s\n", aSetng[i].zName,
1473 db_get_boolean(aSetng[i].zSetting,0) ? "on" : "off");
1474 }
1475 if( search_index_exists() ){
1476 fossil_print("%-16s enabled\n", "full-text index:");
1477 fossil_print("%-16s %d\n", "documents:",
1478
+2 -2
--- src/setup.c
+++ src/setup.c
@@ -2172,16 +2172,16 @@
21722172
}
21732173
style_header("Search Configuration");
21742174
@ <form action="%s(g.zTop)/srchsetup" method="post"><div>
21752175
login_insert_csrf_secret();
21762176
@ <div style="text-align:center;font-weight:bold;">
2177
- @ Server-specific settings that affect the
2177
+ @ Server-specific settings that affect the
21782178
@ <a href="%R/search">/search</a> webpage.
21792179
@ </div>
21802180
@ <hr />
21812181
textarea_attribute("Document Glob List", 3, 35, "doc-glob", "dg", "", 0);
2182
- @ <p>The "Document Glob List" is a comma- or newline-separated list
2182
+ @ <p>The "Document Glob List" is a comma- or newline-separated list
21832183
@ of GLOB expressions that identify all documents within the source
21842184
@ tree that are to be searched when "Document Search" is enabled.
21852185
@ Some examples:
21862186
@ <table border=0 cellpadding=2 align=center>
21872187
@ <tr><td>*.wiki,*.html,*.md,*.txt<td style="width: 4x;">
21882188
--- src/setup.c
+++ src/setup.c
@@ -2172,16 +2172,16 @@
2172 }
2173 style_header("Search Configuration");
2174 @ <form action="%s(g.zTop)/srchsetup" method="post"><div>
2175 login_insert_csrf_secret();
2176 @ <div style="text-align:center;font-weight:bold;">
2177 @ Server-specific settings that affect the
2178 @ <a href="%R/search">/search</a> webpage.
2179 @ </div>
2180 @ <hr />
2181 textarea_attribute("Document Glob List", 3, 35, "doc-glob", "dg", "", 0);
2182 @ <p>The "Document Glob List" is a comma- or newline-separated list
2183 @ of GLOB expressions that identify all documents within the source
2184 @ tree that are to be searched when "Document Search" is enabled.
2185 @ Some examples:
2186 @ <table border=0 cellpadding=2 align=center>
2187 @ <tr><td>*.wiki,*.html,*.md,*.txt<td style="width: 4x;">
2188
--- src/setup.c
+++ src/setup.c
@@ -2172,16 +2172,16 @@
2172 }
2173 style_header("Search Configuration");
2174 @ <form action="%s(g.zTop)/srchsetup" method="post"><div>
2175 login_insert_csrf_secret();
2176 @ <div style="text-align:center;font-weight:bold;">
2177 @ Server-specific settings that affect the
2178 @ <a href="%R/search">/search</a> webpage.
2179 @ </div>
2180 @ <hr />
2181 textarea_attribute("Document Glob List", 3, 35, "doc-glob", "dg", "", 0);
2182 @ <p>The "Document Glob List" is a comma- or newline-separated list
2183 @ of GLOB expressions that identify all documents within the source
2184 @ tree that are to be searched when "Document Search" is enabled.
2185 @ Some examples:
2186 @ <table border=0 cellpadding=2 align=center>
2187 @ <tr><td>*.wiki,*.html,*.md,*.txt<td style="width: 4x;">
2188
+2 -2
--- src/skins.c
+++ src/skins.c
@@ -26,11 +26,11 @@
2626
**
2727
** To add new built-in skins:
2828
**
2929
** 1. Pick a name for the new skin. (Here we use "xyzzy").
3030
**
31
-** 2. Install files skins/xyzzy/css.txt, skins/xyzzy/header.txt,
31
+** 2. Install files skins/xyzzy/css.txt, skins/xyzzy/header.txt,
3232
** and skins/xyzzy/footer.txt into the source tree.
3333
**
3434
** 3. Rerun "tclsh makemake.tcl" in the src/ folder in order to
3535
** rebuild the makefiles to reference the new CSS, headers, and footers.
3636
**
@@ -42,11 +42,11 @@
4242
char *zSQL; /* Filled in at run-time with SQL to insert this skin */
4343
} aBuiltinSkin[] = {
4444
{ "Default", "default", 0 },
4545
{ "Plain Gray, No Logo", "plain_gray", 0 },
4646
{ "Khaki, No Logo", "khaki", 0 },
47
- { "Black & White, Menu on Left", "black_and_white", 0 },
47
+ { "Black & White, Menu on Left", "black_and_white", 0 },
4848
{ "Shadow boxes & Rounded Corners", "rounded1", 0 },
4949
{ "Enhanced Default", "enhanced1", 0 },
5050
{ "San Francisco Modern", "etienne1", 0 },
5151
{ "Eagle", "eagle", 0 },
5252
};
5353
--- src/skins.c
+++ src/skins.c
@@ -26,11 +26,11 @@
26 **
27 ** To add new built-in skins:
28 **
29 ** 1. Pick a name for the new skin. (Here we use "xyzzy").
30 **
31 ** 2. Install files skins/xyzzy/css.txt, skins/xyzzy/header.txt,
32 ** and skins/xyzzy/footer.txt into the source tree.
33 **
34 ** 3. Rerun "tclsh makemake.tcl" in the src/ folder in order to
35 ** rebuild the makefiles to reference the new CSS, headers, and footers.
36 **
@@ -42,11 +42,11 @@
42 char *zSQL; /* Filled in at run-time with SQL to insert this skin */
43 } aBuiltinSkin[] = {
44 { "Default", "default", 0 },
45 { "Plain Gray, No Logo", "plain_gray", 0 },
46 { "Khaki, No Logo", "khaki", 0 },
47 { "Black & White, Menu on Left", "black_and_white", 0 },
48 { "Shadow boxes & Rounded Corners", "rounded1", 0 },
49 { "Enhanced Default", "enhanced1", 0 },
50 { "San Francisco Modern", "etienne1", 0 },
51 { "Eagle", "eagle", 0 },
52 };
53
--- src/skins.c
+++ src/skins.c
@@ -26,11 +26,11 @@
26 **
27 ** To add new built-in skins:
28 **
29 ** 1. Pick a name for the new skin. (Here we use "xyzzy").
30 **
31 ** 2. Install files skins/xyzzy/css.txt, skins/xyzzy/header.txt,
32 ** and skins/xyzzy/footer.txt into the source tree.
33 **
34 ** 3. Rerun "tclsh makemake.tcl" in the src/ folder in order to
35 ** rebuild the makefiles to reference the new CSS, headers, and footers.
36 **
@@ -42,11 +42,11 @@
42 char *zSQL; /* Filled in at run-time with SQL to insert this skin */
43 } aBuiltinSkin[] = {
44 { "Default", "default", 0 },
45 { "Plain Gray, No Logo", "plain_gray", 0 },
46 { "Khaki, No Logo", "khaki", 0 },
47 { "Black & White, Menu on Left", "black_and_white", 0 },
48 { "Shadow boxes & Rounded Corners", "rounded1", 0 },
49 { "Enhanced Default", "enhanced1", 0 },
50 { "San Francisco Modern", "etienne1", 0 },
51 { "Eagle", "eagle", 0 },
52 };
53
+1 -1
--- src/tkt.c
+++ src/tkt.c
@@ -1412,11 +1412,11 @@
14121412
14131413
/*
14141414
** WEBPAGE: ticket
14151415
**
14161416
** This is intended to be the primary "Ticket" page. Render as
1417
-** either ticket-search (if search is enabled) or as the
1417
+** either ticket-search (if search is enabled) or as the
14181418
** /reportlist page (if ticket search is disabled).
14191419
*/
14201420
void tkt_home_page(void){
14211421
login_check_credentials();
14221422
if( search_restrict(SRCH_TKT)!=0 ){
14231423
--- src/tkt.c
+++ src/tkt.c
@@ -1412,11 +1412,11 @@
1412
1413 /*
1414 ** WEBPAGE: ticket
1415 **
1416 ** This is intended to be the primary "Ticket" page. Render as
1417 ** either ticket-search (if search is enabled) or as the
1418 ** /reportlist page (if ticket search is disabled).
1419 */
1420 void tkt_home_page(void){
1421 login_check_credentials();
1422 if( search_restrict(SRCH_TKT)!=0 ){
1423
--- src/tkt.c
+++ src/tkt.c
@@ -1412,11 +1412,11 @@
1412
1413 /*
1414 ** WEBPAGE: ticket
1415 **
1416 ** This is intended to be the primary "Ticket" page. Render as
1417 ** either ticket-search (if search is enabled) or as the
1418 ** /reportlist page (if ticket search is disabled).
1419 */
1420 void tkt_home_page(void){
1421 login_check_credentials();
1422 if( search_restrict(SRCH_TKT)!=0 ){
1423

Keyboard Shortcuts

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