mirror of https://github.com/macssh/macssh.git
Remove getenv()
This commit is contained in:
parent
19f2abd166
commit
0782520773
|
@ -137,20 +137,6 @@ char username[256];
|
|||
|
||||
static char gmessage[512];
|
||||
|
||||
static char *envp[] = {
|
||||
"HOME",
|
||||
"LOGNAME",
|
||||
"TERM",
|
||||
"DISPLAY"
|
||||
};
|
||||
|
||||
enum {
|
||||
kEnvHome = 0,
|
||||
kEnvLogName,
|
||||
kEnvTerm,
|
||||
kEnvDisplay
|
||||
};
|
||||
|
||||
struct CachedPass {
|
||||
struct CachedPass *link;
|
||||
lshcontext *context;
|
||||
|
@ -163,25 +149,6 @@ struct CachedPass *gcachedpass = NULL;
|
|||
int gcachepasscount = 0;
|
||||
int gcachepassdelay = 120; /* 2 minutes */
|
||||
|
||||
/*
|
||||
* getenv
|
||||
*/
|
||||
|
||||
char *getenv(const char *var)
|
||||
{
|
||||
int i;
|
||||
|
||||
lshcontext *context = (lshcontext *)pthread_getspecific(ssh2threadkey);
|
||||
if ( context ) {
|
||||
for ( i = 0; i < sizeof(envp) / sizeof(char *); i++ ) {
|
||||
if ( strcmp( var, envp[i] ) == 0 ) {
|
||||
return context->_envv[i];
|
||||
}
|
||||
}
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/*
|
||||
* openlog
|
||||
*/
|
||||
|
|
|
@ -64,7 +64,6 @@ typedef struct lshcontext {
|
|||
int _verbosing;
|
||||
int _debugging;
|
||||
|
||||
char *_envv[4]; // "HOME", "LOGNAME", "TERM", "DISPLAY"
|
||||
char _term[64]; // home and logname never change
|
||||
char _display[64]; // home and logname never change
|
||||
char _kpassword[64];
|
||||
|
|
Loading…
Reference in New Issue