--- ./source/client/client.c.orig 2007-08-20 15:04:51.000000000 +0200 +++ ./source/client/client.c 2008-01-17 13:38:12.895002048 +0100 @@ -2751,9 +2751,24 @@ static int cmd_prompt(void) { - prompt = !prompt; - DEBUG(2,("prompting is now %s\n",prompt?"on":"off")); - + BOOL change = True; + pstring buf; + + if (next_token_nr(NULL,buf,NULL,sizeof(buf))) { + strlower_m(buf); + if (strequal(buf,"on")) { + prompt = True; + } else if (strequal(buf,"off")) { + prompt = False; + } else { + change = False; + } + } else { + prompt = !prompt; + } + d_printf("Prompting is %s%s.\n",change?"now ":"", + prompt?"on":"off"); + return 1; } @@ -2806,8 +2821,23 @@ static int cmd_lowercase(void) { - lowercase = !lowercase; - DEBUG(2,("filename lowercasing is now %s\n",lowercase?"on":"off")); + BOOL change = True; + pstring buf; + + if (next_token_nr(NULL,buf,NULL,sizeof(buf))) { + strlower_m(buf); + if (strequal(buf,"on")) { + lowercase = True; + } else if (strequal(buf,"off")) { + lowercase = False; + } else { + change = False; + } + } else { + lowercase = !lowercase; + } + d_printf("Filename lowercasing is %s%s.\n",change?"now ":"", + lowercase?"on":"off"); return 0; } @@ -2818,11 +2848,25 @@ static int cmd_setcase(void) { - BOOL orig_case_sensitive = cli_set_case_sensitive(cli, False); + BOOL new_case_sensitive, change = True; + pstring buf; - cli_set_case_sensitive(cli, !orig_case_sensitive); - DEBUG(2,("filename case sensitivity is now %s\n",!orig_case_sensitive ? - "on":"off")); + if (next_token_nr(NULL,buf,NULL,sizeof(buf))) { + strlower_m(buf); + if (strequal(buf,"on")) { + new_case_sensitive = True; + } else if (strequal(buf,"off")) { + new_case_sensitive = False; + } else { + new_case_sensitive = cli_set_case_sensitive(cli, False); + change = False; + } + } else { + new_case_sensitive = !cli_set_case_sensitive(cli, False); + } + cli_set_case_sensitive(cli, new_case_sensitive); + d_printf("Filename case sensitivity is %s%s.\n",change?"now ":"", + new_case_sensitive?"on":"off"); return 0; } @@ -2833,8 +2877,22 @@ static int cmd_showacls(void) { - showacls = !showacls; - DEBUG(2,("showacls is now %s\n",showacls?"on":"off")); + BOOL change = True; + pstring buf; + + if (next_token_nr(NULL,buf,NULL,sizeof(buf))) { + strlower_m(buf); + if (strequal(buf,"on")) { + showacls = True; + } else if (strequal(buf,"off")) { + showacls = False; + } else { + change = False; + } + } else { + showacls = !showacls; + } + d_printf("showacls is %s%s.\n",change?"now ":"",showacls?"on":"off"); if (!ctx && showacls) ctx = talloc_init("smbclient:showacls"); @@ -2852,8 +2910,23 @@ static int cmd_recurse(void) { - recurse = !recurse; - DEBUG(2,("directory recursion is now %s\n",recurse?"on":"off")); + BOOL change = True; + pstring buf; + + if (next_token_nr(NULL,buf,NULL,sizeof(buf))) { + strlower_m(buf); + if (strequal(buf,"on")) { + recurse = True; + } else if (strequal(buf,"off")) { + recurse = False; + } else { + change = False; + } + } else { + recurse = !recurse; + } + d_printf("Directory recursion is %s%s.\n",change?"now ":"", + recurse?"on":"off"); return 0; } @@ -2864,9 +2937,23 @@ static int cmd_translate(void) { - translation = !translation; - DEBUG(2,("CR/LF<->LF and print text translation now %s\n", - translation?"on":"off")); + BOOL change = True; + pstring buf; + + if (next_token_nr(NULL,buf,NULL,sizeof(buf))) { + strlower_m(buf); + if (strequal(buf,"on")) { + translation = True; + } else if (strequal(buf,"off")) { + translation = False; + } else { + change = False; + } + } else { + translation = !translation; + } + d_printf("CR/LF<->LF and print text translation %s%s.\n", + change?"now ":"",translation?"on":"off"); return 0; }