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.6-20-gd6bd18


From: Ludovic Courtès
Subject: [Guile-commits] GNU Guile branch, stable-2.0, updated. v2.0.6-20-gd6bd182
Date: Sun, 26 Aug 2012 22:22: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=d6bd18261895a9b7cb9570c95b779c615e261728

The branch, stable-2.0 has been updated
       via  d6bd18261895a9b7cb9570c95b779c615e261728 (commit)
       via  7aa394b53c289c1f05dacaef8a9167fbaecc00fa (commit)
       via  fd99e505d794049bb1a06aa1e9de8a0f9cff6689 (commit)
       via  866210bf247ea57bed5421ce8887a84e53347acb (commit)
       via  b401fe71692a4473a51c39d7964ce554bf2ced37 (commit)
      from  dc7a9cefbf5434b6e7e503fe83faa07b24a1a6cd (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 d6bd18261895a9b7cb9570c95b779c615e261728
Author: Ian Price <address@hidden>
Date:   Tue Aug 21 12:13:25 2012 +0100

    ISO 8601 time format specifies zero padding for hours, not blank padding.
    
    * doc/ref/srfi-modules.texi ("SRFI-19 Date to string"): Fix iso 8601 format 
strings.
    * module/srfi/srfi-19.scm (directives): Fix iso 8601 format strings.

commit 7aa394b53c289c1f05dacaef8a9167fbaecc00fa
Author: Ludovic Courtès <address@hidden>
Date:   Mon Aug 27 00:09:30 2012 +0200

    doc: Fix description of regexp/locale encoding interaction.
    
    * doc/ref/api-regex.texi (Regexp Functions): Update paragraph that
      mentions locale encoding and strings-as-bytes.
    
    * test-suite/tests/regexp.test ("nonascii locales")["match structures
      refer to char offsets, non-ASCII pattern"]: New test.

commit fd99e505d794049bb1a06aa1e9de8a0f9cff6689
Author: Ludovic Courtès <address@hidden>
Date:   Sun Aug 26 23:42:09 2012 +0200

    Update `texinfo.test' to match latest change.
    
    * test-suite/tests/texinfo.test ("test-texinfo->stexinfo")["@url{arg}"]:
      Update test as a follow-up to
      dc7a9cefbf5434b6e7e503fe83faa07b24a1a6cd ("more robust texinfo alias
      handling").

commit 866210bf247ea57bed5421ce8887a84e53347acb
Author: Ian Price <address@hidden>
Date:   Mon Aug 20 23:12:23 2012 +0100

    Fix uri-encoding for strings with no unreserved chars
    
    * module/web/uri.scm (uri-encode): Change test to check for unreserved
      chars instead of reserved chars.
    * test-suite/tests/web-uri.test ("encode"): Add test.

commit b401fe71692a4473a51c39d7964ce554bf2ced37
Author: Ian Price <address@hidden>
Date:   Mon Aug 20 23:03:38 2012 +0100

    Fix uri-encoding for octets 0-15
    
    * module/web/uri.scm (uri-encode): All encoded octets should be of the
      form % HEXDIGIT HEXDIGIT.
    * test-suite/tests/web-uri.test ("encode"): Add test.

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

Summary of changes:
 doc/ref/api-regex.texi        |   13 +++++++------
 doc/ref/srfi-modules.texi     |    8 ++++----
 module/srfi/srfi-19.scm       |    8 ++++----
 module/web/uri.scm            |    6 +++++-
 test-suite/tests/regexp.test  |   15 ++++++++++++---
 test-suite/tests/texinfo.test |    3 +--
 test-suite/tests/web-uri.test |    4 +++-
 7 files changed, 36 insertions(+), 21 deletions(-)

diff --git a/doc/ref/api-regex.texi b/doc/ref/api-regex.texi
index 11a31fc..082fb87 100644
--- a/doc/ref/api-regex.texi
+++ b/doc/ref/api-regex.texi
@@ -1,6 +1,6 @@
 @c -*-texinfo-*-
 @c This is part of the GNU Guile Reference Manual.
address@hidden Copyright (C)  1996, 1997, 2000, 2001, 2002, 2003, 2004, 2007, 
2009, 2010
address@hidden Copyright (C)  1996, 1997, 2000, 2001, 2002, 2003, 2004, 2007, 
2009, 2010, 2012
 @c   Free Software Foundation, Inc.
 @c See the file guile.texi for copying conditions.
 
@@ -54,11 +54,12 @@ Zero bytes (@code{#\nul}) cannot be used in regex patterns 
or input
 strings, since the underlying C functions treat that as the end of
 string.  If there's a zero byte an error is thrown.
 
-Patterns and input strings are treated as being in the locale
-character set if @code{setlocale} has been called (@pxref{Locales}),
-and in a multibyte locale this includes treating multi-byte sequences
-as a single character.  (Guile strings are currently merely bytes,
-though this may change in the future, @xref{Conversion to/from C}.)
+Internally, patterns and input strings are converted to the current
+locale's encoding, and then passed to the C library's regular expression
+routines (@pxref{Regular Expressions,,, libc, The GNU C Library
+Reference Manual}).  The returned match structures always point to
+characters in the strings, not to individual bytes, even in the case of
+multi-byte encodings.
 
 @deffn {Scheme Procedure} string-match pattern str [start]
 Compile the string @var{pattern} into a regular expression and compare
diff --git a/doc/ref/srfi-modules.texi b/doc/ref/srfi-modules.texi
index 7e7d658..ba701a2 100644
--- a/doc/ref/srfi-modules.texi
+++ b/doc/ref/srfi-modules.texi
@@ -3003,10 +3003,10 @@ with locale decimal point, eg.@: @samp{5.2}
 @item @nicode{~z} @tab time zone, RFC-822 style
 @item @nicode{~Z} @tab time zone symbol (not currently implemented)
 @item @nicode{~1} @tab ISO-8601 date, @samp{~Y-~m-~d}
address@hidden @nicode{~2} @tab ISO-8601 time+zone, @samp{~k:~M:~S~z}
address@hidden @nicode{~3} @tab ISO-8601 time, @samp{~k:~M:~S}
address@hidden @nicode{~4} @tab ISO-8601 date/time+zone, 
@samp{~Y-~m-~dT~k:~M:~S~z}
address@hidden @nicode{~5} @tab ISO-8601 date/time, @samp{~Y-~m-~dT~k:~M:~S}
address@hidden @nicode{~2} @tab ISO-8601 time+zone, @samp{~H:~M:~S~z}
address@hidden @nicode{~3} @tab ISO-8601 time, @samp{~H:~M:~S}
address@hidden @nicode{~4} @tab ISO-8601 date/time+zone, 
@samp{~Y-~m-~dT~H:~M:~S~z}
address@hidden @nicode{~5} @tab ISO-8601 date/time, @samp{~Y-~m-~dT~H:~M:~S}
 @end multitable
 @end defun
 
diff --git a/module/srfi/srfi-19.scm b/module/srfi/srfi-19.scm
index d8f7643..c0a27b1 100644
--- a/module/srfi/srfi-19.scm
+++ b/module/srfi/srfi-19.scm
@@ -1113,13 +1113,13 @@
    (cons #\1 (lambda (date pad-with port)
                (display (date->string date "~Y-~m-~d") port)))
    (cons #\2 (lambda (date pad-with port)
-               (display (date->string date "~k:~M:~S~z") port)))
+               (display (date->string date "~H:~M:~S~z") port)))
    (cons #\3 (lambda (date pad-with port)
-               (display (date->string date "~k:~M:~S") port)))
+               (display (date->string date "~H:~M:~S") port)))
    (cons #\4 (lambda (date pad-with port)
-               (display (date->string date "~Y-~m-~dT~k:~M:~S~z") port)))
+               (display (date->string date "~Y-~m-~dT~H:~M:~S~z") port)))
    (cons #\5 (lambda (date pad-with port)
-               (display (date->string date "~Y-~m-~dT~k:~M:~S") port)))))
+               (display (date->string date "~Y-~m-~dT~H:~M:~S") port)))))
 
 
 (define (get-formatter char)
diff --git a/module/web/uri.scm b/module/web/uri.scm
index 109118b..78614a5 100644
--- a/module/web/uri.scm
+++ b/module/web/uri.scm
@@ -364,7 +364,9 @@ Percent-encoding first writes out the given character to a 
bytevector
 within the given @var{encoding}, then encodes each byte as
 @address@hidden, where @var{HH} is the hexadecimal representation of
 the byte."
-  (if (string-index str unescaped-chars)
+  (define (needs-escaped? ch)
+    (not (char-set-contains? unescaped-chars ch)))
+  (if (string-index str needs-escaped?)
       (call-with-output-string*
        (lambda (port)
          (string-for-each
@@ -377,6 +379,8 @@ the byte."
                     (if (< i len)
                         (let ((byte (bytevector-u8-ref bv i)))
                           (display #\% port)
+                          (when (< byte 16)
+                            (display #\0 port))
                           (display (number->string byte 16) port)
                           (lp (1+ i))))))))
           str)))
diff --git a/test-suite/tests/regexp.test b/test-suite/tests/regexp.test
index 8217a41..ef59465 100644
--- a/test-suite/tests/regexp.test
+++ b/test-suite/tests/regexp.test
@@ -1,8 +1,9 @@
 ;;;; regexp.test ---  test Guile's regexps   -*- coding: utf-8; mode: scheme 
-*-
 ;;;; Jim Blandy <address@hidden> --- September 1999
 ;;;;
-;;;;   Copyright (C) 1999, 2004, 2006, 2007, 2008, 2009, 2010 Free Software 
Foundation, Inc.
-;;;; 
+;;;;   Copyright (C) 1999, 2004, 2006, 2007, 2008, 2009, 2010,
+;;;;      2012 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
 ;;;; License as published by the Free Software Foundation; either
@@ -280,4 +281,12 @@
     (with-locale "en_US.utf8"
       ;; bug #31650
       (equal? (match:substring (string-match ".*" "calçot") 0)
-              "calçot"))))
+              "calçot")))
+
+  (pass-if "match structures refer to char offsets, non-ASCII pattern"
+    (with-locale "en_US.utf8"
+      ;; bug #31650
+      (equal? (match:substring (string-match "λ: The Ultimate (.*)"
+                                             "λ: The Ultimate GOTO")
+                               1)
+              "GOTO"))))
diff --git a/test-suite/tests/texinfo.test b/test-suite/tests/texinfo.test
index 98c44b9..8a4b593 100644
--- a/test-suite/tests/texinfo.test
+++ b/test-suite/tests/texinfo.test
@@ -208,9 +208,8 @@
 
   (test-body "@code{arg}"
              '((para (code "arg"))))
-  ;; FIXME: Why no enclosing para here?  Probably a bug.
   (test-body "@url{arg}"
-             '((uref (% (url "arg")))))
+             '((para (uref (% (url "arg"))))))
   (test-body "@code{     }"
              '((para (code))))
   (test-body "@code{ @code{}    }"
diff --git a/test-suite/tests/web-uri.test b/test-suite/tests/web-uri.test
index 4621a19..3f6e7e3 100644
--- a/test-suite/tests/web-uri.test
+++ b/test-suite/tests/web-uri.test
@@ -258,4 +258,6 @@
     (equal? "foo bar" (uri-decode "foo+bar"))))
 
 (with-test-prefix "encode"
-  (pass-if (equal? "foo%20bar" (uri-encode "foo bar"))))
+  (pass-if (equal? "foo%20bar" (uri-encode "foo bar")))
+  (pass-if (equal? "foo%0a%00bar" (uri-encode "foo\n\x00bar")))
+  (pass-if (equal? "%3c%3e%5c%5e" (uri-encode "<>\\^"))))


hooks/post-receive
-- 
GNU Guile



reply via email to

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