Fossil SCM

Adapt other callers of print_timeline(), so they show as well whether the limit was reached.

jan.nijtmans 2013-10-22 07:46 UTC timeline_cmd_dash_n_fix
Commit 25d0049045e2caa75d5b22868dc7fec57f702610
2 files changed +1 -4 -3
+1 -4
--- src/search.c
+++ src/search.c
@@ -189,11 +189,11 @@
189189
int iBest;
190190
char fAll = NULL != find_option("all", "a", 0); /* If set, do not lop
191191
off the end of the
192192
results. */
193193
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
195195
lines/entries to list */
196196
197197
db_must_be_within_tree();
198198
if( g.argc<2 ) return;
199199
blob_init(&pattern, g.argv[2], -1);
@@ -220,13 +220,10 @@
220220
"WHERE 1 ", -1);
221221
if(!fAll){
222222
blob_appendf(&sql,"AND x>%d ", iBest/3);
223223
}
224224
blob_append(&sql, "ORDER BY x DESC, date DESC ", -1);
225
- if(nLimit>0){
226
- blob_appendf(&sql, "LIMIT %d", nLimit);
227
- }
228225
db_prepare(&q, blob_str(&sql));
229226
blob_reset(&sql);
230227
print_timeline(&q, nLimit, 0);
231228
db_finalize(&q);
232229
}
233230
--- 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 @@
467467
" WHERE tagtype>0 AND tagid=%d"
468468
")"
469469
" ORDER BY event.mtime DESC",
470470
timeline_query_for_tty(), zType, tagid
471471
);
472
- if(nFindLimit>0){
473
- blob_appendf(&sql, " LIMIT %d", nFindLimit);
474
- }
475472
db_prepare(&q, "%s", blob_str(&sql));
476473
blob_reset(&sql);
477474
print_timeline(&q, nFindLimit, 0);
478475
db_finalize(&q);
479476
}
480477
--- 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

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button