Revert r368776:
login(1): when exporting variables check the result of setenv(3) mismatch: the return value upon error is -1, so the code was not doing nothing.
This commit is contained in:
parent
ebb4fcc7cf
commit
a0bed90198
@ -793,7 +793,6 @@ export(const char *s)
|
|||||||
char *p;
|
char *p;
|
||||||
const char **pp;
|
const char **pp;
|
||||||
size_t n;
|
size_t n;
|
||||||
int rv;
|
|
||||||
|
|
||||||
if (strlen(s) > 1024 || (p = strchr(s, '=')) == NULL)
|
if (strlen(s) > 1024 || (p = strchr(s, '=')) == NULL)
|
||||||
return (0);
|
return (0);
|
||||||
@ -805,10 +804,8 @@ export(const char *s)
|
|||||||
return (0);
|
return (0);
|
||||||
}
|
}
|
||||||
*p = '\0';
|
*p = '\0';
|
||||||
rv = setenv(s, p + 1, 1);
|
(void)setenv(s, p + 1, 1);
|
||||||
*p = '=';
|
*p = '=';
|
||||||
if (rv == 1)
|
|
||||||
return (0);
|
|
||||||
return (1);
|
return (1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user