summaryrefslogtreecommitdiffstats
path: root/winsup/cygwin/path.cc
diff options
context:
space:
mode:
authorCorinna Vinschen <corinna@vinschen.de>2006-02-05 18:18:02 +0000
committerCorinna Vinschen <corinna@vinschen.de>2006-02-05 18:18:02 +0000
commitfbae2bf8641db16778ddd4348b6cb7a1115d5cca (patch)
tree0a084553b7593bacab3a50af33a1b073f83318aa /winsup/cygwin/path.cc
parent0913522dbd42e068bc737e7a32d1a8015a1e7c84 (diff)
downloadcygnal-fbae2bf8641db16778ddd4348b6cb7a1115d5cca.tar.gz
cygnal-fbae2bf8641db16778ddd4348b6cb7a1115d5cca.tar.bz2
cygnal-fbae2bf8641db16778ddd4348b6cb7a1115d5cca.zip
* environ.cc (struct parse_thing): Add transparent_exe option.
* fhandler_disk_file.cc (fhandler_disk_file::link): Accomodate transparent_exe option. Add .exe suffix for links to executable files, if transparent_exe is set. * fhandler_process.cc (fhandler_process::fill_filebuf): Remove .exe suffix if transparent_exe option is set. * path.cc (symlink_worker): Accomodate transparent_exe option. (realpath): Don't tack on .exe suffix if transparent_exe is set. * syscalls.cc (transparent_exe): New global variable. (unlink): Accomodate transparent_exe option. (open): Ditto. (link): Ditto. (rename): Ditto. Maybe add .exe suffix when renaming executable files. (pathconf): Accomodate transparent_exe option. * winsup.h: Declare transparent_exe.
Diffstat (limited to 'winsup/cygwin/path.cc')
-rw-r--r--winsup/cygwin/path.cc16
1 files changed, 11 insertions, 5 deletions
diff --git a/winsup/cygwin/path.cc b/winsup/cygwin/path.cc
index 45dc57947..4029ec5eb 100644
--- a/winsup/cygwin/path.cc
+++ b/winsup/cygwin/path.cc
@@ -2675,6 +2675,8 @@ int
symlink_worker (const char *oldpath, const char *newpath, bool use_winsym,
bool isdevice)
{
+ extern suffix_info stat_suffixes[];
+
HANDLE h;
int res = -1;
path_conv win32_path, win32_oldpath;
@@ -2704,7 +2706,8 @@ symlink_worker (const char *oldpath, const char *newpath, bool use_winsym,
goto done;
}
- win32_path.check (newpath, PC_SYM_NOFOLLOW);
+ win32_path.check (newpath, PC_SYM_NOFOLLOW,
+ transparent_exe ? stat_suffixes : NULL);
if (use_winsym && !win32_path.exists ())
{
strcpy (from, newpath);
@@ -2753,7 +2756,8 @@ symlink_worker (const char *oldpath, const char *newpath, bool use_winsym,
ITEMIDLIST field. */
if (GetFileAttributes (reloldpath) == INVALID_FILE_ATTRIBUTES)
{
- win32_oldpath.check (oldpath, PC_SYM_NOFOLLOW);
+ win32_oldpath.check (oldpath, PC_SYM_NOFOLLOW,
+ transparent_exe ? stat_suffixes : NULL);
if (win32_oldpath.error != ENOENT)
strcpy (use_winsym ? reloldpath : w32oldpath, win32_oldpath);
}
@@ -2761,7 +2765,8 @@ symlink_worker (const char *oldpath, const char *newpath, bool use_winsym,
strcpy (w32oldpath, reloldpath);
if (use_winsym)
{
- win32_oldpath.check (oldpath, PC_SYM_NOFOLLOW);
+ win32_oldpath.check (oldpath, PC_SYM_NOFOLLOW,
+ transparent_exe ? stat_suffixes : NULL);
strcpy (w32oldpath, win32_oldpath);
}
if (cp)
@@ -2772,7 +2777,8 @@ symlink_worker (const char *oldpath, const char *newpath, bool use_winsym,
}
else
{
- win32_oldpath.check (oldpath, PC_SYM_NOFOLLOW);
+ win32_oldpath.check (oldpath, PC_SYM_NOFOLLOW,
+ transparent_exe ? stat_suffixes : NULL);
strcpy (w32oldpath, win32_oldpath);
}
create_how = CREATE_NEW;
@@ -3723,7 +3729,7 @@ realpath (const char *path, char *resolved)
{
/* Check for the suffix being tacked on. */
int tack_on = 0;
- if (real_path.known_suffix)
+ if (!transparent_exe && real_path.known_suffix)
{
char *c = strrchr (real_path.normalized_path, '.');
if (!c || !strcasematch (c, real_path.known_suffix))