From: Chris Hanson Date: Thu, 31 Mar 2005 05:08:51 +0000 (+0000) Subject: Fix bug: FILE-LENGTH generated a SIGSEGV when the file didn't exist. X-Git-Tag: 20090517-FFI~1341 X-Git-Url: https://birchwood-abbey.net/git?a=commitdiff_plain;h=4e402834425ef7a5407044794d86b3e80964bda8;p=mit-scheme.git Fix bug: FILE-LENGTH generated a SIGSEGV when the file didn't exist. --- diff --git a/v7/src/runtime/unxprm.scm b/v7/src/runtime/unxprm.scm index 91539ac8d..aed3bd8cd 100644 --- a/v7/src/runtime/unxprm.scm +++ b/v7/src/runtime/unxprm.scm @@ -1,6 +1,6 @@ #| -*-Scheme-*- -$Id: unxprm.scm,v 1.71 2005/03/31 05:06:59 cph Exp $ +$Id: unxprm.scm,v 1.72 2005/03/31 05:08:51 cph Exp $ Copyright 1988,1989,1990,1991,1992,1993 Massachusetts Institute of Technology Copyright 1994,1995,1997,1998,1999,2000 Massachusetts Institute of Technology @@ -117,8 +117,9 @@ USA. (define (file-length filename) (let ((attrs (file-attributes-direct filename))) - (and attrs - (file-attributes/length attrs)))) + (if (not attrs) + (error:bad-range-argument filename 'FILE-LENGTH)) + (file-attributes/length attrs))) (define (file-modification-time-direct filename) ((ucode-primitive file-mod-time 1)