summaryrefslogtreecommitdiffstats
path: root/lib/Plugins/Python.cpp
diff options
context:
space:
mode:
authorKarel Klic <kklic@redhat.com>2010-02-09 15:05:27 +0100
committerKarel Klic <kklic@redhat.com>2010-02-09 15:05:27 +0100
commit43cc8f98f400f063772ff680e5798f664f9acb41 (patch)
tree3759eebf7d554894dec5397b152e399957ced3b0 /lib/Plugins/Python.cpp
parentdc9b75d9a4c5e50a8c1db5d7aa2430cc1bc6fa56 (diff)
parentea11e91fd0ddfa51568e9d52e7ce0dc19971c745 (diff)
downloadabrt-43cc8f98f400f063772ff680e5798f664f9acb41.tar.gz
abrt-43cc8f98f400f063772ff680e5798f664f9acb41.tar.xz
abrt-43cc8f98f400f063772ff680e5798f664f9acb41.zip
Merge branch 'master' of ssh://git.fedorahosted.org/git/abrt
Diffstat (limited to 'lib/Plugins/Python.cpp')
-rw-r--r--lib/Plugins/Python.cpp23
1 files changed, 21 insertions, 2 deletions
diff --git a/lib/Plugins/Python.cpp b/lib/Plugins/Python.cpp
index d6a3084..12cc47e 100644
--- a/lib/Plugins/Python.cpp
+++ b/lib/Plugins/Python.cpp
@@ -38,7 +38,27 @@ string CAnalyzerPython::GetLocalUUID(const char *pDebugDumpDir)
unsigned char hash2[MD5_RESULT_LEN];
md5_ctx_t md5ctx;
md5_begin(&md5ctx);
- md5_hash(bt_str, bt_end - bt_str, &md5ctx);
+ // Better:
+ // "example.py:1:<module>:ZeroDivisionError: integer division or modulo by zero"
+ //md5_hash(bt_str, bt_end - bt_str, &md5ctx);
+ // For now using compat version:
+ {
+ char *copy = xstrndup(bt_str, bt_end - bt_str);
+ char *s = copy;
+ char *d = copy;
+ unsigned colon_cnt = 0;
+ while (*s && colon_cnt < 3) {
+ if (*s != ':')
+ *d++ = *s;
+ else
+ colon_cnt++;
+ s++;
+ }
+ // "example.py1<module>"
+ md5_hash(copy, d - copy, &md5ctx);
+//*d = '\0'; log("str:'%s'", copy);
+ free(copy);
+ }
md5_end(hash2, &md5ctx);
// Hash is MD5_RESULT_LEN bytes long, but we use only first 4
@@ -56,7 +76,6 @@ string CAnalyzerPython::GetLocalUUID(const char *pDebugDumpDir)
//log("hash2:%s str:'%.*s'", hash_str, (int)(bt_end - bt_str), bt_str);
return hash_str;
-
}
string CAnalyzerPython::GetGlobalUUID(const char *pDebugDumpDir)
{