nano

nano with my custom patches
git clone git://bsandro.tech/nano
Log | Files | Refs | README | LICENSE

commit 3705924fc8c48a1c32bd05088aa06a18ff36a72c
parent c596c0c4daaf5eb89d05e0e39e425af44474f27e
Author: David Lawrence Ramsey <pooka109@gmail.com>
Date:   Tue, 19 Apr 2005 20:13:13 +0000

cosmetic fixes


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2480 35c25a1d-7b9e-4130-9fde-d3aeb78583b8

Diffstat:
Msrc/files.c | 4+++-
1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/files.c b/src/files.c @@ -179,7 +179,6 @@ void read_file(FILE *f, const char *filename) /* If it's a *nix file (LF) or a DOS file (CR LF), and file * conversion isn't disabled, handle it! */ if (input == '\n') { - #ifndef NANO_SMALL /* If there's a CR before the LF, set format to DOS if we * currently think this is a *nix file, or to both if we @@ -1278,6 +1277,7 @@ int copy_file(FILE *inn, FILE *out) int retval = 0; assert(inn != NULL && out != NULL); + do { charsread = fread(buf, sizeof(char), BUFSIZ, inn); if (charsread == 0 && ferror(inn)) { @@ -1289,10 +1289,12 @@ int copy_file(FILE *inn, FILE *out) break; } } while (charsread > 0); + if (fclose(inn) == EOF) retval = -1; if (fclose(out) == EOF) retval = -2; + return retval; }