Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error code refactoring #42

Open
wants to merge 30 commits into
base: master
Choose a base branch
from
Open

Error code refactoring #42

wants to merge 30 commits into from

Conversation

tcunha
Copy link
Contributor

@tcunha tcunha commented Feb 23, 2013

No description provided.

Tiago Cunha added 30 commits February 21, 2013 12:35
Just use / in this specific case which might already happen if the
user's home directory is blank in the passwd(5) file.
More to come. Namely, error context which changes throughout the program
(ie output to either stderr or to the command/status window) and
consolidating the debug code, as well.
Specific "modules" should include what they really need and not rely on
some other header including files.

Obviously, now, headers need to be explicitly included.
Might be better, in the future, to append -Wformat=2 to CFLAGS and also
use the printf format attribute.
Which, in my opinion, is a good thing because, as a consequence, there's
less pre-processor goo in the tree.
From now on, there's no need to specify the relative path of local
header files.
It might generate a SIGSEGV exception if it's accessed.
Caught by the new wrapper function.
Now, with error contexts, the execute function can, also, be called when
parsing the configuration file, without having to worry about where to
output its messages.

That is, when parsing the configuration file, the messages are printed to
standard error and, afterwards, they get painted to the command/status
window.
The fparseln(3) function already returns NULL on EOF. Check it and move
the ferror(3) call outside the loop.
It already gets printed by the error functions.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant