1 Commits

Author SHA1 Message Date
dependabot[bot]
24605b639e Bump actions/checkout from 4.1.7 to 4.2.2
Bumps [actions/checkout](https://github.com/actions/checkout) from 4.1.7 to 4.2.2.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v4.1.7...v4.2.2)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-10-23 15:47:21 +00:00
4 changed files with 4 additions and 23 deletions

View File

@@ -41,7 +41,7 @@ jobs:
steps:
- name: Checkout repository
uses: actions/checkout@v4.1.7
uses: actions/checkout@v4.2.2
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL

View File

@@ -9,7 +9,7 @@ jobs:
contents: read # for actions/checkout to fetch code
pull-requests: read # for golangci/golangci-lint-action to fetch pull requests
steps:
- uses: actions/checkout@v4.1.7
- uses: actions/checkout@v4.2.2
- name: golangci-lint
uses: golangci/golangci-lint-action@aaa42aa0628b4ae2578232a66b541047968fac86
with:

View File

@@ -5,7 +5,7 @@ jobs:
name: test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4.1.7
- uses: actions/checkout@v4.2.2
- name: Setup go
uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32
with:

21
ftp.go
View File

@@ -11,7 +11,6 @@ import (
"io"
"net"
"net/textproto"
"regexp"
"strconv"
"strings"
"time"
@@ -828,7 +827,7 @@ func (c *ServerConn) CurrentDir() (string, error) {
end := strings.LastIndex(msg, "\"")
if start == -1 || end == -1 {
return "", errors.New("unsupported PWD response format")
return "", errors.New("unsuported PWD response format")
}
return msg[start+1 : end], nil
@@ -1094,24 +1093,6 @@ func (c *ServerConn) Walk(root string) *Walker {
return w
}
// Search returns all the directories matching the search pattern
func (c *ServerConn) Search(pattern string) ([]string, error) {
_, message, err := c.cmd(StatusCommandOK, "SITE SEARCH %s", pattern)
if err != nil {
return nil, err
}
msgs := make([]string, 0)
re := regexp.MustCompile(`^200- (?P<Path>.*) \(.*\).*$`)
for _, msg := range strings.Split(message, "\n") {
if re.MatchString(msg) {
msgs = append(msgs, re.ReplaceAllString(msg, "${Path}"))
}
}
return msgs, nil
}
// NoOp issues a NOOP FTP command.
// NOOP has no effects and is usually used to prevent the remote FTP server to
// close the otherwise idle connection.