From dba60ce33a0b0003b4fe2f018bf8aae041474ccf Mon Sep 17 00:00:00 2001 From: Chris Hanson Date: Thu, 29 Feb 1996 22:12:07 +0000 Subject: [PATCH] Don't silently ignore pathname syntax errors; signal them. --- v7/src/runtime/dospth.scm | 11 ++++++----- v7/src/runtime/unxpth.scm | 13 +++++++------ 2 files changed, 13 insertions(+), 11 deletions(-) diff --git a/v7/src/runtime/dospth.scm b/v7/src/runtime/dospth.scm index f3183e21e..814635f42 100644 --- a/v7/src/runtime/dospth.scm +++ b/v7/src/runtime/dospth.scm @@ -1,6 +1,6 @@ #| -*-Scheme-*- -$Id: dospth.scm,v 1.34 1996/02/28 23:30:20 cph Exp $ +$Id: dospth.scm,v 1.35 1996/02/29 22:11:54 cph Exp $ Copyright (c) 1992-96 Massachusetts Institute of Technology @@ -124,8 +124,8 @@ MIT in each case. |# ((#\$) (let ((value (get-environment-variable (string-tail string 1)))) (if (not value) - components - (replace-head value)))) + (error "Unbound environment variable:" name)) + (replace-head value))) ((#\~) (replace-head (->namestring @@ -150,8 +150,9 @@ MIT in each case. |# (else directory))) (define (parse-directory-components components) - (map parse-directory-component - (list-transform-negative components string-null?))) + (if (there-exists? components string-null?) + (error "Directory contains null component:" components)) + (map parse-directory-component components)) (define (parse-directory-component component) (if (string=? ".." component) diff --git a/v7/src/runtime/unxpth.scm b/v7/src/runtime/unxpth.scm index 60e87c6d9..26c7132e3 100644 --- a/v7/src/runtime/unxpth.scm +++ b/v7/src/runtime/unxpth.scm @@ -1,6 +1,6 @@ #| -*-Scheme-*- -$Id: unxpth.scm,v 14.22 1996/02/28 23:26:12 cph Exp $ +$Id: unxpth.scm,v 14.23 1996/02/29 22:12:07 cph Exp $ Copyright (c) 1988-96 Massachusetts Institute of Technology @@ -100,9 +100,9 @@ MIT in each case. |# ((#\$) (let ((name (string-tail string 1))) (let ((value (get-environment-variable name))) - (if value - (replace-head value) - components)))) + (if (not value) + (error "Unbound environment variable:" name)) + (replace-head value)))) ((#\~) (replace-head (->namestring @@ -118,8 +118,9 @@ MIT in each case. |# directory)) (define (parse-directory-components components) - (map parse-directory-component - (list-transform-negative components string-null?))) + (if (there-exists? components string-null?) + (error "Directory contains null component:" components)) + (map parse-directory-component components)) (define (parse-directory-component component) (if (string=? ".." component) -- 2.25.1