Fossil SCM
Do not use the memmem() C-library function as it is not available on Windows.
Commit
7d28ae44fe56e99a8dc479831c3d0c4c7196d06ea9e984586ed471b53dcec7e2
Parent
c6285e1b5ecc1e9…
1 file changed
+1
-3
+1
-3
| --- src/dispatch.c | ||
| +++ src/dispatch.c | ||
| @@ -1081,11 +1081,10 @@ | ||
| 1081 | 1081 | const char *zTopic, /* TOPIC */ |
| 1082 | 1082 | const char *zSubtopic /* SUBTOPIC */ |
| 1083 | 1083 | ){ |
| 1084 | 1084 | Blob in, line, subsection; |
| 1085 | 1085 | int n = 0; |
| 1086 | - size_t nSub; /* Length of zSubtopic */ | |
| 1087 | 1086 | char *zQTop = re_quote(zTopic); |
| 1088 | 1087 | char *zQSub = re_quote(zSubtopic); |
| 1089 | 1088 | char *zPattern = mprintf("> fossil %s .*\\b%s\\b", zQTop, zQSub); |
| 1090 | 1089 | ReCompiled *pRe = 0; |
| 1091 | 1090 | |
| @@ -1144,14 +1143,13 @@ | ||
| 1144 | 1143 | |
| 1145 | 1144 | /* If no subtopic name zSubtopic if found, try to match any text. |
| 1146 | 1145 | */ |
| 1147 | 1146 | blob_rewind(&in); |
| 1148 | 1147 | blob_init(&subsection, 0, 0); |
| 1149 | - nSub = (int)strlen(zSubtopic); | |
| 1150 | 1148 | while( blob_line(&in, &line) ){ |
| 1151 | 1149 | size_t len = blob_strlen(&line); |
| 1152 | - if( memmem(blob_buffer(&line), len, zSubtopic, nSub)!=0 ){ | |
| 1150 | + if( strstr(blob_str(&line), zSubtopic)!=0 ){ | |
| 1153 | 1151 | if( blob_strlen(&subsection) && blob_buffer(&line)[0]!='>' ){ |
| 1154 | 1152 | blob_appendb(pOut, &subsection); |
| 1155 | 1153 | blob_reset(&subsection); |
| 1156 | 1154 | } |
| 1157 | 1155 | blob_appendb(pOut, &line); |
| 1158 | 1156 |
| --- src/dispatch.c | |
| +++ src/dispatch.c | |
| @@ -1081,11 +1081,10 @@ | |
| 1081 | const char *zTopic, /* TOPIC */ |
| 1082 | const char *zSubtopic /* SUBTOPIC */ |
| 1083 | ){ |
| 1084 | Blob in, line, subsection; |
| 1085 | int n = 0; |
| 1086 | size_t nSub; /* Length of zSubtopic */ |
| 1087 | char *zQTop = re_quote(zTopic); |
| 1088 | char *zQSub = re_quote(zSubtopic); |
| 1089 | char *zPattern = mprintf("> fossil %s .*\\b%s\\b", zQTop, zQSub); |
| 1090 | ReCompiled *pRe = 0; |
| 1091 | |
| @@ -1144,14 +1143,13 @@ | |
| 1144 | |
| 1145 | /* If no subtopic name zSubtopic if found, try to match any text. |
| 1146 | */ |
| 1147 | blob_rewind(&in); |
| 1148 | blob_init(&subsection, 0, 0); |
| 1149 | nSub = (int)strlen(zSubtopic); |
| 1150 | while( blob_line(&in, &line) ){ |
| 1151 | size_t len = blob_strlen(&line); |
| 1152 | if( memmem(blob_buffer(&line), len, zSubtopic, nSub)!=0 ){ |
| 1153 | if( blob_strlen(&subsection) && blob_buffer(&line)[0]!='>' ){ |
| 1154 | blob_appendb(pOut, &subsection); |
| 1155 | blob_reset(&subsection); |
| 1156 | } |
| 1157 | blob_appendb(pOut, &line); |
| 1158 |
| --- src/dispatch.c | |
| +++ src/dispatch.c | |
| @@ -1081,11 +1081,10 @@ | |
| 1081 | const char *zTopic, /* TOPIC */ |
| 1082 | const char *zSubtopic /* SUBTOPIC */ |
| 1083 | ){ |
| 1084 | Blob in, line, subsection; |
| 1085 | int n = 0; |
| 1086 | char *zQTop = re_quote(zTopic); |
| 1087 | char *zQSub = re_quote(zSubtopic); |
| 1088 | char *zPattern = mprintf("> fossil %s .*\\b%s\\b", zQTop, zQSub); |
| 1089 | ReCompiled *pRe = 0; |
| 1090 | |
| @@ -1144,14 +1143,13 @@ | |
| 1143 | |
| 1144 | /* If no subtopic name zSubtopic if found, try to match any text. |
| 1145 | */ |
| 1146 | blob_rewind(&in); |
| 1147 | blob_init(&subsection, 0, 0); |
| 1148 | while( blob_line(&in, &line) ){ |
| 1149 | size_t len = blob_strlen(&line); |
| 1150 | if( strstr(blob_str(&line), zSubtopic)!=0 ){ |
| 1151 | if( blob_strlen(&subsection) && blob_buffer(&line)[0]!='>' ){ |
| 1152 | blob_appendb(pOut, &subsection); |
| 1153 | blob_reset(&subsection); |
| 1154 | } |
| 1155 | blob_appendb(pOut, &line); |
| 1156 |