pkgsrc-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

pkg/51792: [patch] editors/nvi-m17n fix iso-2022-jp2 autodetection



>Number:         51792
>Category:       pkg
>Synopsis:       [patch] editors/nvi-m17n fix iso-2022-jp2 autodetection
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    pkg-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sat Jan 07 16:05:00 +0000 2017
>Originator:     Yasuhito FUTATSUKI
>Release:        pkgsrc/editors/nvi-m17n/Makefile Rev 1.53
>Organization:
>Environment:
>Description:
nvi-m17n has feature to detect file encoding. This feature allow override fileencoding setting in .nexrc file or NEXINIT environment. I found a bug that nvi cannot detect iso-2022-jp encoding when the file also satisfy the condition of iso-2022-jp2.

this is not just bug for pkgsrc of nvi-m17n but upstream bug.
(so I report this though I don't use nvi-m17n pkg currently.)
>How-To-Repeat:
create file with iso-2022-jp-2, and then
open with nvi-m17n and save

$ printf '\033$B:y$N2V$,:i$-$^$7$?!#\033(B\n' > sakura.txt
$ env NEXRC='se autodetect=jp+ fileencoding=euc-jp' /usr/pkg/bin/nvi sakura.text

(nvi command)
:w!
:q

then the content of file sakura.txt turn into euc-jp text.
(I don't try for pkg environment actually, sorry.)
>Fix:
apply patch against common/multibyte.c

--- ../common/multibyte.c.orig  2017-01-07 18:04:20.087312000 +0900
+++ ../common/multibyte.c       2017-01-07 18:05:53.585988000 +0900
@@ -1455,7 +1455,7 @@
                        return ename;
 
                for (i = 0; i < maxfunc; i++) {
-                       if (maybe == (1 << i))
+                       if (maybe & (1 << i))
                                return dt->name[i];
                }
        }


Home | Main Index | Thread Index | Old Index