1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
|
-
+
|
/*
* tclUnixFile.c --
*
* This file contains wrappers around UNIX file handling functions.
* These wrappers mask differences between Windows and UNIX.
*
* Copyright (c) 1995 Sun Microsystems, Inc.
*
* 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.4 1998/09/14 18:40:17 stanton Exp $
* RCS: @(#) $Id: tclUnixFile.c,v 1.4.4.1 1999/03/03 00:38:46 stanton Exp $
*/
#include "tclInt.h"
#include "tclPort.h"
/*
* The variable below caches the name of the current working directory
|
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
|
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
|
-
+
-
+
|
Tcl_CreateExitHandler(FreeExecutableName, (ClientData) NULL);
}
}
/*
*----------------------------------------------------------------------
*
* TclGetUserHome --
* TclpGetUserHome --
*
* This function takes the passed in user name and finds the
* corresponding home directory specified in the password file.
*
* Results:
* The result is a pointer to a static string containing
* the new name. If there was an error in processing the
* user name then the return value is NULL. Otherwise the
* result is stored in bufferPtr, and the caller must call
* Tcl_DStringFree(bufferPtr) to free the result.
*
* Side effects:
* Information may be left in bufferPtr.
*
*----------------------------------------------------------------------
*/
char *
TclGetUserHome(name, bufferPtr)
TclpGetUserHome(name, bufferPtr)
char *name; /* User name to use to find home directory. */
Tcl_DString *bufferPtr; /* May be used to hold result. Must not hold
* anything at the time of the call, and need
* not even be initialized. */
{
struct passwd *pwPtr;
|