From 8a25be932b7ff5eae3e246c7bdfb851ad6fac943 Mon Sep 17 00:00:00 2001 From: Kalle Olavi Niemitalo Date: Sun, 25 Feb 2007 23:28:02 +0200 Subject: [PATCH] Bug 844, SMB: HTML-encode file names and comments. This probably does the wrong thing with non-ASCII characters. That's just because libsmbclient does not document which charset it uses: it even reads smb.conf, which then may affect the choice. --- src/protocol/smb/smb2.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/protocol/smb/smb2.c b/src/protocol/smb/smb2.c index 3345b6f5b..1c11f8683 100644 --- a/src/protocol/smb/smb2.c +++ b/src/protocol/smb/smb2.c @@ -98,7 +98,7 @@ smb_add_link(struct string *string, struct smbc_dirent *entry, encode_uri_string(&uri_string, entry->name, entry->namelen, 0); add_to_string(string, ""); @@ -107,7 +107,7 @@ smb_add_link(struct string *string, struct smbc_dirent *entry, add_to_string(string, dircolor); add_to_string(string, "\">"); } - add_bytes_to_string(string, entry->name, entry->namelen); + add_html_to_string(string, entry->name, entry->namelen); if (*dircolor) { add_to_string(string, ""); } @@ -130,20 +130,20 @@ display_entry(struct smbc_dirent *entry, unsigned char dircolor[]) case SMBC_SERVER: smb_add_link(&string, entry, " SERVER ", dircolor); if (entry->comment) { - add_bytes_to_string(&string, entry->comment, entry->commentlen); + add_html_to_string(&string, entry->comment, entry->commentlen); } break; case SMBC_FILE_SHARE: smb_add_link(&string, entry, " FILE SHARE ", dircolor); if (entry->comment) { - add_bytes_to_string(&string, entry->comment, entry->commentlen); + add_html_to_string(&string, entry->comment, entry->commentlen); } break; case SMBC_PRINTER_SHARE: - add_bytes_to_string(&string, entry->name, entry->namelen); + add_html_to_string(&string, entry->name, entry->namelen); add_to_string(&string, " PRINTER "); if (entry->comment) { - add_bytes_to_string(&string, entry->comment, entry->commentlen); + add_html_to_string(&string, entry->comment, entry->commentlen); } break; case SMBC_COMMS_SHARE: