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

INI value with trailing slash causes bugs #26977

Closed
wxiaoguang opened this issue Sep 8, 2023 · 2 comments · Fixed by #26995
Closed

INI value with trailing slash causes bugs #26977

wxiaoguang opened this issue Sep 8, 2023 · 2 comments · Fixed by #26995
Assignees
Labels
Milestone

Comments

@wxiaoguang
Copy link
Contributor

eg:

[foo]
key = C:\
xxx = yyy

The current code reads: key = C:\xxx = yyy and can't read xxx

@wxiaoguang wxiaoguang added this to the 1.21.0 milestone Sep 8, 2023
@wxiaoguang wxiaoguang self-assigned this Sep 8, 2023
@silverwind
Copy link
Member

silverwind commented Sep 8, 2023

\ at end of line is common on unix shells for line continuation. I'd argue we should encourage quoting all strings anyways. OTOH, I don't see a valid use case for such line continuation in the configs either, so could drop it.

@wxiaoguang
Copy link
Contributor Author

wxiaoguang commented Sep 8, 2023

The problem is , ini package doesn't encode the \ when writing.

So, in code we SetValue("E:\\"), but we can not read the correct value next time. That's why it is a bug.


And I would also agree to drop the especial \ handling rule for ini reading.

KN4CK3R pushed a commit that referenced this issue Sep 10, 2023
GiteaBot pushed a commit to GiteaBot/gitea that referenced this issue Sep 10, 2023
KN4CK3R pushed a commit that referenced this issue Sep 10, 2023
Backport #26995 by @wxiaoguang

Fix #26977 (a temp fix)

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 26, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants