--- - branch: MAIN date: Wed Jan 23 18:51:51 UTC 2013 files: - new: '1.7' old: '1.6' path: src/dist/nvi/common/conv.c pathrev: src/dist/nvi/common/conv.c@1.7 type: modified id: 20130123T185151Z.64e0b147ee50c24ccd1b54e40c2703a63e6e3cf6 log: "It is ridiculous to truncate files on character conversions without\nwarning and a chance for recovery. This patch sets the handler to\ncopy the character, clear the error and proceed instead of bailing\nout.\n\nTo replicate:\n\t- unset LANG\n\t- Create a file that has ~1000 lines. Put a single bad character\n\t- '\\344' in it, around 2/3rds of the file down. Save it.\n\t- export LANG=en_US.UTF-8\n\t- edit the file. Notice there is no error for input conversion,\n\t since nvi reads the file opportunistically.\n\t- :w Boom, the file is truncated.\n\nAlternatively, you can put that character in the first line of the file,\nand watch the fireworks. If you like to restore the previous behavior\ncompile with -DERROR_ON_CONVERT\n\nXXX: Pullup to 6, 5 etc.\n" module: src subject: 'CVS commit: src/dist/nvi/common' unixtime: '1358967111' user: christos