gsmartcontrol: update to 0.9.0.

This commit is contained in:
Enno Boland 2017-05-23 11:14:16 +02:00
parent 86bde0b1f2
commit 4c2f35603b
2 changed files with 3 additions and 47 deletions

View file

@ -1,44 +0,0 @@
Fix provided by upstream gsmartcontrol.sf.net, in
HomePage > News > 2015-04-29:
The Linux binary packages have been updated with a patch that fixes crash on
startup for some smartmontools version and system configuration combinations.
The source patch can be downloaded separately as well. Note that he fix has
been included in the SVN version for some time now.
direct link for this patch:
fix https://build.opensuse.org/source/home:alex_sh/gsmartcontrol/gsmartcontrol_parser_crash_fix.diff?rev=da33e1d56b052b483f576e5e6823da3b
Index: src/applib/smartctl_parser.cpp
===================================================================
--- src/applib/smartctl_parser.cpp (revision 106)
+++ src/applib/smartctl_parser.cpp (revision 107)
@@ -201,21 +201,20 @@
while (section_start_pos != std::string::npos
&& (section_start_pos = s.find("===", section_start_pos)) != std::string::npos) {
- tmp_pos = s.find("\n", section_start_pos); // works with \r\n too.
+ tmp_pos = s.find("\n", section_start_pos); // works with \r\n too. This may be npos if nothing follows the header.
// trim is needed to remove potential \r in the end
std::string section_header = hz::string_trim_copy(s.substr(section_start_pos,
(tmp_pos == std::string::npos ? tmp_pos : (tmp_pos - section_start_pos)) ));
- if (tmp_pos != std::string::npos)
- ++tmp_pos; // set to start of the next section
-
- section_end_pos = s.find("===", tmp_pos); // start of the next section
- std::string section_body_str = hz::string_trim_copy(s.substr(tmp_pos,
- (section_end_pos == std::string::npos ? section_end_pos : section_end_pos - tmp_pos)));
-
+ std::string section_body_str;
+ if (tmp_pos != std::string::npos) {
+ section_end_pos = s.find("===", tmp_pos); // start of the next section
+ section_body_str = hz::string_trim_copy(s.substr(tmp_pos,
+ (section_end_pos == std::string::npos ? section_end_pos : section_end_pos - tmp_pos)));
+ }
status = parse_section(section_header, section_body_str) || status;
- section_start_pos = section_end_pos;
+ section_start_pos = (tmp_pos == std::string::npos ? std::string::npos : section_end_pos);
}
if (!status) {

View file

@ -1,7 +1,7 @@
# Template file for 'gsmartcontrol'
pkgname=gsmartcontrol
version=0.8.7
revision=2
version=0.9.0
revision=1
build_style=gnu-configure
hostmakedepends="pkg-config"
makedepends="gtkmm2-devel pcre-devel desktop-file-utils"
@ -11,7 +11,7 @@ maintainer="yopito <pierre.bourgin@free.fr>"
license="GPL-3"
homepage="http://gsmartcontrol.sourceforge.net/"
distfiles="${SOURCEFORGE_SITE}/${pkgname}/${pkgname}-${version}.tar.bz2"
checksum=708fa803243abb852ed52050fc82cd3592a798c02743342441996e77f19ffec6
checksum=5da6435aa0845acef134f72c2b5f6fce79f9c51bebe9d099402e0f21a3388651
CXXFLAGS="-std=c++11"