ssh-config 4.4.1 → 4.4.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "ssh-config",
3
3
  "description": "SSH config parser and stringifier",
4
- "version": "4.4.1",
4
+ "version": "4.4.2",
5
5
  "author": "Chen Yangjian (https://www.cyj.me)",
6
6
  "repository": {
7
7
  "type": "git",
package/src/ssh-config.js CHANGED
@@ -357,6 +357,9 @@ function parse(text) {
357
357
  else if (chr === '\\') {
358
358
  escaped = true;
359
359
  }
360
+ else if (chr === '#' && !quoted) {
361
+ break;
362
+ }
360
363
  else {
361
364
  val += chr;
362
365
  }
@@ -398,13 +401,16 @@ function parse(text) {
398
401
  else if (quoted) {
399
402
  val += chr;
400
403
  }
401
- else if (/[ \t]/.test(chr)) {
404
+ else if (/[ \t=]/.test(chr)) {
402
405
  if (val) {
403
406
  results.push(val);
404
407
  val = '';
405
408
  }
406
409
  // otherwise ignore the space
407
410
  }
411
+ else if (chr === '#') {
412
+ break;
413
+ }
408
414
  else {
409
415
  val += chr;
410
416
  }