Index: /trunk/ccl/lib/macros.lisp
===================================================================
--- /trunk/ccl/lib/macros.lisp	(revision 418)
+++ /trunk/ccl/lib/macros.lisp	(revision 419)
@@ -1366,4 +1366,14 @@
       `(let ((,var ,p)) (%setf-macptr (the macptr ,var) (%inc-ptr ,var ,by))))))
 
+(defmacro with-string-from-cstring ((s ptr) &body body)
+  (let* ((len (gensym))
+	 (p (gensym)))
+    `(let* ((,p ,ptr)
+	    (,len (%cstrlen ,p))
+	    (,s (make-string ,len)))
+      (declare (fixnum ,len))
+      (%copy-ptr-to-ivector ,p 0 ,s 0 ,len)
+      (locally
+	  ,@body))))
 
 
