svn commit: samba r5404 - in branches/SAMBA_4_0/source/libcli/nbt: .

tridge at samba.org tridge at samba.org
Tue Feb 15 05:14:10 GMT 2005


Author: tridge
Date: 2005-02-15 05:14:09 +0000 (Tue, 15 Feb 2005)
New Revision: 5404

WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=5404

Log:
allow spaces in the string representation of nbt names


Modified:
   branches/SAMBA_4_0/source/libcli/nbt/nbtname.c


Changeset:
Modified: branches/SAMBA_4_0/source/libcli/nbt/nbtname.c
===================================================================
--- branches/SAMBA_4_0/source/libcli/nbt/nbtname.c	2005-02-15 04:55:56 UTC (rev 5403)
+++ branches/SAMBA_4_0/source/libcli/nbt/nbtname.c	2005-02-15 05:14:09 UTC (rev 5404)
@@ -334,10 +334,11 @@
 {
 	int i, len;
 	char *ret;
-	const char *valid_chars = "_-.$@";
+	const char *valid_chars = "_-.$@ ";
+#define NBT_CHAR_ALLOW(c) (isalnum(c) || strchr(valid_chars, c))
 
 	for (len=i=0;s[i];i++,len++) {
-		if (!isalnum(s[i]) && !strchr(valid_chars, s[i])) {
+		if (!NBT_CHAR_ALLOW(s[i])) {
 			len += 2;
 		}
 	}
@@ -346,7 +347,7 @@
 	if (ret == NULL) return NULL;
 
 	for (len=i=0;s[i];i++) {
-		if (isalnum(s[i]) || strchr(valid_chars, s[i])) {
+		if (NBT_CHAR_ALLOW(s[i])) {
 			ret[len++] = s[i];
 		} else {
 			snprintf(&ret[len], 4, "%%%02x", (unsigned char)s[i]);



More information about the samba-cvs mailing list