[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
CVS commit: [netbsd-6] src/dist/nvi/common
Module Name: src
Committed By: riz
Date: Fri Feb 8 22:34:10 UTC 2013
src/dist/nvi/common [netbsd-6]: conv.c
Pull up following revision(s) (requested by christos in ticket #798):
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
- 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.6 -r220.127.116.11 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.
Main Index |
Thread Index |