From 0819dabc69491a3d7e6efc504522a5c67e3146e1 Mon Sep 17 00:00:00 2001 From: Gravit Date: Sun, 24 Feb 2019 20:59:26 +0700 Subject: [PATCH] [FIX] Issue #179 --- .../gravit/launcher/hasher/FileNameMatcher.java | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/libLauncher/src/main/java/ru/gravit/launcher/hasher/FileNameMatcher.java b/libLauncher/src/main/java/ru/gravit/launcher/hasher/FileNameMatcher.java index ae367181..88db90e5 100644 --- a/libLauncher/src/main/java/ru/gravit/launcher/hasher/FileNameMatcher.java +++ b/libLauncher/src/main/java/ru/gravit/launcher/hasher/FileNameMatcher.java @@ -1,6 +1,7 @@ package ru.gravit.launcher.hasher; import ru.gravit.launcher.LauncherAPI; +import ru.gravit.utils.helper.LogHelper; import java.util.Arrays; import java.util.Collection; @@ -10,11 +11,20 @@ public final class FileNameMatcher { private static boolean anyMatch(String[] entries, Collection path) { //return path.stream().anyMatch(e -> Arrays.stream(entries).anyMatch(p -> p.endsWith(e))); - for(String p : path) + for(String e : entries) { - for(String e : entries) + String[] split = e.split("/"); + int index = 0; + for(String p : path) { - if(p.endsWith(e)) return true; + if(index>=split.length) + { + return true; + } + if(!p.equals(split[index])) { + break; + } + index++; } } return false;