Skip to content

Commit

Permalink
PR
Browse files Browse the repository at this point in the history
  • Loading branch information
levpachmanov committed Apr 3, 2024
1 parent 0427432 commit 504e0da
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions utils/pythonutils/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -308,10 +308,12 @@ func extractFileNameFromRegexCaptureGroup(pattern *gofrogcmd.CmdOutputPattern) (
if lastSlashIndex == -1 {
return filePath
}
latComponent := filePath[lastSlashIndex+1:]
unescapedComponent, err := url.QueryUnescape(latComponent)
if err != nil {
return latComponent
lastComponent := filePath[lastSlashIndex+1:]
// Unescape the last component, for example 'PyYAML-5.1.2%2Bsp1.tar.gz' -> 'PyYAML-5.1.2+sp1.tar.gz'.
unescapedComponent, _ := url.QueryUnescape(lastComponent)
if unescapedComponent == "" {
// Couldn't escape, will use the raw string
return lastComponent
}
return unescapedComponent
}

0 comments on commit 504e0da

Please sign in to comment.