From 2bd461de50a7eae9bf2d9b2ad523443aae9843ba Mon Sep 17 00:00:00 2001 From: Matthew Flatt Date: Sat, 10 Sep 2011 14:56:53 -0600 Subject: [PATCH] win32: fix `get-file-list' with a single file result --- collects/mred/private/wx/win32/filedialog.rkt | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/collects/mred/private/wx/win32/filedialog.rkt b/collects/mred/private/wx/win32/filedialog.rkt index 6a1ecd4aa7..2fc3d712ed 100644 --- a/collects/mred/private/wx/win32/filedialog.rkt +++ b/collects/mred/private/wx/win32/filedialog.rkt @@ -181,10 +181,13 @@ (cons (cast (ptr-add p pos) _pointer _string/utf-16) (loop (+ end-pos 2))))])))]) - (if ((length strs) . < . 2) - #f - (map (lambda (p) (build-path (car strs) p)) - (cdr strs)))) + (let ([len (length strs)]) + (cond + [(len . < . 1) #f] + [(= len 1) (list (string->path (car strs)))] + [else + (map (lambda (p) (build-path (car strs) p)) + (cdr strs))]))) (string->path (cast (OPENFILENAME-lpstrFile ofn) _pointer _string/utf-16)))) (when directory (free (OPENFILENAME-lpstrInitialDir ofn)))