- switch (setup_type) {
- case UI_TEXT:
- title(prompt_title);
- printf("\n%s\n", prompt_text);
- printf("%s\n%s\n", _("This is currently set to:"), Target);
- printf("%s\n", _("Enter new value or press return to leave unchanged:"));
- if (fgets(buf, sizeof buf, stdin)) {
- buf[strlen(buf) - 1] = 0;
- }
- if (!IsEmptyStr(buf))
- strcpy(Target, buf);
- break;
-
- case UI_DIALOG:
- CtdlMakeTempFileName(dialog_result, sizeof dialog_result);
- snprintf(buf, sizeof buf, "exec %s --backtitle '%s' --nocancel --inputbox '%s' 19 72 '%s' 2>%s",
- getenv("CTDL_DIALOG"),
- program_title,
- prompt_text,
- Target,
- dialog_result);
- rv = system(buf);
- if (rv != 0) {
- fprintf(stderr, "failed to run whiptail or dialog\n");
- }
-
- fp = fopen(dialog_result, "r");
- if (fp != NULL) {
- if (fgets(Target, sizeof buf, fp)) {
- if (Target[strlen(Target)-1] == 10) {
- Target[strlen(Target)-1] = 0;
- }
- }
- fclose(fp);
- unlink(dialog_result);
- }
- break;
- case UI_SILENT:
- if (*DefValue != '\0')
- strcpy(Target, DefValue);
- break;
+ title(prompt_title);
+ printf("\n%s\n", prompt_text);
+ printf("%s\n%s\n", _("This is currently set to:"), Target);
+ printf("%s\n", _("Enter new value or press return to leave unchanged:"));
+ if (fgets(buf, sizeof buf, stdin)) {
+ buf[strlen(buf) - 1] = 0;
+ }
+ if (!IsEmptyStr(buf)) {
+ strcpy(Target, buf);