[Gnucash-changes] r14159 - gnucash/trunk - Fix Bug#342736 by replacing "make-shared-substring" with "substring".

Chris Shoemaker chris at cvs.gnucash.org
Tue May 23 21:25:31 EDT 2006


Author: chris
Date: 2006-05-23 21:25:30 -0400 (Tue, 23 May 2006)
New Revision: 14159
Trac: http://svn.gnucash.org/trac/changeset/14159

Modified:
   gnucash/trunk/lib/guile-www/cgi.scm
   gnucash/trunk/lib/guile-www/http.scm
   gnucash/trunk/src/import-export/qif-import/qif-file.scm
   gnucash/trunk/src/import-export/qif-io-core/qif-file.scm
   gnucash/trunk/src/scm/command-line.scm
Log:
   Fix Bug#342736 by replacing "make-shared-substring" with "substring".
   Guile 1.8 automatically shares strings as copy-on-write and no longer
   provides the "make-shared-substring" procedure.


Modified: gnucash/trunk/lib/guile-www/cgi.scm
===================================================================
--- gnucash/trunk/lib/guile-www/cgi.scm	2006-05-24 00:49:10 UTC (rev 14158)
+++ gnucash/trunk/lib/guile-www/cgi.scm	2006-05-24 01:25:30 UTC (rev 14159)
@@ -94,10 +94,10 @@
   ;; Values are URL-encoded, so url:decode must be called on each one.
   (define (get-name pair)
     (let ((p (string-index pair #\=)))
-      (and p (make-shared-substring pair 0 p))))
+      (and p (substring pair 0 p))))
   (define (get-value pair)
     (let ((p (string-index pair #\=)))
-      (and p (url:decode (make-shared-substring pair (+ p 1))))))
+      (and p (url:decode (substring pair (+ p 1))))))
   (for-each (lambda (pair)
 	      (let* ((name (get-name pair))
 		     (value (get-value pair))
@@ -180,6 +180,6 @@
              (str str))
     (let ((pos (string-rindex str ch)))
       (if pos
-	  (loop (cons (make-shared-substring str (+ 1 pos)) fields)
-		(make-shared-substring str 0 pos))
+	  (loop (cons (substring str (+ 1 pos)) fields)
+		(substring str 0 pos))
 	  (cons str fields)))))

Modified: gnucash/trunk/lib/guile-www/http.scm
===================================================================
--- gnucash/trunk/lib/guile-www/http.scm	2006-05-24 00:49:10 UTC (rev 14158)
+++ gnucash/trunk/lib/guile-www/http.scm	2006-05-24 01:25:30 UTC (rev 14159)
@@ -116,9 +116,9 @@
 (define (parse-status-line statline)
   (let* ((first (string-index statline #\space))
 	 (second (string-index statline #\space (1+ first))))
-    (list (make-shared-substring statline 0 first)
-	  (make-shared-substring statline (1+ first) second)
-	  (make-shared-substring statline (1+ second)))))
+    (list (substring statline 0 first)
+	  (substring statline (1+ first) second)
+	  (substring statline (1+ second)))))
 
 
 ;;; HTTP connection management functions.
@@ -299,4 +299,4 @@
 	   (set! end (1- end)))
     (if (< end st)
 	""
-	(make-shared-substring s st end))))
+	(substring s st end))))

Modified: gnucash/trunk/src/import-export/qif-import/qif-file.scm
===================================================================
--- gnucash/trunk/src/import-export/qif-import/qif-file.scm	2006-05-24 00:49:10 UTC (rev 14158)
+++ gnucash/trunk/src/import-export/qif-import/qif-file.scm	2006-05-24 01:25:30 UTC (rev 14159)
@@ -71,7 +71,7 @@
 
                  ;; pick the 1-char tag off from the remainder of the line 
                  (set! tag (string-ref line 0))
-                 (set! value (make-shared-substring line 1))
+                 (set! value (substring line 1))
                  
                  ;; now do something with the line 
                  (if

Modified: gnucash/trunk/src/import-export/qif-io-core/qif-file.scm
===================================================================
--- gnucash/trunk/src/import-export/qif-io-core/qif-file.scm	2006-05-24 00:49:10 UTC (rev 14158)
+++ gnucash/trunk/src/import-export/qif-io-core/qif-file.scm	2006-05-24 01:25:30 UTC (rev 14159)
@@ -28,7 +28,7 @@
       (if (and (string? line)
                (not (string=? line "")))
           (let ((tag (string-ref line 0))
-                (value (make-shared-substring line 1)))
+                (value (substring line 1)))
             (set! byte-count (+ (string-length line) byte-count))
             (case tag
               ((#\^) #t) 

Modified: gnucash/trunk/src/scm/command-line.scm
===================================================================
--- gnucash/trunk/src/scm/command-line.scm	2006-05-24 00:49:10 UTC (rev 14158)
+++ gnucash/trunk/src/scm/command-line.scm	2006-05-24 01:25:30 UTC (rev 14159)
@@ -197,8 +197,8 @@
       (gnc:debug "handling arg " item)
       
       (if (not (string=? "--"
-			 (make-shared-substring item 0
-						(min (string-length item) 2))))
+			 (substring item 0
+                                    (min (string-length item) 2))))
           (begin
             (gnc:debug "non-option " item ", assuming file")
             (set! rest (cdr rest))
@@ -208,7 +208,7 @@
               ;; ignore --
               (set! rest (cdr rest))
               ;; Got something that looks like an option...
-              (let* ((arg-string (make-shared-substring item 2))
+              (let* ((arg-string (substring item 2))
                      (arg-def (assoc-ref gnc:*arg-defs* arg-string)))
 
                 (if (not arg-def)



More information about the gnucash-changes mailing list