int ft_size(t_main *all) { ft_count_cols(all); if (all->nb_lines - 2 < all->cnt_lines || all->nb_cols - 2 < all->cnt_cols) { ft_clear_screen(); ft_putendl_fd("Window size to small", 2); return (0); } else { ft_clear_screen(); ft_print_select(all); } return (1); }
void ft_print_minishell(char *path) { int fd; char *line; char **split; t_mnshlrc *param; ft_allocate_param(¶m); fd = open(path, O_RDONLY); while (get_next_line(fd, &line) > 0) { split = ft_strsplit(line, '='); free(line); if (!split[1]) { ft_clear_screen(); ft_putstr_fd("Error into mnshlrc, aborting.\n", 2); sleep(10); exit(EXIT_FAILURE); } else ft_fill_mnshlrc(¶m, &split); } ft_create_final(¶m); close(fd); }