From 02e052d6f0e6d9b2260b59969bf5c4b2fd7c54ea Mon Sep 17 00:00:00 2001 From: native-api Date: Mon, 5 Jan 2026 18:10:46 +0300 Subject: [PATCH] Fix bogus "No other dashes should touch" errors A lazy quantifier doesn't prevent any matches, it only sets the order of trying them. And we are iterating over all possible matches. So if there are two or more XML comments in the file, the regex would eventually match a multitude of them at once, producing subj errors during verification. Not sure if this affects actual patching as well. A possessive quantifier, on the other hand, prevents trying to find any more matches from the same "". --- src/main/java/net/vhati/modmanager/core/ModUtilities.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/net/vhati/modmanager/core/ModUtilities.java b/src/main/java/net/vhati/modmanager/core/ModUtilities.java index 4e4c361..d531e9c 100644 --- a/src/main/java/net/vhati/modmanager/core/ModUtilities.java +++ b/src/main/java/net/vhati/modmanager/core/ModUtilities.java @@ -878,7 +878,7 @@ public static Report validateModXML( String text ) { tmpBuf = srcBuf; srcBuf = dstBuf; dstBuf = tmpBuf; dstBuf.setLength( 0 ); // Comments with long tails or double-dashes. - m = Pattern.compile( "(?s)" ).matcher( srcBuf ); + m = Pattern.compile( "(?s)){1}+" ).matcher( srcBuf ); while ( m.find() ) { if ( m.group( 1 ).length() > 0 || m.group( 3 ).length() > 0 || m.group( 2 ).indexOf( "--" ) != -1 ) { messages.add( new ReportMessage(