Tcl Source Code

Check-in [23aec1435f]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:use cygwin_conv_path() in stead of deprecated cygwin_conv_to_full_posix_path
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | core-8-5-branch
Files: files | file ages | folders
SHA1: 23aec1435f170c91768f86642ab34552883c7f8e
User & Date: jan.nijtmans 2012-06-26 14:29:09
Context
2012-06-26
19:35
fix some gcc 64-bit warnings quoting improvements eliminate unused variable check-in: ef83c30019 user: jan.nijtmans tags: core-8-5-branch
14:31
use cygwin_conv_path() in stead of deprecated cygwin_conv_to_full_posix_path check-in: 0bde6cbf35 user: jan.nijtmans tags: trunk
14:29
use cygwin_conv_path() in stead of deprecated cygwin_conv_to_full_posix_path check-in: 23aec1435f user: jan.nijtmans tags: core-8-5-branch
14:09
use cygwin_conv_path() in stead of deprecated cygwin_conv_to_full_posix_path check-in: bf8c3e8ec6 user: jan.nijtmans tags: core-8-4-branch
2012-06-25
16:19
Repair Claim/Disclaim imbalance check-in: 42530a7e20 user: dgp tags: core-8-5-branch
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to generic/tclEnv.c.

767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
	unsetenv("Path");

	if (value == NULL) {
	    buf = NULL;
	} else {
	    int size;

	    size = cygwin_posix_to_win32_path_list_buf_size(value);
	    buf = alloca(size + 1);
	    cygwin_posix_to_win32_path_list(value, buf);
	}

	SetEnvironmentVariableA(name, buf);
    }
}
#endif /* __CYGWIN__ */








|

|







767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
	unsetenv("Path");

	if (value == NULL) {
	    buf = NULL;
	} else {
	    int size;

	    size = cygwin_conv_path_list(0, value, NULL, 0);
	    buf = alloca(size + 1);
	    cygwin_conv_path_list(0, value, buf, size);
	}

	SetEnvironmentVariableA(name, buf);
    }
}
#endif /* __CYGWIN__ */


Changes to unix/tclUnixFile.c.

