| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 16802c0 commit 68f698c
3 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -207,7 +207,7 @@ bool config_preserve_symlinks = false; | |||
| 207 | 207 | bool config_expose_internals = false; | |
| 208 | 208 | ||
| 209 | 209 | // Set in node.cc by ParseArgs when --redirect-warnings= is used. | |
| 210 | - const char* config_warning_file; | ||
| 210 | + std::string config_warning_file; // NOLINT(runtime/string) | ||
| 211 | 211 | ||
| 212 | 212 | // process-relative uptime base, initialized at start-up | |
| 213 | 213 | static double prog_start_time; | |
@@ -4410,9 +4410,8 @@ void Init(int* argc, | |||
| 4410 | 4410 | if (openssl_config.empty()) | |
| 4411 | 4411 | SafeGetenv("OPENSSL_CONF", &openssl_config); | |
| 4412 | 4412 | ||
| 4413 | - if (auto redirect_warnings = secure_getenv("NODE_REDIRECT_WARNINGS")) { | ||
| 4414 | - config_warning_file = redirect_warnings; | ||
| 4415 | - } | ||
| 4413 | + if (config_warning_file.empty()) | ||
| 4414 | + SafeGetenv("NODE_REDIRECT_WARNINGS", &config_warning_file); | ||
| 4416 | 4415 | ||
| 4417 | 4416 | // Parse a few arguments which are specific to Node. | |
| 4418 | 4417 | int v8_argc; | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -49,11 +49,12 @@ void InitConfig(Local<Object> target, | |||
| 49 | 49 | if (config_expose_internals) | |
| 50 | 50 | READONLY_BOOLEAN_PROPERTY("exposeInternals"); | |
| 51 | 51 | ||
| 52 | - if (config_warning_file != nullptr) { | ||
| 52 | + if (!config_warning_file.empty()) { | ||
| 53 | 53 | Local<String> name = OneByteString(env->isolate(), "warningFile"); | |
| 54 | 54 | Local<String> value = String::NewFromUtf8(env->isolate(), | |
| 55 | - config_warning_file, | ||
| 56 | - v8::NewStringType::kNormal) | ||
| 55 | + config_warning_file.data(), | ||
| 56 | + v8::NewStringType::kNormal, | ||
| 57 | + config_warning_file.size()) | ||
| 57 | 58 | .ToLocalChecked(); | |
| 58 | 59 | target->DefineOwnProperty(env->context(), name, value).FromJust(); | |
| 59 | 60 | } | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -52,7 +52,7 @@ extern bool config_expose_internals; | |||
| 52 | 52 | // Set in node.cc by ParseArgs when --redirect-warnings= is used. | |
| 53 | 53 | // Used to redirect warning output to a file rather than sending | |
| 54 | 54 | // it to stderr. | |
| 55 | - extern const char* config_warning_file; | ||
| 55 | + extern std::string config_warning_file; | ||
| 56 | 56 | ||
| 57 | 57 | // Forward declaration | |
| 58 | 58 | class Environment; | |
| Back | FazBrowse Home | New Git URL |
0 commit comments