File tree Expand file tree Collapse file tree 1 file changed +21
-1
lines changed
Expand file tree Collapse file tree 1 file changed +21
-1
lines changed Original file line number Diff line number Diff line change 11Additional notes on the lab assignment based on existing implementations.
22
3- Last updated: Dec 31, 2018.
3+ --------------------------------------------------------------------------------
4+ Split the program into (potentially many) .c files. For example one for command
5+ line parsing, another for utility functions, one for execution/pipe handling,
6+ etc. etc.
7+
8+ The program becomes better structured with a room for expansion/growth.
9+
10+ --------------------------------------------------------------------------------
11+ Do not blindly accept potentially unlimited user input. It probably does not
12+ make sense for command line to be millions of characters long.
13+
14+ --------------------------------------------------------------------------------
15+ Check return values of any call that can fail.
16+
17+ Yes, malloc() can fail too.
18+
19+ --------------------------------------------------------------------------------
20+ The shell should not assume it is being run from another shell.
21+
22+ E.g. relying on getenv("PWD") to return non-NULL is futile - your little
23+ shell could be login shell !
424
525--------------------------------------------------------------------------------
626We really require you to use a consistent C style.
You can’t perform that action at this time.
0 commit comments