0.9.11.16:
[sbcl.git] / src / code / win32.lisp
index 8b055ea..e4152a8 100644 (file)
   (declare (type simple-string name))
   (let ((name-length (length name)))
     (with-alien ((aname (* tchar) (make-alien tchar (1+ name-length)))
-                (aenv (* tchar) (make-alien tchar default-environment-length))
-                (afunc (function dword (* tchar) (* tchar) dword)
-                       :extern #!-sb-unicode "GetEnvironmentVariableA@12"
-                       #!+sb-unicode "GetEnvironmentVariableW@12"))
-               (dotimes (i name-length) (setf (deref aname i) (char-code (aref name i))))
-               (setf (deref aname name-length) 0)
-               (let ((ret (alien-funcall afunc aname aenv default-environment-length)))
-                 (when (> ret default-environment-length)
-                   (free-alien aenv)
-                   (setf aenv (make-alien tchar ret))
-                   (alien-funcall afunc aname aenv ret))
-                 (if (> ret 0)
-                     (ucs2->string&free aenv ret)
-                   nil)))))
+                 (aenv (* tchar) (make-alien tchar default-environment-length))
+                 (afunc (function dword (* tchar) (* tchar) dword)
+                        :extern #!-sb-unicode "GetEnvironmentVariableA@12"
+                        #!+sb-unicode "GetEnvironmentVariableW@12"))
+                (dotimes (i name-length) (setf (deref aname i) (char-code (aref name i))))
+                (setf (deref aname name-length) 0)
+                (let ((ret (alien-funcall afunc aname aenv default-environment-length)))
+                  (when (> ret default-environment-length)
+                    (free-alien aenv)
+                    (setf aenv (make-alien tchar ret))
+                    (alien-funcall afunc aname aenv ret))
+                  (if (> ret 0)
+                      (ucs2->string&free aenv ret)
+                    nil)))))