Skip to content

Commit 2e8c377

Browse files
author
Vladimir Kotal
committed
add more notes
1 parent 16bde01 commit 2e8c377

File tree

1 file changed

+21
-1
lines changed

1 file changed

+21
-1
lines changed

docs/class-assignments/extra-feedback.txt

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,26 @@
11
Additional 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
--------------------------------------------------------------------------------
626
We really require you to use a consistent C style.

0 commit comments

Comments
 (0)