Try to fix HPUX bustage.

This commit is contained in:
brendan%mozilla.org 2003-06-14 00:10:09 +00:00
parent 1758ac34e1
commit 12de161f6f
2 changed files with 8 additions and 2 deletions

View File

@ -2010,7 +2010,7 @@ env_setProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
return JS_FALSE;
name = JS_GetStringBytes(idstr);
value = JS_GetStringBytes(valstr);
#ifdef XP_WIN
#if defined XP_WIN || defined HPUX
{
char *waste = JS_smprintf("%s=%s", name, value);
if (!waste) {
@ -2018,7 +2018,10 @@ env_setProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
return JS_FALSE;
}
rv = putenv(waste);
#ifndef HPUX
/* XXX hpux9 at least still has the bad old non-copying putenv */
free(waste);
#endif
}
#else
rv = setenv(name, value, 1);

View File

@ -372,7 +372,7 @@ env_setProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
return JS_FALSE;
name = JS_GetStringBytes(idstr);
value = JS_GetStringBytes(valstr);
#ifdef XP_WIN
#if defined XP_WIN || defined HPUX
{
char *waste = JS_smprintf("%s=%s", name, value);
if (!waste) {
@ -380,7 +380,10 @@ env_setProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
return JS_FALSE;
}
rv = putenv(waste);
#ifndef HPUX
/* XXX hpux9 at least still has the bad old non-copying putenv */
free(waste);
#endif
}
#else
rv = setenv(name, value, 1);