Package: gftp / 2.0.19-5

01-hurd_do_not_use_PATH_MAX.patch Patch series | download
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
--- gftp-2.0.19.orig/lib/local.c	2007-04-27 00:40:50.000000000 +0000
+++ gftp-2.0.19/lib/local.c	2012-05-05 02:18:49.000000000 +0000
@@ -54,13 +54,23 @@
 static int
 local_getcwd (gftp_request * request)
 {
-  char tempstr[PATH_MAX], *utf8;
+#ifdef __GNU__
+  char *tempstr;
+#else
+  char tempstr[PATH_MAX];
+#endif
+  char *utf8;
   size_t destlen;
   
   if (request->directory != NULL)
     g_free (request->directory);
 
+#ifdef __GNU__
+  tempstr = get_current_dir_name();
+  if (tempstr == NULL)
+#else
   if (getcwd (tempstr, sizeof (tempstr)) == NULL)
+#endif
     {
       request->logging_function (gftp_logging_error, request,
                                  _("Could not get current working directory: %s\n"),
@@ -75,6 +85,9 @@
   else
     request->directory = g_strdup (tempstr);
 
+#ifdef __GNU__
+  free(tempstr);
+#endif
   return (0);
 }
 
--- gftp-2.0.19.orig/lib/gftp.h	2008-03-28 11:44:39.000000000 +0000
+++ gftp-2.0.19/lib/gftp.h	2012-05-05 21:54:38.000000000 +0000
@@ -51,7 +51,9 @@
 #include <netinet/in.h>
 #include <arpa/inet.h>
 #include <glib.h>
+#ifndef __GNU__
 #include <limits.h>
+#endif
 #include <netdb.h>
 #include <stdio.h>
 #include <stdarg.h>