[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
string-trim-right bug
- To: srfi-13@xxxxxxxxxxxxxxxxx
- Subject: string-trim-right bug
- From: Mario Domenech Goulart <mario.goulart@xxxxxxxxx>
- Date: Sun, 19 Jan 2014 22:36:00 +0000
- Delivered-to: srfi-13@xxxxxxxxxxxxxxxxx
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:subject:date:message-id:user-agent:mime-version :content-type; bh=iUSBS9sJPBSb3JYxx+qt5sQOd7/NuEhpBDwFBPL1uWA=; b=pe4//PH9JXm8EOlj5QzbamMKkIMbb2hG0cebTTdfCeQa1dof9hE2vY4kwq+fYXRw0Q H8S/37bf4JRN44NcO63aJZFHea53ZdSq8r9KUKgnSrvuwcdRVgXER9uuUMHpUHIyvnPf RBXfx8jKD7hU7H8EKtJvScYqfgsp1l00qLouy2eAg5bpTQ4jg0qH0bjehm9swiGexFej ko1J2HfnJnEGSGXytzbqrelyJvpL5gu89DEs+NLZJ/WShdiJgG2xptN7bILbSUWjEy2y Jl19LqcQ5sCUuzOvPpX7eW4r49uubAiOSFVM/wlzVsOcBEHgjY87Gndt00g8g/QpBYKn IE2Q==
- User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux)
Hi,
Seth Alves found a bug in the reference implementation for
string-trim-right. For the full discussion, please see the thread on
the chicken-hackers mailing list:
http://lists.gnu.org/archive/html/chicken-hackers/2014-01/msg00016.html
Attached you can find a patch against the reference implementation
(ported from the one provided by Seth).
Best wishes.
Mario
--
http://parenteses.org/mario
--- srfi-13.scm.orig 2014-01-19 20:21:54.751772464 -0200
+++ srfi-13.scm 2014-01-19 20:21:57.999772518 -0200
@@ -1015,7 +1015,7 @@
(let-optionals* criterion+start+end ((criterion char-set:whitespace) rest)
(let-string-start+end (start end) string-trim-right s rest
(cond ((string-skip-right s criterion start end) =>
- (lambda (i) (%substring/shared s 0 (+ 1 i))))
+ (lambda (i) (%substring/shared s start (+ 1 i))))
(else "")))))
(define (string-trim-both s . criterion+start+end)