Skip to content

Commit 62e2ea0

Browse files
bnoordhuisitaloacasas
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: #11255 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Sam Roberts <vieuxtech@gmail.com>
1 parent fde7878 commit 62e2ea0

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
@@ -3692,7 +3692,7 @@ static void ParseArgs(int* argc,
36923692
#endif /* HAVE_OPENSSL */
36933693
#if defined(NODE_HAVE_I18N_SUPPORT)
36943694
} else if (strncmp(arg, "--icu-data-dir=", 15) == 0) {
3695-
icu_data_dir.assign(arg, 15);
3695+
icu_data_dir.assign(arg + 15);
36963696
#endif
36973697
} else if (strcmp(arg, "--expose-internals") == 0 ||
36983698
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)