From 4bf87ba029a805ac739fcd9f39e864463938097c Mon Sep 17 00:00:00 2001 From: Eli Barzilay Date: Mon, 24 Apr 2006 01:56:27 +0000 Subject: [PATCH] set eol-style svn: r2757 --- collects/compiler/private/windlldir.ss | 78 +++++++++++++------------- 1 file changed, 39 insertions(+), 39 deletions(-) diff --git a/collects/compiler/private/windlldir.ss b/collects/compiler/private/windlldir.ss index acb7e0a93e..b3b49e3394 100644 --- a/collects/compiler/private/windlldir.ss +++ b/collects/compiler/private/windlldir.ss @@ -1,39 +1,39 @@ - -(module windlldir mzscheme - (require (lib "port.ss")) - - (provide update-dll-dir - get-current-dll-dir) - - (define label "dLl dIRECTORy:") - (define max-dir-len 512) - - (define (update-dll-dir dest path) - (let ([path-bytes (if (eq? path #t) - #"" - (if (path? path) - (path->bytes path) - (string->bytes/locale path)))]) - (unless ((bytes-length path-bytes) . <= . max-dir-len) - (error 'update-dll-dir "path too long: ~e" path)) - (let ([m (with-input-from-file dest - (lambda () - (regexp-match-positions label (current-input-port))))]) - (unless m - (error 'update-ddl-dir "cannot find DLL path in file: ~e" dest)) - (with-output-to-file dest - (lambda () - (file-position (current-output-port) (cdar m)) - (write-bytes path-bytes) - (write-byte 0)) - 'update)))) - - - (define (get-current-dll-dir dest) - (with-input-from-file dest - (lambda () - (unless (regexp-match label (current-input-port)) - (error 'get-current-dll-dir "cannot find DLL path in file: ~e" dest)) - (let ([p (make-limited-input-port (current-input-port) max-dir-len)]) - (let ([m (regexp-match #rx#"[^\0]*" p)]) - (bytes->path (car m)))))))) + +(module windlldir mzscheme + (require (lib "port.ss")) + + (provide update-dll-dir + get-current-dll-dir) + + (define label "dLl dIRECTORy:") + (define max-dir-len 512) + + (define (update-dll-dir dest path) + (let ([path-bytes (if (eq? path #t) + #"" + (if (path? path) + (path->bytes path) + (string->bytes/locale path)))]) + (unless ((bytes-length path-bytes) . <= . max-dir-len) + (error 'update-dll-dir "path too long: ~e" path)) + (let ([m (with-input-from-file dest + (lambda () + (regexp-match-positions label (current-input-port))))]) + (unless m + (error 'update-ddl-dir "cannot find DLL path in file: ~e" dest)) + (with-output-to-file dest + (lambda () + (file-position (current-output-port) (cdar m)) + (write-bytes path-bytes) + (write-byte 0)) + 'update)))) + + + (define (get-current-dll-dir dest) + (with-input-from-file dest + (lambda () + (unless (regexp-match label (current-input-port)) + (error 'get-current-dll-dir "cannot find DLL path in file: ~e" dest)) + (let ([p (make-limited-input-port (current-input-port) max-dir-len)]) + (let ([m (regexp-match #rx#"[^\0]*" p)]) + (bytes->path (car m))))))))