mirror of
https://github.com/Genymobile/scrcpy.git
synced 2025-08-03 06:39:39 +00:00
Get env in windows correctly
Signed-off-by: Yu-Chen Lin <npes87184@gmail.com>
This commit is contained in:
parent
71db667caf
commit
2639c6a5ca
1 changed files with 6 additions and 0 deletions
|
@ -11,6 +11,7 @@
|
||||||
#include "command.h"
|
#include "command.h"
|
||||||
#include "util/log.h"
|
#include "util/log.h"
|
||||||
#include "util/net.h"
|
#include "util/net.h"
|
||||||
|
#include "util/str_util.h"
|
||||||
|
|
||||||
#define SOCKET_NAME "scrcpy"
|
#define SOCKET_NAME "scrcpy"
|
||||||
#define SERVER_FILENAME "scrcpy-server"
|
#define SERVER_FILENAME "scrcpy-server"
|
||||||
|
@ -20,7 +21,12 @@
|
||||||
|
|
||||||
static const char *
|
static const char *
|
||||||
get_server_path(void) {
|
get_server_path(void) {
|
||||||
|
#ifndef _WIN32
|
||||||
const char *server_path_env = getenv("SCRCPY_SERVER_PATH");
|
const char *server_path_env = getenv("SCRCPY_SERVER_PATH");
|
||||||
|
#else
|
||||||
|
const wchar_t *wide_server_path_env = _wgetenv(L"SCRCPY_SERVER_PATH");
|
||||||
|
char *server_path_env = utf8_from_wide_char(wide_server_path_env);
|
||||||
|
#endif
|
||||||
if (server_path_env) {
|
if (server_path_env) {
|
||||||
LOGD("Using SCRCPY_SERVER_PATH: %s", server_path_env);
|
LOGD("Using SCRCPY_SERVER_PATH: %s", server_path_env);
|
||||||
// if the envvar is set, use it
|
// if the envvar is set, use it
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue