1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-12-20 04:02:27 +00:00

Prevent collision with getline(3)

This commit is contained in:
Baptiste Daroussin 2016-05-11 20:32:44 +00:00
parent 00a96641ea
commit 01682d68b3
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=415029
2 changed files with 39 additions and 0 deletions

View File

@ -0,0 +1,29 @@
--- getlines.c.orig 2002-05-04 20:22:22 UTC
+++ getlines.c
@@ -49,7 +49,7 @@ getlines(FILE *stream)
char **ss = NULL;
/* read all lines available */
- while ((s = getline(stream)) != NULL) {
+ while ((s = get_line(stream)) != NULL) {
if (numlines == allocated) /* make more room if needed */
ss = (char **)xrealloc(ss,
(allocated += LINESTEP) * sizeof (char *));
@@ -81,7 +81,7 @@ getmorelines(FILE *stream, char **lines)
allocated = numlines + 1; /* this is a lie, but it's close enough */
/* read all lines available */
- while ((s = getline(stream)) != NULL) {
+ while ((s = get_line(stream)) != NULL) {
if (numlines == allocated) /* make more room if needed */
ss = (char **)xrealloc(ss,
(allocated += LINESTEP) * sizeof (char *));
@@ -100,7 +100,7 @@ getmorelines(FILE *stream, char **lines)
* line in stream, return NULL on EOF
*/
char *
-getline(FILE *stream)
+get_line(FILE *stream)
{
int c, numchars = 0, allocated = 0;
char *s = NULL;

View File

@ -0,0 +1,10 @@
--- getlines.h.orig 2016-05-11 20:30:38 UTC
+++ getlines.h
@@ -39,6 +39,6 @@ char **getmorelines(FILE *stream, char *
* getline: return a pointer to a newly allocated string containing the next
* line in stream
*/
-char *getline(FILE *stream);
+char *get_line(FILE *stream);
#endif /* GETLINES_H */