diff options
author | Kenneth Heafield <github@kheafield.com> | 2012-10-22 12:07:20 +0100 |
---|---|---|
committer | Kenneth Heafield <github@kheafield.com> | 2012-10-22 12:07:20 +0100 |
commit | 5f98fe5c4f2a2090eeb9d30c030305a70a8347d1 (patch) | |
tree | 9b6002f850e6dea1e3400c6b19bb31a9cdf3067f /jam-files/engine/pwd.c | |
parent | cf9994131993b40be62e90e213b1e11e6b550143 (diff) | |
parent | 21825a09d97c2e0afd20512f306fb25fed55e529 (diff) |
Merge remote branch 'upstream/master'
Conflicts:
Jamroot
bjam
decoder/Jamfile
decoder/cdec.cc
dpmert/Jamfile
jam-files/sanity.jam
klm/lm/Jamfile
klm/util/Jamfile
mira/Jamfile
Diffstat (limited to 'jam-files/engine/pwd.c')
-rw-r--r-- | jam-files/engine/pwd.c | 66 |
1 files changed, 0 insertions, 66 deletions
diff --git a/jam-files/engine/pwd.c b/jam-files/engine/pwd.c deleted file mode 100644 index 90c8eb17..00000000 --- a/jam-files/engine/pwd.c +++ /dev/null @@ -1,66 +0,0 @@ -/* Copyright Vladimir Prus 2002, Rene Rivera 2005. Distributed under the Boost */ -/* Software License, Version 1.0. (See accompanying */ -/* file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) */ - -#include "jam.h" -#include "lists.h" -#include "newstr.h" -#include "pathsys.h" -#include "mem.h" - -#include <limits.h> -#include <errno.h> - -/* MinGW on windows declares PATH_MAX in limits.h */ -#if defined(NT) && ! defined(__GNUC__) -#include <direct.h> -#define PATH_MAX _MAX_PATH -#else -#include <unistd.h> -#if defined(__COMO__) - #include <linux/limits.h> -#endif -#endif - -#ifndef PATH_MAX - #define PATH_MAX 1024 -#endif - -/* The current directory can't change in bjam, so optimize this to cache -** the result. -*/ -static char * pwd_result = NULL; - - -LIST* -pwd(void) -{ - if (!pwd_result) - { - int buffer_size = PATH_MAX; - char * result_buffer = 0; - do - { - char * buffer = BJAM_MALLOC_RAW(buffer_size); - result_buffer = getcwd(buffer,buffer_size); - if (result_buffer) - { - #ifdef NT - pwd_result = short_path_to_long_path(result_buffer); - #else - pwd_result = newstr(result_buffer); - #endif - } - buffer_size *= 2; - BJAM_FREE_RAW(buffer); - } - while (!pwd_result && errno == ERANGE); - - if (!pwd_result) - { - perror("can not get current directory"); - return L0; - } - } - return list_new(L0, pwd_result); -} |