Hello community, here is the log from the commit of package zenity for openSUSE:Factory checked in at 2018-12-31 09:39:43 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/zenity (Old) and /work/SRC/openSUSE:Factory/.zenity.new.28833 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Package is "zenity" Mon Dec 31 09:39:43 2018 rev:61 rq:661753 version:3.30.0 Changes: -------- --- /work/SRC/openSUSE:Factory/zenity/zenity.changes 2018-10-17 08:20:05.214895591 +0200 +++ /work/SRC/openSUSE:Factory/.zenity.new.28833/zenity.changes 2018-12-31 09:39:43.342543989 +0100 @@ -1,0 +2,7 @@ +Fri Dec 28 00:28:47 UTC 2018 - bjorn.lie@gmail.com + +- Add upstream bug fix patch: + + zenity-Makes-progress-consider-decimal.patch: Makes progress to + consider the decimal from percent update. + +------------------------------------------------------------------- New: ---- zenity-Makes-progress-consider-decimal.patch ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ zenity.spec ++++++ --- /var/tmp/diff_new_pack.LuuqR4/_old 2018-12-31 09:39:43.870543557 +0100 +++ /var/tmp/diff_new_pack.LuuqR4/_new 2018-12-31 09:39:43.870543557 +0100 @@ -24,6 +24,8 @@ Group: System/GUI/GNOME URL: https://wiki.gnome.org/Projects/Zenity Source0: https://download.gnome.org/sources/zenity/3.30/%{name}-%{version}.tar.xz +# PATCH-FIX-UPSTREAM zenity-Makes-progress-consider-decimal.patch -- Makes progress to consider the decimal from percent update +Patch0: zenity-Makes-progress-consider-decimal.patch BuildRequires: fdupes BuildRequires: pkgconfig @@ -49,7 +51,7 @@ %lang_package %prep -%setup -q +%autosetup -p1 translation-update-upstream %build ++++++ zenity-Makes-progress-consider-decimal.patch ++++++
From 0f413e6a23beec60b206f070f0f38f0dbddd8fb4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aur=C3=A9lio=20A=2E=20Heckert?=
Date: Mon, 18 Jun 2018 18:09:17 -0300 Subject: [PATCH] Makes progress to consider the decimal from percent update
Implements stof alternative to atof, to ignore locale settings. This also helps the time remaining calculation for long tasks. --- src/progress.c | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/src/progress.c b/src/progress.c index 1a5a68f..00bb8aa 100644 --- a/src/progress.c +++ b/src/progress.c @@ -105,6 +105,27 @@ zenity_progress_update_time_remaining (ZenityProgressData *progress_data) { } } +static float +stof(const char* s) { + float rez = 0, fact = 1; + if (*s == '-') { + s++; + fact = -1; + } + for (int point_seen = 0; *s; s++) { + if (*s == '.' || *s == ',') { + point_seen = 1; + continue; + } + int d = *s - '0'; + if (d >= 0 && d <= 9) { + if (point_seen) fact /= 10.0f; + rez = rez * 10.0f + (float)d; + } + } + return rez * fact; +} + static gboolean zenity_progress_handle_stdin ( GIOChannel *channel, GIOCondition condition, gpointer data) { @@ -190,7 +211,7 @@ zenity_progress_handle_stdin ( continue; /* Now try to convert the thing to a number */ - percentage = CLAMP (atoi (string->str), 0, 100); + percentage = CLAMP (stof (string->str), 0, 100); gtk_progress_bar_set_fraction ( GTK_PROGRESS_BAR (progress_bar), percentage / 100.0); -- 2.18.1