Source-Changes archive

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

CVS commit: src/dist/nvi/common

Module Name:    src
Committed By:   christos
Date:           Wed Jan 23 18:51:51 UTC 2013

Modified Files:
        src/dist/nvi/common: conv.c

Log Message:
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

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.6 -r1.7 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