Fossil SCM
Adapt other callers of print_timeline(), so they show as well whether the limit was reached.
Commit
25d0049045e2caa75d5b22868dc7fec57f702610
Parent
feb175065c028d1…
2 files changed
+1
-4
-3
+1
-4
| --- src/search.c | ||
| +++ src/search.c | ||
| @@ -189,11 +189,11 @@ | ||
| 189 | 189 | int iBest; |
| 190 | 190 | char fAll = NULL != find_option("all", "a", 0); /* If set, do not lop |
| 191 | 191 | off the end of the |
| 192 | 192 | results. */ |
| 193 | 193 | char const * zLimit = find_option("limit","n",1); |
| 194 | - int const nLimit = zLimit ? atoi(zLimit) : 0; /* Max number of matching | |
| 194 | + int const nLimit = zLimit ? atoi(zLimit) : -20; /* Max number of matching | |
| 195 | 195 | lines/entries to list */ |
| 196 | 196 | |
| 197 | 197 | db_must_be_within_tree(); |
| 198 | 198 | if( g.argc<2 ) return; |
| 199 | 199 | blob_init(&pattern, g.argv[2], -1); |
| @@ -220,13 +220,10 @@ | ||
| 220 | 220 | "WHERE 1 ", -1); |
| 221 | 221 | if(!fAll){ |
| 222 | 222 | blob_appendf(&sql,"AND x>%d ", iBest/3); |
| 223 | 223 | } |
| 224 | 224 | blob_append(&sql, "ORDER BY x DESC, date DESC ", -1); |
| 225 | - if(nLimit>0){ | |
| 226 | - blob_appendf(&sql, "LIMIT %d", nLimit); | |
| 227 | - } | |
| 228 | 225 | db_prepare(&q, blob_str(&sql)); |
| 229 | 226 | blob_reset(&sql); |
| 230 | 227 | print_timeline(&q, nLimit, 0); |
| 231 | 228 | db_finalize(&q); |
| 232 | 229 | } |
| 233 | 230 |
| --- src/search.c | |
| +++ src/search.c | |
| @@ -189,11 +189,11 @@ | |
| 189 | int iBest; |
| 190 | char fAll = NULL != find_option("all", "a", 0); /* If set, do not lop |
| 191 | off the end of the |
| 192 | results. */ |
| 193 | char const * zLimit = find_option("limit","n",1); |
| 194 | int const nLimit = zLimit ? atoi(zLimit) : 0; /* Max number of matching |
| 195 | lines/entries to list */ |
| 196 | |
| 197 | db_must_be_within_tree(); |
| 198 | if( g.argc<2 ) return; |
| 199 | blob_init(&pattern, g.argv[2], -1); |
| @@ -220,13 +220,10 @@ | |
| 220 | "WHERE 1 ", -1); |
| 221 | if(!fAll){ |
| 222 | blob_appendf(&sql,"AND x>%d ", iBest/3); |
| 223 | } |
| 224 | blob_append(&sql, "ORDER BY x DESC, date DESC ", -1); |
| 225 | if(nLimit>0){ |
| 226 | blob_appendf(&sql, "LIMIT %d", nLimit); |
| 227 | } |
| 228 | db_prepare(&q, blob_str(&sql)); |
| 229 | blob_reset(&sql); |
| 230 | print_timeline(&q, nLimit, 0); |
| 231 | db_finalize(&q); |
| 232 | } |
| 233 |
| --- src/search.c | |
| +++ src/search.c | |
| @@ -189,11 +189,11 @@ | |
| 189 | int iBest; |
| 190 | char fAll = NULL != find_option("all", "a", 0); /* If set, do not lop |
| 191 | off the end of the |
| 192 | results. */ |
| 193 | char const * zLimit = find_option("limit","n",1); |
| 194 | int const nLimit = zLimit ? atoi(zLimit) : -20; /* Max number of matching |
| 195 | lines/entries to list */ |
| 196 | |
| 197 | db_must_be_within_tree(); |
| 198 | if( g.argc<2 ) return; |
| 199 | blob_init(&pattern, g.argv[2], -1); |
| @@ -220,13 +220,10 @@ | |
| 220 | "WHERE 1 ", -1); |
| 221 | if(!fAll){ |
| 222 | blob_appendf(&sql,"AND x>%d ", iBest/3); |
| 223 | } |
| 224 | blob_append(&sql, "ORDER BY x DESC, date DESC ", -1); |
| 225 | db_prepare(&q, blob_str(&sql)); |
| 226 | blob_reset(&sql); |
| 227 | print_timeline(&q, nLimit, 0); |
| 228 | db_finalize(&q); |
| 229 | } |
| 230 |
-3
| --- src/tag.c | ||
| +++ src/tag.c | ||
| @@ -467,13 +467,10 @@ | ||
| 467 | 467 | " WHERE tagtype>0 AND tagid=%d" |
| 468 | 468 | ")" |
| 469 | 469 | " ORDER BY event.mtime DESC", |
| 470 | 470 | timeline_query_for_tty(), zType, tagid |
| 471 | 471 | ); |
| 472 | - if(nFindLimit>0){ | |
| 473 | - blob_appendf(&sql, " LIMIT %d", nFindLimit); | |
| 474 | - } | |
| 475 | 472 | db_prepare(&q, "%s", blob_str(&sql)); |
| 476 | 473 | blob_reset(&sql); |
| 477 | 474 | print_timeline(&q, nFindLimit, 0); |
| 478 | 475 | db_finalize(&q); |
| 479 | 476 | } |
| 480 | 477 |
| --- src/tag.c | |
| +++ src/tag.c | |
| @@ -467,13 +467,10 @@ | |
| 467 | " WHERE tagtype>0 AND tagid=%d" |
| 468 | ")" |
| 469 | " ORDER BY event.mtime DESC", |
| 470 | timeline_query_for_tty(), zType, tagid |
| 471 | ); |
| 472 | if(nFindLimit>0){ |
| 473 | blob_appendf(&sql, " LIMIT %d", nFindLimit); |
| 474 | } |
| 475 | db_prepare(&q, "%s", blob_str(&sql)); |
| 476 | blob_reset(&sql); |
| 477 | print_timeline(&q, nFindLimit, 0); |
| 478 | db_finalize(&q); |
| 479 | } |
| 480 |
| --- src/tag.c | |
| +++ src/tag.c | |
| @@ -467,13 +467,10 @@ | |
| 467 | " WHERE tagtype>0 AND tagid=%d" |
| 468 | ")" |
| 469 | " ORDER BY event.mtime DESC", |
| 470 | timeline_query_for_tty(), zType, tagid |
| 471 | ); |
| 472 | db_prepare(&q, "%s", blob_str(&sql)); |
| 473 | blob_reset(&sql); |
| 474 | print_timeline(&q, nFindLimit, 0); |
| 475 | db_finalize(&q); |
| 476 | } |
| 477 |