mirror of
https://github.com/Genymobile/scrcpy.git
synced 2025-04-20 19:45:00 +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 "util/log.h"
|
||||
#include "util/net.h"
|
||||
#include "util/str_util.h"
|
||||
|
||||
#define SOCKET_NAME "scrcpy"
|
||||
#define SERVER_FILENAME "scrcpy-server"
|
||||
|
@ -20,7 +21,12 @@
|
|||
|
||||
static const char *
|
||||
get_server_path(void) {
|
||||
#ifndef _WIN32
|
||||
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) {
|
||||
LOGD("Using SCRCPY_SERVER_PATH: %s", server_path_env);
|
||||
// if the envvar is set, use it
|
||||
|
|
Loading…
Add table
Reference in a new issue