X-Git-Url: http://git.kpe.io/?a=blobdiff_plain;f=interfaces%2Fpostgresql-socket%2Fpostgresql-socket-api.cl;h=0c64353403fe7912a1378fc567c1d80a20dd91a9;hb=ed0ba77f1cff4820da69c6229018e06b9efad1b5;hp=0be635e1aea8b9b63f387f212b7ad3f601b78860;hpb=e435a2e78dd193194a73ca49074a035a4cf236ec;p=clsql.git diff --git a/interfaces/postgresql-socket/postgresql-socket-api.cl b/interfaces/postgresql-socket/postgresql-socket-api.cl index 0be635e..0c64353 100644 --- a/interfaces/postgresql-socket/postgresql-socket-api.cl +++ b/interfaces/postgresql-socket/postgresql-socket-api.cl @@ -9,7 +9,7 @@ ;;;; ;;;; Date Started: Feb 2002 ;;;; -;;;; $Id: postgresql-socket-api.cl,v 1.10 2002/03/27 10:48:12 kevin Exp $ +;;;; $Id: postgresql-socket-api.cl,v 1.11 2002/03/27 11:13:27 kevin Exp $ ;;;; ;;;; This file, part of CLSQL, is Copyright (c) 2002 by Kevin M. Rosenberg ;;;; and Copyright (c) 1999-2001 by Pierre R. Mai @@ -644,27 +644,28 @@ connection, if it is still open." (unless before-decimal (error "Unexpected value")))) - (dotimes (i length) - (setq char (read-byte socket)) -;; (format t "~&len:~D, i:~D, char:~D, minusp:~A, decimalp:~A" length i char minusp decimalp) - (let ((weight (ascii-digit char))) - (cond - ((and weight (not decimalp)) ;; before decimal point - (setq before-decimal (+ weight (* 10 before-decimal)))) - ((and weight decimalp) ;; after decimal point - (setq after-decimal (+ weight (* 10 after-decimal))) - (incf decimal-count)) - ((and (= char +char-code-period+)) - (setq decimalp t)) - ((or (= char +char-code-lower-e+) ;; E is for exponent - (= char +char-code-upper-e+)) - (setq exponent (read-integer-from-socket socket (- length i 1))) - (setq exponent (or exponent 0)) - (setq i length)) + (block loop + (dotimes (i length) + (setq char (read-byte socket)) + ;; (format t "~&len:~D, i:~D, char:~D, minusp:~A, decimalp:~A" length i char minusp decimalp) + (let ((weight (ascii-digit char))) + (cond + ((and weight (not decimalp)) ;; before decimal point + (setq before-decimal (+ weight (* 10 before-decimal)))) + ((and weight decimalp) ;; after decimal point + (setq after-decimal (+ weight (* 10 after-decimal))) + (incf decimal-count)) + ((and (= char +char-code-period+)) + (setq decimalp t)) + ((or (= char +char-code-lower-e+) ;; E is for exponent + (= char +char-code-upper-e+)) + (setq exponent (read-integer-from-socket socket (- length i 1))) + (setq exponent (or exponent 0)) + (return-from loop)) (t (break "Unexpected value")) ) - )) + ))) (setq result (* (+ (coerce before-decimal 'double-float) (* after-decimal (expt 10 (- decimal-count))))