I think a lot of C programmers would find reading the source to the V6 ed interesting:
http://www.tuhs.org/Archive/PDP-11/Trees/V6/usr/source/s1/ed.c
1333 lines of C, basically no library use at all (no printf, not even malloc -- the only thing dynamically allocated is the document, and it uses sbrk() to manage the memory itself), compiles down to about 6K on a PDP-11. And that includes a regex engine!It contains a lot of 1970 C-isms that won't work today ("=+" instead of "+=" for example) but an experienced C programmer shouldn't have a hard time following it.
As a bonus, look at the commented-out getpid() implementation at the bottom of the file.