Skip to content

Fix infinite loop when using [ or ] in paths#1176

Open
nielswitte wants to merge 1 commit into
microsoft:masterfrom
nielswitte:master
Open

Fix infinite loop when using [ or ] in paths#1176
nielswitte wants to merge 1 commit into
microsoft:masterfrom
nielswitte:master

Conversation

@nielswitte
Copy link
Copy Markdown

Problem

Using [ and/or ] in a path (directory or filename) will result in an endless loop causing: Maximum call stack size exceeded

Fix

Stop the loop when the matched value is the same as the source value.

Changes

  • node/task.ts — Additional if statement added to check if the new src in sourcesToProcess differs from the original source
  • node/tests/cp.ts — Test added with [ and ] in directory and filename

Fixes

#1166

@nielswitte nielswitte requested review from a team as code owners June 3, 2026 21:05
@nielswitte
Copy link
Copy Markdown
Author

@nielswitte please read the following Contributor License Agreement(CLA). If you agree with the CLA, please reply with the following information.

@microsoft-github-policy-service agree [company="{your company}"]

Options:

  • (default - no company specified) I have sole ownership of intellectual property rights to my Submissions and I am not making Submissions in the course of work for my employer.
@microsoft-github-policy-service agree
  • (when company given) I am making Submissions in the course of work for my employer (or my employer has intellectual property rights in my Submissions by contract or applicable law). I have permission from my employer to make Submissions and enter into this Agreement on behalf of my employer. By signing below, the defined term “You” includes me and my employer.
@microsoft-github-policy-service agree company="Microsoft"

Contributor License Agreement

@microsoft-github-policy-service agree

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant