1
0
mirror of https://github.com/rkd77/elinks.git synced 2024-12-04 14:46:47 -05:00

smb: minor optimisation.

This commit is contained in:
Witold Filipczyk 2007-01-27 12:21:29 +01:00 committed by Kalle Olavi Niemitalo
parent 0cf6f91394
commit 0c1371b161

View File

@ -105,7 +105,7 @@ smb_add_link(struct string *string, struct smbc_dirent *entry,
add_to_string(string, dircolor); add_to_string(string, dircolor);
add_to_string(string, "\"><b>"); add_to_string(string, "\"><b>");
} }
add_to_string(string, entry->name); add_bytes_to_string(string, entry->name, entry->namelen);
if (*dircolor) { if (*dircolor) {
add_to_string(string, "</b></font>"); add_to_string(string, "</b></font>");
} }
@ -127,23 +127,29 @@ display_entry(struct smbc_dirent *entry, unsigned char dircolor[])
break; break;
case SMBC_SERVER: case SMBC_SERVER:
smb_add_link(&string, entry, " SERVER ", dircolor); smb_add_link(&string, entry, " SERVER ", dircolor);
if (entry->comment) add_to_string(&string, entry->comment); if (entry->comment) {
add_bytes_to_string(&string, entry->comment, entry->commentlen);
}
break; break;
case SMBC_FILE_SHARE: case SMBC_FILE_SHARE:
smb_add_link(&string, entry, " FILE SHARE ", dircolor); smb_add_link(&string, entry, " FILE SHARE ", dircolor);
if (entry->comment) add_to_string(&string, entry->comment); if (entry->comment) {
add_bytes_to_string(&string, entry->comment, entry->commentlen);
}
break; break;
case SMBC_PRINTER_SHARE: case SMBC_PRINTER_SHARE:
add_to_string(&string, entry->name); add_bytes_to_string(&string, entry->name, entry->namelen);
add_to_string(&string, " PRINTER "); add_to_string(&string, " PRINTER ");
if (entry->comment) add_to_string(&string, entry->comment); if (entry->comment) {
add_bytes_to_string(&string, entry->comment, entry->commentlen);
}
break; break;
case SMBC_COMMS_SHARE: case SMBC_COMMS_SHARE:
add_to_string(&string, entry->name); add_bytes_to_string(&string, entry->name, entry->namelen);
add_to_string(&string, " COMM"); add_to_string(&string, " COMM");
break; break;
case SMBC_IPC_SHARE: case SMBC_IPC_SHARE:
add_to_string(&string, entry->name); add_bytes_to_string(&string, entry->name, entry->namelen);
add_to_string(&string, " IPC"); add_to_string(&string, " IPC");
break; break;
case SMBC_DIR: case SMBC_DIR: