#endif
#include <stdio.h>
-#include <ctype.h>
#include <stdlib.h>
#ifdef HAVE_STRING_H
# include <string.h>
#ifdef STANDALONE
/* Normally, these functions would be defined by your package. */
# define xmalloc malloc
+# define xfree free
# define xstrdup strdup
/* The function reads a whole line. It reads the line realloc-ing the
/* While there are lines in the file... */
while ((line = read_whole_line (fp)))
{
+ /* Do away with line separators. */
+ int len = strlen (line);
+ if (len && line[len - 1] == '\n')
+ line[--len] = '\0';
+ if (len && line[len - 1] == '\r')
+ line[--len] = '\0';
+
ln ++;
/* Parse the line. */