diff options
Diffstat (limited to 'libguile/filesys.c')
-rw-r--r-- | libguile/filesys.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/libguile/filesys.c b/libguile/filesys.c index 29c86883e..459f5530c 100644 --- a/libguile/filesys.c +++ b/libguile/filesys.c @@ -610,18 +610,17 @@ SCM_DEFINE (scm_stat, "stat", 1, 0, 0, SCM_SYSCALL (rv = fstat (scm_to_int (object), &stat_temp)); #endif } - else if (SCM_STRINGP (object)) + else if (scm_is_string (object)) { + char *file = scm_to_locale_string (object); #ifdef __MINGW32__ - char *p, *file = strdup (SCM_STRING_CHARS (object)); + char *p; p = file + strlen (file) - 1; while (p > file && (*p == '/' || *p == '\\')) *p-- = '\0'; +#endif SCM_SYSCALL (rv = stat (file, &stat_temp)); free (file); -#else - SCM_SYSCALL (rv = stat (SCM_STRING_CHARS (object), &stat_temp)); -#endif } else { |