From 254bee62c78503db2ac4e07b2a9a91fefd622083 Mon Sep 17 00:00:00 2001 From: mcolonna Date: Thu, 4 Jul 2024 13:50:43 +0200 Subject: [PATCH] fixes --- src/builtin2.c | 3 ++- src/parse_command.c | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/builtin2.c b/src/builtin2.c index 2ad64fe..ade0a8e 100644 --- a/src/builtin2.c +++ b/src/builtin2.c @@ -6,7 +6,7 @@ /* By: jschaft +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2024/06/25 13:28:29 by jschaft #+# #+# */ -/* Updated: 2024/07/03 14:06:04 by mcolonna ### ########.fr */ +/* Updated: 2024/07/04 13:35:21 by mcolonna ### ########.fr */ /* */ /* ************************************************************************** */ @@ -88,6 +88,7 @@ int cd_builtin(t_env *env, t_call call, int std[2]) if (r) return (perror("cd"), errno); mem_free((char *)variables_get(env->variables, "OLDPWD")); + variables_set(env->variables, "OLDPWD", ""); variables_set(env->variables, "OLDPWD", variables_get(env->variables, "PWD")); pwd = getcwd(NULL, 0); diff --git a/src/parse_command.c b/src/parse_command.c index f7747e2..4a23ed2 100644 --- a/src/parse_command.c +++ b/src/parse_command.c @@ -6,7 +6,7 @@ /* By: mcolonna +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2024/04/24 13:47:40 by mcolonna #+# #+# */ -/* Updated: 2024/06/28 14:10:53 by mcolonna ### ########.fr */ +/* Updated: 2024/07/04 13:49:57 by mcolonna ### ########.fr */ /* */ /* ************************************************************************** */ @@ -62,7 +62,7 @@ static bool parse_variable_set_command( read_only(args, &name, SYMBOL_CHARS); if (str_len(name) == 0 || stream_pop(&args->stream) != '=') return (false); - value = read_string(args, "<>|/"); + value = read_string(args, "<>|"); if (args->r.error) return (false); if (!value)