Problem: If no NL or CR is found in the first block of a file then the
'fileformat' may be set to "mac". (Issue 77)
Solution: Check if a CR was found. (eswald)
{
for (p = ptr; p < ptr + size; ++p)
{
+ /* Reset the carriage return counter. */
+ if (try_mac)
+ try_mac = 1;
+
if (*p == NL)
{
if (!try_unix
fileformat = EOL_UNIX;
break;
}
+ else if (*p == CAR && try_mac)
+ try_mac++;
}
/* Don't give in to EOL_UNIX if EOL_MAC is more likely */
fileformat = EOL_MAC;
}
}
+ else if (fileformat == EOL_UNKNOWN && try_mac == 1)
+ /* Looking for CR but found no end-of-line markers at
+ * all: use the default format. */
+ fileformat = default_fileformat();
}
/* No NL found: may use Mac format */
static int included_patches[] =
{ /* Add new patch number below this line */
+/**/
+ 635,
/**/
634,
/**/