diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2010-03-08 15:31:20 +0100 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2010-03-08 15:31:20 +0100 |
commit | 680f6f562a7fa082b6d9422c2480b240c22d5996 (patch) | |
tree | 75e715620e1200090ad486e4dec70a3bb6c81a21 /src/Daemon/MiddleWare.cpp | |
parent | a799b20e533e0b55b5b85d887ea3a7d13254c11d (diff) | |
download | abrt-680f6f562a7fa082b6d9422c2480b240c22d5996.tar.gz abrt-680f6f562a7fa082b6d9422c2480b240c22d5996.tar.xz abrt-680f6f562a7fa082b6d9422c2480b240c22d5996.zip |
Never flag backtrace as binary file (fixes problem observed in bz#571411)
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'src/Daemon/MiddleWare.cpp')
-rw-r--r-- | src/Daemon/MiddleWare.cpp | 26 |
1 files changed, 16 insertions, 10 deletions
diff --git a/src/Daemon/MiddleWare.cpp b/src/Daemon/MiddleWare.cpp index 4a8c7cf5..3ab3ddd1 100644 --- a/src/Daemon/MiddleWare.cpp +++ b/src/Daemon/MiddleWare.cpp @@ -129,16 +129,22 @@ static void load_crash_data_from_debug_dump(CDebugDump& dd, map_crash_data_t& da while (dd.GetNextFile(&short_name, &full_name)) { ssize_t sz = 4*1024; - char *text = is_text_file(full_name.c_str(), &sz); - if (!text) + char *text = NULL; + bool editable = is_editable_file(short_name.c_str()); + + if (!editable) { - add_to_crash_data_ext(data, - short_name.c_str(), - CD_BIN, - CD_ISNOTEDITABLE, - full_name.c_str() - ); - continue; + text = is_text_file(full_name.c_str(), &sz); + if (!text) + { + add_to_crash_data_ext(data, + short_name.c_str(), + CD_BIN, + CD_ISNOTEDITABLE, + full_name.c_str() + ); + continue; + } } std::string content; @@ -151,7 +157,7 @@ static void load_crash_data_from_debug_dump(CDebugDump& dd, map_crash_data_t& da add_to_crash_data_ext(data, short_name.c_str(), CD_TXT, - is_editable_file(short_name.c_str()) ? CD_ISEDITABLE : CD_ISNOTEDITABLE, + editable ? CD_ISEDITABLE : CD_ISNOTEDITABLE, content.c_str() ); } |