Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

无法处理文件名中有方括号的文件 #24

Open
uHioVK opened this issue Sep 21, 2024 · 8 comments
Open

无法处理文件名中有方括号的文件 #24

uHioVK opened this issue Sep 21, 2024 · 8 comments

Comments

@uHioVK
Copy link

uHioVK commented Sep 21, 2024

如标题,会直接忽视

@iqiziqi
Copy link
Owner

iqiziqi commented Sep 23, 2024

This issue will be fixed later.

这个问题将会在稍后修复。

@iqiziqi
Copy link
Owner

iqiziqi commented Sep 23, 2024

@uHioVK Do you use Linux or MacOS operating system?

@uHioVK 请问你是否使用的 Linux 或 MacOS 的操作系统?

@uHioVK
Copy link
Author

uHioVK commented Sep 24, 2024

@uHioVK Do you use Linux or MacOS operating system?

@uHioVK 请问你是否使用的 Linux 或 MacOS 的操作系统?

No, I use Windows 11. The binary executable is downloaded from 0.8.0 releases. I also tested building from source and the problem still exists.

@iqiziqi
Copy link
Owner

iqiziqi commented Sep 24, 2024

Which shell are you using? PowerShell, cmd, git-bash or shell of wsl?

你用的是哪个shell? PowerShell、cmd、git-bash还是wsl的shell?

@iqiziqi
Copy link
Owner

iqiziqi commented Sep 24, 2024

I did not reproduce this problem when using powershell and cmd. But I repeated this problem when I was using Linux bash.

我在使用 powershell 和 cmd 时没有复现这个问题。但是我是在使用 Linux bash 时,复现了这个问题。

@uHioVK
Copy link
Author

uHioVK commented Sep 24, 2024

I reproduced it with cmd, powershell, git bash, msys2 bash, wsl bash and directly dragging the ncm file onto the executable.
That may be because I am using a dev build of Windows but I don't really know :(

I also noted that different filnames would cause different behaviors:

  • filenames containing only right square bracket would be processed correctly: "abc].ncm"
  • filenames containing unclosed left brackets would cause an error "Error: Can't resolve the path": "[a[bc.ncm" or "[a][bc.ncm"
  • filenames containing empty closed pairs of brackets would also cause the error above: "a[]bc.ncm"
  • filenames containing filled closed pairs of brackets would be ignored, the same as passing files that does not exist: "a[b]c.ncm"
    Quotation marks are optional, they don't affect the program's behaviors.

To be honest this bug is not really big but still annoying sometimes. I don't know about how Rust handles path strings so whether to fix it is up to you.

@Puqns67
Copy link
Contributor

Puqns67 commented Sep 29, 2024

我的问题分析可见此,这应该就是问题的原因了。

@iqiziqi
Copy link
Owner

iqiziqi commented Sep 29, 2024

Yes, you're right.

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

No branches or pull requests

3 participants