Browse Source

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: https://github.com/nodejs/node/pull/11255
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Sam Roberts <vieuxtech@gmail.com>
v6
Ben Noordhuis 8 years ago
parent
commit
291b599bba
  1. 2
      src/node.cc
  2. 2
      test/parallel/test-intl-no-icu-data.js

2
src/node.cc

@ -3742,7 +3742,7 @@ static void ParseArgs(int* argc,
#endif /* HAVE_OPENSSL */
#if defined(NODE_HAVE_I18N_SUPPORT)
} else if (strncmp(arg, "--icu-data-dir=", 15) == 0) {
icu_data_dir.assign(arg, 15);
icu_data_dir.assign(arg + 15);
#endif
} else if (strcmp(arg, "--expose-internals") == 0 ||
strcmp(arg, "--expose_internals") == 0) {

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

@ -2,6 +2,8 @@
'use strict';
require('../common');
const assert = require('assert');
const config = process.binding('config');
// No-op when ICU case mappings are unavailable.
assert.strictEqual('ç'.toLocaleUpperCase('el'), 'ç');
assert.strictEqual(config.icuDataDir, 'test/fixtures/empty/');

Loading…
Cancel
Save