[mupen64plus-core] 151/310: Support locales with commas instead of periods for decimal separator

Sven Eckelmann ecsv-guest at moszumanska.debian.org
Thu Nov 26 05:57:46 UTC 2015


This is an automated email from the git hooks/post-receive script.

ecsv-guest pushed a commit to branch armhf_test
in repository mupen64plus-core.

commit 7db165b1ee1fc52aed266015e99bbff7ca95f204
Author: Sven Eckelmann <sven at narfation.org>
Date:   Sun Apr 8 20:27:34 2012 +0200

    Support locales with commas instead of periods for decimal separator
---
 debian/changelog                          |  5 ++++
 debian/patches/floatingpoint_config.patch | 38 +++++++++++++++++++++++++++++++
 debian/patches/series                     |  1 +
 3 files changed, 44 insertions(+)

diff --git a/debian/changelog b/debian/changelog
index af8654a..7d9a458 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -3,6 +3,11 @@ mupen64plus-core (1.99.5-2) UNRELEASED; urgency=low
   [ Simon Ruderich ]
   * Let debhelper set the buildflags implicitly
 
+  [ Sven Eckelmann ]
+  * debian/patches:
+    - Add floatingpoint_config.patch, Support locales with commas instead of
+      periods for decimal separator
+
  -- Sven Eckelmann <sven at narfation.org>  Sun, 18 Mar 2012 16:52:20 +0100
 
 mupen64plus-core (1.99.5-1) unstable; urgency=low
diff --git a/debian/patches/floatingpoint_config.patch b/debian/patches/floatingpoint_config.patch
new file mode 100644
index 0000000..e6027f4
--- /dev/null
+++ b/debian/patches/floatingpoint_config.patch
@@ -0,0 +1,38 @@
+Description: Support locales with commas instead of periods for decimal separator
+Author: Richard Goedeken <Richard at fascinationsoftware.com>
+Origin: upstream, https://bitbucket.org/richard42/mupen64plus-core/changeset/8497ae23150f
+
+---
+diff --git a/src/api/config.c b/src/api/config.c
+index 4de179032345bde4efcedaec414845e4d0e3e120..feeb821716f16049490fe58977072edd933aa4f7 100644
+--- a/src/api/config.c
++++ b/src/api/config.c
+@@ -98,22 +98,13 @@ static void strip_whitespace(char *string)
+ 
+ static int is_numeric(const char *string)
+ {
+-    int dots = 0;
++    char chTemp[16];
++    float fTemp;
++    int rval = sscanf(string, "%f%8s", &fTemp, chTemp);
+ 
+-    if (*string == '-') string++;
+-
+-    while (*string != 0)
+-    {
+-        char ch = *string++;
+-        if (ch >= '0' && ch <= '9')
+-            continue;
+-        else if (ch == '.' && dots == 0)
+-            dots++;
+-        else
+-            return 0;
+-    }
+-
+-    return 1; /* true, input is numeric */
++    /* I want to find exactly one matched input item: a number with no garbage on the end */
++    /* I use sscanf() instead of a custom loop because this routine must handle locales in which the decimal separator is not '.' */
++    return (rval == 1);
+ }
+ 
+ static config_var *find_section_var(config_section *section, const char *ParamName)
diff --git a/debian/patches/series b/debian/patches/series
index 87fa0e7..c7be470 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,2 +1,3 @@
 dejavu-font.patch
 printf_fixup.patch
+floatingpoint_config.patch

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-games/mupen64plus-core.git



More information about the Pkg-games-commits mailing list