From e3b29f961359b429d41fc368000605efa1e73c4b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Mart=C3=AD?= Date: Wed, 6 Jan 2016 20:48:07 +0100 Subject: [PATCH] Fix regression in prefix/suffix file deletion This partyally reverts ea3c95832ea733bb4e928772772b13638d243032. Fixes #537. --- F-Droid/src/org/fdroid/fdroid/Utils.java | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/F-Droid/src/org/fdroid/fdroid/Utils.java b/F-Droid/src/org/fdroid/fdroid/Utils.java index e69630a5b..a50657da1 100644 --- a/F-Droid/src/org/fdroid/fdroid/Utils.java +++ b/F-Droid/src/org/fdroid/fdroid/Utils.java @@ -662,14 +662,11 @@ public final class Utils { } for (File f : files) { - if (startsWith != null && f.getName().startsWith(startsWith)) { - continue; - } - if (endsWith != null && f.getName().endsWith(endsWith)) { - continue; - } - if (!f.delete()) { - Log.w(TAG, "Couldn't delete cache file " + f); + if ((startsWith != null && f.getName().startsWith(startsWith)) + || (endsWith != null && f.getName().endsWith(endsWith))) { + if (!f.delete()) { + Log.w(TAG, "Couldn't delete cache file " + f); + } } } }