[bug #16452] mcedit forgets POSIX newline at end of file



Follow-up Comment #4, bug #16452 (project mc):

mcedit is currently suitable for editing binary files, too. I wouldn't like
to give up this feature. So we had to do something like:

if (the current file looks like a text file) {
    if (edit->size > 0 && get_byte(edit->size) != '\n') {
        if (inputbox("This file does not end with a newline. "
                     "Shall we add it?", YES|NO|CANCEL) == YES) {
            edit_insert_byte(edit->size, '\n');
        }
    }
}


    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?func=detailitem&item_id=16452>

_______________________________________________
  Nachricht geschickt von/durch Savannah
  http://savannah.gnu.org/




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]