Fossil SCM

Fix the mkindex program so that it ignores lines beginning with COMMAND: when assembling help text.

drh 2010-12-26 00:40 trunk
Commit de4c07ca52ef1f3dd2078540140f33821c825e09
2 files changed +1 +7 -3
+1
--- src/db.c
+++ src/db.c
@@ -1604,10 +1604,11 @@
16041604
};
16051605
16061606
/*
16071607
** COMMAND: settings
16081608
** COMMAND: unset
1609
+**
16091610
** %fossil settings ?PROPERTY? ?VALUE? ?-global?
16101611
** %fossil unset PROPERTY ?-global?
16111612
**
16121613
** The "settings" command with no arguments lists all properties and their
16131614
** values. With just a property name it shows the value of that property.
16141615
--- src/db.c
+++ src/db.c
@@ -1604,10 +1604,11 @@
1604 };
1605
1606 /*
1607 ** COMMAND: settings
1608 ** COMMAND: unset
 
1609 ** %fossil settings ?PROPERTY? ?VALUE? ?-global?
1610 ** %fossil unset PROPERTY ?-global?
1611 **
1612 ** The "settings" command with no arguments lists all properties and their
1613 ** values. With just a property name it shows the value of that property.
1614
--- src/db.c
+++ src/db.c
@@ -1604,10 +1604,11 @@
1604 };
1605
1606 /*
1607 ** COMMAND: settings
1608 ** COMMAND: unset
1609 **
1610 ** %fossil settings ?PROPERTY? ?VALUE? ?-global?
1611 ** %fossil unset PROPERTY ?-global?
1612 **
1613 ** The "settings" command with no arguments lists all properties and their
1614 ** values. With just a property name it shows the value of that property.
1615
+7 -3
--- src/mkindex.c
+++ src/mkindex.c
@@ -59,11 +59,11 @@
5959
#define N_ENTRY 500
6060
6161
/*
6262
** Maximum size of a help message
6363
*/
64
-#define MX_HELP 10000
64
+#define MX_HELP 25000
6565
6666
/*
6767
** Table of entries
6868
*/
6969
Entry aEntry[N_ENTRY];
@@ -128,12 +128,16 @@
128128
*/
129129
void scan_for_func(char *zLine){
130130
int i,j,k;
131131
char *z;
132132
if( nUsed<=nFixed ) return;
133
- if( strncmp(zLine, "**", 2)==0 && isspace(zLine[2])
134
- && strlen(zLine)<sizeof(zHelp)-nHelp-1 && nUsed>nFixed ){
133
+ if( strncmp(zLine, "**", 2)==0
134
+ && isspace(zLine[2])
135
+ && strlen(zLine)<sizeof(zHelp)-nHelp-1
136
+ && nUsed>nFixed
137
+ && memcmp(zLine,"** COMMAND:",11)!=0
138
+ ){
135139
if( zLine[2]=='\n' ){
136140
zHelp[nHelp++] = '\n';
137141
}else{
138142
if( strncmp(&zLine[3], "Usage: ", 6)==0 ) nHelp = 0;
139143
strcpy(&zHelp[nHelp], &zLine[3]);
140144
--- src/mkindex.c
+++ src/mkindex.c
@@ -59,11 +59,11 @@
59 #define N_ENTRY 500
60
61 /*
62 ** Maximum size of a help message
63 */
64 #define MX_HELP 10000
65
66 /*
67 ** Table of entries
68 */
69 Entry aEntry[N_ENTRY];
@@ -128,12 +128,16 @@
128 */
129 void scan_for_func(char *zLine){
130 int i,j,k;
131 char *z;
132 if( nUsed<=nFixed ) return;
133 if( strncmp(zLine, "**", 2)==0 && isspace(zLine[2])
134 && strlen(zLine)<sizeof(zHelp)-nHelp-1 && nUsed>nFixed ){
 
 
 
 
135 if( zLine[2]=='\n' ){
136 zHelp[nHelp++] = '\n';
137 }else{
138 if( strncmp(&zLine[3], "Usage: ", 6)==0 ) nHelp = 0;
139 strcpy(&zHelp[nHelp], &zLine[3]);
140
--- src/mkindex.c
+++ src/mkindex.c
@@ -59,11 +59,11 @@
59 #define N_ENTRY 500
60
61 /*
62 ** Maximum size of a help message
63 */
64 #define MX_HELP 25000
65
66 /*
67 ** Table of entries
68 */
69 Entry aEntry[N_ENTRY];
@@ -128,12 +128,16 @@
128 */
129 void scan_for_func(char *zLine){
130 int i,j,k;
131 char *z;
132 if( nUsed<=nFixed ) return;
133 if( strncmp(zLine, "**", 2)==0
134 && isspace(zLine[2])
135 && strlen(zLine)<sizeof(zHelp)-nHelp-1
136 && nUsed>nFixed
137 && memcmp(zLine,"** COMMAND:",11)!=0
138 ){
139 if( zLine[2]=='\n' ){
140 zHelp[nHelp++] = '\n';
141 }else{
142 if( strncmp(&zLine[3], "Usage: ", 6)==0 ) nHelp = 0;
143 strcpy(&zHelp[nHelp], &zLine[3]);
144

Keyboard Shortcuts

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