summaryrefslogtreecommitdiff
path: root/math/gcalctool
diff options
context:
space:
mode:
authorobache <obache>2010-06-17 08:56:46 +0000
committerobache <obache>2010-06-17 08:56:46 +0000
commit8a2585f93884a27e9b05ca6f4e91752ef0757736 (patch)
treea3fc3671d86d796dcf027a3ff6023ab8b85707cc /math/gcalctool
parent1469c0133738088d55f7cf76b27825609081732e (diff)
downloadpkgsrc-8a2585f93884a27e9b05ca6f4e91752ef0757736.tar.gz
Fixes build failure on NetBSD-5.0.2.
Use fgets(3) instead of getline(3).
Diffstat (limited to 'math/gcalctool')
-rw-r--r--math/gcalctool/distinfo3
-rw-r--r--math/gcalctool/patches/patch-aa32
2 files changed, 34 insertions, 1 deletions
diff --git a/math/gcalctool/distinfo b/math/gcalctool/distinfo
index 986cc89e675..e1d476ee654 100644
--- a/math/gcalctool/distinfo
+++ b/math/gcalctool/distinfo
@@ -1,5 +1,6 @@
-$NetBSD: distinfo,v 1.43 2010/06/15 21:09:31 drochner Exp $
+$NetBSD: distinfo,v 1.44 2010/06/17 08:56:46 obache Exp $
SHA1 (gcalctool-5.30.1.tar.bz2) = 9a7f561705e931416ba028f712ef3f16c9b58fee
RMD160 (gcalctool-5.30.1.tar.bz2) = 27122e63ceb2880ca27cf550ab8c55bfd865d169
Size (gcalctool-5.30.1.tar.bz2) = 1125957 bytes
+SHA1 (patch-aa) = dd8311ca98bf93748a904e623af2043e5da6e402
diff --git a/math/gcalctool/patches/patch-aa b/math/gcalctool/patches/patch-aa
new file mode 100644
index 00000000000..3f7471d6501
--- /dev/null
+++ b/math/gcalctool/patches/patch-aa
@@ -0,0 +1,32 @@
+$NetBSD: patch-aa,v 1.15 2010/06/17 08:56:46 obache Exp $
+
+portability fix (no advantage to use getline(3) here)
+ https://bugzilla.gnome.org/show_bug.cgi?id=621863
+
+--- src/gcalccmd.c.orig 2010-04-26 01:14:22.000000000 +0000
++++ src/gcalccmd.c
+@@ -73,7 +73,7 @@ int
+ main(int argc, char **argv)
+ {
+ char *equation;
+- int bytes_read;
++ char *line_read;
+ size_t nbytes = MAXLINE;
+
+ /* Seed random number generator. */
+@@ -82,12 +82,12 @@ main(int argc, char **argv)
+ equation = (char *) malloc(MAXLINE * sizeof(char));
+ while (1) {
+ printf("> ");
+- bytes_read = getline(&equation, &nbytes, stdin);
++ line_read = fgets(equation, nbytes, stdin);
+
+- if (bytes_read >= 0)
++ if (line_read != NULL)
+ str_adjust(equation);
+
+- if (bytes_read < 0 || strcmp(equation, "exit") == 0 || strcmp(equation, "quit") == 0 || strlen(equation) == 0)
++ if (line_read == NULL || strcmp(equation, "exit") == 0 || strcmp(equation, "quit") == 0 || strlen(equation) == 0)
+ break;
+
+ solve(equation);