summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark H Weaver <mhw@netris.org>2013-08-23 22:36:02 -0400
committerMark H Weaver <mhw@netris.org>2013-08-23 22:36:02 -0400
commit453acfacf408fafe0712f8796e06241d236d011a (patch)
tree0281c9b526c6c16e041f841e8316b0dabf5ba7c2
parentc099201da1de71652b9791fb0a3a863b6d3c355d (diff)
parent0ac084bf2b0b0d7dcae4c5f27477f5af0374d6e5 (diff)
downloadguile-453acfacf408fafe0712f8796e06241d236d011a.tar.gz
Merge remote-tracking branch 'origin/stable-2.0'
-rw-r--r--doc/ref/api-io.texi2
-rw-r--r--module/ice-9/boot-9.scm4
-rw-r--r--module/ice-9/curried-definitions.scm27
-rw-r--r--module/web/http.scm9
-rw-r--r--test-suite/tests/web-http.test4
5 files changed, 21 insertions, 25 deletions
diff --git a/doc/ref/api-io.texi b/doc/ref/api-io.texi
index 8e3d40a69..19ed3fca6 100644
--- a/doc/ref/api-io.texi
+++ b/doc/ref/api-io.texi
@@ -1932,7 +1932,7 @@ exact integer object. If no characters can be read before an end of
file, the end-of-file object is returned.
@end deffn
-@deffn {Scheme Procedure} get-string-all textual-input-port count
+@deffn {Scheme Procedure} get-string-all textual-input-port
Reads from @var{textual-input-port} until an end of file, decoding
characters in the same manner as @code{get-string-n} and
@code{get-string-n!}.
diff --git a/module/ice-9/boot-9.scm b/module/ice-9/boot-9.scm
index 30aabb9fc..cf0dcd8d8 100644
--- a/module/ice-9/boot-9.scm
+++ b/module/ice-9/boot-9.scm
@@ -2599,6 +2599,8 @@ written into the port is returned."
(define (module-add! m v var)
(if (not (variable? var))
(error "Bad variable to module-add!" var))
+ (if (not (symbol? v))
+ (error "Bad symbol to module-add!" v))
(module-obarray-set! (module-obarray m) v var)
(module-modified m))
@@ -3750,7 +3752,7 @@ but it fails to load."
(syntax-rules ()
((_ (name . args) . body)
(begin
- (define name (lambda args . body))
+ (define (name . args) . body)
(export name)))
((_ name val)
(begin
diff --git a/module/ice-9/curried-definitions.scm b/module/ice-9/curried-definitions.scm
index 8c684a18c..fa369906c 100644
--- a/module/ice-9/curried-definitions.scm
+++ b/module/ice-9/curried-definitions.scm
@@ -1,4 +1,4 @@
-;;; Copyright (C) 2010 Free Software Foundation, Inc.
+;;; Copyright (C) 2010, 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
@@ -21,32 +21,25 @@
(define-syntax cdefine
(syntax-rules ()
- ((_ ((head . tail) . rest) body body* ...)
- (cdefine (head . tail)
- (lambda rest body body* ...)))
((_ (head . rest) body body* ...)
- (define head
+ (cdefine head
(lambda rest body body* ...)))
- ((_ . rest)
- (define . rest))))
+ ((_ name val)
+ (define name val))))
(define-syntax cdefine*
(syntax-rules ()
- ((_ ((head . tail) . rest) body body* ...)
- (cdefine* (head . tail)
- (lambda* rest body body* ...)))
((_ (head . rest) body body* ...)
- (define* head
+ (cdefine* head
(lambda* rest body body* ...)))
- ((_ . rest)
- (define* . rest))))
+ ((_ name val)
+ (define* name val))))
(define-syntax define-public
(syntax-rules ()
- ((_ (name . args) . body)
- (begin
- (cdefine (name . args) . body)
- (export name)))
+ ((_ (head . rest) body body* ...)
+ (define-public head
+ (lambda rest body body* ...)))
((_ name val)
(begin
(define name val)
diff --git a/module/web/http.scm b/module/web/http.scm
index 21d2964b4..af04259cc 100644
--- a/module/web/http.scm
+++ b/module/web/http.scm
@@ -1137,16 +1137,13 @@ three values: the method, the URI, and the version."
(display host-port port)))))
(let ((path (uri-path uri))
(query (uri-query uri)))
- (if (not (string-null? path))
+ (if (string-null? path)
+ (display "/" port)
(display path port))
(if query
(begin
(display "?" port)
- (display query port)))
- (if (and (string-null? path)
- (not query))
- ;; Make sure we display something.
- (display "/" port)))
+ (display query port))))
(display #\space port)
(write-http-version version port)
(display "\r\n" port))
diff --git a/test-suite/tests/web-http.test b/test-suite/tests/web-http.test
index b2c5c2c2b..e24a268ec 100644
--- a/test-suite/tests/web-http.test
+++ b/test-suite/tests/web-http.test
@@ -173,6 +173,10 @@
(build-uri 'http
#:path "/pub/WWW/TheProject.html")
(1 . 1))
+ (pass-if-write-request-line "GET /?foo HTTP/1.1"
+ GET
+ (build-uri 'http #:query "foo")
+ (1 . 1))
(pass-if-write-request-line "HEAD /etc/hosts?foo=bar HTTP/1.1"
HEAD
(build-uri 'http