diff src/fileio.c @ 15840:734b1928a5aa v8.1.0927

patch 8.1.0927: USE_CR is never defined commit https://github.com/vim/vim/commit/00590740081489db69f43d9f1c0e3f70e29ce6da Author: Bram Moolenaar <Bram@vim.org> Date: Fri Feb 15 21:06:09 2019 +0100 patch 8.1.0927: USE_CR is never defined Problem: USE_CR is never defined. Solution: Remove usage of USE_CR. (Ken Takata, closes https://github.com/vim/vim/issues/3958)
author Bram Moolenaar <Bram@vim.org>
date Fri, 15 Feb 2019 21:15:07 +0100
parents 40336d427dd2
children 7fad90423bd2
line wrap: on
line diff
--- 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 *f
     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 *f
 	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