*** empty log message ***
[bpt/guile.git] / libguile / simpos.c
index ff4637d..d1fcd81 100644 (file)
@@ -13,7 +13,7 @@
  *
  * You should have received a copy of the GNU Lesser General Public
  * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 
@@ -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);
@@ -111,10 +114,10 @@ SCM_DEFINE (scm_system_star, "system*", 0, 0, 1,
 "Example: (system* \"echo\" \"foo\" \"bar\")")
 #define FUNC_NAME s_scm_system_star
 {
-  if (SCM_NULLP (args))
+  if (scm_is_null (args))
     SCM_WRONG_NUM_ARGS ();
 
-  if (SCM_CONSP (args))
+  if (scm_is_pair (args))
     {
       SCM oldint;
       SCM oldquit;