Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

exitテストケースの追加+対応! #92

Merged
merged 5 commits into from
Oct 17, 2021
Merged

Conversation

takumihara
Copy link
Owner

Purpose

以下のケースに対応!それぞれのコミット追って見てもらうと分かりやすいと思います!

$ exit 9223372036854775808
$ exit -9223372036854775808
$ exit a a a
$ exit "42    "

Test

$ cd /minishell/test
$ make

@takumihara takumihara requested a review from moromin October 16, 2021 11:31
Copy link
Collaborator

@moromin moromin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

昨日話したところだけ確認お願いします〜

ft_putstr_fd("minishell: exit: ", STDERR_FILENO);
ft_putstr_fd(argv[1], STDERR_FILENO);
ft_putendl_fd(": numeric argument required", STDERR_FILENO);
exit(EXIT_STATUS_OUT_OF_RANGE);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ここのexit -> returnの修正だけお願いします!

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ん?これはexitしますよ?

takumihara@MacBook-Pro minishell % bash

The default interactive shell is now zsh.
To update your account to use zsh, please run `chsh -s /bin/zsh`.
For more details, please visit https://support.apple.com/kb/HT208050.
%T exit a
exit
bash: exit: a: numeric argument required
takumihara@MacBook-Pro minishell %

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

t_executorとか諸々をfree()する必要があるから、一旦return()するみたいなことじゃなかったでしたっけ?

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

したのここでもfreeはする必要あるので、ここから呼べる関数か何かを作って処理する予定です。

	exit((unsigned char)num); //todo: free?

他のexitする時の処理とまとめて考えようと思ったので、todoはこちらに入れてます!
#73 (comment)

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

りょうかいです!

@takumihara takumihara requested a review from moromin October 17, 2021 02:52
@takumihara takumihara merged commit dbb9653 into master Oct 17, 2021
@takumihara takumihara deleted the tacomea/builtin branch October 17, 2021 04:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants