Skip to content

Commit 9892d6c

Browse files
committed
src: fix SplitString to ignore white spaces
1 parent 4e9dc31 commit 9892d6c

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

src/util.cc

+1
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,7 @@ std::vector<std::string> SplitString(const std::string& in, char delim) {
131131
while (in_stream.good()) {
132132
std::string item;
133133
std::getline(in_stream, item, delim);
134+
if (item.empty()) continue;
134135
out.emplace_back(std::move(item));
135136
}
136137
return out;

test/parallel/test-cli-node-options.js

+2
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ tmpdir.refresh();
1414
const printA = require.resolve('../fixtures/printA.js');
1515
expect(`-r ${printA}`, 'A\nB\n');
1616
expect(`-r ${printA} -r ${printA}`, 'A\nB\n');
17+
expect(` -r ${printA} -r ${printA}`, 'A\nB\n');
18+
expect(` --require ${printA} --require ${printA}`, 'A\nB\n');
1719
expect('--no-deprecation', 'B\n');
1820
expect('--no-warnings', 'B\n');
1921
expect('--no_warnings', 'B\n');

0 commit comments

Comments
 (0)