From 39b54cddb3e35ca6cecae29dc3544094bef0aa33 Mon Sep 17 00:00:00 2001 From: Sebastian Ramacher Date: Tue, 2 May 2017 21:38:30 +0200 Subject: [PATCH] Fix SQL statement Signed-off-by: Sebastian Ramacher --- zathura/database-sqlite.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zathura/database-sqlite.c b/zathura/database-sqlite.c index c72b1cf..4d1b146 100644 --- a/zathura/database-sqlite.c +++ b/zathura/database-sqlite.c @@ -766,7 +766,7 @@ sqlite_get_recent_files(zathura_database_t* db, int max, const char* basepath) static const char SQL_HISTORY_GET[] = "SELECT file FROM fileinfo ORDER BY time DESC LIMIT ?"; static const char SQL_HISTORY_GET_WITH_BASEPATH[] = - "SELECT file FROM fileinfo WHERE file LIKE '?%' ORDER BY time DESC LIMIT ?"; + "SELECT file FROM fileinfo WHERE file LIKE ? || '%' ORDER BY time DESC LIMIT ?"; zathura_sqldatabase_private_t* priv = ZATHURA_SQLDATABASE_GET_PRIVATE(db); sqlite3_stmt* stmt = prepare_statement(priv->session, basepath == NULL ? SQL_HISTORY_GET : SQL_HISTORY_GET_WITH_BASEPATH);