~ chicken-core (chicken-5) 2a3ea33b86cb30d12ff8496dd6dfeba53c8628fb


commit 2a3ea33b86cb30d12ff8496dd6dfeba53c8628fb
Author:     Peter Bex <peter@more-magic.net>
AuthorDate: Sat Feb 25 15:45:41 2017 +0100
Commit:     felix <felix@call-with-current-continuation.org>
CommitDate: Wed Mar 22 11:15:53 2017 +0100

    Fix invalid definition caught by previous commit.
    
    This was inadvertantly treated as a global definition before!
    
    Signed-off-by: felix <felix@call-with-current-continuation.org>

diff --git a/chicken-profile.scm b/chicken-profile.scm
index 85120fa1..4a6bbb8c 100644
--- a/chicken-profile.scm
+++ b/chicken-profile.scm
@@ -138,14 +138,14 @@ EOF
 (set! sort-by sort-by-time)
 
 (define (set-decimals arg)
+  (define (arg-digit n)
+    (let ((n (- (char->integer (string-ref arg n))
+		(char->integer #\0))))
+      (if (<= 0 n 9)
+	  (if (= n 9) 8 n)		; 9 => overflow in format-real
+	  (error "invalid argument to -decimals option" arg))))
   (if (= (string-length arg) 3)
       (begin
-	(define (arg-digit n)
-	  (let ((n (- (char->integer (string-ref arg n))
-		      (char->integer #\0))))
-	    (if (<= 0 n 9)
-		(if (= n 9) 8 n) ; 9 => overflow in format-real
-		(error "invalid argument to -decimals option" arg))))
 	(set! seconds-digits (arg-digit 0))
 	(set! average-digits (arg-digit 1))
 	(set! percent-digits (arg-digit 2)))
Trap