From 4e402834425ef7a5407044794d86b3e80964bda8 Mon Sep 17 00:00:00 2001 From: Chris Hanson Date: Thu, 31 Mar 2005 05:08:51 +0000 Subject: [PATCH] Fix bug: FILE-LENGTH generated a SIGSEGV when the file didn't exist. --- v7/src/runtime/unxprm.scm | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) 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) -- 2.25.1