Distributed under the LGPL
*/
+#include <cstdlib>
#include <cxxabi.h>
#include "demangle.h"
#ifdef __GNUC__
int status;
char *dm=abi::__cxa_demangle(sym.c_str(), 0, 0, &status);
- string result(dm);
+
+ string result;
+ if(status==0)
+ result=dm;
+ else
+ result=sym;
+
free(dm);
+
return result;
#else
return sym;