summaryrefslogtreecommitdiffstats
path: root/lib/plugins
diff options
context:
space:
mode:
authorNikola Pajkovsky <npajkovs@redhat.com>2010-08-19 16:37:51 +0200
committerNikola Pajkovsky <npajkovs@redhat.com>2010-08-19 16:40:37 +0200
commit0ad8bf6e3a537ff8de6967ab8a0bda8a5a91de83 (patch)
tree9cb08e00f88f5ff033b69d45e983dd180f3ac372 /lib/plugins
parentbd9e90bd8d6359a8cbb2799a50d805e768b20059 (diff)
downloadabrt-0ad8bf6e3a537ff8de6967ab8a0bda8a5a91de83.tar.gz
abrt-0ad8bf6e3a537ff8de6967ab8a0bda8a5a91de83.tar.xz
abrt-0ad8bf6e3a537ff8de6967ab8a0bda8a5a91de83.zip
Python.cpp: fix indentation
Signed-off-by: Nikola Pajkovsky <npajkovs@redhat.com>
Diffstat (limited to 'lib/plugins')
-rw-r--r--lib/plugins/Python.cpp102
1 files changed, 52 insertions, 50 deletions
diff --git a/lib/plugins/Python.cpp b/lib/plugins/Python.cpp
index b4d6cefc..7b6e761a 100644
--- a/lib/plugins/Python.cpp
+++ b/lib/plugins/Python.cpp
@@ -26,66 +26,68 @@ using namespace std;
string CAnalyzerPython::GetLocalUUID(const char *pDebugDumpDir)
{
- CDebugDump dd;
- if (!dd.Open(pDebugDumpDir))
- {
- VERB1 log(_("Unable to open debug dump '%s'"), pDebugDumpDir);
- return string("");
- }
+ CDebugDump dd;
+ if (!dd.Open(pDebugDumpDir))
+ {
+ VERB1 log(_("Unable to open debug dump '%s'"), pDebugDumpDir);
+ return string("");
+ }
- string bt;
- dd.LoadText(FILENAME_BACKTRACE, bt);
- dd.Close();
+ string bt;
+ dd.LoadText(FILENAME_BACKTRACE, bt);
+ dd.Close();
- const char *bt_str = bt.c_str();
- const char *bt_end = strchrnul(bt_str, '\n');
+ const char *bt_str = bt.c_str();
+ const char *bt_end = strchrnul(bt_str, '\n');
- char hash_str[MD5_RESULT_LEN*2 + 1];
- unsigned char hash2[MD5_RESULT_LEN];
- md5_ctx_t md5ctx;
- md5_begin(&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);
+ char hash_str[MD5_RESULT_LEN*2 + 1];
+ unsigned char hash2[MD5_RESULT_LEN];
+ md5_ctx_t md5ctx;
+ md5_begin(&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);
+ free(copy);
+ }
+ md5_end(hash2, &md5ctx);
- // Hash is MD5_RESULT_LEN bytes long, but we use only first 4
- // (I don't know why old Python code was using only 4, I mimic that)
- unsigned len = 4;
- char *d = hash_str;
- unsigned char *s = hash2;
- while (len) {
- *d++ = "0123456789abcdef"[*s >> 4];
- *d++ = "0123456789abcdef"[*s & 0xf];
- s++;
- len--;
- }
- *d = '\0';
+ // Hash is MD5_RESULT_LEN bytes long, but we use only first 4
+ // (I don't know why old Python code was using only 4, I mimic that)
+ unsigned len = 4;
+ char *d = hash_str;
+ unsigned char *s = hash2;
+ while (len)
+ {
+ *d++ = "0123456789abcdef"[*s >> 4];
+ *d++ = "0123456789abcdef"[*s & 0xf];
+ s++;
+ len--;
+ }
+ *d = '\0';
//log("hash2:%s str:'%.*s'", hash_str, (int)(bt_end - bt_str), bt_str);
- return hash_str;
+ return hash_str;
}
string CAnalyzerPython::GetGlobalUUID(const char *pDebugDumpDir)
{
- return GetLocalUUID(pDebugDumpDir);
+ return GetLocalUUID(pDebugDumpDir);
}
void CAnalyzerPython::Init()