src/platform_unix.c
changeset 1211 09280603503b
parent 1210 cf758fec0273
child 1213 050ee17c6e99
--- a/src/platform_unix.c	Sun Mar 11 03:39:57 2012 -0400
+++ b/src/platform_unix.c	Sun Mar 11 03:43:07 2012 -0400
@@ -305,44 +305,6 @@
 } /* __PHYSFS_platformRealPath */
 
 
-char *__PHYSFS_platformCurrentDir(void)
-{
-    int allocSize = 64;
-    char *retval = NULL;
-    char *ptr;
-
-    do
-    {
-        allocSize *= 2;
-        ptr = (char *) allocator.Realloc(retval, allocSize);
-        if (ptr == NULL)
-        {
-            if (retval != NULL)
-                allocator.Free(retval);
-            BAIL_MACRO(ERR_OUT_OF_MEMORY, NULL);
-        } /* if */
-
-        retval = ptr;
-        ptr = getcwd(retval, allocSize);
-    } while (ptr == NULL && errno == ERANGE);
-
-    if (ptr == NULL && errno)
-    {
-        /* getcwd() failed , for example current directory not existing... */
-        if (retval != NULL)
-            allocator.Free(retval);
-        BAIL_MACRO(ERR_NO_SUCH_FILE, NULL);
-    } /* if */
-
-    /* try to shrink buffer... */
-    ptr = (char *) allocator.Realloc(retval, strlen(retval) + 1);
-    if (ptr != NULL)
-        retval = ptr;  /* oh well if it failed. */
-
-    return retval;
-} /* __PHYSFS_platformCurrentDir */
-
-
 int __PHYSFS_platformSetDefaultAllocator(PHYSFS_Allocator *a)
 {
     return 0;  /* just use malloc() and friends. */