Fossil SCM

Fix end-marker handling in "fossil timeline", broken by previous commit [465f8ecd4a]. (That's what the "n+1" in [14104fde04?ln=1818] was meant for, but -1 is always better)

jan.nijtmans 2013-11-13 08:39 trunk
Commit f13ae6b673ca4efd547c2460641b0823562cec10
1 file changed +3 -3
+3 -3
--- src/timeline.c
+++ src/timeline.c
@@ -1823,13 +1823,13 @@
18231823
if( zType && (zType[0]!='a') ){
18241824
blob_appendf(&sql, " AND event.type=%Q ", zType);
18251825
}
18261826
blob_appendf(&sql, " ORDER BY event.mtime DESC");
18271827
if( iOffset>0 ){
1828
- int n2 = (n >= 0) ? n : -n;
1829
- if( n2==0 ) n2 = -1; /* NO LIMIT */
1830
- blob_appendf(&sql, " LIMIT %d OFFSET %d", n2, iOffset);
1828
+ /* Don't handle LIMIT here, otherwise print_timeline()
1829
+ * will not determine the end-marker correctly! */
1830
+ blob_appendf(&sql, " LIMIT -1 OFFSET %d", iOffset);
18311831
}
18321832
db_prepare(&q, blob_str(&sql));
18331833
blob_reset(&sql);
18341834
print_timeline(&q, n, width, verboseFlag);
18351835
db_finalize(&q);
18361836
--- src/timeline.c
+++ src/timeline.c
@@ -1823,13 +1823,13 @@
1823 if( zType && (zType[0]!='a') ){
1824 blob_appendf(&sql, " AND event.type=%Q ", zType);
1825 }
1826 blob_appendf(&sql, " ORDER BY event.mtime DESC");
1827 if( iOffset>0 ){
1828 int n2 = (n >= 0) ? n : -n;
1829 if( n2==0 ) n2 = -1; /* NO LIMIT */
1830 blob_appendf(&sql, " LIMIT %d OFFSET %d", n2, iOffset);
1831 }
1832 db_prepare(&q, blob_str(&sql));
1833 blob_reset(&sql);
1834 print_timeline(&q, n, width, verboseFlag);
1835 db_finalize(&q);
1836
--- src/timeline.c
+++ src/timeline.c
@@ -1823,13 +1823,13 @@
1823 if( zType && (zType[0]!='a') ){
1824 blob_appendf(&sql, " AND event.type=%Q ", zType);
1825 }
1826 blob_appendf(&sql, " ORDER BY event.mtime DESC");
1827 if( iOffset>0 ){
1828 /* Don't handle LIMIT here, otherwise print_timeline()
1829 * will not determine the end-marker correctly! */
1830 blob_appendf(&sql, " LIMIT -1 OFFSET %d", iOffset);
1831 }
1832 db_prepare(&q, blob_str(&sql));
1833 blob_reset(&sql);
1834 print_timeline(&q, n, width, verboseFlag);
1835 db_finalize(&q);
1836

Keyboard Shortcuts

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