Skip to content

Commit

Permalink
Merge pull request #1391 from Caphyon/1390-invalid-regex
Browse files Browse the repository at this point in the history
Invalid regex
  • Loading branch information
mariru27 authored Feb 4, 2025
2 parents adf1f34 + b21024e commit 1e6ef12
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -478,8 +478,9 @@ Function Convert-UnixPathToDos([Parameter(Mandatory = $true)][string] $content)
{
continue
}

$content = $content -replace $path,($path -replace '/','\')
# Escape the backslashes in before using it in -replace.
$escapedPath = [regex]::Escape($path)
$content = $content -replace $escapedPath, ($path -replace '/','\')
}
return $content
}
Expand Down

0 comments on commit 1e6ef12

Please sign in to comment.