summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2000-09-13 07:08:09 +0000
committerAndrew Tridgell <tridge@samba.org>2000-09-13 07:08:09 +0000
commit4aae2b3702bbfb8082fd225652337e18c3c4abf8 (patch)
tree1c1db9404667314081ad7a06ce3b00a4e4e8a2f2 /source3
parent7be9a4fd4c044fa98c434bbdbf0f8229f1101bbb (diff)
downloadsamba-4aae2b3702bbfb8082fd225652337e18c3c4abf8.tar.gz
samba-4aae2b3702bbfb8082fd225652337e18c3c4abf8.tar.bz2
samba-4aae2b3702bbfb8082fd225652337e18c3c4abf8.zip
don't show equivalent enum options in swat
(This used to be commit 52074960971995580a03647ac5c638043eb8f5e1)
Diffstat (limited to 'source3')
-rw-r--r--source3/web/swat.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/source3/web/swat.c b/source3/web/swat.c
index 54192b70da..29ff28a75a 100644
--- a/source3/web/swat.c
+++ b/source3/web/swat.c
@@ -57,7 +57,7 @@ static int iNumNonAutoPrintServices = 0;
****************************************************************************/
static int enum_index(int value, struct enum_list *enumlist)
{
-int i;
+ int i;
for (i=0;enumlist[i].name;i++)
if (value == enumlist[i].value) break;
return(i);
@@ -65,8 +65,8 @@ int i;
static char *fix_backslash(char *str)
{
-static char newstring[1024];
-char *p = newstring;
+ static char newstring[1024];
+ char *p = newstring;
while (*str) {
if (*str == '\\') {*p++ = '\\';*p++ = '\\';}
@@ -226,8 +226,11 @@ static void show_parameter(int snum, struct parm_struct *parm)
case P_ENUM:
printf("<select name=\"parm_%s\">",make_parm_name(parm->label));
- for (i=0;parm->enum_list[i].name;i++)
- printf("<option %s>%s",(*(int *)ptr)==parm->enum_list[i].value?"selected":"",parm->enum_list[i].name);
+ for (i=0;parm->enum_list[i].name;i++) {
+ if (i == 0 || parm->enum_list[i].value != parm->enum_list[i-1].value) {
+ printf("<option %s>%s",(*(int *)ptr)==parm->enum_list[i].value?"selected":"",parm->enum_list[i].name);
+ }
+ }
printf("</select>");
printf("<input type=button value=\"Set Default\" onClick=\"swatform.parm_%s.selectedIndex=\'%d\'\">",
make_parm_name(parm->label),enum_index((int)(parm->def.ivalue),parm->enum_list));