X-Git-Url: http://git.kpe.io/?p=kmrcl.git;a=blobdiff_plain;f=strings.lisp;h=975f1e2dcaad34dd1ff7b98d12ab1975a15cbdd8;hp=a348ed5211af5fb91491d624f1798f3a343b71bf;hb=865f2486d2bb5ff217f640e0475b8646b9480bbe;hpb=b7af043786744aaf0b67a5ee6f4d42a647dc738d diff --git a/strings.lisp b/strings.lisp index a348ed5..975f1e2 100644 --- a/strings.lisp +++ b/strings.lisp @@ -7,7 +7,7 @@ ;;;; Programmer: Kevin M. Rosenberg ;;;; Date Started: Apr 2000 ;;;; -;;;; $Id: strings.lisp,v 1.11 2003/04/29 00:23:21 kevin Exp $ +;;;; $Id: strings.lisp,v 1.14 2003/04/29 00:49:09 kevin Exp $ ;;;; ;;;; This file, part of KMRCL, is Copyright (c) 2002 by Kevin M. Rosenberg ;;;; @@ -110,9 +110,17 @@ (defun string-trim-last-character (s) "Return the string less the last character" - (aif (plusp (length s)) - (subseq s 0 (1- it)) - s)) + (let ((len (length s))) + (if (plusp len) + (subseq s 0 (1- len)) + s))) + +(defun nstring-trim-last-character (s) + "Return the string less the last character" + (let ((len (length s))) + (if (plusp len) + (nsubseq s 0 (1- len)) + s))) (defun string-hash (str &optional (bitmask 65535)) (let ((hash 0))