From 0273b019c41053a02ade0aafb2d1515d0a062353 Mon Sep 17 00:00:00 2001 From: y-syo Date: Wed, 14 Aug 2024 10:51:54 +0200 Subject: [PATCH] =?UTF-8?q?=E3=80=8C=F0=9F=94=A8=E3=80=8D=20fix(switch=5Fc?= =?UTF-8?q?md=5Fpath):=20path=20to=20.=20if=20no=20path?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/exec/utils_exec.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/exec/utils_exec.c b/src/exec/utils_exec.c index 859d928..44da48f 100644 --- a/src/exec/utils_exec.c +++ b/src/exec/utils_exec.c @@ -6,12 +6,13 @@ /* By: mmoussou cmd[0] != '/') { path = env_get_value("PATH", env); + if (!path || !path[0]) + { + if (path) + free(path); + path = ft_strdup(ret_cwd()); + } cmd->cmd = get_path(path, cmd->cmd); free(path); }