From 3b88353ff4a37d3fc122ab5956a33becfd50c625 Mon Sep 17 00:00:00 2001 From: erg Date: Fri, 20 Oct 2006 01:18:41 +0000 Subject: [PATCH] fix win32 directory primitive --- vm/os-windows.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/vm/os-windows.c b/vm/os-windows.c index 7fe4300f9c..9efeba3d4a 100644 --- a/vm/os-windows.c +++ b/vm/os-windows.c @@ -114,18 +114,19 @@ void primitive_stat(void) void primitive_read_dir(void) { - F_STRING *path; HANDLE dir; WIN32_FIND_DATA find_data; F_ARRAY *result; CELL result_count = 0; + char path[MAX_PATH + 4]; maybe_gc(0); result = array(ARRAY_TYPE,100,F); - path = untag_string(dpop()); - if (INVALID_HANDLE_VALUE != (dir = FindFirstFile(".\\*", &find_data))) + sprintf(path, "%s\\*", to_char_string(untag_string(dpop()),true)); + + if (INVALID_HANDLE_VALUE != (dir = FindFirstFile(path, &find_data))) { do {