no bug - Bumping Firefox l10n changesets r=release a=l10n-bump DONTBUILD CLOSED TREE
[gecko.git] / mozglue / android / nsGeckoUtils.cpp
blob834e2d05fc85f55e4b7b6fd41af0eabbad8c991d
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 <string.h>
10 #include "APKOpen.h"
12 extern "C" __attribute__((visibility("default"))) void MOZ_JNICALL
13 Java_org_mozilla_gecko_mozglue_GeckoLoader_putenv(JNIEnv* jenv, jclass,
14 jstring map) {
15 const char* str;
16 // XXX: java doesn't give us true UTF8, we should figure out something
17 // better to do here
18 str = jenv->GetStringUTFChars(map, nullptr);
19 if (str == nullptr) return;
20 putenv(strdup(str));
21 jenv->ReleaseStringUTFChars(map, str);