gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[taler-exchange] branch master updated: fix #6198


From: gnunet
Subject: [taler-exchange] branch master updated: fix #6198
Date: Thu, 23 Apr 2020 16:06:23 +0200

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

grothoff pushed a commit to branch master
in repository exchange.

The following commit(s) were added to refs/heads/master by this push:
     new de61e06e fix #6198
de61e06e is described below

commit de61e06eb164c5cb05778aba8e448a001462b783
Author: Christian Grothoff <address@hidden>
AuthorDate: Thu Apr 23 16:06:21 2020 +0200

    fix #6198
---
 src/mhd/mhd_legal.c | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/src/mhd/mhd_legal.c b/src/mhd/mhd_legal.c
index b7859da1..a46b7279 100644
--- a/src/mhd/mhd_legal.c
+++ b/src/mhd/mhd_legal.c
@@ -110,6 +110,7 @@ mime_matches (const char *accept_pattern,
 /**
  * Check if @a lang matches the @a language_pattern, and if so with
  * which preference.
+ * See also: https://tools.ietf.org/html/rfc7231#section-5.3.1
  *
  * @param language_pattern a language preferences string
  *        like "fr-CH, fr;q=0.9, en;q=0.8, *;q=0.1"
@@ -125,15 +126,20 @@ language_matches (const char *language_pattern,
   char *sptr;
   double r = 0.0;
 
-  for (char *tok = strtok_r (p, ", ", &sptr);
+  for (char *tok = strtok_r (p, ",", &sptr);
        NULL != tok;
-       tok = strtok_r (NULL, ", ", &sptr))
+       tok = strtok_r (NULL, ",", &sptr))
   {
     char *sptr2;
     char *lp = strtok_r (tok, ";", &sptr2);
     char *qp = strtok_r (NULL, ";", &sptr2);
     double q = 1.0;
 
+    while (isspace ((int) *lp))
+      lp++;
+    if (NULL != qp)
+      while (isspace ((int) *qp))
+        qp++;
     GNUNET_break_op ( (NULL == qp) ||
                       (1 == sscanf (qp,
                                     "q=%lf",

-- 
To stop receiving notification emails like this one, please contact
address@hidden.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]