Skip to content

Commit

Permalink
Fix bug in retry input.
Browse files Browse the repository at this point in the history
  • Loading branch information
kentlouisetonino committed Jul 2, 2024
1 parent ec6ab9d commit 28b1bfe
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 7 deletions.
7 changes: 7 additions & 0 deletions src/displays/app_exit.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#include "./add_new_tab.h"

void app_exit(void) {
add_new_tab();
add_new_tab();
printf("Good Bye!");
}
7 changes: 7 additions & 0 deletions src/displays/app_exit.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#ifndef APP_EXIT_H
#define APP_EXIT_H
#include "./app_exit.c"

void app_exit(void);

#endif
10 changes: 3 additions & 7 deletions src/inputs/get_retry_input.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,10 @@ int get_retry_input(void) {

char *lower_retry_input = get_lowercase_input(retry_input);

if (strcmp(retry_input, "y") == 0 || strcmp(retry_input, "yes") == 0) {
if (strcmp(lower_retry_input, "y") == 0 ||
strcmp(lower_retry_input, "yes") == 0) {
return 1;
} else {
add_new_tab();
add_new_tab();
printf(" Good Bye! 😀");
exit(0);
return 0;
}

return 0;
}
Binary file modified src/main
Binary file not shown.
3 changes: 3 additions & 0 deletions src/main.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#include "./displays/add_new_line.h"
#include "./displays/app_description.h"
#include "./displays/app_exit.h"
#include "./displays/clear_terminal.h"
#include "./displays/element_not_found.h"
#include "./elements/element_data.h"
Expand Down Expand Up @@ -61,6 +62,8 @@ int main(void) {

// Add some spaces before the exit.
add_new_line();
app_exit();
add_new_line();
add_new_line();

return 0;
Expand Down

0 comments on commit 28b1bfe

Please sign in to comment.