mirror of
https://github.com/textmate/textmate.git
synced 2026-01-20 20:27:59 -05:00
Do not call abort (on failure) in pretty_plist.cc
Instead we return one of the constants from sysexits.h — the problem with abort() is that, for users with the feature enabled, it will trigger a core dump. That is a bit extreme for somewhat expected problems (like empty input file).
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
#include <plist/ascii.h>
|
||||
#include <sysexits.h>
|
||||
|
||||
static double const AppVersion = 2.1;
|
||||
static size_t const AppRevision = APP_REVISION;
|
||||
@@ -36,7 +37,7 @@ static void parse_plist (FILE* fp, bool ascii, bool extended)
|
||||
if(data.empty())
|
||||
{
|
||||
fprintf(stderr, "empty property list\n");
|
||||
abort();
|
||||
exit(EX_DATAERR);
|
||||
}
|
||||
|
||||
if(ascii)
|
||||
@@ -109,7 +110,7 @@ int main (int argc, char* const* argv)
|
||||
else
|
||||
{
|
||||
perror("fopen");
|
||||
abort();
|
||||
exit(EX_NOINPUT);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user