Index: src/timeline.c ================================================================== --- src/timeline.c +++ src/timeline.c @@ -1701,11 +1701,11 @@ zLimit = find_option("count",0,1); } if( zLimit ){ n = atoi(zLimit); }else{ - n = 20; + n = -20; } if( g.argc>=4 ){ k = strlen(g.argv[2]); if( strncmp(g.argv[2],"before",k)==0 ){ mode = 1; @@ -1778,13 +1778,16 @@ } if( zType && (zType[0]!='a') ){ blob_appendf(&sql, " AND event.type=%Q ", zType); } blob_appendf(&sql, " ORDER BY event.mtime DESC"); + if(n>0){ + blob_appendf(&sql, " LIMIT %d", n); + } db_prepare(&q, blob_str(&sql)); blob_reset(&sql); - print_timeline(&q, n, verboseFlag); + print_timeline(&q, n<0?-n:0, verboseFlag); db_finalize(&q); } /* ** This is a version of the "localtime()" function from the standard