mirror of
https://github.com/boostorg/build.git
synced 2026-02-16 01:12:13 +00:00
are very annoying --- e.g. you might decide there are several msvc
installation just because you have default location as long name, and there's
vcvars32.bat in PATH, and PATH element uses short name.
* jam_src/pathsys.h
(short_name_to_long_name): New function.
* jam_src/filent.c:
(file_dirscan): Call 'short_name_to_long_name' on argument.
* jam_src/pathunix.c:
(ShortPathToLongPath): Move here from pwd.c, and fix bugs:
'.' and '..' elements were completely broken.
(short_name_to_long_name): Implement here.
[SVN r18401]
34 lines
517 B
C
34 lines
517 B
C
#include "jam.h"
|
|
#include "lists.h"
|
|
#include "newstr.h"
|
|
#include "pathsys.h"
|
|
|
|
#ifdef NT
|
|
#include <direct.h>
|
|
#define PATH_MAX _MAX_PATH
|
|
#else
|
|
#include <unistd.h>
|
|
#endif
|
|
|
|
#include <limits.h>
|
|
|
|
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
|
|
}
|
|
}
|
|
|