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

Accomodate filenames containing spaces in a DCC transfer. #157

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

vjorlikowski
Copy link

Many (most?) IRC clients accomodate receiving files that contain spaces in their names by having quotes surround the file name.

This quick fix allows bitlbee to handle that case.

An alternative implementation option would be to allow selecting either quotes surrounding the filename, or replacing all spaces in the offered file name using underbar characters.

File names containing quotes should probably receive additional processing, in order to ensure the quotes internal to the filename are properly escaped.

This patch, however, allows me to exchange files containing spaces in the names with a colleague who uses XMPP via Adium, with my client being a combination of bitlbee and ERC (under emacs).

@jelmer
Copy link
Member

jelmer commented Aug 22, 2022

For compatibility with clients that don't support quotes, perhaps only add the quotes when strictly necessary?

Copy link
Member

@jelmer jelmer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See inline comment.

@Thaodan
Copy link
Contributor

Thaodan commented Sep 29, 2022

Which client doesn't support quotes? Adding an extra check sounds unnecessary if it is just about quoting a file.

@jelmer
Copy link
Member

jelmer commented Sep 29, 2022

Which client doesn't support quotes? Adding an extra check sounds unnecessary if it is just about quoting a file.

How do you know all clients support quotes? There may be some out there that don't, it's hard to know for sure. Clients clearly have to support lack of quotes as well, or bitlbee wouldn't work with them today.

@vjorlikowski
Copy link
Author

Apologies for the delayed response.
How would I go about detecting a client that doesn't support quotes?

I'm willing to make the change - just not quite sure how to go about it...

@jelmer
Copy link
Member

jelmer commented Nov 8, 2022

Apologies for the delayed response. How would I go about detecting a client that doesn't support quotes?

I'm willing to make the change - just not quite sure how to go about it...

Given the number of clients out there, I think that's almost impossible to test with certainty. Which is why I'd rather be conservative about changing this behaviour by only sending quotes when we need to (because the filename e.g. contains spaces). That means that if a client doesn't support double quotes, at least we only break them when they send files with spaces in the name.

Also, please escape e.g. quotes when quoting.

Copy link
Member

@jelmer jelmer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See earlier comments

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants