diff options
author | Bram Moolenaar <Bram@vim.org> | 2019-02-15 21:06:09 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2019-02-15 21:06:09 +0100 |
commit | 00590740081489db69f43d9f1c0e3f70e29ce6da (patch) | |
tree | 5200046e5c39885c50b5057cca9110975a629eb5 /src/fileio.c | |
parent | e93e5a504f481bd0dad9c504d5fcf0e5f0dfc6e6 (diff) | |
download | vim-git-00590740081489db69f43d9f1c0e3f70e29ce6da.tar.gz |
patch 8.1.0927: USE_CR is never definedv8.1.0927
Problem: USE_CR is never defined.
Solution: Remove usage of USE_CR. (Ken Takata, closes #3958)
Diffstat (limited to 'src/fileio.c')
-rw-r--r-- | src/fileio.c | 53 |
1 files changed, 1 insertions, 52 deletions
diff --git a/src/fileio.c b/src/fileio.c index f9e18d413..85d2df3bb 100644 --- a/src/fileio.c +++ b/src/fileio.c @@ -5216,14 +5216,12 @@ msg_add_fileformat(int eol_type) return TRUE; } #endif -#ifndef USE_CR if (eol_type == EOL_MAC) { STRCAT(IObuff, shortmess(SHM_TEXT) ? _("[mac]") : _("[mac format]")); return TRUE; } -#endif -#if defined(USE_CRNL) || defined(USE_CR) +#ifdef USE_CRNL if (eol_type == EOL_UNIX) { STRCAT(IObuff, shortmess(SHM_TEXT) ? _("[unix]") : _("[unix format]")); @@ -6359,11 +6357,7 @@ vim_fgets(char_u *buf, int size, FILE *fp) char tbuf[FGETS_SIZE]; buf[size - 2] = NUL; -#ifdef USE_CR - eof = fgets_cr((char *)buf, size, fp); -#else eof = fgets((char *)buf, size, fp); -#endif if (buf[size - 2] != NUL && buf[size - 2] != '\n') { buf[size - 1] = NUL; /* Truncate the line */ @@ -6372,57 +6366,12 @@ vim_fgets(char_u *buf, int size, FILE *fp) do { tbuf[FGETS_SIZE - 2] = NUL; -#ifdef USE_CR - vim_ignoredp = fgets_cr((char *)tbuf, FGETS_SIZE, fp); -#else vim_ignoredp = fgets((char *)tbuf, FGETS_SIZE, fp); -#endif } while (tbuf[FGETS_SIZE - 2] != NUL && tbuf[FGETS_SIZE - 2] != '\n'); } return (eof == NULL); } -#if defined(USE_CR) || defined(PROTO) -/* - * Like vim_fgets(), but accept any line terminator: CR, CR-LF or LF. - * Returns TRUE for end-of-file. - * Only used for the Mac, because it's much slower than vim_fgets(). - */ - int -tag_fgets(char_u *buf, int size, FILE *fp) -{ - int i = 0; - int c; - int eof = FALSE; - - for (;;) - { - c = fgetc(fp); - if (c == EOF) - { - eof = TRUE; - break; - } - if (c == '\r') - { - /* Always store a NL for end-of-line. */ - if (i < size - 1) - buf[i++] = '\n'; - c = fgetc(fp); - if (c != '\n') /* Macintosh format: single CR. */ - ungetc(c, fp); - break; - } - if (i < size - 1) - buf[i++] = c; - if (c == '\n') - break; - } - buf[i] = NUL; - return eof; -} -#endif - /* * rename() only works if both files are on the same file system, this * function will (attempts to?) copy the file across if rename fails -- webb |