38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
TclpFindExecutable(
    CONST char *argv0)		/* The value of the application's argv[0]
				 * (native). */
{
    Tcl_Encoding encoding;
#ifdef __CYGWIN__
    int length;
    char buf[PATH_MAX * TCL_UTF_MAX + 1];
    char name[PATH_MAX * TCL_UTF_MAX + 1];
    GetModuleFileNameW(NULL, name, PATH_MAX);
    WideCharToMultiByte(CP_UTF8, 0, name, -1, buf, PATH_MAX, NULL, NULL);
    cygwin_conv_to_full_posix_path(buf, name);
    length = strlen(name);
    if ((length > 4) && !strcasecmp(name + length - 4, ".exe")) {
	/* Strip '.exe' part. */
	length -= 4;
    }
	encoding = Tcl_GetEncoding(NULL, NULL);
	TclSetObjNameOfExecutable(







|

|
<
|







38
39
40
41
42
43
44
45
46
47

48
49
50
51
52
53
54
55
TclpFindExecutable(
    CONST char *argv0)		/* The value of the application's argv[0]
				 * (native). */
{
    Tcl_Encoding encoding;
#ifdef __CYGWIN__
    int length;
    char buf[PATH_MAX * 2];
    char name[PATH_MAX * TCL_UTF_MAX + 1];
    GetModuleFileNameW(NULL, buf, PATH_MAX);

    cygwin_conv_path(3, buf, name, PATH_MAX);
    length = strlen(name);
    if ((length > 4) && !strcasecmp(name + length - 4, ".exe")) {
	/* Strip '.exe' part. */
	length -= 4;
    }
	encoding = Tcl_GetEncoding(NULL, NULL);
	TclSetObjNameOfExecutable(

Changes to unix/tclUnixPort.h.

22
23
24
25
26
27
28
29
30
31
32
33
34
35
36

#ifndef _TCLUNIXPORT
#define _TCLUNIXPORT

#ifndef MODULE_SCOPE
#define MODULE_SCOPE extern
#endif

/*
 *---------------------------------------------------------------------------
 * The following sets of #includes and #ifdefs are required to get Tcl to
 * compile under the various flavors of unix.
 *---------------------------------------------------------------------------
 */








|







22
23
24
25
26
27
28
29
30
31
32
33
34
35
36

#ifndef _TCLUNIXPORT
#define _TCLUNIXPORT

#ifndef MODULE_SCOPE
#define MODULE_SCOPE extern
#endif

/*
 *---------------------------------------------------------------------------
 * The following sets of #includes and #ifdefs are required to get Tcl to
 * compile under the various flavors of unix.
 *---------------------------------------------------------------------------
 */

50
51
52
53
54
55
56






57
58
59
60
61
62
63
#else
#ifdef NO_DIRENT_H
#   include "../compat/dirent.h"
#else
#   include <dirent.h>
#endif
#endif







#ifdef HAVE_STRUCT_DIRENT64
typedef struct dirent64	Tcl_DirEntry;
#   define TclOSreaddir		readdir64
#else
typedef struct dirent	Tcl_DirEntry;
#   define TclOSreaddir		readdir







>
>
>
>
>
>







50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
#else
#ifdef NO_DIRENT_H
#   include "../compat/dirent.h"
#else
#   include <dirent.h>
#endif
#endif

/*
 *---------------------------------------------------------------------------
 * Parameterize for 64-bit filesystem support.
 *---------------------------------------------------------------------------
 */

#ifdef HAVE_STRUCT_DIRENT64
typedef struct dirent64	Tcl_DirEntry;
#   define TclOSreaddir		readdir64
#else
typedef struct dirent	Tcl_DirEntry;
#   define TclOSreaddir		readdir
84
85
86
87
88
89
90
91

92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
#   define SOCKET unsigned int
#   define WSAEWOULDBLOCK 10035
    DLLIMPORT extern __stdcall int GetModuleHandleExW(unsigned int, const char *, void *);
    DLLIMPORT extern __stdcall int GetModuleFileNameW(void *, const char *, int);
    DLLIMPORT extern __stdcall int WideCharToMultiByte(int, int, const char *, int,
	    const char *, int, const char *, const char *);

    DLLIMPORT extern int cygwin_conv_to_full_posix_path(const char *, char *);

#   define USE_PUTENV 1
#   define USE_PUTENV_FOR_UNSET 1
/* On Cygwin, the environment is imported from the Cygwin DLL. */
#   define environ __cygwin_environ
#   define timezone _timezone
    DLLIMPORT extern char **__cygwin_environ;
    DLLIMPORT extern int cygwin_conv_to_win32_path(const char *, char *);
    DLLIMPORT extern int cygwin_posix_to_win32_path_list_buf_size(char *value);
    DLLIMPORT extern void cygwin_posix_to_win32_path_list(char *buf, char *value);
    MODULE_SCOPE int TclOSstat(const char *name, Tcl_StatBuf *statBuf);
    MODULE_SCOPE int TclOSlstat(const char *name, Tcl_StatBuf *statBuf);
#elif defined(HAVE_STRUCT_STAT64)
#   define TclOSstat		stat64
#   define TclOSlstat		lstat64
#else
#   define TclOSstat		stat







|
>






<
<
<







90
91
92
93
94
95
96
97
98
99
100
101
102
103
104



105
106
107
108
109
110
111
#   define SOCKET unsigned int
#   define WSAEWOULDBLOCK 10035
    DLLIMPORT extern __stdcall int GetModuleHandleExW(unsigned int, const char *, void *);
    DLLIMPORT extern __stdcall int GetModuleFileNameW(void *, const char *, int);
    DLLIMPORT extern __stdcall int WideCharToMultiByte(int, int, const char *, int,
	    const char *, int, const char *, const char *);

    DLLIMPORT extern int cygwin_conv_path(int, const void *, void *, int);
    DLLIMPORT extern int cygwin_conv_path_list(int, const void *, void *, int);
#   define USE_PUTENV 1
#   define USE_PUTENV_FOR_UNSET 1
/* On Cygwin, the environment is imported from the Cygwin DLL. */
#   define environ __cygwin_environ
#   define timezone _timezone
    DLLIMPORT extern char **__cygwin_environ;



    MODULE_SCOPE int TclOSstat(const char *name, Tcl_StatBuf *statBuf);
    MODULE_SCOPE int TclOSlstat(const char *name, Tcl_StatBuf *statBuf);
#elif defined(HAVE_STRUCT_STAT64)
#   define TclOSstat		stat64
#   define TclOSlstat		lstat64
#else
#   define TclOSstat		stat