Skip to content

Commit d0b9c34

Browse files
bnoordhuissam-github
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 <jasnell@gmail.com> Reviewed-By: Sam Roberts <vieuxtech@gmail.com>
1 parent ce10b06 commit d0b9c34

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