Skip to content

Commit

Permalink
cd - test gives false positive
Browse files Browse the repository at this point in the history
  • Loading branch information
josfelip@debian committed Sep 10, 2024
1 parent 745f896 commit 61a098e
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 3 deletions.
6 changes: 6 additions & 0 deletions qa/unit_test/builtin_cd/unit_tester.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,3 +145,9 @@ def unit_cd():
trash = subprocess.run(f"make fclean -C {unit}", stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True, shell=True)

return status

def main():
unit_cd()

if __name__ == "__main__":
main()
6 changes: 5 additions & 1 deletion qa/unit_test/builtin_export/unit_tester.py
Original file line number Diff line number Diff line change
Expand Up @@ -178,4 +178,8 @@ def unit_export():

return status

unit_export()
def main():
unit_export()

if __name__ == "__main__":
main()
5 changes: 3 additions & 2 deletions src/95_builtin_cd.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
/* By: josfelip <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/05/20 14:34:02 by josfelip #+# #+# */
/* Updated: 2024/09/06 22:13:28 by josfelip ### ########.fr */
/* Updated: 2024/09/10 00:24:46 by josfelip ### ########.fr */
/* */
/* ************************************************************************** */

Expand Down Expand Up @@ -47,7 +47,7 @@ static int chdir_and_env_sync(t_dict *dict, char *directory)
int ret;
char *var[2];

var[0] = "PWD";
var[0] = "OLDPWD";
var[1] = getcwd(NULL, 0);
ft_collect_mem_env(var[1]);
ret = chdir(directory);
Expand All @@ -59,6 +59,7 @@ static int chdir_and_env_sync(t_dict *dict, char *directory)
return (EXIT_FAILURE);
}
ft_dict_update(dict, var);
var[0] = "PWD";
var[1] = getcwd(NULL, 0);
ft_collect_mem_env(var[1]);
ft_dict_update(dict, var);
Expand Down

0 comments on commit 61a098e

Please sign in to comment.