Changeset 1594 in MondoRescue for branches/stable/mondo/src/common/newt-specific.c
- Timestamp:
- Aug 26, 2007, 12:26:06 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/stable/mondo/src/common/newt-specific.c
r1549 r1594 698 698 699 699 /*@ buffers ********************************************************** */ 700 char *blurb = NULL;701 char *original_contents = NULL;702 700 bool ret = TRUE; 701 size_t n = 0; 703 702 704 703 assert_string_is_neither_NULL_nor_zerolength(title); … … 706 705 assert(output != NULL); 707 706 707 n = strlen(output) + 1; 708 708 if (g_text_mode) { 709 709 printf 710 710 ("---promptstring---1--- %s\n---promptstring---2--- %s\n---promptstring---Q---\n--> ", 711 711 title, b); 712 (void) fgets(output, maxsize, stdin);713 if ( output[strlen(output) - 1] == '\n')712 mr_getline(&output, &n, stdin); 713 if ((strlen(output) > 1) && (output[strlen(output) - 1] == '\n')) { 714 714 output[strlen(output) - 1] = '\0'; 715 } 715 716 return(ret); 716 717 } 717 mr_asprintf(&blurb, b); 718 text = newtTextboxReflowed(2, 1, blurb, 48, 5, 5, 0); 719 mr_asprintf(&original_contents, output); 720 output[0] = '\0'; 718 719 text = newtTextboxReflowed(2, 1, b, 48, 5, 5, 0); 721 720 type_here = 722 721 newtEntry(2, newtTextboxGetNumLines(text) + 2, 723 original_contents, 50, 724 #ifdef __cplusplus 725 0, NEWT_FLAG_RETURNEXIT 726 #else 722 output, 50, 727 723 (void *) &entry_value, NEWT_FLAG_RETURNEXIT 728 #endif729 724 ); 730 725 b_1 = newtButton(6, newtTextboxGetNumLines(text) + 4, _(" OK ")); … … 736 731 center_string(blurb, 80); 737 732 */ 738 newtPushHelpLine(blurb); 739 mr_free(blurb); 733 newtPushHelpLine(b); 740 734 741 735 b_res = newtRunForm(myForm); 742 strcpy(output, entry_value);743 736 newtPopHelpLine(); 744 737 if (b_res == b_2) { 745 strcpy(output, original_contents);746 738 ret = FALSE; 739 } else { 740 mr_allocstr(output, newtEntryGetValue(entry_value)); 747 741 } 748 742 newtFormDestroy(myForm); 749 743 newtPopWindow(); 750 mr_free(original_contents);751 744 return(ret); 752 745 }
Note:
See TracChangeset
for help on using the changeset viewer.