+2005-07-25 Guillem Jover <guillem@debian.org>
+
+ * fgetln.c (fgetln): Reindent, remove commented code and translate
+ variable names to english.
+
2005-07-25 Guillem Jover <guillem@debian.org>
* Versions: New file.
fgetln (stream, len)
FILE *stream;
size_t *len;
-
{
char *line=NULL;
- size_t leido = 0;
-
- while (leido == 1) {
- if ((leido = getline (&line, len, stream)) == -1)
- return NULL;
+ size_t nread = 0;
+
+ while (nread == 1) {
+ nread = getline (&line, len, stream);
+ if (nread == -1)
+ return NULL;
}
-// if (*(line+leido) != '\n')
-// if (leido != 0)
- (*len)--; /* get rid of the trailing \0, fgetln
- does not have it */
-// if (leido == 1)
-// leido = getline (&line, len, stream);
+ (*len)--; /* get rid of the trailing \0, fgetln
+ does not have it */
-// printf ("Caracter '%c' - Leido '%d'\n", *(line+leido-1), leido);
return line;
}
#endif
+