If your writing a program that is designed to run on any modern computer, please consider adding an –inpath option to your program, or -Z as a short option, just to signal that your program ran. Here’s why:
Many other programs need to know if your program exists in the system path. Save a lot of people time, trouble and effort of writing code to recursively search said path to find out if your program is present and executable. Most C libs come with inherent memory leaks, don’t make us use inherent search functions, don’t make us write our own stuff.
–inpath switches should exit with a status of 0, regardless of the EXIT_SUCCESS macro. This saves malloc()’s, contiguous cache and a whole lot of headache.
A good example is here:
Lets say I’m writing a CLI that gets an env variable named EDITOR to find out what editor you want to use. When I call getenv() to fetch EDITOR, I should be able to issue a system call + –inpath to get a result of 0. This lets me know, the user was sane and set the variable correctly, else, do something else.
Otherwise, I have no choice but to over-malloc() needlessly, robbing your computer of precious contiguous memory space for no good reason. What fun is that? If your program is not in the system path, well, duh, its not going to return what I expect. I can even test against EXIT_SUCCESS to make sure I’m testing it right.