ports/math/gcalctool/files/patch-src_gcalccmd.c
Koop Mast 48e62d9a37 Presenting GNOME 2.30.1 for FreeBSD. The offical release notes for this
release can be found at http://library.gnome.org/misc/release-notes/2.30/ .

This release brings initial PackageKit support, Upower (replaces power
management part of hal), cuse4bsd integration with HAL and cheese, and a
faster Evolution.

Sadly GNOME 2.30.x will be the last release with FreeBSD 6.X support. This
will also be the last of the 2.x releases. The next release will be the
highly-anticipated GNOME 3.0 which will bring with it a new UI experience.

Currently, there are a few bugs with GNOME 2.30 that may be of note for our
users. Be sure to consult the UPGRADING note or the 2.30 upgrade FAQ at
http://www.freebsd.org/gnome/docs/faq230.html for specific upgrading
instructions, and the up-to-date list of known issues.

This release features commits by avl, ahze, bland, marcus, mezz, and myself.

The FreeBSD GNOME Team would like to thank Anders F Bjorklund for doing the
initual packagekit porting.

And the following contributors & testers for there help with this release:
Eric L. Chen
Vladimir Grebenschikov
Sergio de Almeida Lenzi
DomiX
walder
crsd
Kevin Oberman
Michal Varga
Pavel Plesov
Bapt
kevin

and ITetcu for two exp-run

PR:	ports/143852
	ports/145347
	ports/144980
	ports/145830
	ports/145511
2010-05-10 21:19:08 +00:00

92 lines
1.7 KiB
C

--- src/gcalccmd.c.orig 2009-12-08 21:27:37.000000000 -0500
+++ src/gcalccmd.c 2010-01-24 13:38:19.000000000 -0500
@@ -18,16 +18,89 @@
* 02111-1307, USA.
*/
+#include <errno.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/types.h>
+#include <sys/param.h>
#include <time.h>
#include "mp-equation.h"
#define MAXLINE 1024
+#if __FreeBSD_version < 800067
+static ssize_t
+getline (char **lineptr, size_t *n, FILE *stream)
+{
+ char *line, *p;
+ long size, copy;
+
+ if (lineptr == NULL || n == NULL) {
+ errno = EINVAL;
+ return (ssize_t) -1;
+ }
+
+ if (ferror (stream))
+ return (ssize_t) -1;
+
+ /* Make sure we have a line buffer to start with. */
+ if (*lineptr == NULL || *n < 2) /* !seen and no buf yet need 2 chars. */ {
+#ifndef MAX_CANON
+#define MAX_CANON 256
+#endif
+ if (!*lineptr)
+ line = (char *) malloc (MAX_CANON);
+ else
+ line = (char *) realloc (*lineptr, MAX_CANON);
+ if (line == NULL)
+ return (ssize_t) -1;
+ *lineptr = line;
+ *n = MAX_CANON;
+ }
+
+ line = *lineptr;
+ size = *n;
+
+ copy = size;
+ p = line;
+
+ while (1) {
+ long len;
+
+ while (--copy > 0) {
+ int c = getc (stream);
+
+ if (c == EOF)
+ goto lose;
+ else if ((*p++ = c) == '\n')
+ goto win;
+ }
+
+ /* Need to enlarge the line buffer. */
+ len = p - line;
+ size *= 2;
+ line = (char *) realloc (line, size);
+ if (line == NULL)
+ goto lose;
+ *lineptr = line;
+ *n = size;
+ p = line + len;
+ copy = size - len;
+ }
+
+lose:
+ if (p == *lineptr)
+ return (ssize_t) -1;
+
+ /* Return a partial line since we got an error in the middle. */
+win:
+ *p = '\0';
+ return p - *lineptr;
+}
+#endif
+
static void
solve(const char *equation)
{