projects
/
gnulib.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Better handling of collision with AIX stpncpy() function.
[gnulib.git]
/
lib
/
getline.c
diff --git
a/lib/getline.c
b/lib/getline.c
index
ccc3b4a
..
896b6bb
100644
(file)
--- a/
lib/getline.c
+++ b/
lib/getline.c
@@
-26,36
+26,33
@@
/* Specification. */
#include "getline.h"
/* Specification. */
#include "getline.h"
-/* The `getdelim' function is only declared if the following symbol
- is defined. */
-#ifndef _GNU_SOURCE
-# define _GNU_SOURCE 1
-#endif
-
#include <stddef.h>
#include <stdio.h>
#include <stddef.h>
#include <stdio.h>
+/* Get ssize_t. */
+#include <sys/types.h>
+
#if defined __GNU_LIBRARY__ && HAVE_GETDELIM
#if defined __GNU_LIBRARY__ && HAVE_GETDELIM
-
in
t
-getline (char **lineptr, size_t *
n
, FILE *stream)
+
ssize_
t
+getline (char **lineptr, size_t *
linesize
, FILE *stream)
{
{
- return getdelim (lineptr,
n
, '\n', stream);
+ return getdelim (lineptr,
linesize
, '\n', stream);
}
#else /* ! have getdelim */
}
#else /* ! have getdelim */
-#
include "getndelim2.c
"
+#
include "getndelim2.h
"
-
in
t
-getline (char **lineptr, size_t *
n
, FILE *stream)
+
ssize_
t
+getline (char **lineptr, size_t *
linesize
, FILE *stream)
{
{
- return getndelim2 (lineptr,
n
, (size_t)(-1), stream, '\n', 0, 0);
+ return getndelim2 (lineptr,
linesize
, (size_t)(-1), stream, '\n', 0, 0);
}
}
-
in
t
-getdelim (char **lineptr, size_t *
n
, int delimiter, FILE *stream)
+
ssize_
t
+getdelim (char **lineptr, size_t *
linesize
, int delimiter, FILE *stream)
{
{
- return getndelim2 (lineptr,
n
, (size_t)(-1), stream, delimiter, 0, 0);
+ return getndelim2 (lineptr,
linesize
, (size_t)(-1), stream, delimiter, 0, 0);
}
#endif
}
#endif