summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordkf <donal.k.fellows@manchester.ac.uk>2009-08-02 12:08:16 (GMT)
committerdkf <donal.k.fellows@manchester.ac.uk>2009-08-02 12:08:16 (GMT)
commitcaf9f82c8c57615ac532064b2eb0c7649ea7eb40 (patch)
treefc1b9ef4b1a8267263d395626b6d210ae0f48a27
parentad16cb700076b09c515d59baee67ff5e235326eb (diff)
downloadtcl-caf9f82c8c57615ac532064b2eb0c7649ea7eb40.zip
tcl-caf9f82c8c57615ac532064b2eb0c7649ea7eb40.tar.gz
tcl-caf9f82c8c57615ac532064b2eb0c7649ea7eb40.tar.bz2
Stop calling endpwent() and endgrent(); unneeded. [Bug 1942222]
-rw-r--r--ChangeLog24
-rw-r--r--unix/tclUnixFCmd.c8
-rw-r--r--unix/tclUnixFile.c6
3 files changed, 20 insertions, 18 deletions
diff --git a/ChangeLog b/ChangeLog
index eb400b1..1d3f768 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,16 +1,24 @@
+2009-08-02 Donal K. Fellows <dkf@users.sf.net>
+
+ * unix/tclUnixFCmd.c (GetOwnerAttribute, SetOwnerAttribute)
+ (GetGroupAttribute, SetGroupAttribute): [Bug 1942222]: Stop calling
+ * unix/tclUnixFile.c (TclpGetUserHome): endpwent() and endgrent();
+ they've been unnecessary for ages.
+
2009-08-02 Jan Nijtmans <nijtmans@users.sf.net>
- * win/tclWin32Dll.c eliminate TclWinResetInterfaceEncodings, because
- * win/tclWinInit.c it does exactly the same as TclWinEncodingsCleanup,
- * win/tclWinInt.h make sure that tclWinProcs and tclWinTCharEncoding
- are always set and reset concurrently.
- * win/tclWinFCmd.c: correct check for win95
+ * win/tclWin32Dll.c: Eliminate TclWinResetInterfaceEncodings, since it
+ * win/tclWinInit.c: does exactly the same as TclWinEncodingsCleanup,
+ * win/tclWinInt.h: make sure that tclWinProcs and
+ tclWinTCharEncoding are always set and reset
+ concurrently.
+ * win/tclWinFCmd.c: Correct check for win95
2009-07-31 Don Porter <dgp@users.sourceforge.net>
- * generic/tclStringObj.c: Corrected failure to grow buffer
- * tests/format.test: when format spec request large width
- floating point values. Thanks to Clemens Misch. [Bug 2830354]
+ * generic/tclStringObj.c: [Bug 2830354]: Corrected failure to
+ * tests/format.test: grow buffer when format spec request
+ large width floating point values. Thanks to Clemens Misch.
2009-07-26 Donal K. Fellows <dkf@users.sf.net>
diff --git a/unix/tclUnixFCmd.c b/unix/tclUnixFCmd.c
index 75fc727..e450589 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.72 2009/02/03 23:10:57 nijtmans Exp $
+ * RCS: @(#) $Id: tclUnixFCmd.c,v 1.73 2009/08/02 12:08:17 dkf Exp $
*
* Portions of this code were derived from NetBSD source code which has the
* following copyright notice:
@@ -1341,7 +1341,6 @@ GetGroupAttribute(
*attributePtrPtr = Tcl_NewStringObj(utf, -1);
Tcl_DStringFree(&ds);
}
- endgrent();
return TCL_OK;
}
@@ -1396,7 +1395,6 @@ GetOwnerAttribute(
*attributePtrPtr = Tcl_NewStringObj(utf, Tcl_DStringLength(&ds));
Tcl_DStringFree(&ds);
}
- endpwent();
return TCL_OK;
}
@@ -1483,7 +1481,6 @@ SetGroupAttribute(
Tcl_DStringFree(&ds);
if (groupPtr == NULL) {
- endgrent();
if (interp != NULL) {
Tcl_AppendResult(interp, "could not set group for file \"",
TclGetString(fileName), "\": group \"", string,
@@ -1497,7 +1494,6 @@ SetGroupAttribute(
native = Tcl_FSGetNativePath(fileName);
result = chown(native, (uid_t) -1, (gid_t) gid); /* INTL: Native. */
- endgrent();
if (result != 0) {
if (interp != NULL) {
Tcl_AppendResult(interp, "could not set group for file \"",
@@ -1545,7 +1541,7 @@ SetOwnerAttribute(
string = Tcl_GetStringFromObj(attributePtr, &length);
native = Tcl_UtfToExternalDString(NULL, string, length, &ds);
- pwPtr = TclpGetPwNam(native); /* INTL: Native. */
+ pwPtr = TclpGetPwNam(native); /* INTL: Native. */
Tcl_DStringFree(&ds);
if (pwPtr == NULL) {
diff --git a/unix/tclUnixFile.c b/unix/tclUnixFile.c
index 8eabbbb..c8ac03a 100644
--- a/unix/tclUnixFile.c
+++ b/unix/tclUnixFile.c
@@ -9,7 +9,7 @@
* See the file "license.terms" for information on usage and redistribution of
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclUnixFile.c,v 1.54 2009/02/03 23:10:57 nijtmans Exp $
+ * RCS: @(#) $Id: tclUnixFile.c,v 1.55 2009/08/02 12:08:17 dkf Exp $
*/
#include "tclInt.h"
@@ -578,15 +578,13 @@ TclpGetUserHome(
Tcl_DString ds;
const char *native = Tcl_UtfToExternalDString(NULL, name, -1, &ds);
- pwPtr = getpwnam(native); /* INTL: Native. */
+ pwPtr = TclpGetPwNam(native); /* INTL: Native. */
Tcl_DStringFree(&ds);
if (pwPtr == NULL) {
- endpwent();
return NULL;
}
Tcl_ExternalToUtfDString(NULL, pwPtr->pw_dir, -1, bufferPtr);
- endpwent();
return Tcl_DStringValue(bufferPtr);
}