This commit is contained in:
mcolonna 2024-07-04 13:50:43 +02:00
parent 6184e4e982
commit 254bee62c7
2 changed files with 4 additions and 3 deletions

View file

@ -6,7 +6,7 @@
/* By: jschaft <cecile.schaft@orange.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* 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);

View file

@ -6,7 +6,7 @@
/* By: mcolonna <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* 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)