From: Juho Snellman Date: Thu, 30 Nov 2006 15:18:56 +0000 (+0000) Subject: 1.0.0.1: X-Git-Url: http://repo.macrolet.net/gitweb/?a=commitdiff_plain;h=b71853ba2228aae847de00da7fac9b9b89de8653;p=sbcl.git 1.0.0.1: Fix handling of non-ascii characters in *posix-argv* / *core-pathname* (thanks to Yaroslav Kavenchuk). --- diff --git a/NEWS b/NEWS index f0f7845..0990d5b 100644 --- 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) diff --git a/src/code/common-os.lisp b/src/code/common-os.lisp index 9846ed6..7de4d46 100644 --- a/src/code/common-os.lisp +++ b/src/code/common-os.lisp @@ -17,9 +17,21 @@ #!+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*") diff --git a/src/runtime/runtime.c b/src/runtime/runtime.c index f72cd60..f2b52d6 100644 --- a/src/runtime/runtime.c +++ b/src/runtime/runtime.c @@ -211,7 +211,10 @@ search_for_core () return core; } - +char **posix_argv; +char *core_string; + + 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)); diff --git a/version.lisp-expr b/version.lisp-expr index 1c1a34f..310cea7 100644 --- a/version.lisp-expr +++ b/version.lisp-expr @@ -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"