aboutsummaryrefslogtreecommitdiffstats
path: root/regenc.h
diff options
context:
space:
mode:
Diffstat (limited to 'regenc.h')
-rw-r--r--regenc.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/regenc.h b/regenc.h
index 09c6da4783..317175f5df 100644
--- a/regenc.h
+++ b/regenc.h
@@ -70,7 +70,7 @@ typedef struct {
#define ONIG_CHECK_NULL_RETURN(p) if (ONIG_IS_NULL(p)) return NULL
#define ONIG_CHECK_NULL_RETURN_VAL(p,val) if (ONIG_IS_NULL(p)) return (val)
-#define enclen(enc,p,e) ONIGENC_MBC_ENC_LEN(enc,p,e)
+#define enclen(enc,p,e) ((enc->max_enc_len == enc->min_enc_len) ? enc->min_enc_len : ONIGENC_MBC_ENC_LEN(enc,p,e))
/* character types bit flag */
#define BIT_CTYPE_NEWLINE (1<< ONIGENC_CTYPE_NEWLINE)