Fossil SCM
Revert unintended, incomplete change to timeline.c
Commit
5cb36bdd52932c1916e7e1b9a9f3ff480b8b4e5f
Parent
780c0150c2939ce…
1 file changed
+32
-35
+32
-35
| --- src/timeline.c | ||
| +++ src/timeline.c | ||
| @@ -1241,34 +1241,29 @@ | ||
| 1241 | 1241 | ** the tag table to access the "tagname" column. |
| 1242 | 1242 | ** |
| 1243 | 1243 | ** Each pattern is adjusted to to start with "sym-" and be anchored at end. |
| 1244 | 1244 | ** |
| 1245 | 1245 | ** In MS_REGEXP mode, backslash can be used to protect delimiter characters. |
| 1246 | -** | |
| 1247 | -** In addition to assembling and returning an SQL expression, this function | |
| 1248 | -** makes an English-language description of the patterns being matched, suitable | |
| 1249 | -** for display in the web interface. | |
| 1250 | 1246 | */ |
| 1251 | 1247 | static const char *tagMatchExpression( |
| 1252 | 1248 | MatchStyle matchStyle, /* Match style code */ |
| 1253 | 1249 | const char *zTag, /* Tag name, match pattern, or list of patterns */ |
| 1254 | - const char **zDesc /* Output expression description string */ | |
| 1250 | + int *pCount /* Pointer to match pattern count variable */ | |
| 1255 | 1251 | ){ |
| 1256 | - Blob expr = BLOB_INITIALIZER; /* SQL expression string assembly buffer */ | |
| 1257 | - Blob desc = BLOB_INITIALIZER; /* English description of match patterns */ | |
| 1252 | + Blob blob = BLOB_INITIALIZER; /* SQL expression string assembly buffer */ | |
| 1258 | 1253 | const char *zStart; /* Text at start of expression */ |
| 1259 | 1254 | const char *zDelimiter; /* Text between expression terms */ |
| 1260 | 1255 | const char *zEnd; /* Text at end of expression */ |
| 1261 | 1256 | const char *zPrefix; /* Text before each match pattern */ |
| 1262 | 1257 | const char *zSuffix; /* Text after each match pattern */ |
| 1263 | - char cInputDelim; /* Input delimiter character */ | |
| 1264 | - char cDescDelim; /* Description delimiter character */ | |
| 1258 | + char cDel; /* Input delimiter character */ | |
| 1265 | 1259 | int i; /* Input match pattern length counter */ |
| 1266 | 1260 | |
| 1267 | 1261 | /* Optimize exact matches by looking up the ID in advance to create a simple |
| 1268 | 1262 | * numeric comparison. Bypass the remainder of this function. */ |
| 1269 | 1263 | if( matchStyle==MS_EXACT ){ |
| 1264 | + *pCount = 1; | |
| 1270 | 1265 | return mprintf("(tagid=%d)", db_int(-1, |
| 1271 | 1266 | "SELECT tagid FROM tag WHERE tagname='sym-%q'", zTag)); |
| 1272 | 1267 | } |
| 1273 | 1268 | |
| 1274 | 1269 | /* Decide pattern prefix and suffix strings according to match style. */ |
| @@ -1290,13 +1285,13 @@ | ||
| 1290 | 1285 | zEnd = ")$')"; |
| 1291 | 1286 | zPrefix = ""; |
| 1292 | 1287 | zSuffix = ""; |
| 1293 | 1288 | } |
| 1294 | 1289 | |
| 1295 | - /* Convert the list of matches into an SQL expression and text description. */ | |
| 1296 | - blob_zero(&expr); | |
| 1297 | - blob_zero(&desc); | |
| 1290 | + /* Convert the list of matches into an SQL expression. */ | |
| 1291 | + *pCount = 0; | |
| 1292 | + blob_zero(&blob); | |
| 1298 | 1293 | while( 1 ){ |
| 1299 | 1294 | /* Skip leading delimiters. */ |
| 1300 | 1295 | for( ; fossil_isspace(*zTag) || *zTag==','; ++zTag ); |
| 1301 | 1296 | |
| 1302 | 1297 | /* Next non-delimiter character determines quoting. */ |
| @@ -1303,21 +1298,21 @@ | ||
| 1303 | 1298 | if( !*zTag ){ |
| 1304 | 1299 | /* Terminate loop at end of string. */ |
| 1305 | 1300 | break; |
| 1306 | 1301 | }else if( *zTag=='\'' || *zTag=='"' ){ |
| 1307 | 1302 | /* If word is quoted, prepare to stop at end quote. */ |
| 1308 | - cInputDelim = *zTag; | |
| 1303 | + cDel = *zTag; | |
| 1309 | 1304 | ++zTag; |
| 1310 | 1305 | }else{ |
| 1311 | 1306 | /* If word is not quoted, prepare to stop at delimiter. */ |
| 1312 | - cInputDelim = ','; | |
| 1307 | + cDel = ','; | |
| 1313 | 1308 | } |
| 1314 | 1309 | |
| 1315 | 1310 | /* Find the next delimiter character or end of string. */ |
| 1316 | - for( i=0; zTag[i] && zTag[i]!=cInputDelim; ++i ){ | |
| 1311 | + for( i=0; zTag[i] && zTag[i]!=cDel; ++i ){ | |
| 1317 | 1312 | /* If delimiter is comma, also recognize spaces as delimiters. */ |
| 1318 | - if( cInputDelim==',' && fossil_isspace(zTag[i]) ){ | |
| 1313 | + if( cDel==',' && fossil_isspace(zTag[i]) ){ | |
| 1319 | 1314 | break; |
| 1320 | 1315 | } |
| 1321 | 1316 | |
| 1322 | 1317 | /* In regexp mode, ignore delimiters following backslashes. */ |
| 1323 | 1318 | if( matchStyle==MS_REGEXP && zTag[i]=='\\' && zTag[i+1] ){ |
| @@ -1325,24 +1320,27 @@ | ||
| 1325 | 1320 | } |
| 1326 | 1321 | } |
| 1327 | 1322 | |
| 1328 | 1323 | /* Incorporate the match word into the output expression. The %q format is |
| 1329 | 1324 | * used to protect against SQL injection attacks by replacing ' with ''. */ |
| 1330 | - blob_appendf(&expr, "%s%s%#q%s", blob_size(&expr) ? zDelimiter : zStart, | |
| 1325 | + blob_appendf(&blob, "%s%s%#q%s", *pCount ? zDelimiter : zStart, | |
| 1331 | 1326 | zPrefix, i, zTag, zSuffix); |
| 1327 | + | |
| 1328 | + /* Keep track of the number of match expressions. */ | |
| 1329 | + ++*pCount; | |
| 1332 | 1330 | |
| 1333 | 1331 | /* Advance past all consumed input characters. */ |
| 1334 | 1332 | zTag += i; |
| 1335 | - if( cInputDelim!=',' && *zTag==cInputDelim ){ | |
| 1333 | + if( cDel!=',' && *zTag==cDel ){ | |
| 1336 | 1334 | ++zTag; |
| 1337 | 1335 | } |
| 1338 | 1336 | } |
| 1339 | 1337 | |
| 1340 | 1338 | /* Finalize and extract the SQL expression. */ |
| 1341 | - if( blob_size(&expr) ){ | |
| 1342 | - blob_append(&expr, zEnd, -1); | |
| 1343 | - return blob_str(&expr); | |
| 1339 | + if( *pCount ){ | |
| 1340 | + blob_append(&blob, zEnd, -1); | |
| 1341 | + return blob_str(&blob); | |
| 1344 | 1342 | } |
| 1345 | 1343 | |
| 1346 | 1344 | /* If execution reaches this point, the pattern was empty. Return NULL. */ |
| 1347 | 1345 | return 0; |
| 1348 | 1346 | } |
| @@ -1406,12 +1404,12 @@ | ||
| 1406 | 1404 | const char *zMark = P("m"); /* Mark this event or an event this time */ |
| 1407 | 1405 | const char *zTagName = P("t"); /* Show events with this tag */ |
| 1408 | 1406 | const char *zBrName = P("r"); /* Show events related to this tag */ |
| 1409 | 1407 | const char *zMatchStyle = P("ms"); /* Tag/branch match style string */ |
| 1410 | 1408 | MatchStyle matchStyle = MS_EXACT; /* Match style code */ |
| 1411 | - const char *zMatchDesc = 0; /* Tag match expression description text */ | |
| 1412 | 1409 | const char *zTagSql = 0; /* Tag/branch match SQL expression */ |
| 1410 | + int tagMatchCount = 0; /* Number of tag match patterns */ | |
| 1413 | 1411 | const char *zSearch = P("s"); /* Search string */ |
| 1414 | 1412 | const char *zUses = P("uf"); /* Only show check-ins hold this file */ |
| 1415 | 1413 | const char *zYearMonth = P("ym"); /* Show check-ins for the given YYYY-MM */ |
| 1416 | 1414 | const char *zYearWeek = P("yw"); /* Check-ins for YYYY-WW (week-of-year) */ |
| 1417 | 1415 | const char *zDay = P("ymd"); /* Check-ins for the day YYYY-MM-DD */ |
| @@ -1490,11 +1488,11 @@ | ||
| 1490 | 1488 | } |
| 1491 | 1489 | } |
| 1492 | 1490 | |
| 1493 | 1491 | /* Construct the tag match expression. */ |
| 1494 | 1492 | if( zThisTag ){ |
| 1495 | - zTagSql = tagMatchExpression(matchStyle, zThisTag, &zMatchDesc); | |
| 1493 | + zTagSql = tagMatchExpression(matchStyle, zThisTag, &tagMatchCount); | |
| 1496 | 1494 | } |
| 1497 | 1495 | |
| 1498 | 1496 | if( zTagName && g.perm.Read ){ |
| 1499 | 1497 | style_submenu_element("Related", "Related", "%s", |
| 1500 | 1498 | url_render(&url, "r", zTagName, "t", 0)); |
| @@ -1921,22 +1919,21 @@ | ||
| 1921 | 1919 | if( zTagName ){ |
| 1922 | 1920 | blob_append(&desc, " with tags matching ", -1); |
| 1923 | 1921 | }else{ |
| 1924 | 1922 | blob_append(&desc, " related to tags matching ", -1); |
| 1925 | 1923 | } |
| 1926 | - blob_append(&desc, zMatchDesc, -1); | |
| 1927 | -// if( matchStyle==MS_LIKE ){ | |
| 1928 | -// blob_append(&desc, " SQL LIKE pattern", -1); | |
| 1929 | -// }else if( matchStyle==MS_GLOB ){ | |
| 1930 | -// blob_append(&desc, " glob pattern", -1); | |
| 1931 | -// }else/* if( matchStyle==MS_REGEXP )*/{ | |
| 1932 | -// blob_append(&desc, " regular expression", -1); | |
| 1933 | -// } | |
| 1934 | -// if( tagMatchCount!=1 ){ | |
| 1935 | -// blob_append(&desc, "s", 1); | |
| 1936 | -// } | |
| 1937 | -// blob_appendf(&desc, " (%h)", zThisTag); | |
| 1924 | + if( matchStyle==MS_LIKE ){ | |
| 1925 | + blob_append(&desc, " SQL LIKE pattern", -1); | |
| 1926 | + }else if( matchStyle==MS_GLOB ){ | |
| 1927 | + blob_append(&desc, " glob pattern", -1); | |
| 1928 | + }else/* if( matchStyle==MS_REGEXP )*/{ | |
| 1929 | + blob_append(&desc, " regular expression", -1); | |
| 1930 | + } | |
| 1931 | + if( tagMatchCount!=1 ){ | |
| 1932 | + blob_append(&desc, "s", 1); | |
| 1933 | + } | |
| 1934 | + blob_appendf(&desc, " (%h)", zThisTag); | |
| 1938 | 1935 | }else if( zTagName ){ |
| 1939 | 1936 | blob_appendf(&desc, " tagged with \"%h\"", zTagName); |
| 1940 | 1937 | }else{ |
| 1941 | 1938 | blob_appendf(&desc, " related to \"%h\"", zBrName); |
| 1942 | 1939 | } |
| 1943 | 1940 |
| --- src/timeline.c | |
| +++ src/timeline.c | |
| @@ -1241,34 +1241,29 @@ | |
| 1241 | ** the tag table to access the "tagname" column. |
| 1242 | ** |
| 1243 | ** Each pattern is adjusted to to start with "sym-" and be anchored at end. |
| 1244 | ** |
| 1245 | ** In MS_REGEXP mode, backslash can be used to protect delimiter characters. |
| 1246 | ** |
| 1247 | ** In addition to assembling and returning an SQL expression, this function |
| 1248 | ** makes an English-language description of the patterns being matched, suitable |
| 1249 | ** for display in the web interface. |
| 1250 | */ |
| 1251 | static const char *tagMatchExpression( |
| 1252 | MatchStyle matchStyle, /* Match style code */ |
| 1253 | const char *zTag, /* Tag name, match pattern, or list of patterns */ |
| 1254 | const char **zDesc /* Output expression description string */ |
| 1255 | ){ |
| 1256 | Blob expr = BLOB_INITIALIZER; /* SQL expression string assembly buffer */ |
| 1257 | Blob desc = BLOB_INITIALIZER; /* English description of match patterns */ |
| 1258 | const char *zStart; /* Text at start of expression */ |
| 1259 | const char *zDelimiter; /* Text between expression terms */ |
| 1260 | const char *zEnd; /* Text at end of expression */ |
| 1261 | const char *zPrefix; /* Text before each match pattern */ |
| 1262 | const char *zSuffix; /* Text after each match pattern */ |
| 1263 | char cInputDelim; /* Input delimiter character */ |
| 1264 | char cDescDelim; /* Description delimiter character */ |
| 1265 | int i; /* Input match pattern length counter */ |
| 1266 | |
| 1267 | /* Optimize exact matches by looking up the ID in advance to create a simple |
| 1268 | * numeric comparison. Bypass the remainder of this function. */ |
| 1269 | if( matchStyle==MS_EXACT ){ |
| 1270 | return mprintf("(tagid=%d)", db_int(-1, |
| 1271 | "SELECT tagid FROM tag WHERE tagname='sym-%q'", zTag)); |
| 1272 | } |
| 1273 | |
| 1274 | /* Decide pattern prefix and suffix strings according to match style. */ |
| @@ -1290,13 +1285,13 @@ | |
| 1290 | zEnd = ")$')"; |
| 1291 | zPrefix = ""; |
| 1292 | zSuffix = ""; |
| 1293 | } |
| 1294 | |
| 1295 | /* Convert the list of matches into an SQL expression and text description. */ |
| 1296 | blob_zero(&expr); |
| 1297 | blob_zero(&desc); |
| 1298 | while( 1 ){ |
| 1299 | /* Skip leading delimiters. */ |
| 1300 | for( ; fossil_isspace(*zTag) || *zTag==','; ++zTag ); |
| 1301 | |
| 1302 | /* Next non-delimiter character determines quoting. */ |
| @@ -1303,21 +1298,21 @@ | |
| 1303 | if( !*zTag ){ |
| 1304 | /* Terminate loop at end of string. */ |
| 1305 | break; |
| 1306 | }else if( *zTag=='\'' || *zTag=='"' ){ |
| 1307 | /* If word is quoted, prepare to stop at end quote. */ |
| 1308 | cInputDelim = *zTag; |
| 1309 | ++zTag; |
| 1310 | }else{ |
| 1311 | /* If word is not quoted, prepare to stop at delimiter. */ |
| 1312 | cInputDelim = ','; |
| 1313 | } |
| 1314 | |
| 1315 | /* Find the next delimiter character or end of string. */ |
| 1316 | for( i=0; zTag[i] && zTag[i]!=cInputDelim; ++i ){ |
| 1317 | /* If delimiter is comma, also recognize spaces as delimiters. */ |
| 1318 | if( cInputDelim==',' && fossil_isspace(zTag[i]) ){ |
| 1319 | break; |
| 1320 | } |
| 1321 | |
| 1322 | /* In regexp mode, ignore delimiters following backslashes. */ |
| 1323 | if( matchStyle==MS_REGEXP && zTag[i]=='\\' && zTag[i+1] ){ |
| @@ -1325,24 +1320,27 @@ | |
| 1325 | } |
| 1326 | } |
| 1327 | |
| 1328 | /* Incorporate the match word into the output expression. The %q format is |
| 1329 | * used to protect against SQL injection attacks by replacing ' with ''. */ |
| 1330 | blob_appendf(&expr, "%s%s%#q%s", blob_size(&expr) ? zDelimiter : zStart, |
| 1331 | zPrefix, i, zTag, zSuffix); |
| 1332 | |
| 1333 | /* Advance past all consumed input characters. */ |
| 1334 | zTag += i; |
| 1335 | if( cInputDelim!=',' && *zTag==cInputDelim ){ |
| 1336 | ++zTag; |
| 1337 | } |
| 1338 | } |
| 1339 | |
| 1340 | /* Finalize and extract the SQL expression. */ |
| 1341 | if( blob_size(&expr) ){ |
| 1342 | blob_append(&expr, zEnd, -1); |
| 1343 | return blob_str(&expr); |
| 1344 | } |
| 1345 | |
| 1346 | /* If execution reaches this point, the pattern was empty. Return NULL. */ |
| 1347 | return 0; |
| 1348 | } |
| @@ -1406,12 +1404,12 @@ | |
| 1406 | const char *zMark = P("m"); /* Mark this event or an event this time */ |
| 1407 | const char *zTagName = P("t"); /* Show events with this tag */ |
| 1408 | const char *zBrName = P("r"); /* Show events related to this tag */ |
| 1409 | const char *zMatchStyle = P("ms"); /* Tag/branch match style string */ |
| 1410 | MatchStyle matchStyle = MS_EXACT; /* Match style code */ |
| 1411 | const char *zMatchDesc = 0; /* Tag match expression description text */ |
| 1412 | const char *zTagSql = 0; /* Tag/branch match SQL expression */ |
| 1413 | const char *zSearch = P("s"); /* Search string */ |
| 1414 | const char *zUses = P("uf"); /* Only show check-ins hold this file */ |
| 1415 | const char *zYearMonth = P("ym"); /* Show check-ins for the given YYYY-MM */ |
| 1416 | const char *zYearWeek = P("yw"); /* Check-ins for YYYY-WW (week-of-year) */ |
| 1417 | const char *zDay = P("ymd"); /* Check-ins for the day YYYY-MM-DD */ |
| @@ -1490,11 +1488,11 @@ | |
| 1490 | } |
| 1491 | } |
| 1492 | |
| 1493 | /* Construct the tag match expression. */ |
| 1494 | if( zThisTag ){ |
| 1495 | zTagSql = tagMatchExpression(matchStyle, zThisTag, &zMatchDesc); |
| 1496 | } |
| 1497 | |
| 1498 | if( zTagName && g.perm.Read ){ |
| 1499 | style_submenu_element("Related", "Related", "%s", |
| 1500 | url_render(&url, "r", zTagName, "t", 0)); |
| @@ -1921,22 +1919,21 @@ | |
| 1921 | if( zTagName ){ |
| 1922 | blob_append(&desc, " with tags matching ", -1); |
| 1923 | }else{ |
| 1924 | blob_append(&desc, " related to tags matching ", -1); |
| 1925 | } |
| 1926 | blob_append(&desc, zMatchDesc, -1); |
| 1927 | // if( matchStyle==MS_LIKE ){ |
| 1928 | // blob_append(&desc, " SQL LIKE pattern", -1); |
| 1929 | // }else if( matchStyle==MS_GLOB ){ |
| 1930 | // blob_append(&desc, " glob pattern", -1); |
| 1931 | // }else/* if( matchStyle==MS_REGEXP )*/{ |
| 1932 | // blob_append(&desc, " regular expression", -1); |
| 1933 | // } |
| 1934 | // if( tagMatchCount!=1 ){ |
| 1935 | // blob_append(&desc, "s", 1); |
| 1936 | // } |
| 1937 | // blob_appendf(&desc, " (%h)", zThisTag); |
| 1938 | }else if( zTagName ){ |
| 1939 | blob_appendf(&desc, " tagged with \"%h\"", zTagName); |
| 1940 | }else{ |
| 1941 | blob_appendf(&desc, " related to \"%h\"", zBrName); |
| 1942 | } |
| 1943 |
| --- src/timeline.c | |
| +++ src/timeline.c | |
| @@ -1241,34 +1241,29 @@ | |
| 1241 | ** the tag table to access the "tagname" column. |
| 1242 | ** |
| 1243 | ** Each pattern is adjusted to to start with "sym-" and be anchored at end. |
| 1244 | ** |
| 1245 | ** In MS_REGEXP mode, backslash can be used to protect delimiter characters. |
| 1246 | */ |
| 1247 | static const char *tagMatchExpression( |
| 1248 | MatchStyle matchStyle, /* Match style code */ |
| 1249 | const char *zTag, /* Tag name, match pattern, or list of patterns */ |
| 1250 | int *pCount /* Pointer to match pattern count variable */ |
| 1251 | ){ |
| 1252 | Blob blob = BLOB_INITIALIZER; /* SQL expression string assembly buffer */ |
| 1253 | const char *zStart; /* Text at start of expression */ |
| 1254 | const char *zDelimiter; /* Text between expression terms */ |
| 1255 | const char *zEnd; /* Text at end of expression */ |
| 1256 | const char *zPrefix; /* Text before each match pattern */ |
| 1257 | const char *zSuffix; /* Text after each match pattern */ |
| 1258 | char cDel; /* Input delimiter character */ |
| 1259 | int i; /* Input match pattern length counter */ |
| 1260 | |
| 1261 | /* Optimize exact matches by looking up the ID in advance to create a simple |
| 1262 | * numeric comparison. Bypass the remainder of this function. */ |
| 1263 | if( matchStyle==MS_EXACT ){ |
| 1264 | *pCount = 1; |
| 1265 | return mprintf("(tagid=%d)", db_int(-1, |
| 1266 | "SELECT tagid FROM tag WHERE tagname='sym-%q'", zTag)); |
| 1267 | } |
| 1268 | |
| 1269 | /* Decide pattern prefix and suffix strings according to match style. */ |
| @@ -1290,13 +1285,13 @@ | |
| 1285 | zEnd = ")$')"; |
| 1286 | zPrefix = ""; |
| 1287 | zSuffix = ""; |
| 1288 | } |
| 1289 | |
| 1290 | /* Convert the list of matches into an SQL expression. */ |
| 1291 | *pCount = 0; |
| 1292 | blob_zero(&blob); |
| 1293 | while( 1 ){ |
| 1294 | /* Skip leading delimiters. */ |
| 1295 | for( ; fossil_isspace(*zTag) || *zTag==','; ++zTag ); |
| 1296 | |
| 1297 | /* Next non-delimiter character determines quoting. */ |
| @@ -1303,21 +1298,21 @@ | |
| 1298 | if( !*zTag ){ |
| 1299 | /* Terminate loop at end of string. */ |
| 1300 | break; |
| 1301 | }else if( *zTag=='\'' || *zTag=='"' ){ |
| 1302 | /* If word is quoted, prepare to stop at end quote. */ |
| 1303 | cDel = *zTag; |
| 1304 | ++zTag; |
| 1305 | }else{ |
| 1306 | /* If word is not quoted, prepare to stop at delimiter. */ |
| 1307 | cDel = ','; |
| 1308 | } |
| 1309 | |
| 1310 | /* Find the next delimiter character or end of string. */ |
| 1311 | for( i=0; zTag[i] && zTag[i]!=cDel; ++i ){ |
| 1312 | /* If delimiter is comma, also recognize spaces as delimiters. */ |
| 1313 | if( cDel==',' && fossil_isspace(zTag[i]) ){ |
| 1314 | break; |
| 1315 | } |
| 1316 | |
| 1317 | /* In regexp mode, ignore delimiters following backslashes. */ |
| 1318 | if( matchStyle==MS_REGEXP && zTag[i]=='\\' && zTag[i+1] ){ |
| @@ -1325,24 +1320,27 @@ | |
| 1320 | } |
| 1321 | } |
| 1322 | |
| 1323 | /* Incorporate the match word into the output expression. The %q format is |
| 1324 | * used to protect against SQL injection attacks by replacing ' with ''. */ |
| 1325 | blob_appendf(&blob, "%s%s%#q%s", *pCount ? zDelimiter : zStart, |
| 1326 | zPrefix, i, zTag, zSuffix); |
| 1327 | |
| 1328 | /* Keep track of the number of match expressions. */ |
| 1329 | ++*pCount; |
| 1330 | |
| 1331 | /* Advance past all consumed input characters. */ |
| 1332 | zTag += i; |
| 1333 | if( cDel!=',' && *zTag==cDel ){ |
| 1334 | ++zTag; |
| 1335 | } |
| 1336 | } |
| 1337 | |
| 1338 | /* Finalize and extract the SQL expression. */ |
| 1339 | if( *pCount ){ |
| 1340 | blob_append(&blob, zEnd, -1); |
| 1341 | return blob_str(&blob); |
| 1342 | } |
| 1343 | |
| 1344 | /* If execution reaches this point, the pattern was empty. Return NULL. */ |
| 1345 | return 0; |
| 1346 | } |
| @@ -1406,12 +1404,12 @@ | |
| 1404 | const char *zMark = P("m"); /* Mark this event or an event this time */ |
| 1405 | const char *zTagName = P("t"); /* Show events with this tag */ |
| 1406 | const char *zBrName = P("r"); /* Show events related to this tag */ |
| 1407 | const char *zMatchStyle = P("ms"); /* Tag/branch match style string */ |
| 1408 | MatchStyle matchStyle = MS_EXACT; /* Match style code */ |
| 1409 | const char *zTagSql = 0; /* Tag/branch match SQL expression */ |
| 1410 | int tagMatchCount = 0; /* Number of tag match patterns */ |
| 1411 | const char *zSearch = P("s"); /* Search string */ |
| 1412 | const char *zUses = P("uf"); /* Only show check-ins hold this file */ |
| 1413 | const char *zYearMonth = P("ym"); /* Show check-ins for the given YYYY-MM */ |
| 1414 | const char *zYearWeek = P("yw"); /* Check-ins for YYYY-WW (week-of-year) */ |
| 1415 | const char *zDay = P("ymd"); /* Check-ins for the day YYYY-MM-DD */ |
| @@ -1490,11 +1488,11 @@ | |
| 1488 | } |
| 1489 | } |
| 1490 | |
| 1491 | /* Construct the tag match expression. */ |
| 1492 | if( zThisTag ){ |
| 1493 | zTagSql = tagMatchExpression(matchStyle, zThisTag, &tagMatchCount); |
| 1494 | } |
| 1495 | |
| 1496 | if( zTagName && g.perm.Read ){ |
| 1497 | style_submenu_element("Related", "Related", "%s", |
| 1498 | url_render(&url, "r", zTagName, "t", 0)); |
| @@ -1921,22 +1919,21 @@ | |
| 1919 | if( zTagName ){ |
| 1920 | blob_append(&desc, " with tags matching ", -1); |
| 1921 | }else{ |
| 1922 | blob_append(&desc, " related to tags matching ", -1); |
| 1923 | } |
| 1924 | if( matchStyle==MS_LIKE ){ |
| 1925 | blob_append(&desc, " SQL LIKE pattern", -1); |
| 1926 | }else if( matchStyle==MS_GLOB ){ |
| 1927 | blob_append(&desc, " glob pattern", -1); |
| 1928 | }else/* if( matchStyle==MS_REGEXP )*/{ |
| 1929 | blob_append(&desc, " regular expression", -1); |
| 1930 | } |
| 1931 | if( tagMatchCount!=1 ){ |
| 1932 | blob_append(&desc, "s", 1); |
| 1933 | } |
| 1934 | blob_appendf(&desc, " (%h)", zThisTag); |
| 1935 | }else if( zTagName ){ |
| 1936 | blob_appendf(&desc, " tagged with \"%h\"", zTagName); |
| 1937 | }else{ |
| 1938 | blob_appendf(&desc, " related to \"%h\"", zBrName); |
| 1939 | } |
| 1940 |