Fossil SCM
Fix Older/Newer buttons if sowing timeline before beginning or after end of timeline
Commit
aa867868d8849f33b46d3890a39669a944ad56a5
Parent
9ab7122d6a00c7b…
1 file changed
+6
+6
| --- src/timeline.c | ||
| +++ src/timeline.c | ||
| @@ -1766,16 +1766,22 @@ | ||
| 1766 | 1766 | free(zDate); |
| 1767 | 1767 | } |
| 1768 | 1768 | }else{ |
| 1769 | 1769 | if( zAfter || n==nEntry ){ |
| 1770 | 1770 | zDate = db_text(0, "SELECT min(timestamp) FROM timeline /*scan*/"); |
| 1771 | + if( !zDate || !zDate[0] ){ | |
| 1772 | + zDate = mprintf("%s", zAfter); | |
| 1773 | + } | |
| 1771 | 1774 | timeline_submenu(&url, "Older", "b", zDate, "a"); |
| 1772 | 1775 | zOlderButton = fossil_strdup(url_render(&url, "b", zDate, "a", 0)); |
| 1773 | 1776 | free(zDate); |
| 1774 | 1777 | } |
| 1775 | 1778 | if( zBefore || (zAfter && n==nEntry) ){ |
| 1776 | 1779 | zDate = db_text(0, "SELECT max(timestamp) FROM timeline /*scan*/"); |
| 1780 | + if( !zDate || !zDate[0] ){ | |
| 1781 | + zDate = mprintf("%s", (zBefore ? zBefore : zAfter)); | |
| 1782 | + } | |
| 1777 | 1783 | timeline_submenu(&url, "Newer", "a", zDate, "b"); |
| 1778 | 1784 | free(zDate); |
| 1779 | 1785 | } |
| 1780 | 1786 | } |
| 1781 | 1787 | if( zType[0]=='a' || zType[0]=='c' ){ |
| 1782 | 1788 |
| --- src/timeline.c | |
| +++ src/timeline.c | |
| @@ -1766,16 +1766,22 @@ | |
| 1766 | free(zDate); |
| 1767 | } |
| 1768 | }else{ |
| 1769 | if( zAfter || n==nEntry ){ |
| 1770 | zDate = db_text(0, "SELECT min(timestamp) FROM timeline /*scan*/"); |
| 1771 | timeline_submenu(&url, "Older", "b", zDate, "a"); |
| 1772 | zOlderButton = fossil_strdup(url_render(&url, "b", zDate, "a", 0)); |
| 1773 | free(zDate); |
| 1774 | } |
| 1775 | if( zBefore || (zAfter && n==nEntry) ){ |
| 1776 | zDate = db_text(0, "SELECT max(timestamp) FROM timeline /*scan*/"); |
| 1777 | timeline_submenu(&url, "Newer", "a", zDate, "b"); |
| 1778 | free(zDate); |
| 1779 | } |
| 1780 | } |
| 1781 | if( zType[0]=='a' || zType[0]=='c' ){ |
| 1782 |
| --- src/timeline.c | |
| +++ src/timeline.c | |
| @@ -1766,16 +1766,22 @@ | |
| 1766 | free(zDate); |
| 1767 | } |
| 1768 | }else{ |
| 1769 | if( zAfter || n==nEntry ){ |
| 1770 | zDate = db_text(0, "SELECT min(timestamp) FROM timeline /*scan*/"); |
| 1771 | if( !zDate || !zDate[0] ){ |
| 1772 | zDate = mprintf("%s", zAfter); |
| 1773 | } |
| 1774 | timeline_submenu(&url, "Older", "b", zDate, "a"); |
| 1775 | zOlderButton = fossil_strdup(url_render(&url, "b", zDate, "a", 0)); |
| 1776 | free(zDate); |
| 1777 | } |
| 1778 | if( zBefore || (zAfter && n==nEntry) ){ |
| 1779 | zDate = db_text(0, "SELECT max(timestamp) FROM timeline /*scan*/"); |
| 1780 | if( !zDate || !zDate[0] ){ |
| 1781 | zDate = mprintf("%s", (zBefore ? zBefore : zAfter)); |
| 1782 | } |
| 1783 | timeline_submenu(&url, "Newer", "a", zDate, "b"); |
| 1784 | free(zDate); |
| 1785 | } |
| 1786 | } |
| 1787 | if( zType[0]=='a' || zType[0]=='c' ){ |
| 1788 |