svn commit: samba r4368 - in trunk/source/web: .

jra at samba.org jra at samba.org
Sun Dec 26 18:51:43 GMT 2004


Author: jra
Date: 2004-12-26 18:51:43 +0000 (Sun, 26 Dec 2004)
New Revision: 4368

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

Log:
Patch for bug #2190 (SWAT displaying parameters in UNIX charset)
not utf8. Fixed by Shiro Yamada <shiro at miraclelinux.com>.
Jeremy.

Modified:
   trunk/source/web/swat.c


Changeset:
Modified: trunk/source/web/swat.c
===================================================================
--- trunk/source/web/swat.c	2004-12-26 18:02:18 UTC (rev 4367)
+++ trunk/source/web/swat.c	2004-12-26 18:51:43 UTC (rev 4368)
@@ -193,6 +193,7 @@
 {
 	int i;
 	void *ptr = parm->ptr;
+	char *utf8_s1, *utf8_s2;
 
 	if (parm->class == P_LOCAL && snum >= 0) {
 		ptr = lp_local_ptr(snum, ptr);
@@ -214,10 +215,17 @@
 			char **list = *(char ***)ptr;
 			for (;*list;list++) {
 				/* enclose in quotes if the string contains a space */
-				if ( strchr_m(*list, ' ') ) 
-					printf("\'%s\'%s", *list, ((*(list+1))?", ":""));
-				else
-					printf("%s%s", *list, ((*(list+1))?", ":""));
+				if ( strchr_m(*list, ' ') ) {
+					push_utf8_allocate(&utf8_s1, *list);
+					push_utf8_allocate(&utf8_s2, ((*(list+1))?", ":""));
+					printf("\'%s\'%s", utf8_s1, utf8_s2);
+				} else {
+					push_utf8_allocate(&utf8_s1, *list);
+					push_utf8_allocate(&utf8_s2, ((*(list+1))?", ":""));
+					printf("%s%s", utf8_s1, utf8_s2);
+				}
+				SAFE_FREE(utf8_s1);
+				SAFE_FREE(utf8_s2);
 			}
 		}
 		printf("\">");
@@ -238,16 +246,20 @@
 
 	case P_STRING:
 	case P_USTRING:
+		push_utf8_allocate(&utf8_s1, *(char **)ptr);
 		printf("<input type=text size=40 name=\"parm_%s\" value=\"%s\">",
-		       make_parm_name(parm->label), *(char **)ptr);
+		       make_parm_name(parm->label), utf8_s1);
+		SAFE_FREE(utf8_s1);
 		printf("<input type=button value=\"%s\" onClick=\"swatform.parm_%s.value=\'%s\'\">",
 			_("Set Default"), make_parm_name(parm->label),fix_backslash((char *)(parm->def.svalue)));
 		break;
 
 	case P_GSTRING:
 	case P_UGSTRING:
+		push_utf8_allocate(&utf8_s1, (char *)ptr);
 		printf("<input type=text size=40 name=\"parm_%s\" value=\"%s\">",
-		       make_parm_name(parm->label), (char *)ptr);
+		       make_parm_name(parm->label), utf8_s1);
+		SAFE_FREE(utf8_s1);
 		printf("<input type=button value=\"%s\" onClick=\"swatform.parm_%s.value=\'%s\'\">",
 			_("Set Default"), make_parm_name(parm->label),fix_backslash((char *)(parm->def.svalue)));
 		break;



More information about the samba-cvs mailing list