diff options
author | Marius Vollmer <mvo@zagadka.de> | 2004-08-12 17:38:52 +0000 |
---|---|---|
committer | Marius Vollmer <mvo@zagadka.de> | 2004-08-12 17:38:52 +0000 |
commit | ddae95259d1875ea0ea5e3afc2187e325946b80a (patch) | |
tree | 9cf5537bb8162ee7cae9ba2dffebb075c96677ad /libguile/simpos.c | |
parent | 0d189573e59f2e5e15bf1287d08dc2af2a47e07d (diff) | |
download | guile-ddae95259d1875ea0ea5e3afc2187e325946b80a.tar.gz |
(scm_system): Convert SCM strings to locale strings instead of
accessing their internals.
Diffstat (limited to 'libguile/simpos.c')
-rw-r--r-- | libguile/simpos.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/libguile/simpos.c b/libguile/simpos.c index ff4637d61..d0a5a28f1 100644 --- a/libguile/simpos.c +++ b/libguile/simpos.c @@ -64,8 +64,9 @@ SCM_DEFINE (scm_system, "system", 0, 1, 0, "indicating whether the command processor is available.") #define FUNC_NAME s_scm_system { - int rv; - + int rv, eno; + char *c_cmd; + if (SCM_UNBNDP (cmd)) { rv = system (NULL); @@ -73,7 +74,9 @@ SCM_DEFINE (scm_system, "system", 0, 1, 0, } SCM_VALIDATE_STRING (1, cmd); errno = 0; - rv = system (SCM_STRING_CHARS (cmd)); + c_cmd = scm_to_locale_string (cmd); + rv = system (c_cmd); + eno = errno; free (c_cmd); errno = eno; if (rv == -1 || (rv == 127 && errno != 0)) SCM_SYSERROR; return scm_from_int (rv); |