Source-Changes archive

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

CVS commit: [netbsd-5] src/dist/nvi/common



Module Name:    src
Committed By:   msaitoh
Date:           Sun Jun  9 16:03:04 UTC 2013

Modified Files:
        src/dist/nvi/common [netbsd-5]: conv.c

Log Message:
Pull up following revision(s) (requested by christos in ticket #1845):
        dist/nvi/common/conv.c: revision 1.7
It is ridiculous to truncate files on character conversions without
warning and a chance for recovery. This patch sets the handler to
copy the character, clear the error and proceed instead of bailing
out.
To replicate:
        - unset LANG
        - Create a file that has ~1000 lines. Put a single bad character
        - '\344' in it, around 2/3rds of the file down. Save it.
        - export LANG=en_US.UTF-8
        - edit the file. Notice there is no error for input conversion,
          since nvi reads the file opportunistically.
        - :w Boom, the file is truncated.
Alternatively, you can put that character in the first line of the file,
and watch the fireworks. If you like to restore the previous behavior
compile with -DERROR_ON_CONVERT
XXX: Pullup to 6, 5 etc.


To generate a diff of this commit:
cvs rdiff -u -r1.3.6.2 -r1.3.6.3 src/dist/nvi/common/conv.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.




Home | Main Index | Thread Index | Old Index