1.0.0.1:
authorJuho Snellman <jsnell@iki.fi>
Thu, 30 Nov 2006 15:18:56 +0000 (15:18 +0000)
committerJuho Snellman <jsnell@iki.fi>
Thu, 30 Nov 2006 15:18:56 +0000 (15:18 +0000)
        Fix handling of non-ascii characters in *posix-argv* / *core-pathname*
        (thanks to Yaroslav Kavenchuk).

NEWS
src/code/common-os.lisp
src/runtime/runtime.c
version.lisp-expr

diff --git a/NEWS b/NEWS
index f0f7845..0990d5b 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -1,4 +1,8 @@
 ;;;; -*- coding: utf-8; -*-
+changes in sbcl-1.0.1 relative to sbcl-1.0:
+  * bug fix: fix handling of non-ascii command-line arguments (thanks to
+    Yaroslav Kavenchuk)
+
 changes in sbcl-1.0 relative to sbcl-0.9.18:
   * improvement: experimental support for threading on FreeBSD/x86.
     (thanks to NIIMI Satoshi)
index 9846ed6..7de4d46 100644 (file)
   #!+sb-doc
   "The absolute pathname of the running SBCL core.")
 
+(sb!alien:define-alien-variable ("posix_argv" *native-posix-argv*) (* (* char)))
+(sb!alien:define-alien-variable ("core_string" *native-core-string*) (* char))
+
 ;;; if something ever needs to be done differently for one OS, then
 ;;; split out the different part into per-os functions.
 (defun os-cold-init-or-reinit ()
+  (/show0 "setting *CORE-STRING*")
+  (setf *core-string*
+        (sb!alien:cast *native-core-string* sb!alien:c-string))
+  (/show0 "setting *POSIX-ARGV*")
+  (setf sb!ext:*posix-argv*
+        (loop for i from 0
+              for arg = (sb!alien:deref *native-posix-argv* i)
+              until (sb!alien:null-alien arg)
+              collect (sb!alien:cast arg sb!alien:c-string)))
   (/show0 "entering OS-COLD-INIT-OR-REINIT")
   (setf *software-version* nil)
   (/show0 "setting *DEFAULT-PATHNAME-DEFAULTS*")
index f72cd60..f2b52d6 100644 (file)
@@ -211,7 +211,10 @@ search_for_core ()
     return core;
 }
 
\f
+char **posix_argv;
+char *core_string;
+
+\f
 int
 main(int argc, char *argv[], char *envp[])
 {
@@ -404,15 +407,11 @@ main(int argc, char *argv[], char *envp[])
     wos_install_interrupt_handlers(&exception_frame);
 #endif
 
-    /* Pass core filename into Lisp */
-    SetSymbolValue(CORE_STRING, alloc_base_string(core),0);
-    SHOW("freeing core");
-    free(core);
-
-    /* Convert remaining argv values to something that Lisp can grok. */
-    SHOW("setting POSIX-ARGV symbol value");
-    SetSymbolValue(POSIX_ARGV, alloc_base_string_list(sbcl_argv),0);
-    free(sbcl_argv);
+    /* Pass core filename and the processed argv into Lisp. They'll
+     * need to be processed further there, to do locale conversion.
+     */
+    core_string = core;
+    posix_argv = sbcl_argv;
 
     FSHOW((stderr, "/funcalling initial_function=0x%lx\n",
           (unsigned long)initial_function));
index 1c1a34f..310cea7 100644 (file)
@@ -17,4 +17,4 @@
 ;;; checkins which aren't released. (And occasionally for internal
 ;;; versions, especially for internal versions off the main CVS
 ;;; branch, it gets hairier, e.g. "0.pre7.14.flaky4.13".)
-"1.0"
+"1.0.0.1"