From e43f962ef65839969377c9516689b6c1d5b4b4e6 Mon Sep 17 00:00:00 2001 From: John Bogovic Date: Fri, 19 Apr 2024 12:44:28 -0400 Subject: [PATCH] fix: relativePath regexp --- .../janelia/saalfeldlab/n5/universe/metadata/MetadataUtils.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/org/janelia/saalfeldlab/n5/universe/metadata/MetadataUtils.java b/src/main/java/org/janelia/saalfeldlab/n5/universe/metadata/MetadataUtils.java index c4b6289..e994d4b 100644 --- a/src/main/java/org/janelia/saalfeldlab/n5/universe/metadata/MetadataUtils.java +++ b/src/main/java/org/janelia/saalfeldlab/n5/universe/metadata/MetadataUtils.java @@ -207,7 +207,7 @@ public static String relativePath(final String parent, final String child) { try { final String purl = new N5URI("?" + parent).normalizeGroupPath(); final String curl = new N5URI("?" + child).normalizeGroupPath(); - return new N5URI("?" + curl.replaceFirst(purl, "")).normalizeGroupPath(); + return new N5URI("?" + curl.replaceFirst("^"+purl, "")).normalizeGroupPath(); } catch (final URISyntaxException e) {} return child; }