* Arguments: prompt - the prompt string.
* buf, buflen - buffer to be returned and its MAX size?
* default value for the answer.
- * Returns: the value returned by prompt_input.
+ * Returns: zero on failure
*/
int
char tmp[BUFSIZ];
int ans;
+ if (parsed_argc > 0) {
+ parsed_argc--;
+ strncpy(buf, parsed_argv[0], buflen);
+ sprintf(tmp, "%s: %s", prompt, buf);
+ Put_message(tmp);
+ parsed_argv++;
+ return(1);
+ }
+
(void) sprintf(tmp, "%s [%s]: ", prompt, def ? def : "");
ans = Prompt_input(tmp, buf, buflen);
if (ans == 0) {
{
char buf[BUFSIZ];
- if (PromptWithDefault(prompt, buf, BUFSIZ, *pointer) == -1)
+ if (PromptWithDefault(prompt, buf, BUFSIZ, *pointer) == 0)
return(SUB_ERROR);
/*
*/
int
-GetFSTypes(current)
+GetFSTypes(current, options)
char ** current;
+int options;
{
int c_value, new_val = 0; /* current value of filesys type (int). */
char ret_value[BUFSIZ];
return(SUB_ERROR);
if (GetFSVal("miscellaneous", MR_FS_MISC, c_value, &new_val) == FALSE)
return(SUB_ERROR);
- if (GetFSVal("Group Quotas", MR_FS_GROUPQUOTA, c_value, &new_val) == FALSE)
- return(SUB_ERROR);
+ if (options) {
+ if (GetFSVal("Group Quotas", MR_FS_GROUPQUOTA, c_value, &new_val) ==
+ FALSE)
+ return(SUB_ERROR);
+ }
FreeAndClear(current, TRUE);
sprintf(ret_value, "%d", new_val);
return(GetTypeFromUser(prompt, tname, pointer));
}
for (elem = GetTypeValues(tname); elem; elem = elem->q_forw) {
- if (!cistrcmp(elem->q_data, *pointer))
+ if (!cistrcmp(elem->q_data, *pointer)) {
+ strcpy(*pointer, elem->q_data);
return(SUB_NORMAL);
+ }
}
sprintf(buffer, "\"%s\" is not a legal value for %s. Use one of:",
*pointer, tname);