mirror of https://github.com/ericonr/ep.git
Érico Rolim
46ea87ea21
Avoid unnecessary heap allocations (though we added new ones in main()) if possible by using a PATH_MAX buffer. Check for PWD matching current directory ourselves, which allows us to save a stat syscall, by re-using the stat(".") result to compare to stat("$HOME"). Improve how we check if HOME is actually part of pwd - previous would get confused with "${HOME}char", which should not get the prompt to display '~'. Use strtok_r to scan characters now. Writing directly to p() makes more sense than writing chars to a buffer, so remove that. I'm somewhat unhappy with the rpwd and mrpwd solution, since while coding I forgot to set one or the other a couple of times. It would be nice if I could "unconst" the variable at some point, though I greatly dislike that pattern. |
||
---|---|---|
po | ||
.gitignore | ||
Makefile | ||
ep.c | ||
ep.h | ||
git.c | ||
lang.c | ||
out.c | ||
path.c | ||
ssh.c |