summaryrefslogtreecommitdiffstats
path: root/unix/tclUnixFCmd.c
diff options
context:
space:
mode:
authorstanton <stanton>1998-09-28 20:24:18 (GMT)
committerstanton <stanton>1998-09-28 20:24:18 (GMT)
commit94b67f615e361c95e27693c44d54634642ecd81f (patch)
treed270b0a7f036300030b94b96506a44d9327cc12d /unix/tclUnixFCmd.c
parent9995355714bc90faf7c2e345b3d6a1d041447097 (diff)
downloadtcl-94b67f615e361c95e27693c44d54634642ecd81f.zip
tcl-94b67f615e361c95e27693c44d54634642ecd81f.tar.gz
tcl-94b67f615e361c95e27693c44d54634642ecd81f.tar.bz2
fixed stat() and access() usage to use correct routines for wrapper
Diffstat (limited to 'unix/tclUnixFCmd.c')
-rw-r--r--unix/tclUnixFCmd.c26
1 files changed, 10 insertions, 16 deletions
diff --git a/unix/tclUnixFCmd.c b/unix/tclUnixFCmd.c
index cbcab04..3538328 100644
--- a/unix/tclUnixFCmd.c
+++ b/unix/tclUnixFCmd.c
@@ -10,7 +10,7 @@
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclUnixFCmd.c,v 1.1.2.2 1998/09/24 23:59:45 stanton Exp $
+ * RCS: @(#) $Id: tclUnixFCmd.c,v 1.1.2.3 1998/09/28 20:24:20 stanton Exp $
*
* Portions of this code were derived from NetBSD source code which has
* the following copyright notice:
@@ -1065,13 +1065,9 @@ GetGroupAttribute(interp, objIndex, fileName, attributePtrPtr)
{
struct stat statBuf;
struct group *groupPtr;
- Tcl_DString ds;
- CONST char *native, *utf;
int result;
- native = Tcl_UtfToExternalDString(NULL, fileName, -1, &ds);
- result = TclStat(native, &statBuf); /* INTL: Native. */
- Tcl_DStringFree(&ds);
+ result = TclStat(fileName, &statBuf);
if (result != 0) {
Tcl_AppendResult(interp, "could not read \"", fileName, "\": ",
@@ -1083,6 +1079,9 @@ GetGroupAttribute(interp, objIndex, fileName, attributePtrPtr)
if (groupPtr == NULL) {
*attributePtrPtr = Tcl_NewIntObj(statBuf.st_gid);
} else {
+ Tcl_DString ds;
+ CONST char *utf;
+
utf = Tcl_ExternalToUtfDString(NULL, groupPtr->gr_name, -1, &ds);
*attributePtrPtr = Tcl_NewStringObj(utf, -1);
Tcl_DStringFree(&ds);
@@ -1117,13 +1116,9 @@ GetOwnerAttribute(interp, objIndex, fileName, attributePtrPtr)
{
struct stat statBuf;
struct passwd *pwPtr;
- Tcl_DString ds;
- CONST char *native, *utf;
int result;
- native = Tcl_UtfToExternalDString(NULL, fileName, -1, &ds);
- result = TclStat(native, &statBuf); /* INTL: Native. */
- Tcl_DStringFree(&ds);
+ result = TclStat(fileName, &statBuf);
if (result != 0) {
Tcl_AppendResult(interp, "could not read \"", fileName, "\": ",
@@ -1135,6 +1130,9 @@ GetOwnerAttribute(interp, objIndex, fileName, attributePtrPtr)
if (pwPtr == NULL) {
*attributePtrPtr = Tcl_NewIntObj(statBuf.st_uid);
} else {
+ Tcl_DString ds;
+ CONST char *utf;
+
utf = Tcl_ExternalToUtfDString(NULL, pwPtr->pw_name, -1, &ds);
*attributePtrPtr = Tcl_NewStringObj(utf, Tcl_DStringLength(&ds));
Tcl_DStringFree(&ds);
@@ -1169,13 +1167,9 @@ GetPermissionsAttribute(interp, objIndex, fileName, attributePtrPtr)
{
struct stat statBuf;
char returnString[6];
- Tcl_DString ds;
- CONST char *native;
int result;
- native = Tcl_UtfToExternalDString(NULL, fileName, -1, &ds);
- result = TclStat(native, &statBuf); /* INTL: Native. */
- Tcl_DStringFree(&ds);
+ result = TclStat(fileName, &statBuf);
if (result != 0) {
Tcl_AppendResult(interp, "could not read \"", fileName, "\": ",