summaryrefslogtreecommitdiff
path: root/ftp/IglooFTP/files/patch-main.c
blob: 93172e5900d6ebb628e074fe907346d63312d2e2 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
--- main.c.orig	Thu Apr 15 19:05:15 1999
+++ main.c	Fri Feb 10 22:43:48 2006
@@ -20,6 +20,9 @@
 #include <stdlib.h>
 #include <unistd.h>
 #include <string.h>
+#ifdef __FreeBSD__
+#include <floatingpoint.h>
+#endif
 #include "protos.h"
 
 
@@ -100,7 +103,22 @@
   GtkWidget *hbox;
   GtkWidget *vbox1;
   char IS_SPAWNED = FALSE;
+  char *td;
   register int f;
+
+#ifdef __FreeBSD__
+  fpsetmask(0);
+#endif
+  if ((td = getenv("TMPDIR")) != NULL && strlen(td) != 0) {
+    if (td[strlen(td)-1] == '/')
+      strncpy(tmpfile_template, td, strlen(td)-1);
+    else
+      strncpy(tmpfile_template, td, strlen(td));
+  } else {
+    strcpy(tmpfile_template, "/tmp");
+  }
+  strncat(tmpfile_template, "/", sizeof(tmpfile_template));
+  strncat(tmpfile_template, TMPFILE_FILE, sizeof(tmpfile_template));
 
   gtk_set_locale ();
   gtk_init (&argc, &argv);