6 |
|
|
7 |
|
#include "common.h" |
8 |
|
|
9 |
+ |
#ifdef __sun__ |
10 |
+ |
#define getpass getpassphrase |
11 |
+ |
#endif |
12 |
+ |
|
13 |
|
Shells shells[] = { |
14 |
|
{ "sh", "/bin/sh", "/bin/sh", "/bin/sh", "/usr/bin/sh" }, |
15 |
|
{ "csh", "/bin/csh", "/bin/csh", "/bin/csh", "/usr/bin/csh" }, |
207 |
|
|
208 |
|
int setenv(const char *name, const char *value, int overwrite) |
209 |
|
{ |
210 |
< |
char *string = getenv(name); |
210 |
> |
char *string_ = getenv(name); |
211 |
|
|
212 |
< |
if (overwrite || !string) |
212 |
> |
if (overwrite || !string_) |
213 |
|
{ |
214 |
< |
string = string ? realloc(string, strlen(name) + strlen(value) + 2) : malloc(strlen(name) + strlen(value) + 2); |
214 |
> |
char *string = malloc(strlen(name) + strlen(value) + 2); |
215 |
|
|
216 |
|
sprintf(string, "%s=%s", name, value); |
217 |
|
|
218 |
< |
return putenv(string); |
218 |
> |
int value_ = putenv(string); |
219 |
> |
|
220 |
> |
if (!string_) |
221 |
> |
free(string_); |
222 |
> |
|
223 |
> |
return value_; |
224 |
|
} |
225 |
|
|
226 |
|
return 0; |