fix: updated gnl include path and function names that caused compilation errors
This commit is contained in:
2
Makefile
2
Makefile
@@ -206,7 +206,7 @@ ft_printf:
|
|||||||
GNL = get_next_line
|
GNL = get_next_line
|
||||||
GNL_REPO = https://github.com/sdevsantiago/get_next_line.git
|
GNL_REPO = https://github.com/sdevsantiago/get_next_line.git
|
||||||
GNL_PATH = $(LIB_PATH)/$(GNL)
|
GNL_PATH = $(LIB_PATH)/$(GNL)
|
||||||
GNL_INCLUDE_PATH = $(GNL_PATH)
|
GNL_INCLUDE_PATH = $(GNL_PATH)/include
|
||||||
GNL_BIN = $(GNL_PATH)/get_next_line.a
|
GNL_BIN = $(GNL_PATH)/get_next_line.a
|
||||||
|
|
||||||
get_next_line:
|
get_next_line:
|
||||||
|
|||||||
@@ -69,7 +69,7 @@ static char *resolve_cmd_path(char const *cmd, char const *path)
|
|||||||
i = 0;
|
i = 0;
|
||||||
while (path_splitted[i])
|
while (path_splitted[i])
|
||||||
{
|
{
|
||||||
abs_path = ft_strjoin_mul(
|
abs_path = ft_strnjoin(
|
||||||
3, (char *)path_splitted[i], "/", (char *)cmd);
|
3, (char *)path_splitted[i], "/", (char *)cmd);
|
||||||
if (access(abs_path, X_OK) != -1)
|
if (access(abs_path, X_OK) != -1)
|
||||||
break ;
|
break ;
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ int export_builtin(int argc, char const *argv[], char **envp)
|
|||||||
{
|
{
|
||||||
if (ft_strncmp(envp[i], env[0], ft_strlen(env[0])) == 0)
|
if (ft_strncmp(envp[i], env[0], ft_strlen(env[0])) == 0)
|
||||||
{
|
{
|
||||||
char *line = ft_strjoin_mul(3, env[0], "=", env[1]);
|
char *line = ft_strnjoin(3, env[0], "=", env[1]);
|
||||||
envp[i] = line;
|
envp[i] = line;
|
||||||
break ;
|
break ;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -74,7 +74,6 @@ static t_minishell init_minishell(
|
|||||||
minishell.envp = (char **)malloc(n_env * sizeof(char *));
|
minishell.envp = (char **)malloc(n_env * sizeof(char *));
|
||||||
if (!minishell.envp && errno == ENOMEM)
|
if (!minishell.envp && errno == ENOMEM)
|
||||||
return (clear_minishell(&minishell), minishell);
|
return (clear_minishell(&minishell), minishell);
|
||||||
minishell.history_file = ft_strjoin(getenv("HOME"), "/"HISTORY_FILE);
|
|
||||||
return (minishell);
|
return (minishell);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -117,15 +116,10 @@ static int minishell(t_minishell *minishell)
|
|||||||
{
|
{
|
||||||
if (line)
|
if (line)
|
||||||
free(line);
|
free(line);
|
||||||
char *prompt;
|
char *prompt = NULL;
|
||||||
char *hostname = get_hostname();
|
char *hostname = get_hostname();
|
||||||
if (hostname)
|
if (hostname)
|
||||||
{
|
{
|
||||||
prompt = ft_strjoin_mul(12,
|
|
||||||
BOLD, BLUE_TEXT, getenv("USERNAME"), "@", hostname,
|
|
||||||
RESET, ":",
|
|
||||||
BOLD, GREEN_TEXT, getenv("PWD"),
|
|
||||||
RESET, "> ");
|
|
||||||
free(hostname);
|
free(hostname);
|
||||||
}
|
}
|
||||||
if (prompt)
|
if (prompt)
|
||||||
|
|||||||
Reference in New Issue
Block a user