161
162
163
164
165
166
167
168
169
170
171
172
173
174
|
*/
void glob_free(Glob *pGlob){
if( pGlob ){
fossil_free(pGlob->azPattern);
fossil_free(pGlob);
}
}
/*
** COMMAND: test-glob
**
** Usage: %fossil test-glob PATTERN STRING...
**
** PATTERN is a comma- and whitespace-separated list of optionally
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
|
*/
void glob_free(Glob *pGlob){
if( pGlob ){
fossil_free(pGlob->azPattern);
fossil_free(pGlob);
}
}
/*
** Appends the given glob to the given buffer in the form of a
** JS/JSON-compatible array. It requires that pDest have been
** initialized. If pGlob is NULL or empty it emits [] (an empty
** array).
*/
void glob_render_as_json(Glob *pGlob, Blob *pDest){
int i = 0;
blob_append(pDest, "[", 1);
for( ; pGlob && i < pGlob->nPattern; ++i ){
if(i){
blob_append(pDest, ",", 1);
}
blob_appendf(pDest, "%!j", pGlob->azPattern[i]);
}
blob_append(pDest, "]", 1);
}
/*
** COMMAND: test-glob
**
** Usage: %fossil test-glob PATTERN STRING...
**
** PATTERN is a comma- and whitespace-separated list of optionally
|