[frameworks/kcodecs] src/probers: [KEncodingProber] Shortcut no longer active group probers

Stefan Brüns <[email protected]>
Newsgroups gmane.comp.kde.cvs
Message-ID <[email protected]>
Git commit fc871a471a550d4ef227be254ecae02def38e159 by Stefan Brüns.
Committed on 26/07/2026 at 17:01.
Pushed by bruns into branch 'master'.

[KEncodingProber] Shortcut no longer active group probers

The filter would be executed even if subordinate probers are inactive,
skip the whole group instead.

M  +4    -0    src/probers/nsMBCSGroupProber.cpp
M  +4    -0    src/probers/nsSBCSGroupProber.cpp

https://invent.kde.org/frameworks/kcodecs/-/commit/fc871a471a550d4ef227be254ecae02def38e159

diff --git a/src/probers/nsMBCSGroupProber.cpp b/src/probers/nsMBCSGroupProber.cpp
index 1bb736d..8115d49 100644
--- a/src/probers/nsMBCSGroupProber.cpp
+++ b/src/probers/nsMBCSGroupProber.cpp
@@ -96,6 +96,10 @@ const char *nsMBCSGroupProber::GetCharSetName()
 
 nsProbingState nsMBCSGroupProber::HandleData(const char *aBuf, unsigned int aLen)
 {
+    if (mState != eDetecting) {
+        return mState;
+    }
+
     // do filtering to reduce load to probers
     char *highbyteBuf;
     char *hptr;
diff --git a/src/probers/nsSBCSGroupProber.cpp b/src/probers/nsSBCSGroupProber.cpp
index 1cdddcd..2dac39d 100644
--- a/src/probers/nsSBCSGroupProber.cpp
+++ b/src/probers/nsSBCSGroupProber.cpp
@@ -61,6 +61,10 @@ const char *nsSBCSGroupProber::GetCharSetName()
 
 nsProbingState nsSBCSGroupProber::HandleData(const char *aBuf, unsigned int aLen)
 {
+    if (mState != eDetecting) {
+        return mState;
+    }
+
     char *newBuf1 = nullptr;
     unsigned int newLen1 = 0;
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.