From af4b73515c97300a91c4a8ab0b35472eb0a9056a Mon Sep 17 00:00:00 2001 From: feiniks <36756310+feiniks@users.noreply.github.com> Date: Fri, 9 May 2025 14:36:25 +0800 Subject: [PATCH] Get dot from the end of the string (#757) * Get dot from the end of the string * Upgrade ci python --------- Co-authored-by: Heran Yang --- .github/workflows/ci.yml | 2 +- ci/run.py | 2 +- fileserver/fileop.go | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f6cc403..86422d2 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -12,7 +12,7 @@ jobs: fetch-depth: 1 - uses: actions/setup-python@v1 with: - python-version: "3.12.9" + python-version: "3.12.10" - name: install dependencies and test run: | cd $GITHUB_WORKSPACE diff --git a/ci/run.py b/ci/run.py index b385041..0397fdd 100755 --- a/ci/run.py +++ b/ci/run.py @@ -54,7 +54,7 @@ def make_build_env(): _env_add('PATH', join(PREFIX, 'bin')) if on_github_actions(): - _env_add('PYTHONPATH', join(os.environ.get('RUNNER_TOOL_CACHE'), 'Python/3.12.9/x64/lib/python3.12/site-packages')) + _env_add('PYTHONPATH', join(os.environ.get('RUNNER_TOOL_CACHE'), 'Python/3.12.10/x64/lib/python3.12/site-packages')) _env_add('PYTHONPATH', join(PREFIX, 'lib/python3.12/site-packages')) _env_add('PKG_CONFIG_PATH', join(PREFIX, 'lib', 'pkgconfig')) _env_add('PKG_CONFIG_PATH', join(PREFIX, 'lib64', 'pkgconfig')) diff --git a/fileserver/fileop.go b/fileserver/fileop.go index 9e4e163..131f2df 100644 --- a/fileserver/fileop.go +++ b/fileserver/fileop.go @@ -932,7 +932,7 @@ func genUniqueFileName(fileName string, fileList []string) string { var uniqueName string var name string i := 1 - dot := strings.Index(fileName, ".") + dot := strings.LastIndex(fileName, ".") if dot < 0 { name = fileName } else { @@ -2334,7 +2334,7 @@ func genUniqueName(fileName string, entries []*fsmgr.SeafDirent) string { var uniqueName string var name string i := 1 - dot := strings.Index(fileName, ".") + dot := strings.LastIndex(fileName, ".") if dot < 0 { name = fileName } else {