Bug 1812780 [wpt PR 38207] - [rsafor] Move to tentative external WPTs, a=testonly
[gecko.git] / mozglue / android / nsGeckoUtils.cpp
blob017353e548eee98accf8686daf8aae60dfaf03a2
1 /* -*- Mode: c++; c-basic-offset: 2; tab-width: 20; indent-tabs-mode: nil; -*-
2 * This Source Code Form is subject to the terms of the Mozilla Public
3 * License, v. 2.0. If a copy of the MPL was not distributed with this
4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
6 #include <jni.h>
8 #include <stdlib.h>
9 #include <fcntl.h>
10 #include "APKOpen.h"
11 #include "Zip.h"
12 #include "mozilla/RefPtr.h"
14 extern "C" __attribute__((visibility("default"))) void MOZ_JNICALL
15 Java_org_mozilla_gecko_mozglue_GeckoLoader_putenv(JNIEnv* jenv, jclass,
16 jstring map) {
17 const char* str;
18 // XXX: java doesn't give us true UTF8, we should figure out something
19 // better to do here
20 str = jenv->GetStringUTFChars(map, nullptr);
21 if (str == nullptr) return;
22 putenv(strdup(str));
23 jenv->ReleaseStringUTFChars(map, str);