2
0
mirror of https://github.com/boostorg/build.git synced 2026-02-16 01:12:13 +00:00
Files
build/jam_src/pwd.c
Vladimir Prus 0667999e30 Try to eliminate short paths on windows, at least in some contexts. They
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]
2003-05-15 13:07:09 +00:00

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
}
}