From 6e7cd0f131416656933af53a1a635ff5b5bc35dc Mon Sep 17 00:00:00 2001 From: John Benediktsson Date: Mon, 6 Jan 2020 14:20:15 -0800 Subject: [PATCH] io: fix for win32-error not throwing on zero. --- basis/io/directories/windows/windows.factor | 2 +- basis/io/files/info/windows/windows.factor | 2 +- basis/io/files/windows/windows.factor | 4 ++-- basis/io/sockets/secure/windows/windows.factor | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/basis/io/directories/windows/windows.factor b/basis/io/directories/windows/windows.factor index 083c5187fb..b06a5bf1e1 100644 --- a/basis/io/directories/windows/windows.factor +++ b/basis/io/directories/windows/windows.factor @@ -31,7 +31,7 @@ ERROR: file-delete-failed path error ; : (delete-file) ( path -- ) dup DeleteFile 0 = [ GetLastError ERROR_ACCESS_DENIED = - [ delete-read-only-file ] [ win32-error ] if + [ delete-read-only-file ] [ drop win32-error ] if ] [ drop ] if ; M: windows delete-file ( path -- ) diff --git a/basis/io/files/info/windows/windows.factor b/basis/io/files/info/windows/windows.factor index 99eccd1c0f..88fa83a745 100644 --- a/basis/io/files/info/windows/windows.factor +++ b/basis/io/files/info/windows/windows.factor @@ -19,7 +19,7 @@ TUPLE: windows-file-info < file-info-tuple attributes ; : get-compressed-file-size ( path -- n ) { DWORD } [ GetCompressedFileSize ] with-out-parameters - over INVALID_FILE_SIZE = [ win32-error ] [ >64bit ] if ; + over INVALID_FILE_SIZE = [ win32-error ] when >64bit ; : set-windows-size-on-disk ( file-info path -- file-info ) over attributes>> +compressed+ swap member? [ diff --git a/basis/io/files/windows/windows.factor b/basis/io/files/windows/windows.factor index 19c08cb3a8..2bdb64cbfb 100644 --- a/basis/io/files/windows/windows.factor +++ b/basis/io/files/windows/windows.factor @@ -117,7 +117,7 @@ M: windows init-io ( -- ) : handle>file-size ( handle -- n/f ) (handle>file-size) [ GetLastError ERROR_INVALID_FUNCTION = - [ f ] [ win32-error ] if + [ win32-error ] unless f ] unless* ; ERROR: seek-before-start n ; @@ -405,7 +405,7 @@ M: windows home 0 [ FindFirstStream ] keepd over INVALID_HANDLE_VALUE = [ - 2drop win32-error + 2drop win32-error f ] [ 1vector swap file-streams-rest ] if ; diff --git a/basis/io/sockets/secure/windows/windows.factor b/basis/io/sockets/secure/windows/windows.factor index c1b8e3936d..815200c11b 100644 --- a/basis/io/sockets/secure/windows/windows.factor +++ b/basis/io/sockets/secure/windows/windows.factor @@ -14,7 +14,7 @@ M: openssl ssl-certificate-verification-supported? f ; : load-windows-cert-store ( string -- HCERTSTORE ) [ f ] dip CertOpenSystemStore - [ win32-error ] when-zero ; + [ win32-error f ] when-zero ; : X509-NAME. ( X509_NAME -- ) f 0 X509_NAME_oneline