2
0
mirror of https://github.com/boostorg/build.git synced 2026-02-17 01:32:12 +00:00
Files
build/jam_src/pwd.c
Vladimir Prus e20a80ccc1 Comeau fixes.
Patch from Larry Evans.


[SVN r24824]
2004-08-30 08:22:02 +00:00

40 lines
661 B
C

#include "jam.h"
#include "lists.h"
#include "newstr.h"
#include "pathsys.h"
#include <limits.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 <limits.h>
#if defined(__COMO__)
#include <linux/limits.h>
#endif
#endif
LIST*
pwd(void)
{
char buffer[PATH_MAX];
if (getcwd(buffer, sizeof(buffer)) == NULL)
{
perror("can not get current directory");
return L0;
}
else
{
#ifdef NT
return list_new(L0, short_path_to_long_path(buffer));
#else
return list_new(L0, newstr(buffer));
#endif
}
}