Skip to content

Commit 2cba585

Browse files
bnoordhuiskrydos
authored andcommitted
src: fix --icu-data-dir= regression
Commit a8734af ("src: make copies of startup environment variables") from two weeks ago introduced a regression in the capturing of the `--icu-data-dir=` switch: it captured the string up to the `=` instead of what comes after it. PR-URL: nodejs#11255 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Sam Roberts <[email protected]>
1 parent 11339cf commit 2cba585

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

src/node.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3742,7 +3742,7 @@ static void ParseArgs(int* argc,
37423742
#endif /* HAVE_OPENSSL */
37433743
#if defined(NODE_HAVE_I18N_SUPPORT)
37443744
} else if (strncmp(arg, "--icu-data-dir=", 15) == 0) {
3745-
icu_data_dir.assign(arg, 15);
3745+
icu_data_dir.assign(arg + 15);
37463746
#endif
37473747
} else if (strcmp(arg, "--expose-internals") == 0 ||
37483748
strcmp(arg, "--expose_internals") == 0) {

test/parallel/test-intl-no-icu-data.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
'use strict';
33
require('../common');
44
const assert = require('assert');
5+
const config = process.binding('config');
56

67
// No-op when ICU case mappings are unavailable.
78
assert.strictEqual('ç'.toLocaleUpperCase('el'), 'ç');
9+
assert.strictEqual(config.icuDataDir, 'test/fixtures/empty/');

0 commit comments

Comments
 (0)