summaryrefslogtreecommitdiff
path: root/misc
diff options
context:
space:
mode:
authorBaptiste Daroussin <bapt@FreeBSD.org>2016-05-11 20:32:44 +0000
committerBaptiste Daroussin <bapt@FreeBSD.org>2016-05-11 20:32:44 +0000
commit01682d68b3f95763daa86360c04c31377a9f865a (patch)
tree84734c715d338c2c28a8dc45ee56770da83ddc19 /misc
parentPrevent collision with getline(3) (diff)
Prevent collision with getline(3)
Notes
Notes: svn path=/head/; revision=415029
Diffstat (limited to 'misc')
-rw-r--r--misc/bogosort/files/patch-getlines.c29
-rw-r--r--misc/bogosort/files/patch-getlines.h10
2 files changed, 39 insertions, 0 deletions
diff --git a/misc/bogosort/files/patch-getlines.c b/misc/bogosort/files/patch-getlines.c
new file mode 100644
index 000000000000..d122c2c55226
--- /dev/null
+++ b/misc/bogosort/files/patch-getlines.c
@@ -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;
diff --git a/misc/bogosort/files/patch-getlines.h b/misc/bogosort/files/patch-getlines.h
new file mode 100644
index 000000000000..5bf0b6d38220
--- /dev/null
+++ b/misc/bogosort/files/patch-getlines.h
@@ -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 */