summaryrefslogtreecommitdiffstats
path: root/lib/Utils/DebugDump.cpp
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2009-10-30 13:22:56 +0100
committerDenys Vlasenko <vda.linux@googlemail.com>2009-10-30 13:22:56 +0100
commit995bb1352eb5a461047d0acfc5f9648270c9b446 (patch)
tree10d5ba51f4408d445469ff25fecdc5f2cf1f4549 /lib/Utils/DebugDump.cpp
parent06671bee8dbf4c5f7f633e3bd6ae7e5135cac0f1 (diff)
downloadabrt-995bb1352eb5a461047d0acfc5f9648270c9b446.tar.gz
abrt-995bb1352eb5a461047d0acfc5f9648270c9b446.tar.xz
abrt-995bb1352eb5a461047d0acfc5f9648270c9b446.zip
Bugzilla: simplify; CCpp, DebugDump: don't add EOL to one-line data files
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'lib/Utils/DebugDump.cpp')
-rw-r--r--lib/Utils/DebugDump.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/Utils/DebugDump.cpp b/lib/Utils/DebugDump.cpp
index 51c25da4..ecd6d05b 100644
--- a/lib/Utils/DebugDump.cpp
+++ b/lib/Utils/DebugDump.cpp
@@ -362,6 +362,9 @@ void CDebugDump::SaveKernelArchitectureRelease()
}
std::string release;
LoadTextFile("/etc/redhat-release", release);
+ const char *release_ptr = release.c_str();
+ unsigned len_1st_str = strchrnul(release_ptr, '\n') - release_ptr;
+ release.erase(len_1st_str); /* usually simply removes trailing '\n' */
SaveText(FILENAME_RELEASE, release);
}