revert the conversion of each line to a valid multibyte string, as it

doesn't take encodings other than ASCII and Latin-1 into account and
hence isn't accurate enough


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2614 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
This commit is contained in:
David Lawrence Ramsey
2005-06-08 20:12:57 +00:00
parent 01458cd380
commit c7935e20b7
3 changed files with 5 additions and 15 deletions

View File

@@ -77,16 +77,10 @@ filestruct *read_line(char *buf, filestruct *prevnode, bool
fileptr->data = mallocstrcpy(NULL, buf);
#ifndef NANO_SMALL
if (!ISSET(NO_CONVERT)) {
/* If it's a DOS file (CR LF), and file conversion isn't
* disabled, strip the CR part from fileptr->data. */
if (len > 0 && buf[len - 1] == '\r')
fileptr->data[len - 1] = '\0';
/* Make sure fileptr->data is a valid multibyte string. */
fileptr->data = mallocstrassn(fileptr->data,
make_mbstring(fileptr->data));
}
/* If it's a DOS file (CR LF), and file conversion isn't disabled,
* strip the CR part from fileptr->data. */
if (!ISSET(NO_CONVERT) && len > 0 && buf[len - 1] == '\r')
fileptr->data[len - 1] = '\0';
#endif
if (*first_line_ins || fileage == NULL) {