GeezerVison is showing github.com — src: fix SplitString to ignore white spaces · nodejs/node@bc09d2f
File tree
Expand file treeCollapse file tree
Open diff view settings
Expand file treeCollapse file tree
Open diff view settings
Collapse file
Copy file name to clipboardExpand all lines: src/util.cc +1Lines changed: 1 addition & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -134,6 +134,7 @@ std::vector<std::string> SplitString(const std::string& in, char delim) { |
134 | 134 | while (in_stream.good()) { |
135 | 135 | std::string item; |
136 | 136 | std::getline(in_stream, item, delim); |
| 137 | + if (item.empty()) continue; |
137 | 138 | out.emplace_back(std::move(item)); |
138 | 139 | } |
139 | 140 | return out; |
|
Collapse file
Copy file name to clipboardExpand all lines: test/parallel/test-cli-node-options.js +2Lines changed: 2 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -14,6 +14,8 @@ tmpdir.refresh(); |
14 | 14 | const printA = require.resolve('../fixtures/printA.js'); |
15 | 15 | expect(`-r ${printA}`, 'A\nB\n'); |
16 | 16 | 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'); |
17 | 19 | expect('--no-deprecation', 'B\n'); |
18 | 20 | expect('--no-warnings', 'B\n'); |
19 | 21 | expect('--no_warnings', 'B\n'); |
|