| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 00b9d95 commit 9b8596a
2 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -349,6 +349,7 @@ function preprocessSymlinkDestination(path, type, linkPath) { | |||
| 349 | 349 | // No preprocessing is needed on Unix. | |
| 350 | 350 | return path; | |
| 351 | 351 | } | |
| 352 | + path = '' + path; | ||
| 352 | 353 | if (type === 'junction') { | |
| 353 | 354 | // Junctions paths need to be absolute and \\?\-prefixed. | |
| 354 | 355 | // A relative target is relative to the link's parent directory. | |
@@ -360,7 +361,7 @@ function preprocessSymlinkDestination(path, type, linkPath) { | |||
| 360 | 361 | return pathModule.toNamespacedPath(path); | |
| 361 | 362 | } | |
| 362 | 363 | // Windows symlinks don't tolerate forward slashes. | |
| 363 | - return ('' + path).replace(/\//g, '\\'); | ||
| 364 | + return path.replace(/\//g, '\\'); | ||
| 364 | 365 | } | |
| 365 | 366 | ||
| 366 | 367 | // Constructor for file stats. | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -51,6 +51,10 @@ fs.symlink(linkData, linkPath, common.mustSucceed(() => { | |||
| 51 | 51 | fs.readlink(linkPath, common.mustSucceed((destination) => { | |
| 52 | 52 | assert.strictEqual(destination, linkData); | |
| 53 | 53 | })); | |
| 54 | + | ||
| 55 | + tmpdir.refresh(); | ||
| 56 | + // Fixes: https://github.com/nodejs/node/issues/34514 | ||
| 57 | + fs.symlinkSync(Buffer.from(linkData), linkPath); | ||
| 54 | 58 | })); | |
| 55 | 59 | ||
| 56 | 60 | // Test invalid symlink | |
| Back | FazBrowse Home | New Git URL |
0 commit comments