summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2010-05-05 15:58:10 +0200
committerDenys Vlasenko <vda.linux@googlemail.com>2010-05-05 15:58:10 +0200
commit04a316805eb2418f6a9d505a77e6021f26663966 (patch)
tree3787910d52e28077d3575d597b2ca8fcc3671443
parent14fd7bf27dd0d320f29dc3db163e244e150c7501 (diff)
downloadabrt-04a316805eb2418f6a9d505a77e6021f26663966.tar.gz
abrt-04a316805eb2418f6a9d505a77e6021f26663966.tar.xz
abrt-04a316805eb2418f6a9d505a77e6021f26663966.zip
fix bug 571411: backtrace attachment of the form /var/cache/abrt/foo-12345-67890/backtrace
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-rw-r--r--src/Daemon/MiddleWare.cpp13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/Daemon/MiddleWare.cpp b/src/Daemon/MiddleWare.cpp
index 5c9ecb76..667a36f8 100644
--- a/src/Daemon/MiddleWare.cpp
+++ b/src/Daemon/MiddleWare.cpp
@@ -86,10 +86,15 @@ static char* is_text_file(const char *name, ssize_t *sz)
}
/* Some files in our dump directories are known to always be textual */
- if (strcmp(name, FILENAME_BACKTRACE) == 0
- || strcmp(name, FILENAME_CMDLINE) == 0
- ) {
- return buf;
+ const char *base = strrchr(name, '/');
+ if (base)
+ {
+ base++;
+ if (strcmp(base, FILENAME_BACKTRACE) == 0
+ || strcmp(base, FILENAME_CMDLINE) == 0
+ ) {
+ return buf;
+ }
}
/* Every once in a while, even a text file contains a few garbled