diff options
author | delphij <delphij@FreeBSD.org> | 2007-11-26 08:58:07 +0000 |
---|---|---|
committer | delphij <delphij@FreeBSD.org> | 2007-11-26 08:58:07 +0000 |
commit | e140286e7508c6c80d949f4972f88f71fd8a5f49 (patch) | |
tree | 892c1c89b1887c2105a5cb3caaff4ca409224aee /contrib/less | |
parent | 07d0aeedba51258d0f6ee2c093e54bf82d6fa2fd (diff) | |
download | FreeBSD-src-e140286e7508c6c80d949f4972f88f71fd8a5f49.zip FreeBSD-src-e140286e7508c6c80d949f4972f88f71fd8a5f49.tar.gz |
Resolve conflicts.
Diffstat (limited to 'contrib/less')
-rw-r--r-- | contrib/less/search.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/contrib/less/search.c b/contrib/less/search.c index 87e2a8c..4fb169c 100644 --- a/contrib/less/search.c +++ b/contrib/less/search.c @@ -120,13 +120,16 @@ cvt_length(len, ops) int len; int ops; { - if (utf_mode && (ops & CVT_TO_LC)) + if (utf_mode) /* - * Converting case can cause a UTF-8 string to increase in length. - * Multiplying by 3 is the worst case. + * Just copying a string in UTF-8 mode can cause it to grow + * in length. + * Six output bytes for one input byte is the worst case + * (and unfortunately is far more than is needed in any + * non-pathological situation, so this is very wasteful). */ - len *= 3; - return len+1; + len *= 6; + return len + 1; } /* |