Date: Wed, 11 May 2016 20:32:44 +0000 (UTC) From: Baptiste Daroussin <bapt@FreeBSD.org> To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r415029 - head/misc/bogosort/files Message-ID: <201605112032.u4BKWiiD005885@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: bapt Date: Wed May 11 20:32:44 2016 New Revision: 415029 URL: https://svnweb.freebsd.org/changeset/ports/415029 Log: Prevent collision with getline(3) Added: head/misc/bogosort/files/patch-getlines.c (contents, props changed) head/misc/bogosort/files/patch-getlines.h (contents, props changed) Added: head/misc/bogosort/files/patch-getlines.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/misc/bogosort/files/patch-getlines.c Wed May 11 20:32:44 2016 (r415029) @@ -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; Added: head/misc/bogosort/files/patch-getlines.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/misc/bogosort/files/patch-getlines.h Wed May 11 20:32:44 2016 (r415029) @@ -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 */
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201605112032.u4BKWiiD005885>