guile-commits
[Top][All Lists]
Advanced

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

[Guile-commits] GNU Guile branch, stable-2.0, updated. v2.0.7-233-g59b0f


From: Ludovic Courtès
Subject: [Guile-commits] GNU Guile branch, stable-2.0, updated. v2.0.7-233-g59b0f9d
Date: Mon, 25 Mar 2013 22:29:18 +0000

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU Guile".

http://git.savannah.gnu.org/cgit/guile.git/commit/?id=59b0f9d7635ea7e272e2976ab69764a570d7f6ff

The branch, stable-2.0 has been updated
       via  59b0f9d7635ea7e272e2976ab69764a570d7f6ff (commit)
       via  5bb40f9df02c3395b198f254fdd43e7468b5ceee (commit)
      from  570fdeceacaad7f6e928123f40e8bb5f72677dcb (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 59b0f9d7635ea7e272e2976ab69764a570d7f6ff
Author: Ludovic Courtès <address@hidden>
Date:   Mon Mar 25 23:25:57 2013 +0100

    SRFI-37: Fix infinite loop when processing short option with no required 
arg.
    
    Fixes <http://bugs.gnu.org/13176>.
    
    * module/srfi/srfi-37.scm (args-fold)[short-option-argument]: When ARGS
      is a pair, always set it to its cdr.
    * test-suite/tests/srfi-37.test ("SRFI-37")["short option with optional
      argument omitted", "short option with optional argument provided"]:
      New tests.

commit 5bb40f9df02c3395b198f254fdd43e7468b5ceee
Author: Ludovic Courtès <address@hidden>
Date:   Mon Mar 25 22:46:53 2013 +0100

    getaddrinfo: Document the missing errno value for EAI_SYSTEM.
    
    In response to <http://bugs.gnu.org/13958>.
    Reported by Lluís Batlle i Rossell <address@hidden>.
    
    * doc/ref/posix.texi (Network Databases): Document the missing errno
      value for EAI_SYSTEM.
    * libguile/net_db.c (scm_getaddrinfo): Likewise.

-----------------------------------------------------------------------

Summary of changes:
 doc/ref/posix.texi            |    7 +++++--
 libguile/net_db.c             |    6 ++++--
 module/srfi/srfi-37.scm       |    5 ++++-
 test-suite/tests/srfi-37.test |   24 +++++++++++++++++++++++-
 4 files changed, 36 insertions(+), 6 deletions(-)

diff --git a/doc/ref/posix.texi b/doc/ref/posix.texi
index bc87329..341191a 100644
--- a/doc/ref/posix.texi
+++ b/doc/ref/posix.texi
@@ -2562,8 +2562,11 @@ code should be prepared to handle it when it is defined.
 @var{hint_socktype} was not recognized.
 
 @item EAI_SYSTEM
-A system error occurred; the error code can be found in
address@hidden
+A system error occurred.  In C, the error code can be found in
address@hidden; this value is not accessible from Scheme, but in
+practice it provides little information about the actual error
+cause.
address@hidden See <http://bugs.gnu.org/13958>.
 @end table
 
 Users are encouraged to read the
diff --git a/libguile/net_db.c b/libguile/net_db.c
index 95f0040..d7a12c5 100644
--- a/libguile/net_db.c
+++ b/libguile/net_db.c
@@ -595,8 +595,10 @@ SCM_DEFINE (scm_getaddrinfo, "getaddrinfo", 1, 5, 0,
            "@item EAI_SOCKTYPE\n"
            "@var{hint_socktype} was not recognized.\n\n"
            "@item EAI_SYSTEM\n"
-           "A system error occurred; the error code can be found in "
-           "@code{errno}.\n"
+           "A system error occurred.  In C, the error code can be found in "
+           "@code{errno}; this value is not accessible from Scheme, but in\n"
+           "practice it provides little information about the actual error "
+           "cause.\n\n"          /* see <http://bugs.gnu.org/13958>. */
            "@end table\n"
            "\n"
            "Users are encouraged to read the "
diff --git a/module/srfi/srfi-37.scm b/module/srfi/srfi-37.scm
index 565b44c..3f654af 100644
--- a/module/srfi/srfi-37.scm
+++ b/module/srfi/srfi-37.scm
@@ -1,6 +1,6 @@
 ;;; srfi-37.scm --- args-fold
 
-;;     Copyright (C) 2007, 2008 Free Software Foundation, Inc.
+;;     Copyright (C) 2007, 2008, 2013 Free Software Foundation, Inc.
 ;;
 ;; This library is free software; you can redistribute it and/or
 ;; modify it under the terms of the GNU Lesser General Public
@@ -145,6 +145,9 @@ program-arguments in ARGS, as decided by the OPTIONS'
             (let ((result (cadr args)))
               (set! args (cddr args))
               result))
+            ((pair? args)
+             (set! args (cdr args))
+             #f)
            (else #f)))
 
     ;; Interpret the short-option at index POSITION in (car ARGS),
diff --git a/test-suite/tests/srfi-37.test b/test-suite/tests/srfi-37.test
index 1f739c5..5a39750 100644
--- a/test-suite/tests/srfi-37.test
+++ b/test-suite/tests/srfi-37.test
@@ -1,6 +1,6 @@
 ;;;; srfi-37.test --- Test suite for SRFI 37 -*- scheme -*-
 ;;;;
-;;;;   Copyright (C) 2007, 2008 Free Software Foundation, Inc.
+;;;;   Copyright (C) 2007, 2008, 2013 Free Software Foundation, Inc.
 ;;;;
 ;;;; This library is free software; you can redistribute it and/or
 ;;;; modify it under the terms of the GNU Lesser General Public
@@ -105,4 +105,26 @@
                         (lambda (opt name arg k) #f)
                         '()))))
 
+  (pass-if-equal "short option with optional argument omitted" 'good
+    ;; This would trigger an infinite loop in Guile up to 2.0.7.
+    ;; See <http://bugs.gnu.org/13176>.
+    (args-fold '("-I")
+               (list (option '(#\I) #f #t
+                             (lambda (opt name arg value)
+                               (and (eqv? name #\I) (not arg)
+                                    'good))))
+               (lambda _ (error "unrecognized"))
+               (const #f)
+               #f))
+
+  (pass-if-equal "short option with optional argument provided"
+      "the-argument"
+    (args-fold '("-I" "the-argument")
+               (list (option '(#\I) #f #t
+                             (lambda (opt name arg result)
+                               (and (eqv? name #\I) arg))))
+               (lambda _ (error "unrecognized"))
+               (const #f)
+               #f))
+
 )


hooks/post-receive
-- 
GNU Guile



reply via email to

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