1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
|
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
|
-
|
const char *z, /* Full original help text */
Blob *pOut, /* Write simplified help text here */
const char *zTopic, /* TOPIC */
const char *zSubtopic /* SUBTOPIC */
){
Blob in, line, subsection;
int n = 0;
size_t nSub; /* Length of zSubtopic */
char *zQTop = re_quote(zTopic);
char *zQSub = re_quote(zSubtopic);
char *zPattern = mprintf("> fossil %s .*\\b%s\\b", zQTop, zQSub);
ReCompiled *pRe = 0;
fossil_free(zQTop);
fossil_free(zQSub);
|
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
|
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
|
-
-
+
|
}
/* If no subtopic name zSubtopic if found, try to match any text.
*/
blob_rewind(&in);
blob_init(&subsection, 0, 0);
nSub = (int)strlen(zSubtopic);
while( blob_line(&in, &line) ){
size_t len = blob_strlen(&line);
if( memmem(blob_buffer(&line), len, zSubtopic, nSub)!=0 ){
if( strstr(blob_str(&line), zSubtopic)!=0 ){
if( blob_strlen(&subsection) && blob_buffer(&line)[0]!='>' ){
blob_appendb(pOut, &subsection);
blob_reset(&subsection);
}
blob_appendb(pOut, &line);
n++;
}else if( len>9 && strncmp(blob_buffer(&line),"> fossil ",9)==0 ){
|