0
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2025-03-03 09:31:22 -05:00

deno2: make getcwd() work on windows

This commit is contained in:
Bert Belder 2018-06-14 14:03:02 +02:00 committed by Ryan Dahl
parent a5f53c000a
commit fb98474239

View file

@ -2,9 +2,14 @@
// All rights reserved. MIT License.
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <string>
#ifdef _WIN32
#include <direct.h>
#else
#include <unistd.h>
#endif
#include "./msg.pb.h"
#include "include/deno.h"
#include "v8/src/base/logging.h"
@ -19,6 +24,7 @@ void MessagesFromJS(Deno* d, const char* channel, deno_buf buf) {
response.set_command(deno::Msg_Command_START);
char cwdbuf[1024];
// TODO(piscisaureus): support unicode on windows.
std::string cwd(getcwd(cwdbuf, sizeof(cwdbuf)));
response.set_start_cwd(cwd);