From 716df24211de61bc0bbb831a45ae98fd4e09f846 Mon Sep 17 00:00:00 2001 From: Stephen Heumann Date: Fri, 19 Apr 2019 21:32:20 -0500 Subject: [PATCH] Restore ability to use a blank query to show all disks. This was broken by the change to parenthesize the query. Now that is done only when the query is not blank. --- disksearch.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/disksearch.c b/disksearch.c index dfab703..5924eb5 100644 --- a/disksearch.c +++ b/disksearch.c @@ -79,13 +79,15 @@ void DoSearch(boolean getMore) { asprintf(&searchURL, "http://archive.org/advancedsearch.php?" - "q=emulator%%3A%s%%20(%s)" + "q=emulator%%3A%s%s%s%s" "&fl%%5B%%5D=identifier&fl%%5B%%5D=title" "&fl%%5B%%5D=emulator_ext" "&sort%%5B%%5D=titleSorter+asc" "&rows=%i&page=%i&output=json", gsDisksOnly ? "apple2gs" : "apple2%2A", + queryString[0] != '\0' ? "%20(" : "", queryString, + queryString[0] != '\0' ? ")" : "", PAGE_SIZE, pageNum + 1); if (searchURL == NULL) {