+2007-08-15 Dirk Mueller <dmueller@suse.de> (tiny change)
+ Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
+
+ * libltdl/ltdl.c (parse_dotla_file): Avoid a strlen. When
+ reading .la files, cope with files that are not
+ newline-terminated.
+
2007-08-05 Tilman Koschnick <til@subnetz.org> (tiny change)
* libltdl/m4/libtool.m4 (_LT_COMPILER_PIC, _LT_LANG_CXX_CONFIG)
while (!feof (file))
{
+ line[line_len-2] = '\0';
if (!fgets (line, (int) line_len, file))
{
break;
}
/* Handle the case where we occasionally need to read a line
- that is longer than the initial buffer size. */
- while ((line[LT_STRLEN(line) -1] != '\n') && (!feof (file)))
+ that is longer than the initial buffer size.
+ Behave even if the file contains NUL bytes due to corruption. */
+ while (line[line_len-2] != '\0' && line[line_len-2] != '\n' && !feof (file))
{
line = REALLOC (char, line, line_len *2);
if (!line)
++errors;
goto cleanup;
}
+ line[line_len * 2 - 2] = '\0';
if (!fgets (&line[line_len -1], (int) line_len +1, file))
{
break;