- Timestamp:
- Nov 18, 2016, 5:31:43 PM (8 years ago)
- Location:
- branches/3.2/mondo/src
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/3.2/mondo/src/common/libmondo-fork.c
r3610 r3615 38 38 * caller 39 39 */ 40 char *call_program_and_get_last_line_of_output(char *call) 41 { 40 char *call_program_and_get_last_line_of_output(const char *call) { 42 41 /*@ buffers ***************************************************** */ 43 42 char *result = NULL; 44 char *tmp = NULL; 43 char *resultbkp = NULL; 44 char *result2 = NULL; 45 45 46 46 /*@ pointers **************************************************** */ … … 59 59 if (strlen(result) > 1) { 60 60 log_msg(7, "result = '%s'", result); 61 /* in case we have to loop, we keep the 62 * previous value */ 63 mr_free(resultbkp); 64 mr_asprintf(resultbkp, "%s", result); 65 } else { 66 /* we had to loop and got nothing useul, so we keep the 67 * previous value */ 68 mr_free(result); 69 result = resultbkp; 61 70 } 62 71 } … … 66 75 } 67 76 mr_free(eng_call); 68 mr_strip_spaces(result); 69 log_msg(5, "cpaglloo returns '%s'", result); 70 return(result); 77 if (result != NULL) { 78 result2 = mr_strip_spaces(result); 79 mr_free(result); 80 log_msg(5, "cpaglloo returns '%s'", result2); 81 } else { 82 mr_asprintf(result2, ""); 83 } 84 return(result2); 71 85 } 72 86 -
branches/3.2/mondo/src/common/libmondo-fork.h
r1999 r3615 5 5 6 6 7 char *call_program_and_get_last_line_of_output(c har *call);7 char *call_program_and_get_last_line_of_output(const char *call); 8 8 int run_program_and_log_to_screen(char *basic_call, char *what_i_am_doing); 9 9 int run_program_and_log_output(char *program, int); -
branches/3.2/mondo/src/mondorestore/mr-externs.h
r3273 r3615 21 21 extern int closein_tape(); 22 22 extern void close_evalcall_form(void); 23 extern char *call_program_and_get_last_line_of_output(c har *);23 extern char *call_program_and_get_last_line_of_output(const char *); 24 24 extern void close_progress_form(void); 25 25 extern long count_lines_in_file(char *);
Note:
See TracChangeset
for help on using the changeset viewer.