aboutsummaryrefslogtreecommitdiffstats
path: root/packages/ctorrent/files/nogetwd.patch
blob: d150521cca88f1aa5f98fb1f2d19bfa366eee5f9 (plain)
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
Index: ctorrent-1.3.4/btfiles.cpp
===================================================================
--- ctorrent-1.3.4.orig/btfiles.cpp	2004-09-08 18:10:51.000000000 -0500
+++ ctorrent-1.3.4/btfiles.cpp	2005-02-10 17:27:55.000000000 -0600
@@ -169,7 +169,7 @@
   DIR *dp;
   BTFILE *pbf;
 
-  if( !getwd(full_cur) ) return -1;
+  if( !getcwd(full_cur, MAXPATHLEN) ) return -1;
 
   if( cur_path ){
     strcpy(fn, full_cur);
@@ -293,7 +293,7 @@
     m_btfhead = pbf;
   }else if( S_IFDIR & sb.st_mode ){
     char wd[MAXPATHLEN];
-    if( !getwd(wd) ) return -1;
+    if( !getcwd(wd, MAXPATHLEN) ) return -1;
     m_directory = new char[strlen(pathname) + 1];
 #ifndef WINDOWS
     if( !m_directory ) return -1;
Index: ctorrent-1.3.4/configure.ac
===================================================================
--- ctorrent-1.3.4.orig/configure.ac	2004-09-08 18:10:51.000000000 -0500
+++ ctorrent-1.3.4/configure.ac	2005-02-10 17:28:03.000000000 -0600
@@ -32,6 +32,6 @@
 AC_FUNC_MEMCMP
 AC_TYPE_SIGNAL
 AC_FUNC_STAT
-AC_CHECK_FUNCS([ftruncate gethostbyname gettimeofday getwd inet_ntoa memchr memmove memset mkdir select socket strchr strerror strncasecmp strstr strtol strnstr])
+AC_CHECK_FUNCS([ftruncate gethostbyname gettimeofday getcwd inet_ntoa memchr memmove memset mkdir select socket strchr strerror strncasecmp strstr strtol strnstr])
 
 AC_OUTPUT(Makefile)