diff options
| author | nijtmans@users.sourceforge.net <jan.nijtmans> | 2012-03-15 21:14:05 (GMT) |
|---|---|---|
| committer | nijtmans@users.sourceforge.net <jan.nijtmans> | 2012-03-15 21:14:05 (GMT) |
| commit | fe3d883e70f81a1803e98e176ae072cb1748e512 (patch) | |
| tree | 208a77acdb455c105e739d589128c3dd644af53e /win/tclWinFile.c | |
| parent | 23b4ddf7c02459809ab3a8256c02a0362dcf9f88 (diff) | |
| parent | 50df7d58f017fa63b1b1ebc733d1e3cac412fe0d (diff) | |
| download | tcl-fe3d883e70f81a1803e98e176ae072cb1748e512.zip tcl-fe3d883e70f81a1803e98e176ae072cb1748e512.tar.gz tcl-fe3d883e70f81a1803e98e176ae072cb1748e512.tar.bz2 | |
[Bug 3288345] Wrong Tcl_StatBuf used on Cygwin
Diffstat (limited to 'win/tclWinFile.c')
| -rw-r--r-- | win/tclWinFile.c | 62 |
1 files changed, 0 insertions, 62 deletions
diff --git a/win/tclWinFile.c b/win/tclWinFile.c index 6e7b4c2..dcc05bb 100644 --- a/win/tclWinFile.c +++ b/win/tclWinFile.c @@ -1809,27 +1809,10 @@ TclpObjChdir( { int result; const TCHAR *nativePath; -#ifdef __CYGWIN__ - extern int cygwin_conv_to_posix_path(const char *, char *); - char posixPath[MAX_PATH+1]; - const char *path; - Tcl_DString ds; -#endif /* __CYGWIN__ */ nativePath = Tcl_FSGetNativePath(pathPtr); -#ifdef __CYGWIN__ - /* - * Cygwin chdir only groks POSIX path. - */ - - path = Tcl_WinTCharToUtf(nativePath, -1, &ds); - cygwin_conv_to_posix_path(path, posixPath); - result = (chdir(posixPath) == 0 ? 1 : 0); - Tcl_DStringFree(&ds); -#else /* __CYGWIN__ */ result = SetCurrentDirectory(nativePath); -#endif /* __CYGWIN__ */ if (result == 0) { TclWinConvertError(GetLastError()); @@ -1838,51 +1821,6 @@ TclpObjChdir( return 0; } -#ifdef __CYGWIN__ -/* - *--------------------------------------------------------------------------- - * - * TclpReadlink -- - * - * This function replaces the library version of readlink(). - * - * Results: - * The result is a pointer to a string specifying the contents of the - * symbolic link given by 'path', or NULL if the symbolic link could not - * be read. Storage for the result string is allocated in bufferPtr; the - * caller must call Tcl_DStringFree() when the result is no longer - * needed. - * - * Side effects: - * See readlink() documentation. - * - *--------------------------------------------------------------------------- - */ - -char * -TclpReadlink( - const char *path, /* Path of file to readlink (UTF-8). */ - Tcl_DString *linkPtr) /* Uninitialized or free DString filled with - * contents of link (UTF-8). */ -{ - char link[MAXPATHLEN]; - int length; - char *native; - Tcl_DString ds; - - native = Tcl_UtfToExternalDString(NULL, path, -1, &ds); - length = readlink(native, link, sizeof(link)); /* INTL: Native. */ - Tcl_DStringFree(&ds); - - if (length < 0) { - return NULL; - } - - Tcl_ExternalToUtfDString(NULL, link, length, linkPtr); - return Tcl_DStringValue(linkPtr); -} -#endif /* __CYGWIN__ */ - /* *---------------------------------------------------------------------- * |
