summaryrefslogtreecommitdiff
path: root/source3/web
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2004-12-26 18:51:49 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 10:53:46 -0500
commit7f98253a67d9f417f98376f0608b7dd61e0b7150 (patch)
treea5155fb6d7907a3d0ba9b58100e6b5080ce0e228 /source3/web
parent3c1f5a024d3a8e4b85057122556dd5930af09be3 (diff)
downloadsamba-7f98253a67d9f417f98376f0608b7dd61e0b7150.tar.gz
samba-7f98253a67d9f417f98376f0608b7dd61e0b7150.tar.bz2
samba-7f98253a67d9f417f98376f0608b7dd61e0b7150.zip
r4369: Patch for bug #2190 (SWAT displaying parameters in UNIX charset)
not utf8. Fixed by Shiro Yamada <shiro@miraclelinux.com>. Jeremy. (This used to be commit 8de04888097b3e125845340ba1a9a1bb79892e22)
Diffstat (limited to 'source3/web')
-rw-r--r--source3/web/swat.c24
1 files changed, 18 insertions, 6 deletions
diff --git a/source3/web/swat.c b/source3/web/swat.c
index 48537d1d04..7bd9837c37 100644
--- a/source3/web/swat.c
+++ b/source3/web/swat.c
@@ -193,6 +193,7 @@ static void show_parameter(int snum, struct parm_struct *parm)
{
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 @@ static void show_parameter(int snum, struct parm_struct *parm)
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 @@ static void show_parameter(int snum, struct parm_struct *parm)
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;