diff --git a/src/auditing-cybersecurity.h b/src/auditing-cybersecurity.h index 454f304..3f72249 100644 --- a/src/auditing-cybersecurity.h +++ b/src/auditing-cybersecurity.h @@ -247,7 +247,7 @@ int set_last_activity_error(int, char const *); int open_file(char *, char *, FILE **); int open_file_str(char *, char *, FILE **, char ***); int show_message(char *, int , int , int , bool, bool, bool); -char * get_readline(char *, bool ); +char * get_readline(char *, bool); int format_strings_from_files(char *, char *); void show_intro(char *, char *); void show_intro_banner(); diff --git a/src/others/common.c b/src/others/common.c index d6d7001..a514ee1 100644 --- a/src/others/common.c +++ b/src/others/common.c @@ -21,8 +21,12 @@ char * get_readline(char *prompt, bool addHistory){ free(lineRead); lineRead=(char *)NULL; } - printf("%s",prompt); - lineRead=readline(" "); + if(addHistory){ + lineRead=readline(prompt); + }else{ + printf("%s",prompt); + lineRead=readline(" "); + } if(lineRead && *lineRead && addHistory) add_history (lineRead); return (lineRead); }