Index: src/json_finfo.c ================================================================== --- src/json_finfo.c +++ src/json_finfo.c @@ -36,10 +36,11 @@ char const * zAfter = NULL; char const * zBefore = NULL; int limit = -1; int currentRow = 0; char const * zCheckin = NULL; + char sort = -1; if(!g.perm.Read){ json_set_err(FSL_JSON_E_DENIED,"Requires 'o' privileges."); return NULL; } json_warn( FSL_JSON_W_UNKNOWN, "Achtung: the output of the finfo command is up for change."); @@ -95,16 +96,17 @@ blob_appendf(&sql, " AND ci.uuid='%q'", zU); free(zU); }else{ if( zAfter && *zAfter ){ blob_appendf(&sql, " AND event.mtime>=julianday('%q')", zAfter); + sort = 1; }else if( zBefore && *zBefore ){ blob_appendf(&sql, " AND event.mtime<=julianday('%q')", zBefore); } } - blob_appendf(&sql," ORDER BY event.mtime DESC /*sort*/"); + blob_appendf(&sql," ORDER BY event.mtime %s /*sort*/", (sort>0?"ASC":"DESC")); /*printf("SQL=\n%s\n",blob_str(&sql));*/ db_prepare(&q, "%s", blob_str(&sql)/*extra %s to avoid double-expanding SQL escapes*/); blob_reset(&sql);