-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathft_getinput.c
More file actions
30 lines (27 loc) · 1.18 KB
/
ft_getinput.c
File metadata and controls
30 lines (27 loc) · 1.18 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_getinput.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: makbulut <makbulut@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2022/06/23 16:53:13 by makbulut #+# #+# */
/* Updated: 2022/09/05 13:54:38 by makbulut ### ########.fr */
/* */
/* ************************************************************************** */
#include <stdlib.h>
#include <stdio.h>
#include <readline/readline.h>
#include <readline/history.h>
#include "minishell.h"
char *ft_getinput(void)
{
char *input;
char *prompt;
prompt = ft_create_prompt();
input = readline(prompt);
if (input && *input)
add_history(input);
free(prompt);
return (input);
}