Changeset 3892 in MondoRescue for branches/3.3/mondo/src/common/newt-specific.c
- Timestamp:
- Mar 12, 2024, 3:10:24 AM (3 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/3.3/mondo/src/common/newt-specific.c
r3882 r3892 79 79 long g_isoform_starttime; ///< The time (in seconds since the epoch) that the evalcall form was opened. 80 80 int g_isoform_old_progress = -1; ///< The most recent progress update of the evalcall form (percent). 81 char g_isoform_header_str = NULL; ///< The string for the evalcall form title.81 char *g_isoform_header_str = NULL; ///< The string for the evalcall form title. 82 82 int g_mysterious_dot_counter; ///< The counter for the twirling baton (/ | \\ - ...) on percentage less than 3 83 83 int g_noof_log_lines = 6; ///< The number of lines to show in the log at the bottom of the screen. … … 602 602 603 603 assert(ttl != NULL); 604 //strcpy(g_isoform_header_str, ttl);605 604 if (g_text_mode) { 606 605 log_msg(0, ttl); … … 614 613 g_isoform_starttime = get_time(); 615 614 if (g_text_mode) { 616 log_msg(0, g_isoform_header_str);615 log_msg(0, "g_isoform_header_str = %s", g_isoform_header_str); 617 616 } else { 618 617 g_isoform_header = newtLabel(1, 1, g_isoform_header_str); … … 1012 1011 } 1013 1012 1014 /* not sure it's useful to shrink here1015 prompt = malloc(MAX_NEWT_COMMENT_LEN);1016 strncpy(prompt, p, MAX_NEWT_COMMENT_LEN - 1);1017 prompt[MAX_NEWT_COMMENT_LEN - 1] = '\0';1018 text = newtTextboxReflowed(1, 1, prompt, 40, 5, 5, 0);1019 */1020 1013 text = newtTextboxReflowed(1, 1, p, 40, 5, 5, 0); 1021 1014 b_1 = newtButton(20 - ((button2[0] != '\0') ? strlen(button1) + 2 : strlen(button1) / 2), newtTextboxGetNumLines(text) + 3, button1); … … 1528 1521 * @param flentry The filelist entry to stringify. 1529 1522 * @return The string form of @p flentry. 1530 * @note The returned value points to static storage that will be overwritten with each call.1523 * @note The returned value points to a dynamically allocated string that the caller needs to free. 1531 1524 */ 1532 1525 char *filelist_entry_to_string(struct s_filelist_entry *flentry) { 1533 static char comment[100]; 1534 char *tmp = NULL; 1526 char *comment = NULL; 1535 1527 1536 1528 log_msg(8, "entering"); 1537 1529 assert(flentry != NULL); 1538 1530 if (flentry->severity == 0) { 1539 mr_asprintf( tmp, "0 ");1531 mr_asprintf(comment, "0 "); 1540 1532 } else if (flentry->severity == 1) { 1541 mr_asprintf( tmp, "low ");1533 mr_asprintf(comment, "low "); 1542 1534 } else if (flentry->severity == 2) { 1543 mr_asprintf(tmp, "med "); 1544 } else { 1545 mr_asprintf(tmp, "high"); 1546 } 1547 mr_strcat(tmp, " "); 1548 mr_strcat(tmp, flentry->filename); 1549 strncpy(comment, tmp, 99); 1550 mr_free(tmp); 1551 1535 mr_asprintf(comment, "med "); 1536 } else { 1537 mr_asprintf(comment, "high"); 1538 } 1539 mr_strcat(comment, " "); 1540 mr_strcat(comment, flentry->filename); 1552 1541 log_it("leaving"); 1553 1542 return (comment); … … 1615 1604 for (i = 0; i < filelist->entries; i++) { 1616 1605 keylist[i] = (void *) i; 1606 tmp = filelist_entry_to_string(&(filelist->el[i])); 1617 1607 newtListboxAppendEntry(fileListbox, 1618 filelist_entry_to_string(& 1619 (filelist-> 1620 el[i])), 1608 tmp, 1621 1609 keylist[i]); 1610 mr_free(tmp); 1622 1611 } 1623 1612 mr_asprintf(differ_sz, " %ld files differ. Hit 'Select' to pick a file. Hit 'Close' to quit the list.", i);
Note:
See TracChangeset
for help on using the changeset viewer.